home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / progm / cwt1.zip / MANUAL < prev    next >
Text File  |  1989-11-26  |  75KB  |  2,010 lines

  1.  
  2. INTRODUCTION
  3. ============
  4.  
  5. This is a summary manual for the "c_wndw" and "c_ndx" libraries.  It is
  6. in three parts:
  7.  
  8.   o An alphabetical list of the functions in the libraries.  
  9.  
  10.   o A list of the structs and enums defined for the libraries.
  11.  
  12.   o A list of the configuration constants and variables.
  13.  
  14. This  manual and the "c_wndw" and "c_ndx" computer software is the copyright 
  15. of  Marietta Systems,  Inc.,  1987, 1988, 1989.  Marietta Systems, Inc. is 
  16. located in  Cobb  County, Georgia.
  17.  
  18. Duplication  of the shareware-issued computer  software  and   this  manual 
  19. for  non-commercial  purposes  is encouraged.   Amendment or  sale  of  the 
  20. computer software or manual not permitted except as specifically authorized 
  21. in writing by an officer of Marietta Systems, Inc.
  22.  
  23. Marietta Systems does NOT warrant that the computer software will meet your 
  24. requirements  or  that  the  operation of the  computer  software  will  be 
  25. uninterrupted and error free.  You are solely responsible for the selection 
  26. and  use of the computer software to achieve your intended results and  for 
  27. the results actually obtained.
  28.  
  29. Product specifications and features are subject to change without notice.
  30.  
  31. dBase III Plus is a trademark of Ashton-Tate.
  32.  
  33. Marietta Systems "c_wndw" library is a Trademark of Marietta Systems, Inc.
  34. Marietta Systems "c_ndx" library is a Trademark of Marietta Systems, Inc.
  35.  
  36.      Copyright (c) 1987, 1988, 1989 by Marietta Systems.
  37.      All rights reserved.
  38.  
  39. The shareware libraries are issued for the medium memory models in the
  40. MC_WNDW.LIB and MC_NDX.LIB library files.
  41.  
  42. The header files are the C_WNDW.H and C_NDX.H files.
  43.  
  44.  
  45. A) FUNCTION LIST
  46. ================
  47.  
  48. ###########################
  49. #include <c_wndw.h>
  50. int accept (byte *field, enum _JUST just, enum ATTRIB atb, int len,
  51.      int dec)
  52. int acptbig (byte *field, enum _JUST just, enum ATTRIB atb, int len,
  53.      int width)
  54.  
  55. The functions provide for the formatted and validated input of a
  56. string from the console.  The string is displayed at the current
  57. cursor position within the current window while being entered.
  58.  
  59. fields Either an ASCIIZ string or a compressed date.
  60. just   The format of field: left, right, center, as_typed, code,
  61.             decimal, db_number, c_number, date
  62.        Note: left and as_typed are the only types for acptbig()
  63. atb    The display attribute during entry (ex: high etc.).
  64. len    1 - 254 for the size of text strings (format type left, right,
  65.             center, as_typed).
  66.        1 - 24 for the number of digits before the decimal point of
  67.             numeric strings (format type code, decimal, c_number,
  68.             db_number).
  69.        Ignored for format type date.
  70. dec    0 - 8 for the number of decimal places of format type
  71.             decimal, c_number or db_number.
  72.        Ignored for all other format types.
  73. width  Field display area width for the acptbig() function.  This has
  74.             a range of 20 to 'len'.
  75.  
  76. The functions return (-1) for a parameter error, zero if the 'Enter'
  77. key is used, or positive number identifying the valid function key
  78. used. The function key code is also stored in INCHAR.
  79.  
  80.  
  81. ###########################
  82. #include <c_wndw.h>
  83. int acptchar (char *field, enum _JUST just, enum ATTRIB atb,
  84.      unsigned len)
  85. int acptdbl (double *field, enum _JUST just, enum ATTRIB atb,
  86.      unsigned len, unsigned dec)
  87. int acptint (int *field, enum _JUST just, enum ATTRIB atb, unsigned len)
  88. int acptlong (long *field, enum _JUST just, enum ATTRIB atb, unsigned len)
  89.  
  90. #include <c_ndx.h>
  91. int acptmony (mony *field, enum _JUST just, enum ATTRIB atb, unsigned len)
  92.  
  93. The functions accept entry of numbers at the current cursor position
  94. with justification 'just', using video attribute 'atb'.  The operator
  95. interface of these functions are identical to the accept()  function.
  96.  
  97. field  Pointer to the field containing the number.
  98. just   Format of field: code, decimal, db_number, or c_number.
  99.            (code not applicable to acptmony()).
  100. atb    The display attribute during entry (ex: high etc.).
  101. len    The number of digits to be entered:
  102.            char    From 1 to 2.
  103.            double  From 0 to 24 (digits before decimal point).
  104.            int     From 1 to 4.
  105.            long    From 1 to 9.
  106.            mony    From 1 to 7 (digits before decimal point).
  107. dec    0 - 8, the number of digits after the decimal point for a
  108.            double type field.
  109.        Note: Both 'len' and 'dec' cannot be zero.
  110.  
  111. The returns are the same as for the accept() function.
  112.  
  113.  
  114. ###########################
  115. #include <c_ndx.h>
  116. int acptdbf (int fh, unsigned field, enum ATTRIB atb)
  117.  
  118. The function provides for the entry of a field from a dbase3 or
  119. hashed type file with a dBASE-compatible data dictionary.  The
  120. function behaves like the accept() function, except the field details
  121. are taken from the data dictionary.  This includes field size and
  122. justification.
  123.  
  124. fh     The file handle of the dbase3 or hashed type file.
  125. field  The field number from the data dictionary.
  126. atb    The display attribute.
  127.  
  128. Return values as for the accept() function.
  129.  
  130.  
  131. ###########################
  132. #include <c_wndw.h>
  133. int acptmask (byte *field, byte *mask, enum ATTRIB atb)
  134.  
  135. Accepts and formats the entry of a string using a character mask to
  136. format and control the entry.
  137.  
  138. field  The field to be entered.
  139. mask   The mask to use in entering the string.  This must not be
  140.            greater than SCRN_WID characters in size.
  141. atb    The screen attribute to use during entry.
  142.  
  143. The return values are as for the accept() function.
  144.  
  145.  
  146. ###########################
  147. #include <c_wndw.h>
  148. int acptmenu (byte *field, byte *list, enum ATTRIB atb, unsigned len)
  149.  
  150. The function accepts entry of a string and validates it against a
  151. list of options.  If not present the operator can select an entry
  152. from a menu of these options.
  153.  
  154. field  The string to be entered.
  155. list   The list of optional entries in menu() format.
  156. atb    The screen attribute to use during entry.
  157. len    The length of the field.  Range of 1 to 32.
  158.  
  159. The return values are as for the accept() function, plus (-3) when
  160. inadequate heap space is available.
  161.  
  162.  
  163. ###########################
  164. #include <c_ndx.h>
  165. mony atom (byte *text)
  166.  
  167. The function converts a ASCIIZ string of a number with two decimal
  168. places into a mony type field.  In keeping with the spirit of atol()
  169. and atoi(), the function does not validate the 'text' parameter string
  170. and ignores the optional decimal point.
  171.  
  172. text   The function expects an ASCIIZ string formatted:
  173.        [whitespace][sign][digits][.]dec-digits
  174.        Ex: " -345.67",  "67", "  345.78", "2345"
  175.  
  176. The function returns a mony type field with the binary value of the
  177. input string.  There is no error checking or error return.
  178.  
  179.  
  180. ###########################
  181. #include <c_ndx.h>
  182. int cacheoff (int fh)
  183.  
  184. The function disables "c_wndw" disk caching for file 'fh'.  Disk
  185. caching can be re-initiated with the fileinit() function.
  186.  
  187. fh     The file whose caching is to be disabled.
  188.  
  189. The function returns 0 for success, -1 if the file is not open.
  190.  
  191.  
  192. ###########################
  193. #include <c_wndw.h>
  194. void clr_keys (void)
  195.  
  196. The function clears the activated flag of all optional "end of field"
  197. function keys.  The only permanently activated keys for the accept()
  198. and its related functions are 'ENTER' and 'F10 - Quit'.
  199.  
  200.  
  201. ###########################
  202. #include <c_wndw.h>
  203. void clr_scrn (char *title)
  204.  
  205. The function must be called at the start of the program to initialize
  206. the window and file buffers used by the "c_wndw" software.  It also
  207. clears the screen and sets up the base window #0.  The 'title' is
  208. displayed centered on the top line.
  209.  
  210. The function can subsequently be used several times in the program
  211. to clear the screen and change the screen title.
  212.  
  213. title  The screen title of up to 32 characters.
  214.  
  215. void main () {
  216.      clr_scrn ("Main screen title");
  217.      display ("hello world", 12, 35, blink);
  218.      read_kb();
  219.      goodbye (0);
  220. }
  221.  
  222.  
  223. ###########################
  224. #include <c_wndw.h>
  225. void clr_wndw (void)
  226.  
  227. The function clears the current window.
  228.  
  229.  
  230. ###########################
  231. #include <c_ndx.h>
  232. int compress (byte *text)
  233.  
  234. The function compresses a string by stripping trailing spaces and
  235. replacing any group of TAB_SET number of spaces with a '\t'
  236. character.
  237.  
  238. text   The ASCIIZ string to be compressed.
  239.  
  240. The function returns the new length of the string (excluding the zero
  241. terminator byte).
  242.  
  243.  
  244. ###########################
  245. #include <c_wndw.h>
  246. byte* concat (byte *field, int spaces)
  247.  
  248. The function strips trailing spaces off the string 'field', optionally
  249. adding 1 or 2 depending on the value of 'spaces'.
  250.  
  251. field  The field to be stripped of trailing spaces
  252. spaces The number of spaces to leave at the end of the string
  253.             Range (0 - 2).
  254.  
  255. The function returns a pointer to the new end of the string.
  256.  
  257.  
  258. ###########################
  259. #include <c_wndw.h>
  260. int datecomp (char *d1, char *d2)
  261.  
  262. Compares two dates held in "c_wndw" compressed format.  The function
  263. handles null dates "00/00/00" as dates before any valid date.
  264.  
  265. d1     The first compressed date
  266. d2     The second compressed date
  267.  
  268. The function returns
  269.     Zero if d1 == d2
  270.     Positive if d1 > d2
  271.     Negative if d1 < d2
  272. If the dates are within 80 years, the return value is the number of
  273. days difference.
  274.  
  275.  
  276. ###########################
  277. #include <c_wndw.h>
  278. long datelong (char *d1)
  279.  
  280. Converts the compressed date 'd1' to a count of the number of days
  281. since 1/1/80.
  282.  
  283. d1     The date in compressed "c_wndw" format
  284.  
  285. The function returns the number of days since 1/1/80.  For example:
  286. Jan 2, 1980 yields (1L), and Dec 31, 1979 yields  (-1L).
  287.  
  288.  
  289. ###########################
  290. #include <c_wndw.h>
  291. void datemath (char *d1, int days)
  292.  
  293. Adds the specified number of days to the compressed date 'd1'.  The
  294. 'days' variable can be negative for subtraction.
  295.  
  296. d1     The date to be changed.
  297. days   The number of days to add or subtract from the date.
  298.  
  299.  
  300. ###########################
  301. #include <c_wndw.h>
  302. void dateread (char *d1)
  303.  
  304. Accesses the system clock to get today's date in compressed "c_wndw"
  305. format.
  306.  
  307. d1     Today's date is returned in this 3 char date field
  308.  
  309.  
  310. ###########################
  311. #include <c_wndw.h>
  312. void date_in (char *d1, char *text)
  313. void date_out (char *text, char *d1)
  314.  
  315. These functions convert dates in and out of "c_wndw" compressed 3
  316. char format.  date_in() converts into compressed format and date_out()
  317. converts out of compressed format.
  318.  
  319. d1     The date in compressed 3 char "c_wndw" format
  320. text   The ASCIIZ format date
  321.  
  322.  
  323. ###########################
  324. #include <c_ndx.h>
  325. void dbfdatein (char *d1, char *dbdate)
  326. void dbfdateout (char *dbdate, char *d1)
  327.  
  328. These functions convert dates between dBASE format and "c_wndw"
  329. compressed 3 char format.  dbfdatein() converts into compressed
  330. format and dbfdateout() converts out of compressed format.
  331.  
  332. d1     The "c_wndw" compressed 3 char date format.
  333. dbdate The eight char dBASE date format.
  334.  
  335.  
  336. ###########################
  337. #include <c_ndx.h>
  338. int dbffield (int fh, char *fldname)
  339.  
  340. The function scans a hashed or dbase3 type file for the field number
  341. corresponding to the 'fldname' parameter.
  342.  
  343. fh      The file handle of the hashed or dbase3 file.
  344. fldname The field name in dBASE format.
  345.  
  346. If found, the function returns the field number in the range 0 to 253.
  347. Otherwise, it returns (-1).
  348.  
  349.  
  350. ###########################
  351. #include <c_ndx.h>
  352. int dbffile (int ndx)
  353.  
  354. The function returns the dbase3 file handle for the index file 'ndx'.
  355.  
  356. ndx    File handle for an index file opened by the ndxcustom(),
  357.             ndxrdex(), or ndxopen() functions.
  358.  
  359. If 'ndx' is a valid index file, the function returns the file handle
  360. of the dbase3 file it indexes.  The function returns (-1) if 'ndx' is
  361. not a valid index file.
  362.  
  363.  
  364. ###########################
  365. #include <c_ndx.h>
  366. double *dbfgetf (int fh, unsigned field, double *fdest)
  367. long  *dbfgetl (int fh, unsigned field, long *ldest)
  368. mony  *dbfgetm (int fh, unsigned field, mony *mdest)
  369. char  *dbfgets (int fh, unsigned field, char *cdest)
  370.  
  371. The functions get a field from the current record of a dbase3 or
  372. hashed type file and format it correctly.
  373.  
  374. dbfgetf() Takes a numeric field from the file and returns it as a
  375.             double type field.
  376. dbfgetl() Takes the integer part of a numeric field and returns it
  377.             as a long type field.
  378. dbfgetm() Takes a numeric field with 2 decimal places and returns
  379.             it as a mony type field.
  380. dbfgets() Returns the identified field as an ASCIIZ string, except
  381.             dates are returned in 3 char "c_wndw" compressed
  382.             date format.
  383.  
  384. fh     The file handle of the hashed or dbase3 type file.
  385. field  The number of the field (range of 0 to 253).
  386. cdest  A pointer to the area to return the string for the field from
  387.             the file.  The size is in element dbf_len in the struct
  388.             DBF_DEF for the file.
  389. fdest  The parameter to return the double value.
  390. ldest  The parameter to return the long value.
  391. mdest  The parameter to return the mony value.
  392.  
  393. The function returns NULL for an error, or a pointer to the destin-
  394. ation field if successful.
  395.  
  396.  
  397. ###########################
  398. #include <c_ndx.h>
  399. int dbflist (int fh, char *list, int max, unsigned mask)
  400.  
  401. The function produces a list of field names of a dbase3 or hashed
  402. type file.  This list of names is suitable to be passed directly to
  403. the menu() function.
  404.  
  405. fh     The file handle of the dbase3 or hashed-type file.
  406. list   The buffer area for the field list.  This must be at least of
  407.             size ((max << 4) + 2).
  408. max    The maximum number of field name elements that can be
  409.             fitted within the 'list' buffer area.
  410. mask   The field type(s) to be selected by the the function:
  411.             0X0  For C, D, L, N field types (special case).
  412.             0X1  For C (character string) field type.
  413.             0X2  For D (date) field type.
  414.             0X4  For L (logical) field type.
  415.             0X8  For M (memo) field type.
  416.             0X10 For N (numeric) field type.
  417.  
  418. The function returns (-1) for a parameter error or the number of
  419. fields extracted from the data dictionary (range of 0 to 'max').
  420. The field list is returned sorted in alpha-numeric sequence.
  421.  
  422.  
  423. ###########################
  424. #include <c_ndx.h>
  425. int dbfputf (int fh, unsigned field, double d_src)
  426. int dbfputl (int fh, unsigned field, long l_src)
  427. int dbfputm (int fh, unsigned field, mony m_src)
  428. int dbfputs (int fh, unsigned field, char *c_src)
  429.  
  430. The functions put a field into the current record of a dbase3 or
  431. hashed type file and format it correctly using the information from
  432. the data dictionary.
  433.  
  434. dbfputf() Converts a double type field to a N (numeric), D (date),
  435.             or M (memo) type field.
  436. dbfputl() Converts a long type field to a N (numeric) or M (memo)
  437.             type field.
  438. dbfputm() Converts a mony type field to a N (numeric) type field.
  439. dbfputs() Converts an ASCIIZ string or 3 char "c_wndw" format
  440.             compressed date to a suitable form for the type of the
  441.             field and loads it into the record.
  442.  
  443. fh     The file handle of the hashed or dbase3 file type.
  444. field  The number of the field (range of 0 to 253).
  445. c_src  A pointer to the ASCIIZ string or compressed date.
  446. f_src  The double value.
  447. l_src  The long value.
  448. m_src  The mony value.
  449.  
  450. The functions return (-1) for an error, or zero if successful.
  451.  
  452.  
  453. ###########################
  454. #include <c_ndx.h>
  455. int dbfread (int fh, enum F_READ mode)
  456.  
  457. The function reads the file 'fh' and all related files.  The parameter
  458. 'fh' can be a dbase3 or hashed type file, or an index file.  The
  459. relationships to other files are established with the dbfrelate()
  460. function.
  461.  
  462. This function provides automatic relational multi-file reads and is
  463. key to the use of the relational database facilities in the "c_ndx"
  464. library.  Multiple files can be linked at multiple levels with the
  465. dbfrelate() function, and then read with a single dbfread() call.
  466.  
  467. If a read to a related file fails, the function space fills the
  468. record of that file, and sets its status byte in position 0 to EMPTY.
  469. For  example: for related file 'fh4', the following establishes if a
  470. successful read from disk occurred:
  471.  
  472. /* fh4 is related to fh1, read by ndx1 index file */
  473.      ret = dbfread (ndx1, random);
  474.      if (ret > 0 && FN[fh4].record[0] != EMPTY) {
  475.           /*  Process the result of a successful read to fh4 */
  476.           ......
  477.      }
  478.  
  479.      fh     The primary file to be read.  This can be hashed, dbase3 or
  480.                  an index file.
  481.      mode   The read mode.  This can be firstrec, lastrec, nextrec,
  482.                  previous or random.
  483.  
  484. The function returns:
  485.   1   Successful read to the main file.
  486.   0   Unsuccessful read to the main file.  Top/end of file for a
  487.           sequential read, or not found for random.
  488.   -1  File/disk error.
  489.   -2  Parameter error.
  490.   -4  Hashed random read on the main file abandoned after 200
  491.           hashed hits.
  492.   -5  Corruption in the relationship information.
  493.   -7  Disk cache error.
  494.  
  495.  
  496. ###########################
  497. #include <c_ndx.h>
  498. int dbfrelate (int fh1, int fh2, int ndx, char *fields)
  499.  
  500. The function establishes a relationship between files 'fh1' and 'fh2'.
  501. These files can be dbase3 or hashed file types.
  502.  
  503. fh1    The dbase3 or hashed file to be related.
  504. fh2    The dbase3 or hashed file to relate to file 'fh1'.
  505. ndx    If 'fh2' is a dbase3 file, 'ndx' is the index file used
  506.             in the relationship between 'fh1' and 'fh2'.
  507.        If 'fh2' is a hashed file, 'ndx' must be 0.
  508. fields A string naming the fields in the relationship.  These fields
  509.             must be common to both 'fh1' and 'fh2', and are space
  510.             separated.
  511.  
  512. The function returns 0 for success and negative for error.
  513. The error returns are:
  514.   -1  A named field is not present in 'fh1'.
  515.   -2  A named field is not present in 'fh2'.
  516.   -3  'fh2' is hashed, and a named field is not part of the key.
  517.   -4  A named field is not of the same type in both 'fh1' and 'fh2'.
  518.   -5  'fh1' and 'fh2' have already been related.
  519.   -6  Parameter error.
  520.   -7  Inadequate heap memory is available.
  521.   -8  Attempt made to open an 8th relationship on file 'fh1'.
  522.  
  523. /* Program to read through three related files in index sequence
  524.  * of primary file.
  525.  * One of the related files is accessed through an index
  526.  * and one is accessed through hashed random techniques */
  527. void main () {
  528.      int ret, one, two, three, ndx1, ndx2;
  529.      clr_scrn ("");
  530.  /*  Open the files and the indexes */
  531.      one = fileopen ("DATFILE1.DBF", dbase3, readonly);
  532.      ndx1 = ndxopen (one, "DATFILE1.NDX");
  533.      two = fileopen ("DATFILE2.DBF", dbase3, readonly);
  534.      ndx2 = ndxopen (two, "DATFILE2.NDX");
  535.      three = fileopen ("DATAFILE.HSH", hashed, readonly);
  536.  /* Setup the relationships */
  537.      if (dbfrelate (one, two, ndx2, "SURNAME ZIP_CODE") < 0) goodbye (2);
  538.      if (dbfrelate (one, three, 0, "STOCK_ID") < 0) goodbye (3);
  539.  /* Read through 'one' with automatic join to 'two' and 'three' */
  540.      for (ret = dbfread (ndx1, firstrec) ; ret == 1 ;
  541.               ret = dbfread (ndx1, nextrec) {
  542.           list_records (one, two, three); /* user written function */
  543.      }
  544.      err_wndw ("End of file reached", 0, 0); /* press ESC to end program */
  545.      goodbye (0);
  546. }
  547.  
  548. ###########################
  549. #include <c_ndx.h>
  550. int dbf_fld (int fh)
  551.  
  552. The function returns the number of fields in the data dictionary of a
  553. dbase3 or hashed type file.
  554.  
  555. fh     The file handle of the file
  556.  
  557. The functions returns 0 if the file is not open, does not have a data
  558. dictionary, or is not of type hashed or dbase3.  Otherwise it returns
  559. the number of the fields in the data dictionary in the range 1 to 254.
  560.  
  561.  
  562. ###########################
  563. #include <c_wndw.h>
  564. int dispchar (char field, int rx, int ry, enum ATTRIB atb, enum _JUST
  565.      just, unsigned len);
  566. int dispdbl (double field, int rx, int ry, enum ATTRIB atb, enum _JUST
  567.      just, unsigned len, unsigned dec);
  568. int dispint (int field, int rx, int ry, enum ATTRIB atb, enum _JUST just,
  569.      unsigned len);
  570. int displong (long field, int rx, int ry, enum ATTRIB atb, enum _JUST just,
  571.      unsigned len);
  572.  
  573. #include <c_ndx.h>
  574. int dispmony (mony field, int rx, int ry, enum ATTRIB atb, enum _JUST
  575.      just, unsigned len)
  576.  
  577. The functions display the numeric value of 'field' with format 'just'
  578. at cursor position (rx, ry) using attribute 'atb'. As a special case,
  579. position (0, 0) is interpreted to refer to the current cursor location.
  580.  
  581. field  The field containing the number.
  582.           char    Range of -99 to 99.
  583.           double  Virtually any number allowed.
  584.           int     Range of -9999 to 9999.
  585.           long    Range of -999999999 to 999999999.
  586.           mony    Range of -9999999.99 to 9999999.99 .
  587. x      The display row within the current window.
  588. y      The display starting column location within the current
  589.             window.
  590. just   Format of field: code, decimal, db_number, or c_number.
  591.             (code not applicable to dispmony()).
  592. atb    The display attribute (ex: high, reverse, etc.).
  593. len    The number of digits to be displayed.
  594.           char    From 1 to 2.
  595.           double  From 0 to 24 (digits before decimal point).
  596.           int     From 1 to 4.
  597.           long    From 1 to 9.
  598.           mony    From 1 to 7 (digits before decimal point).
  599. dec    0 - 8, the number of digits after the decimal point for a
  600.             double type field.
  601.  
  602. The functions return (-1) for parameter error, and zero if correct.
  603.  
  604.  
  605. ###########################
  606. #include <c_ndx.h>
  607. int dispdbf (int fh, unsigned field, int rx, int ry, enum ATTRIB atb)
  608.  
  609. The function provides for the display to the screen of a field from a
  610. dbase3 or hashed type file with dBASE compatible data dictionary.  The
  611. field details are taken from the data dictionary, including field
  612. type, size and justification.
  613.  
  614. fh     The file handle of the file.
  615. field  The field number from the data dictionary.
  616. rx     The display row within the current window.
  617. ry     The display starting column location within the current
  618.              window.
  619. atb    The display attribute.
  620.  
  621. The function returns (-1) for parameter error, 0 for success.
  622.  
  623.  
  624. ###########################
  625. #include <c_wndw.h>
  626. void dispkeys (void)
  627.  
  628. The function redisplays the bottom line of the screen provided
  629. BOT_LINE is non-zero.
  630.  
  631.  
  632. ###########################
  633. #include <c_wndw.h>
  634. void display (byte *field, int rx, int ry, enum ATTRIB atb)
  635.  
  636. The function displays the string ASCIIZ 'field' at cursor position
  637. (rx, ry) within the current window with the color pair attribute 'atb'.
  638. The string can contain any of the IBM graphics characters in addition
  639. to the ASCII character set.  As a special case, position (0,0) is
  640. interpreted to refer to the current cursor location.
  641.  
  642. field  The ASCIIZ string to be displayed.
  643. rx     The display row within the current window.
  644. ry     The display starting column location within the current
  645.             window.
  646. atb    The display attribute value.
  647.  
  648.  
  649. ###########################
  650. #include <c_wndw.h>
  651. int dispmask (byte *field, int row, int col, enum ATTRIB atb, byte *mask)
  652.  
  653. The function display a string at the identified location after
  654. formatting it through the character mask.
  655.  
  656. field  The field to be displayed after formatting.
  657. row    The starting row location within the current window.
  658. col    The starting column location within the current window.
  659. atb    The screen attribute to use for display.
  660. mask   The mask to use in formatting the string.
  661.  
  662. The function returns zero for success, (-1) if the 'mask' did not
  663. contain any formatting characters and (-2) for a parameter error.
  664.  
  665.  
  666. ###########################
  667. #include <c_wndw.h>
  668. int dispwndw (unsigned wndw, byte *field, unsigned rx, unsigned ry,
  669.      enum ATTRIB atb);
  670.  
  671. The function displays 'field' at cursor position (rx, ry) within
  672. window 'wndw' using attribute 'atb'.  'field' must fit on one line
  673. and be entirely visible. The test must not be hidden or partially
  674. hidden in the window.
  675.  
  676. wndw   The number of the window to display within.
  677.             This must be <= W_NUM
  678. field  The ASCIIZ string to be displayed.
  679. rx     The display row within window 'wndw'.
  680. ry     The display starting column location within window 'wndw'.
  681. atb    The display attribute value.
  682.  
  683. The function returns 0 for a successful display, (-1) if the field
  684. string would have been partially or completely hidden, or (-2) for a
  685. parameter error.
  686.  
  687.  
  688. ###########################
  689. #include <c_ndx.h>
  690. int dispwrap (byte *text, int rx, int ry, enum ATTRIB atb, unsigned height,
  691.      unsigned width);
  692.  
  693. The function displays a scrollable block of text to the screen.  The
  694. function supports word-wrap and the '\t', '\n', '\v', and '\f' control
  695. codes.  The function ignores the '\r' and '\b' codes.  If the text is
  696. too long for the screen area assigned to it, operator controlled
  697. scrolling is supported.
  698.  
  699. text   The text to be displayed.  Up to 32 Kbytes spanning up to
  700.             254 lines.
  701. rx     The starting screen row within the current window.
  702. ry     The starting screen column within the current window.
  703. atb    The display atribute.
  704. height The number of screen rows available for the display of the
  705.             text.  This must be at least 7.
  706. width  The line width for displaying the text.  This must be at least
  707.             16.
  708. The display box described by the 'rx', 'ry', 'height' and 'width'
  709. parameters must fit within the current window.
  710.  
  711. The function returns (-2) for a parameter error, or the value of the
  712. last used function key.
  713.  
  714. Return values of CRS_UP, CTL_ENT and PGUP indicate the operator
  715. exited from the top of the text display, values of CRS_DN, PGDN and
  716. ENTER indicate the operator exited from the bottom of the text
  717. display.  The other possible return values are ESC, HELP and QUIT.
  718.  
  719.  
  720. ###########################
  721. disp_err() disp_msg() disp_qry()
  722.  
  723. Obsolete functions entirely replaced in the latest version of the
  724. "c_wndw" library.  disp_err() and disp_msg() by the err_wndw()
  725. function, and disp_qry() by the qry_wndw() function.
  726.  
  727.  
  728. ###########################
  729. #include <c_wndw.h>
  730. int err_wndw (byte *text, int errcode, int ret)
  731.  
  732. The function creates a window and displays the message in 'text'.
  733. The window is the minimum size needed for the error message.  The
  734. window is located near the current cursor position, without
  735. overwriting it.
  736.  
  737. text   A multi-line text string containing the message to be
  738.             displayed.  Lines can be up to 60 characters wide, or
  739.             terminated with the '\n' character.  Up to five lines
  740.             can be displayed.
  741. errcode If non-zero, this code is displayed in the window.
  742. ret    If positive, the message window is only be displayed for that
  743.             number of clockticks (18 per second).  If zero or
  744.             negative, the message window is displayed until the
  745.             ESC key is pressed.
  746.  
  747. The function returns the value of the 'ret' parameter.  The function
  748. automatically removes its window when it exits.
  749.  
  750.  
  751. ###########################
  752. #include <c_wndw.h>
  753. int fileback (char *fname)
  754.  
  755. The function erases any prior file with the ".BAK" extension, and
  756. then renames the named file to have the ".BAK" extension.  The file
  757. is set to read-only mode.
  758.  
  759. fname  The name of the file to be set to backup mode
  760.  
  761. The return values are as follows:
  762.   1    Successful.
  763.   0    File cannot be found.
  764.   -1   File/disk error.
  765.   -2   Parameter error.
  766.   -3   Fail because of attempt to backup a ".BAK" file.
  767.   -4   Cannot backup an open file.
  768.   -5   The old backup file cannot be deleted, or new file renamed.
  769.  
  770.  
  771. ###########################
  772. #include <c_wndw.h>
  773. int fileclos (int fh)
  774.  
  775. Closes the file identified with file handle 'fh'.  If the file has
  776. indexes opened with the ndxcustom(), ndxopen() or ndxrdex() function,
  777. these are also closed.
  778.  
  779. fh     The file handle number of the file to be closed.
  780.  
  781. The function returns:
  782.   0   Successful, or the file was already closed.
  783.   -1  File or disc error
  784.   -2  A parameter error.
  785.  
  786.  
  787. ###########################
  788. #include <c_wndw.h>
  789. int fileinit (int fh, unsigned start, unsigned rec_len, long max_rec)
  790.  
  791. Sets the record length of the file and the size of the header area at
  792. the start of the file.  The function is required for binary type
  793. files after successful fileopen().
  794.  
  795. fh      The file handle number of the file.
  796. start   0 - 65,521 the size of the header area of the file.
  797. rec_len 1 - 32,767 the record length. Must be <= DISCBLCK.
  798. max_rec 0L through LONG_MAX the number of records in the file.
  799.             Generally only used for ascii type files.
  800.  
  801. The function returns:
  802.   0   Successful.
  803.   -1  The file is not open.
  804.   -2  A parameter error.
  805.  
  806.  
  807. ###########################
  808. #include <c_ndx.h>
  809. int filelist (char *list, char *mask, unsigned max, int type, char *path)
  810.  
  811. The function extracts a set of file names from a directory.  The files
  812. are returned as the ASCIIZ string 'list' in menu() format.
  813.  
  814. list   The returned list of file names.
  815. mask   The directory path name and file name mask to be searched which
  816.             must contain at least one '*' or '?' metacharacter.
  817. max    The maximum number of file names that can be fitted into the
  818.             area pointed to by the 'list' parameter. Range 1 to 254.
  819. type   The DOS file type attribute.
  820. path   A pointer to an area of at least 61 bytes.  The function
  821.             returns the directory path from the 'mask' parameter.
  822.  
  823. The function returns (-1) for parameter error, (-2) if the 'mask'
  824. parameter has an invalid path.  If successful it returns the number
  825. of files extracted in a range of 0 to 'max'.
  826.  
  827.  
  828. ###########################
  829. #include <c_ndx.h>
  830. int filemenu (char *name)
  831.  
  832. The function uses a menu of file names to allow the operator to
  833. select a file name.  The parameter to the function is the directory
  834. path and filename mask.  The selected file name is returned in the
  835. same parameter.
  836.  
  837. name   The directory path and file name mask.  If a file is selected
  838.             by the operator, its path and name are returned
  839.             through this parameter.
  840.  
  841. The function returns:
  842.   1    A file was selected by the operator.
  843.   0    No files match the mask, or the operator pressed the
  844.            'F10 - Quit' or 'Esc' key during menu selection.
  845.   -1   Parameter error.
  846.   -2   Invalid path name.
  847.   -10  Insufficient heap memory.
  848.  
  849.  
  850. ###########################
  851. #include <c_wndw.h>
  852. int fileopen (char *fname, enum F_TYPE type, enum F_MODE mode)
  853.  
  854. The function opens the file given by 'fname' with file-type 'type' and
  855. under file-mode 'mode'.
  856.  
  857. fname  The name of the file to be opened.
  858. type   The type of the file.
  859. mode   The access mode of the file.
  860.  
  861. The function returns zero if the file name cannot be found, or the
  862. file handle value if successful.  On error, the function returns:
  863.   -1   File/disc error
  864.   -2   Parameter error
  865.   -4   File already open
  866.  
  867.  
  868. ###########################
  869. #include <c_wndw.h>
  870. int fileread (int fh, enum F_READ mode, long *rec_nbr)
  871.  
  872. Reads a record from the file handle 'fh' with read-mode 'mode'.  The
  873. function can be used to read a specific record from a file, or to read
  874. through a file sequentially.  The file can be read sequentially
  875. forwards or backwards.
  876.  
  877. fh     The file handle of the file
  878. mode   The read action mode:
  879. rec_nbr For relative reads, the record number to be read.
  880.             The first record in the file is record number 1L.
  881.  
  882. The function returns
  883.   1   A successful read
  884.   0   End or top of file
  885.   -1  File/disc error
  886.   -2  Parameter error
  887.   -6  Read-mode not recognized
  888.   -7  Cache error
  889.  
  890. On a successful read, the 'rec_nbr' parameter contains the number
  891. of the next record in the file.  For example, after reading the first
  892. record in a file, 'rec_nbr' is set to 2L.
  893.  
  894.  
  895. ###########################
  896. #include <c_wndw.h>
  897. long filerecno (int fh)
  898.  
  899. The function returns the number of the current record for a binary,
  900. dbase3 or hashed type file.
  901.  
  902. fh     The file handle of the file.
  903.  
  904. The function returns 0L for an empty file, (-1L) for a parameter
  905. error or a positive number for the number of the current record.
  906. The first record is 1L.
  907.  
  908.  
  909. ###########################
  910. #include <c_ndx>
  911. int filesave (int fh)
  912.  
  913. The function performs cache and file buffer flushing for one or all
  914. open files.  The function is used to force file changes to disk and
  915. out of the "c_wndw" cache and the DOS file buffers.
  916.  
  917. fh     If a valid file handle, the function just flushes that file,
  918.             otherwise flushes all open files.
  919.  
  920. The function returns the number of files actually flushed.
  921.  
  922.  
  923. ###########################
  924. #include <c_wndw.h>
  925. int fileseek (int fh, long loc)
  926.  
  927. Performs a seek on the file to a specified byte location.  The function
  928. is rarely used as the fileread() function performs positioning as
  929. required.  If successful the new file location is set into component
  930. location of FN[].
  931.  
  932. As a special case, a fileseek() with 'loc' of (-1L) positions to the
  933. end of file.
  934.  
  935. fh     The file handle of the file.
  936. loc    The target byte location in the file.
  937.  
  938. The function returns:
  939.   0    Successful file movement
  940.   -1   File/disc error
  941.   -2   Parameter error
  942.  
  943.  
  944. ###########################
  945. #include <c_wndw.h>
  946. int filewrit (int fh, long *rec_nbr)
  947.  
  948. The function writes a record from the buffer FN[fh].record to the
  949. file.  This is a fixed length record unless the file type is ascii.
  950.  
  951. For ascii type files the function writes a record through to the first
  952. '\n' or '\0' byte, up to the maximum length of the record (from
  953. FN[fh].rec_len), and terminates each record with "\r\n".
  954.  
  955. fh     The file handle of the file.
  956. rec_nbr The number of the record to be written.
  957.  
  958. The function returns:
  959.   0    On a successful write.
  960.   -1   File/disc error
  961.   -2   Parameter error
  962.  
  963.  
  964. ###########################
  965. #include <c_wndw.h>
  966. int fld_len (enum _JUST just, unsigned len, unsigned dec)
  967.  
  968. This returns the required size of a string to hold a field with
  969. justification 'just' and size 'len' with decimal places 'dec'.  For
  970. numeric fields, the 'len' parameter refers to the digits before the
  971. decimal point.
  972.  
  973. just   The format of the field:
  974. len    1 - 254 for the size of text strings (format type left, right,
  975.             center, as_typed).
  976.        1 - 24 for the number of digits before the decimal point of
  977.             numeric strings (format type code, decimal, c_number,
  978.             db_number).
  979.        Ignored for format type date.
  980. dec    0 - 8 for the number of decimal places of format type decimal,
  981.             c_number or db_number.
  982.        Ignored for all other format types.
  983.  
  984. The function returns a value of the size of the string necessary to
  985. hold the field.  This is in the range 0 to 254.  This value does not
  986. include the zero byte, and is compatible with the strlen() function.
  987.  
  988.  
  989. ###########################
  990. #include <c_wndw.h>
  991. int flt_wndw (unsigned h, unsigned w, byte *title)
  992.  
  993. This function creates a floating window of 'h' rows and 'w' columns
  994. next to the current cursor location.
  995.  
  996. h      The number of rows in the window.  Range 1 to (SCRN_LEN -
  997.         TOP_LINE).
  998. w      The number of columns in the window.  Range 1 to SCRN_WID.
  999. title  The window title.
  1000.  
  1001. Returns as as for the mk_wndw() function.
  1002.  
  1003.  
  1004. ###########################
  1005. #include <c_ndx.h>
  1006. byte *ftoascii (byte *text, double field, unsigned len, unsigned dec)
  1007.  
  1008. The function converts a double to an ASCIIZ string in c_number format,
  1009. with leading sign and a properly located decimal point.  The number of
  1010. decimal places corresponds to the value of the 'dec' parameter.  The 
  1011. function uses ecvt() to perform fractional rounding. If the value of 
  1012. the double field is too big, the 'text' string is filled with '*'.
  1013.  
  1014. text   A pointer to an area at least of size (len + dec + 3).
  1015. field  The double type field to be converted.
  1016. len    0 - 24 digits before the decimal point.
  1017. dec    0 - 8 digits after the decimal point.
  1018.        Note: both 'len' and 'dec' cannot be zero.
  1019.  
  1020. The function returns a pointer to 'text'.
  1021.  
  1022.  
  1023. ###########################
  1024. #include <c_ndx.h>
  1025. mony ftom (double dsrc)
  1026.  
  1027. The function converts a double type field into a mony type field.  The
  1028. value is rounded nearest.
  1029.  
  1030. dsrc   The double type field to be converted.
  1031.  
  1032. The function returns LONG_MAX if the 'dsrc' field is too big to fit in
  1033. a mony type field, otherwise it returns the rounded converted value.
  1034.   
  1035.  
  1036. ###########################
  1037. #include <c_wndw.h>
  1038. void goodbye (short errcode)
  1039.  
  1040. The function must be used to end the program.  It closes the files and 
  1041. resets the configuration changes made by the clr_scrn() function.  The 
  1042. function does not return but  calls the exit() function with 'errcode'
  1043. to end the program.  An 'errcode' of zero is a normal exit, and non-zero 
  1044. is an error exit.
  1045.  
  1046. err_code The code to be passed to the exit() function.  Codes of 200
  1047.           through 254 are reserved for the "c_wndw" software.
  1048.  
  1049. void main() {
  1050.      int fh;
  1051.      clr_scrn (" File processing program ");
  1052.      fh = fileopen ("MAINFILE.DBF", dbase3, readonly);
  1053.      if (fh <= 0) goodbye (1); /* end program on error */
  1054.      process_file (fh); /* user written function */
  1055.      goodbye (0); /* normal end to program */
  1056. }
  1057.  
  1058.  
  1059. ###########################
  1060. #include <c_wndw.h>
  1061. int grabchar (void)
  1062.  
  1063. The function waits for entry of a keystroke from the keyboard, then returns
  1064. the converted entry character.  All key stroke entries, including function
  1065. keys, are converted into a single value.  The key entered is not echoed 
  1066. to the screen.
  1067.  
  1068. The function returns the value of the keystroke entered.  This value
  1069. is also set into INCHAR.
  1070.  
  1071.  
  1072. ###########################
  1073. #include <c_ndx.h>
  1074. int hashmake (char* fname, unsigned fields, unsigned rec_len, long
  1075.      max_rec, unsigned key_off, unsigned key_len)
  1076.  
  1077. Creates an empty hashed type file of name 'fname', record length
  1078. 'rec_len', and with 'max_rec' pre-allocated records.  The location
  1079. of the hash key within the record starts at position 'key_off' with
  1080. length 'key_len'.   The file is in update mode after successful creation.
  1081.  
  1082. fields  The number of fields in the data dictionary.
  1083.             Range of 1 to 254.
  1084. rec_len The length of the record including the status byte.
  1085.             Range of 2 to 32,767.  Must be <= DISCBLCK.
  1086. max_rec The number of records to create in the file.  The actual
  1087.             record count is rounded to the nearest prime number above
  1088.             the number requested.  Range of 2L to 999,999L.
  1089. key_off The start location of the record key.
  1090.             Range of 1 to ('rec_len' - 'key_len').
  1091. key_len The length of the key.  Range of 1 to 254.
  1092.  
  1093. The returns are as for the fileopen() function.
  1094.  
  1095.   
  1096. ###########################
  1097. #include <c_ndx.h>
  1098. long hashread (int fh, byte *key, int access)
  1099.  
  1100. The function performs a hashed read to a hashed type file using the
  1101. field pointed to by 'key'.  The key for the file can be a string or a
  1102. binary code (such as a double).
  1103.  
  1104. fh     The file handle of the file.
  1105. key    A pointer to the key to be used.
  1106. access (0) to read a record from the file.
  1107.        (1) to find the number of an available record.
  1108.  
  1109. If successful, the function returns the record number.  Otherwise:
  1110.   -1L  Bad key (key not found with 'access' == 0, or matching key
  1111.           found with 'access' == 1)
  1112.   -2L  Parameter error.
  1113.   -4L  The read abandoned after 200 attempts.  This indicates the
  1114.           file has very few EMPTY records and needs re-organizing.
  1115.  
  1116.  
  1117. ###########################
  1118. #include <c_wndw.h>
  1119. void helpmenu (int item)
  1120.  
  1121. The function provides the default help screen for the menu() and
  1122. top_menu() functions.  The functions pass a parameter identifying
  1123. the currently highlighted menu item.
  1124.  
  1125.  
  1126. ###########################
  1127. #include <c_wndw.h>
  1128. int helpscrn (byte *field)
  1129.  
  1130. The function provides the default help screen for the accept() and
  1131. related functions.  The parameter is the current entry string contents.
  1132.  
  1133. The function always returns (-1).
  1134.  
  1135.  
  1136. ###########################
  1137. #include <c_wndw.h>
  1138. void idleloop (int ticks)
  1139.  
  1140. The function delays for the number of clock ticks given in the parameter 
  1141. 'ticks'.  There are approximately 18.2 ticks per second, 1092 per minute.
  1142.  
  1143. ticks  The number of clock ticks to delay.
  1144.  
  1145.  
  1146. ###########################
  1147. #include <c_ndx.h>
  1148. int iscache (int fh)
  1149.  
  1150. The function returns whether the "c_wndw" disk access caching facilities
  1151. are active on file 'fh'. The file must be of type hashed, dbase3 or binary.
  1152.  
  1153. fh     The file handle.
  1154.  
  1155. The function returns 0 if access to the file 'fh' does not use "c_wndw"
  1156. disk caching, or 'fh' is not a valid or open file.  Otherwise the 
  1157. function returns the disk cache size in records.
  1158.  
  1159.  
  1160. ###########################
  1161. #include <c_wndw.h>
  1162. int isendch (byte *field, int c, enum ATTRIB atb)
  1163.  
  1164. The function is primarily used by the accept() and related functions and
  1165. returns (1) if the parameter 'c' is a valid "end of field" function key 
  1166. code as determined by set_keys(), unset_keys() and clr_keys().  A zero or 
  1167. negative value means it is not currently an "end of field" key.
  1168.  
  1169.  
  1170. ###########################
  1171. #include <c_ndx.h>
  1172. int isuniqndx (int ndx)
  1173.  
  1174. The function returns 1 if the index file uses unique keys, or 0 if the
  1175. index allows duplicate keys or is not a valid index file.
  1176.  
  1177. ndx    A valid index file opened with ndxcustom(), ndxopen(), or ndxrdex().
  1178.  
  1179.  
  1180. ###########################
  1181. #include <c_wndw.h>
  1182. byte *justify (enum _JUST just, byte *dest, byte *src, unsigned len,
  1183.      unsigned dec)
  1184.  
  1185. The function copies and justifies string 'src' into string 'dest', using 
  1186. the length parameters 'len' and 'dec'.  The function is used to automatically 
  1187. expand and truncate strings, and to format and extract numeric fields.
  1188.  
  1189. just   The desired format of the destination string:
  1190. dest   Pointer to the destination string.
  1191. src    Pointer to the source string.
  1192. len    1 - 254 for the size of text strings (format type left right,
  1193.             center, as_typed)
  1194.        1 - 24 for the number of digits before the decimal point of
  1195.             numeric strings (format type code, decimal, c_number,
  1196.             db_number).
  1197.        Ignored for format type date.
  1198. dec    0 - 8 for the number of decimal places of format type decimal,
  1199.             c_number or db_number.
  1200.        Ignored for all other format types.
  1201.  
  1202. The function returns NULL for an error, or a pointer to the destination
  1203. string if successful.
  1204.  
  1205.  
  1206. ###########################
  1207. #include <c_wndw.h>
  1208. int lastline (byte *field, unsigned col, enum ATTRIB atb)
  1209.  
  1210. The function provides the means to write to the bottom line of the
  1211. screen.  This allows the programmer to customize the display on this
  1212. protected line of the screen instead of using the dispkeys() function.
  1213.  
  1214. field  The ASCIIZ string to be displayed.
  1215. col    The column location to start displaying the string.
  1216.            Range of 1 through SCRN_WID.
  1217. atb    The display attribute.
  1218.  
  1219. The function returns (1) if the 'field' was successfully displayed, zero 
  1220. if it was displayed but truncated, and negative for error.  The function 
  1221. returns (-1) if BOT_LINE is non-zero, and (-2) for a parameter error.
  1222.  
  1223.  
  1224. ###########################
  1225. #include <c_ndx.h>
  1226. int ln_ex (byte *dest, byte *src, unsigned len)
  1227.  
  1228. The function extracts a line of text from a string, expanding any '\t'
  1229. characters into groups of spaces.
  1230.  
  1231. dest   Pointer to the destination string.
  1232. src    Pointer to the source string.
  1233. len    Required length of the destination string.  Range of 1 to 254.
  1234.  
  1235. The function returns the number of characters read from 'src', or
  1236. returns zero if 'len' is greater than 254.
  1237.  
  1238.  
  1239. ###########################
  1240. #include <c_wndw.h>
  1241. int maskfield (byte *dest, byte *src, byte *mask)
  1242.  
  1243. This function applies a character mask to a field.  The 'mask' string
  1244. can contain punctuation and masking characters.  The masking characters 
  1245. are A, C, N, S, X.  This is not case sensitive.
  1246.  
  1247. dest   The pointer to the destination field.
  1248. src    The pointer to the source field.
  1249. mask   The pointer to the masking field.
  1250.  
  1251. If successful the function will return the count of masking characters
  1252. in the 'mask' field.  The function returns (-2) for a parameter error.
  1253.  
  1254. /* format a 10 digit field as a USA style phone number */
  1255.     maskfield (out, phonenumber, "(NNN) NNN-NNNN");
  1256.  
  1257.  
  1258. ###########################
  1259. #include <c_wndw.h>
  1260. int menu (char *menutext, int size, int start, int up)
  1261.  
  1262. Displays the menu from the string 'menutext' within the current window 
  1263. starting from the current cursor position.  Each menu item must be 
  1264. terminated with a '&' or '|' character.
  1265.  
  1266. menutext A string consisting of the items of the menu.
  1267. size     The maximum displayed size of a menu item. This must be non-zero 
  1268.           and fit on the line in the current window.  For multiple items 
  1269.           per line, at least one space is left between each item.
  1270. start    The initially selected menu item.
  1271. up       The maximum number of items per line.
  1272.          up <= (WINDOW[W_NUM].W - _CURSOR.Y + 1) / (size + 1)
  1273.  
  1274. The function returns a positive number corresponding to the item selected 
  1275. where the first item is (1).  The other return values are:
  1276.   0    The 'F10 - Quit' or 'ESC' key was used.
  1277.   -1   No memory available on the heap.
  1278.   -2   Parameter error.  Note: the most common parameter error
  1279.        is for 'size' and 'up' to specify items that cannot fit on
  1280.        the line in the current window.
  1281.  
  1282. /* A menu of a vertical column of items, the fourth item not allowed */
  1283.      item = menu("Small&Compact&Medium&Huge|Large&", 7, 1, 1);
  1284.  
  1285.  
  1286. ###########################
  1287. #include <c_wndw.h>
  1288. int mk_wndw (int ax1, int ay1, int ax2, int ay2, byte *title)
  1289.  
  1290. Creates a window from the coordinates of its top left hand corner
  1291. (ax1, ay1), and bottom right hand corner (ax2, ay2).  The string
  1292. 'text'is displayed on the top border of the window.  All reading and
  1293. writing to the screen occurs within the bounds of the current window
  1294. using the display() and accept() and related functions.
  1295.  
  1296. The body of the window must fit within the main screen display area,
  1297. however the borders of the window can be outside and need not be
  1298. visible.  The maximum window size that displays the borders is:
  1299.     mk_wndw (TOP_LINE + 1, 1, SCRN_LEN - 1, SCRN_WID, "title")
  1300.  
  1301. ax1    The row number of the top left hand corner of the window.
  1302.            This must be >= TOP_LINE.
  1303. ay1    The column of the top left hand corner of the window.
  1304.            This must be >= 0.
  1305. ax2    The row number of the bottom right hand corner.
  1306.            This must be <= SCRN_LEN and at least 2 rows below 'ax1'.
  1307. ay2    The column of the bottom right hand corner of the window.
  1308.            This must be <= (SCRN_WID + 1) and at least 2 columns to the 
  1309.            right of 'ay1'.
  1310. title  The title for the top border of the window.
  1311.  
  1312. If successful, the function returns a positive number of the window number 
  1313. just created.  This number is also set into W_NUM.  The error returns are:
  1314.   -1   Too many windows (compared to _WINDW).
  1315.   -2   No memory available.
  1316.   -3   W_NUM contains an invalid number.
  1317.   -4   Invalid coordinates.
  1318.  
  1319. /* Create a window with an internal area of 9 by 69 */
  1320.    ret = mk_wndw(5, 5, 15, 75, "Test window");
  1321.  
  1322.  
  1323. ###########################
  1324. #include <c_ndx.h>
  1325. mony monydisc (mony amount, mony discount)
  1326. mony monydiv (mony amount1, mony amount2)
  1327. mony monymarkup (mony amount, mony markup)
  1328. mony monymult (mony amount1, mony amount2)
  1329. mony monypercent (mony amount, mony divisor)
  1330. mony monyratio (mony amount, double ratio)
  1331.  
  1332. The functions perform common arithmetic functions with mony type fields 
  1333. as operands.  The functions handle overflow situations, rounding and the
  1334. maintenance of the two implied decimal places.
  1335.  
  1336. monydisc()    Take a discount of a mony field.
  1337. monydiv()     Divide one mony field into another.
  1338. monymarkup()  Markup one mony field by another.
  1339. monymult()    Multiply two mony fields.
  1340. monypercent() The percentage one mony field is of another.
  1341. monyratio()   Apply a ratio to a mony field.
  1342.  
  1343. The functions return LONG_MAX if the result of the calculation is outside 
  1344. the range (-9,999,999.99) to (9,999,999.99).  If successful, they return
  1345. the rounded value of the result of the calculation.
  1346.  
  1347.  
  1348. ###########################
  1349. #include <c_ndx.h>
  1350. byte *mtoascii (byte *dest, mony msrc)
  1351. double mtof (mony msrc)
  1352.  
  1353. The functions convert mony type fields to double type and ASCIIZ string
  1354. fields.
  1355.  
  1356. msrc   The mony type field to be converted.
  1357. dest   Pointer to the destination string for mtoascii().
  1358.            This must be at least 13 bytes in size.
  1359.  
  1360.  
  1361. ###########################
  1362. #include <c_ndx.h>
  1363. int ndxappend (int ndx)
  1364.  
  1365. The function appends a record to an indexed dbase3 file opened in update 
  1366. or append mode.  The parameter to the function is the file handle of an
  1367. index on the file.  This index file must have been previously opened with 
  1368. the ndxcustom(), ndxopen() or ndxrdex() function.
  1369.  
  1370. ndx    The file handle of an index file opened on a dbase3 type file
  1371.            by the ndxcustom(), ndxrdex(), or ndxopen() function.
  1372.  
  1373. The function returns the following values:
  1374.   0    Successful write.
  1375.   -1   Attempt to write a record with a duplicate key where an
  1376.         index file requires unique keys.
  1377.   -2   A write error on the disk.
  1378.   -3   Record status byte not set to IN_USE.
  1379.   -6   Parameter error.
  1380.  
  1381.  
  1382. ###########################
  1383. #include <c_ndx.h>
  1384. int ndxcustom (int fh, char *xname, int (*makekey)(), int type)
  1385.  
  1386. The function opens an index on a dbase3 type file, using a custom index 
  1387. function.  The index key entries are calculated with the 'makekey'
  1388. function passed as a parameter.  The custom index function is not supplied
  1389. with the "c_wndw" and "c_ndx" software.
  1390.  
  1391. The custom index function must have the following parameters:
  1392.      int makekey (int fh, int tag, void *ptr, char *key);
  1393. Where 'makekey()' is the name of the function, 'fh' is the dbase3 file
  1394. handle, 'tag' is an initialization flag passed to the function by the 
  1395. "c_ndx" software and 'key' is the pointer to the key returned by the
  1396. function.  The parameter 'ptr' must not be used by the custom index function.
  1397.  
  1398. The custom index function is initialized by being called with 'tag' equal 
  1399. zero.  Subsequent calls to the custom index function are made with 'tag'
  1400. set non-zero.  The function is expected to return the key for the current
  1401. record in file 'fh' as the 'key' parameter.  The function must return 0 
  1402. for success or negative for error.
  1403.  
  1404. fh     The file handle of the dbase3 file to be indexed.
  1405. xname  The name of the index file.
  1406. makekey() The name of the custom index function.
  1407. type   This identifies the type of the key and should be one of the
  1408.             following values:
  1409.          0  Key is an unterminated string.
  1410.          1  Key is of type double.
  1411.          3  Key is a dBASE-type date key field held as a double.
  1412.  
  1413. If successful, the function returns a positive number of the file handle 
  1414. of the index file.  Otherwise the function returns:
  1415.   0    The named file cannot be found.
  1416.   -1   The index file is entirely empty or corrupted.
  1417.   -2   Parameter error (ex: fh is not open, or is not a dbase3 type
  1418.           file, or DISCBLCK < 512).
  1419.   -4   The named index file is already open.
  1420.   -5   Insufficient heap memory available.
  1421.   -8   If this would be the 8th index on the file.
  1422.  
  1423.  
  1424. ###########################
  1425. #include <c_ndx.h>
  1426. int ndxdelete (int ndx)
  1427.  
  1428. The function flags the current record from the dbase3 file as deleted, and 
  1429. writes it back out to disk.  The file is identified through the index 
  1430. file 'ndx'.
  1431.  
  1432. ndx    The file handle of the index file.
  1433.  
  1434. The function returns zero if successful, (-1) for disk/file error or
  1435. (-2) for a parameter error.
  1436.  
  1437.  
  1438. ###########################
  1439. #include <c_ndx.h>
  1440. int ndxfield (int ndx, unsigned fnbr)
  1441.  
  1442. The function returns the data field number of the 'fnbr' index field.
  1443.  
  1444. ndx    The file handle of an index file opened on a dbase3 file
  1445.             type with the ndxopen() or ndxrdex() functions.  Custom
  1446.             indexes are not supported.
  1447. fnbr   The index field sequence number (from a base of 0).
  1448.  
  1449. The function returns (-1) if 'ndx' is not a valid index file, or the index 
  1450. field number does not exist.  If successful, it returns the data dictionary 
  1451. field number (range 0 - 253).
  1452.  
  1453.  
  1454. ###########################
  1455. #include <c_ndx.h>
  1456. int ndxopen (int fh, char *xname)
  1457.  
  1458. The function opens an index file on a dbase3 file.  The details on the
  1459. index are obtained from the information in the index file.  This information 
  1460. includes whether the index is numeric, or has unique keys.
  1461.  
  1462. The parsing system and index calculation logic supports a subset of the 
  1463. dBASE index calculation logic covering the vast majority of indexes in 
  1464. use in existing dBASE compatible B-tree index files.
  1465.  
  1466. fh     The file handle of the dbase3 file to be indexed.
  1467. xname  The name of the index file.
  1468.  
  1469. If successful the function returns a positive number of the file handle 
  1470. of the index file.  Otherwise the function returns:
  1471.   0    The named file cannot be found.
  1472.   -1   The index file is entirely empty or corrupted.
  1473.   -2   Parameter error (ex: 'fh' is not open, or is not a dbase3 type
  1474.             file, or DISCBLCK < 512).
  1475.   -4   The named index file is already open.
  1476.   -5   Insufficient heap memory available.
  1477.   -7   The index expression cannot be parsed.
  1478.   -8   If this would be the 8th index on the file.
  1479.  
  1480.  
  1481. ###########################
  1482. #include <c_ndx.h>
  1483. int ndxrdex (int fh, char *xname, char *exprn, int (*makekey)(), int type)
  1484.  
  1485. The function creates or recreates an index on a dbase3 file.  It supports 
  1486. both dBASE compatible and custom indexes.  The function is the only way
  1487. to create a custom index on a file.
  1488.  
  1489. fh      The file handle of the dbase3 type file to be indexed.
  1490. xname   The name of the index file.  If the file exists, it is replaced.
  1491.             If it does not exist it is created.  If the 'exprn' and 
  1492.             'makekey' parameters are both NULL, 'xname' must be a valid, 
  1493.             existing index file to be re-indexed by the ndxrdex() function.
  1494. exprn   If not equal to NULL, this points to valid dBASE index expression
  1495.             of up to 220 bytes in length.  If the 'makekey' parameter is
  1496.             not equal NULL 'exprn' is for documentation only, but otherwise
  1497.             is evaluated for the key calculation logic as described above.
  1498. makekey If not equal to NULL, this is the custom key calculation
  1499.             function, more fully described under the ndxcustom() function.
  1500. type    This flag is used to identify characteristics of the key.
  1501.  
  1502. On successful completion, the function returns the file handle of the index 
  1503. file.  The error returns are:
  1504.   -1  Parameter error.
  1505.   -5  Insufficient heap memory available.
  1506.   -7  (custom key only) The 'makekey' function returned an error.
  1507.   -8  Attempt to open the 8th index on a file.
  1508.  
  1509.  
  1510. ###########################
  1511. #include <c_ndx.h>
  1512. int ndxread (int ndx, enum F_READ mode)
  1513.  
  1514. The function performs a random or sequential read on a dbase3 file via the  
  1515. index file 'ndx'.  The parameter 'mode' identifies the type of the read.
  1516.  
  1517. Performing a random read involves moving the fields in the key into the 
  1518. record.  The ndxread() function then builds the key and retrieves the 
  1519. matching record from the file.  If a matching record cannot be found,
  1520. the function retrieves the record with the next higher key.
  1521.  
  1522. ndx    The file handle of the index file.
  1523. mode   The read action mode:
  1524.        firstrec The first record in index sequence.
  1525.        nextrec  The next record in index sequence.
  1526.        previous The previous record in index sequence.
  1527.        lastrec  The last record in index sequence.
  1528.        random   Retrieve a record randomly using a key search
  1529.                  through the indexes.
  1530.  
  1531. All values of 'mode' return 1 for a valid, successful read.  random
  1532. returns 0 if an exact key match was not found, and retrieves the record 
  1533. with the next higher key.  The other values of 'mode' return 0 at the 
  1534. top/end of the file.
  1535.  
  1536. The error returns of the function are:
  1537.    -1   File/disc error.
  1538.    -2   Parameter error.
  1539.    -7   Disk cache error.
  1540.  
  1541.  
  1542. ###########################
  1543. #include <c_ndx.h>
  1544. int ndxwrite (int ndx)
  1545.  
  1546. The function writes a record to an indexed dbase3 file opened in update or
  1547. append mode.  The parameter to the function is the file handle of an index
  1548. on the file.
  1549.  
  1550. If the dbase3 file was opened in append mode, the effect of using ndxwrite() 
  1551. is identical to using ndxappend().  If the file was opened in update mode,
  1552. the function overwrites the current record on disk.
  1553.  
  1554. ndx    The file handle of an index file opened on a dbase3 type file.
  1555.  
  1556. The function returns the following values:
  1557.   0   Successful write.
  1558.   -1  Attempt to write a record with a duplicate key to an index
  1559.       file requiring unique indexes.
  1560.   -2  A write error on the disk.
  1561.   -6  Parameter error.
  1562.  
  1563.  
  1564. ###########################
  1565. #include <c_wndw.h>
  1566. long primenbr (long source)
  1567.  
  1568. Returns the first prime number equal to or higher than the number
  1569. provided.  The function is accurate for 'source' values between 8L
  1570. and 29,999,999.  'source' values under 8L return (11L).
  1571.  
  1572. source The number to be converted to a prime.
  1573.  
  1574. The function returns the prime number if successful, or:
  1575.   -1L  'source' is negative or greater than 29,999,999.
  1576.   -4L  No heap memory available.
  1577.  
  1578.  
  1579. ###########################
  1580. #include <c_wndw.h>
  1581. void prn_scrn (void)
  1582.  
  1583. The function prints a copy of the screen onto the main printer.  This
  1584. works with any printer as the IBM graphics characters used by the
  1585. mk_wndw() function are translated to ASCII equivalents, and any
  1586. other graphics characters are replaced with the '#' character.
  1587.  
  1588. The function is automatically activated by pressing the 'Alt+P' key.
  1589.  
  1590.  
  1591. ###########################
  1592. #include <c_wndw.h>
  1593. int qry_wndw (byte *text)
  1594.  
  1595. The function creates a window, displays the message in 'text', and prompts 
  1596. for a yes/no response.
  1597.  
  1598. text   A multi-line text string containing the query to be displayed.
  1599.             Lines can be up to 60 characters wide, or terminated with 
  1600.             the '\n' character.  Up to five lines can be displayed.
  1601.  
  1602. The function returns (1) for a BOOL_YES entry and (0) for a BOOL_NO entry.
  1603. The function automatically removes its window when it exits.
  1604.  
  1605.      if (qry_wndw(" Do you want to finish entry? ")) return;
  1606.  
  1607.  
  1608. ###########################
  1609. #include <c_wndw.h>
  1610. void read_kb (void)
  1611.  
  1612. Reads and ignores a keyboard entry.  If the 'Alt+X' keys are pressed the 
  1613. function prompts for a controlled termination.
  1614.  
  1615.  
  1616. ###########################
  1617. #include <c_wndw.h>
  1618. int rm_wndw (void)
  1619.  
  1620. Removes the current window and redisplays the part of the screen covered 
  1621. by it.  All screen activity now takes place in the previous window.
  1622. The main window, window #0 cannot be removed.
  1623.  
  1624. If successful, the function returns a positive number of the window
  1625. removed. If unsuccessful, it returns:
  1626.   -1  Attempt to remove window #0.
  1627.   -3  System error.
  1628.  
  1629. /* Remove all windows */
  1630.    while ( rm_wndw () > 0);
  1631.  
  1632.  
  1633. ###########################
  1634. #include <c_wndw.h>
  1635. void scrnsave (int posn)
  1636.  
  1637. A function used by accept(), read_kb(), err_wndw() and qry_wndw() functions.
  1638. If the functions have to wait longer than SAVEWAIT ticks for a keyboard 
  1639. entry, all file buffers are flushed.
  1640.  
  1641.   while (!isascii(c)) {scrnsave(0); c = grabchar();}
  1642.  
  1643.  
  1644. ###########################
  1645. #include <c_wndw.h>
  1646. void scrn_map (byte *field, int ax, int ay)
  1647.  
  1648. The function writes the 'field' string onto the screen starting at the
  1649. (ax, ay) location using the current color code (set by set_clr()).  The 
  1650. function uses absolute screen not relative window coordinates and can be
  1651. used to write anywhere on the screen without regard to windows.
  1652.  
  1653.  
  1654. ###########################
  1655. #include <c_wndw.h>
  1656. void scroll (int incr, int head)
  1657.  
  1658. The function scrolls the window up or down according to the 'incr'
  1659. parameter, leaving a header of 'head' lines unscrolled.
  1660.  
  1661. incr   The number lines the window scrolls.  Negative for scrolling
  1662.             down, positive for up.
  1663. head   The size of an unscrolled header area at the top of the
  1664.             window.
  1665. If the parameters are invalid, the function does not scroll.
  1666.  
  1667. /* To scroll up by 2 lines all but the first 3 lines of a window */
  1668.      scroll (2, 3);
  1669.  
  1670.  
  1671. ###########################
  1672. #include <c_wndw.h>
  1673. void set_clr (int clr_nbr, enum ATTRIB atb)
  1674.  
  1675. The function is used to change the color code used by the scrn_map()
  1676. function.  The color code is selected from COLOR[], by applying the effect 
  1677. of the attribute 'atb'.  The function also works to select the display 
  1678. attribute on monochrome screens.
  1679.  
  1680. clr_nbr The array index element selected from COLOR[], or a special case
  1681.           entry.  This can be 95, 98 or 99, or >= 0 and < _COLORS.
  1682. atb     The screen attribute color variation.
  1683.  
  1684.  
  1685. ###########################
  1686. #include <c_wndw.h>
  1687. void set_crsr (int rx, int ry)
  1688.  
  1689. The function moves the cursor within the current window to the location 
  1690. given by (rx, ry).  The function wraps around from an invalid location
  1691. to one that fits in the window.
  1692.  
  1693. rx     The row location within the current window.
  1694. ry     The column location within the current window.
  1695.  
  1696.  
  1697. ###########################
  1698. #include <c_wndw.h>
  1699. void set_keys (unsigned count, unsigned param1, ...)
  1700.  
  1701. The function determines which function keys are recognized by accept()
  1702. and related functions as "end of field" function keys.
  1703.  
  1704. It has a variable function list which allows a large number of keys to
  1705. be set.  The key codes are defined in the c_wndw.h header file.  For
  1706. example: CRS_UP for cursor up key.
  1707.  
  1708. count     A count of the number of keys to be set.
  1709. param1... The parameter list of keys to be set.
  1710.  
  1711. set_keys (5, CRS_UP, CRS_DN, PGUP, PGDN, HELP);
  1712.  
  1713.  
  1714. ###########################
  1715. #include <c_wndw.h>
  1716. int set_wndw (unsigned wnbr, enum _JUST just, enum ATTRIB atb,
  1717.      unsigned style)
  1718.  
  1719. The function sets the window characteristics of border styles and title 
  1720. formats for windows.  The set_wndw() function must be called before the
  1721. mk_wndw() function in order to properly set up the format.
  1722.  
  1723. wnbr   The number of the window to set.  This window need not be
  1724.            active, and if active this has no effect until the window
  1725.            is removed and re-activated.  The range is 1 to _WINDW.
  1726. just   The format of the title.  This must be left, center, or right.
  1727. atb    The screen attribute for the title.
  1728. style  The style of the window border as follows:
  1729.         0    Double line box (the default).
  1730.         1    Single line box.
  1731.         2    Light hatch box.
  1732.         3    Heavy hatch box.
  1733.  
  1734. The function returns (-1) on error, zero on success.
  1735.  
  1736.  
  1737. ###########################
  1738. #include <c_wndw.h>
  1739. void shortbeep (int tone)
  1740.  
  1741. The function produces beep of duration ERR_BEEP clock ticks, with a
  1742. minimum beep duration of two clock ticks.  There are 18.2 clock ticks
  1743. to the second.  The tone of the beep is based on the 'tone' parameter.
  1744.  
  1745.  
  1746. ###########################
  1747. #include <c_wndw.h>
  1748. int sys_wndw (byte *text, int errcode, int ret)
  1749.  
  1750. The function behaves exactly as the err_wndw() function except the window 
  1751. is only displayed if ERRORMSG is non-zero.  This is used extensively in the
  1752. "c_wndw" and "c_ndx" functions to allow the error displays to be suppressed
  1753. by setting ERRORMSG to zero after your programs have acheived a stable status.
  1754.  
  1755.  
  1756. ###########################
  1757. #include <c_wndw.h>
  1758. int top_menu (char *menutext, int size, int start)
  1759.  
  1760. The function displays the menu across the top line of the screen.  The
  1761. items have a maximum size of 27 bytes and the  full menu must fit on one 
  1762. line.  The returns are as for the menu() function.  This menu is independent
  1763. of the window system.
  1764.  
  1765.     k = top_menu ("Amend&Create&Delete&Extract&Report&", 9, k);
  1766.  
  1767.  
  1768. ###########################
  1769. #include <c_wndw.h>
  1770. void top_spot (int val)
  1771.  
  1772. Refreshes the status values on the top line of the screen.  These status 
  1773. values are the screen title, available memory, date, and available capacity
  1774. on the default disk drive.
  1775.  
  1776. If TOP_LINE is zero, the function does not output to the screen.
  1777.  
  1778. val    0 refreshes the whole status line.
  1779.        1 refreshes the available memory percent display.
  1780.        2 refreshes the status of "INSERT" at bottom right of screen
  1781.          by calling the dispkeys() function.
  1782.        3 refreshes available disk percent display.
  1783.        4 refreshes the date display.
  1784.  
  1785.  
  1786. ###########################
  1787. #include <c_wndw.h>
  1788. void unset_keys (unsigned count, unsigned param1, ...)
  1789.  
  1790. The function deactivates function keys from being used as "end of field"
  1791. keys by the accept() and related functions.
  1792.  
  1793. It has a variable function list which allows a large number of keys
  1794. to be unset.  The key codes are defined in the c_wndw.h header file.
  1795. For example: CRS_UP for cursor up key.
  1796.  
  1797. count     A count of the number of keys to be unset.
  1798. param1... The parameter list of keys to be unset.
  1799.  
  1800. unset_keys (3, CRS_UP, CRS_DN, HELP);
  1801.  
  1802.  
  1803. ###########################
  1804. #include <c_wndw.h>
  1805. int validate (byte *line, enum _JUST just, unsigned len, unsigned dec)
  1806.  
  1807. The function evaluates the value of 'line' to ensure it is valid.  If
  1808. 'line' is of type date, the month and day are validated.  If 'line' is of
  1809. type c_number, db_number or decimal, it is checked to see if it has too 
  1810. many digits before the decimal point.
  1811.  
  1812. line   The string to be evaluated.
  1813. just   The format of the string to be evaluated.
  1814. len    The number of digits before the decimal point.
  1815. dec    The number of decimal digits.
  1816.  
  1817. The function returns zero if 'line' is invalid and (1) if valid.
  1818.  
  1819.  
  1820. ###########################
  1821. #include <c_wndw.h>
  1822. int v_bool (int c)
  1823.  
  1824. Tests the character 'c' against comparison characters stored in BOOL_NO 
  1825. and BOOL_YES.  It is not case sensitive.
  1826.  
  1827. The function returns (2) if 'c' is BOOL_YES, (1) if 'c' is BOOL_NO, and 
  1828. zero if neither BOOL_YES nor BOOL_NO.
  1829.  
  1830.  
  1831. ###########################
  1832. #include <c_wndw.h>
  1833. void warble (int tone)
  1834.  
  1835. Turns on the computer's speaker to the tone provided.  As a special case,
  1836. a tone of zero shuts off the speaker.
  1837.  
  1838.  
  1839. B) enum AND struct DEFINITIONS
  1840. ==============================
  1841.  
  1842. enum ATTRIB {low, high, reverse, blink, blank, alt_low, alt_high,
  1843.           alt_reverse};
  1844.      Defines the screen attribute code to select which of the 6 color pairs
  1845.      are to be used, plus supports blink and blank fields.  This is used
  1846.      with the accept(), display(), set_clr() and related functions.
  1847.  
  1848. enum COLOR_OF {Mblack, Mblue, Mgreen, Mcyan, Mred, Mmagenta, Myellow,
  1849.           Mwhite};
  1850.      Defines the 8 base colors used by the software, which extend to 16
  1851.      with the high/low intensity options.
  1852.  
  1853. enum fld_type {alphanum, graphic, flag, boolean, calendar, numeric, value,
  1854.           real, chrono}:
  1855.      Defined for future use.
  1856.  
  1857. enum F_MODE {append, readonly, recreate, update};
  1858.      Defines the file access mode for the fileopen() function.   All access
  1859.      modes are available with all file types except append with hashed,
  1860.      and update with ascii.
  1861.  
  1862. enum F_READ {firstrec, previous, nextrec, lastrec, random, relative};
  1863.      Defines the file read mode for the dbfread(), fileread() and ndxread()
  1864.      functions.
  1865.  
  1866. enum F_TYPE {ascii, binary, dbase3, hashed, marietta};
  1867.      Defines the file type for the fileopen() function.  ascii type files
  1868.      have variable length records terminated with "\r\n", whereas binary,
  1869.      dbase3 and hashed files have fixed length records which may contain
  1870.      binary information.
  1871.  
  1872. enum _JUST {left, right, as_typed, center, code, decimal, db_number,
  1873.           c_number, date, _time};
  1874.      Defines field format (justification) codes used by the accept() (and
  1875.      related functions), fld_len(), and justify() functions.
  1876.  
  1877. struct CLR_TYPE {enum COLOR_OF FORE, BACK; int ALT_CLR}
  1878.           COLOR[], TOP_CLR, ER_COLOR;
  1879.      Defines the primary color pair, and the number of the alternate
  1880.      color pair for the windows, and the top and bottom lines.
  1881.  
  1882. struct CURSR {byte X,Y;} _CURSOR;
  1883.      Contains the current cursor location within current window.
  1884.  
  1885. struct DBF_DEF {byte dbf_name[11]; int dbf_type, dbf_len, dbf_dec,
  1886.           dbf_set, dbf_dig; enum _JUST just; unsigned posn; ... };
  1887.      Defines the field format of the dBASE style data dictionary created
  1888.      when a hashed or dbase3 file is opened with the fileopen() function.
  1889.  
  1890. struct F_DEF {long prime, r_count; int key_len, offset, start, ismemo;
  1891.           unsigned rec_len; enum F_TYPE ftype; byte *record; char
  1892.           fname[13], fvol, fpath[61]; void *fnext; ...} *FN;
  1893.      Defines the buffers and control variables used by the "c_wndw" and
  1894.      "c_ndx" file access software.
  1895.  
  1896. struct WINDW {int X, Y, H, W, .......} *WINDOW;
  1897.      Defines the buffers and sizes used by the "c_wndw" windowing
  1898.      software.  The number of usable columns in the current window is
  1899.      (WINDOW[W_NUM].W - 1) and the number of usable rows is
  1900.      (WINDOW[W_NUM].H - 1).
  1901.  
  1902. typedef unsigned char byte;
  1903.      Used in the "c_wndw" software to contain values in the range (0) to
  1904.      (254). The value (255) by convention is viewed as an error or a null
  1905.      value.
  1906.  
  1907. typedef long mony;
  1908.      A mony type field is of storage class long, but includes two implied
  1909.      decimal places (ex: cents in a dollar field).  It is the programmer's
  1910.      responsibility, on this type of field, to keep track of these decimal
  1911.      places.  The mony field type can contain a signed binary number in
  1912.      the range (-9,999,999.99) to (9,999,999.99).  The value LONG_MAX
  1913.      by convention is viewed as an error value.
  1914.  
  1915.  
  1916. C) CONFIGURATION CONSTANTS AND VARIABLES
  1917. ========================================
  1918.  
  1919. ACC_DISP    This enum ATTRIB type field determines the attribute used
  1920.             by the accept() function to re-display the entered field after
  1921.             entry.
  1922.  
  1923. A_TRACK     Used by the accept() function.  If negative it is ignored,
  1924.             but otherwise becomes the starting cursor position within the
  1925.             display string.  At the end of the accept() or related
  1926.             function, this is the string location where the function key
  1927.             was pressed.
  1928.  
  1929. BANNER_MSG[]   The contents of the information window that appears when
  1930.             the clr_scrn() function is first called, or when the operator
  1931.             presses the Alt+V key combination.
  1932.  
  1933. BOOL_NO     Identifies the uppercase boolean no/false code.
  1934.  
  1935. BOOL_YES    Identifies the uppercase boolean yes/true code.
  1936.  
  1937. BOT_LINE    This controls the display of the active function keys on the
  1938.             bottom line of the screen.
  1939.  
  1940. CLR_TONE    The length of time, in clock ticks, for the display of the
  1941.             initial information window during the clr_scrn() function.
  1942.             The default is 25, about 1.5 seconds.
  1943.  
  1944. COMMA       Identifies the thousands separator character.
  1945.  
  1946. _COLORS     The maximum number of color pairs.
  1947.  
  1948. D_FORMAT    Provides the format of the date. The default is 'U'.
  1949.             'U' = mm/dd/yy; 'E' = dd/mm/yy;  'I' = yy/mm/dd.
  1950.  
  1951. DISCBLCK    The maximum size of any record accessed by fileread(),
  1952.             filewrit() or related functions.  The default is 4100, the
  1953.             minimum is 512, and the maximum 65,000.
  1954.  
  1955. D_PUNCT     Identifies the punctuation character for dates.
  1956.  
  1957. D_20XX      Identifies the split between the 20th and 21st centuries
  1958.             for 2 digit year fields.
  1959.  
  1960. ERR_BEEP    This determines the length of the beep by the shortbeep()
  1961.             function in clock ticks.
  1962.  
  1963. ERRORMSG    This is used to suppress the error messages displayed by the
  1964.             "c_wndw" and "c_ndx" software.
  1965.  
  1966. FLD_FULL    Used by the accept() function.  A non-zero value automatically
  1967.             ends field entry when it is full.  A zero value requires the
  1968.             ENTER key (or an activated function key) to end the field.
  1969.  
  1970. GOODBYEMSG     This is used by the goodbye() function.  If non-zero the
  1971.             function issues success or failure messages at the end of the
  1972.             program.  If zero, these messages are suppressed.
  1973.  
  1974. KEY_DISPLAY[]   This array of seven short strings contains the key names
  1975.             of function keys F3 through F9.
  1976.  
  1977. MAXFILES    Maximum number of files open at one time, including the five
  1978.             standard C streams.  The default value of 9 actually allows
  1979.             for 4 disk files.  The maximum is set by your operating system.
  1980.             20 is typical, but it can be as high as 99.
  1981.  
  1982. MAX_WIND    The maximum heap space to be used by the windowing functions.
  1983.  
  1984. MEM_WARN     A warning is issued by the top_spot() function when
  1985.             available heap space falls below this value.  The default is
  1986.             1024, with a range of 0 to 9999.
  1987.  
  1988. MENULINE    This determines if an information line for menus is displayed
  1989.             on the bottom line of the screen while the menu() and
  1990.             top_menu() functions are active.
  1991.  
  1992. PERIOD      Identifies the decimal point character which must be different
  1993.             from COMMA.
  1994.  
  1995. SAVEWAIT    The scrnsave() function waits this time (in clockticks) before
  1996.             flushing the file buffers.  Setting to zero supresses this
  1997.             facility.
  1998.  
  1999. SCRN_LEN    The number of lines on the screen.  This is normally the
  2000.             default of 25.  It allows utilization of 43 and 50 line per
  2001.             screen systems.
  2002.  
  2003. SCRN_WID    The number of columns on the screen.  This should remain 80.
  2004.  
  2005. TOP_LINE    The number of lines dedicated for status line and the
  2006.             top_menu() function at the top of the screen.
  2007.  
  2008. _WINDW      The maximum allowed number of windows.
  2009.  
  2010.