home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / database / scd210.zip / SC_BASE.H < prev    next >
Text File  |  1991-01-26  |  27KB  |  836 lines

  1. /*************************************************
  2.  **                                             **
  3.  **   sc_base.h                                 **
  4.  **                                             **
  5.  **       SoftC Database Library common header  **
  6.  **                                             **
  7.  **    Copyright (C) 1988, 1989, 1990, 1991 by  **
  8.  **               SoftC, Ltd.                   **
  9.  **               16820 3rd St NE               **
  10.  **               Ham Lake, MN 55304            **
  11.  **               (612) 434-6968                **
  12.  **                                             **
  13.  **             All rights reserved.            **
  14.  *************************************************/
  15.  
  16.  
  17.  
  18. /**********
  19.  *
  20.  *  Program Control Prototypes
  21.  *
  22.  **********/
  23.  
  24.  
  25.  
  26.  
  27. int scdinit( int,  int );
  28. void scdterm( void );
  29.  
  30.  
  31.  
  32.  
  33. /**********
  34.  *
  35.  *  Defines
  36.  *
  37.  **********/
  38.  
  39.  
  40.  
  41.  
  42. /* scdikfind, scdnkfind, scdckfind definitions */
  43. #define SC_FIRST 1                  /* find first key */
  44. #define SC_EXACT 2                  /* find exact key (uses record number) */
  45.  
  46. /* scdtrget, scdtrput definitions */
  47. #define SC_CRUNCHNG 0               /* leave memo buffer unchanged */
  48. #define SC_CRDELETE 0x100           /* delete soft carriage returns */
  49.  
  50. /* scdcopen, scddopen, scdiopen, scdnopen, scdtopen */
  51. #define SC_RDWR 0                   /* read/write access (default) */
  52. #define SC_RDONLY 0x100             /* read only access */
  53. #define SC_BUFFER 0                 /* buffer disk writes in memory (default) */
  54. #define SC_FLUSH 0x200              /* force all writes to disk */
  55. #define SC_EXCLUDE 0                /* open file for exclusive use (default) */
  56. #define SC_SHARED 0x400             /* open file for shared use */
  57.  
  58. /* scdcbfrsz, scddbfrsz, scdibfrsz, scdnbfrsz */
  59. #define SC_SETSZ 0                  /* set buffer size */
  60. #define SC_GETSZ 1                  /* get current buffer size */
  61.  
  62. /* scddrput, scdtrput */
  63. #define SC_UPDATE 0x100             /* update existing record */
  64. #define SC_ADD 0x200                /* append record at end of file */
  65.  
  66. /* scdccreate, scdicreate, scdncreate, scdmtnew */
  67. #define SC_DESCEND 0x100            /* descending key order */
  68. #define SC_UNIQUE 0x80              /* unique index keys */
  69. #define SC_CKEY 'C'                 /* character type key */
  70. #define SC_DKEY 'D'                 /* date type key */
  71. #define SC_LKEY 'L'                 /* logical key type */
  72. #define SC_NKEY 'N'                 /* numeric type key */
  73.  
  74. /* SoftC extended index file key types (scdncreate) */
  75. #define SC_DBLKEY 1                 /* double key */
  76. #define SC_FLTKEY 2                 /* float key */
  77. #define SC_ULNGKEY 3                /* unsigned long key */
  78. #define SC_LNGKEY 4                 /* long key */
  79. #define SC_USHTKEY 5                /* unsigned short key */
  80. #define SC_SHTKEY 6                 /* short key */
  81.  
  82. /* scdinit */
  83. #define SC_USEXHNDL 1               /* allow more than 20 open files */
  84.  
  85.  
  86.  
  87.  
  88.  
  89. /**********
  90.  *
  91.  *  Type Definitions
  92.  *
  93.  **********/
  94.  
  95.  
  96.  
  97.  
  98. typedef struct {  /* database field description */
  99.   char name[11];    /* field name */
  100.   char type;        /* field type
  101.                      * 'c' or 'C' - character
  102.                      * 'd' or 'D' - date
  103.                      * 'f' or 'F' - floating point (binary)
  104.                      * 'l' or 'L' - logical
  105.                      *              't' or 'T' - true
  106.                      *              'f' or 'F' - false
  107.                      *              'y' or 'Y' - yes
  108.                      *              'n' or 'N' - no
  109.                      *              '?'        - uninitialized
  110.                      * 'n' or 'N' - floating point (bcd) */
  111.   int len;          /* field width */
  112.   int decpl;        /* decimal count */
  113. } SC_FIELD;
  114.  
  115. /* SoftC extended data file field types */
  116. #define SC_SHORT_FLD 1              /* signed short integer (16 bits) */
  117. #define SC_USHORT_FLD 2             /* unsigned short integer */
  118. #define SC_LONG_FLD 3               /* signed long integer (32 bits) */
  119. #define SC_ULONG_FLD 4              /* unsigned long integer */
  120. #define SC_FLOAT_FLD 11             /* IEEE single real (32 bits) */
  121. #define SC_MSFLT_FLD 12             /* Microsoft floating point (old) */
  122. #define SC_DOUBLE_FLD 13            /* IEEE double real (64 bits) */
  123. #define SC_MSDBL_FLD 14             /* Microsoft double (old) */
  124.  
  125.  
  126.  
  127. typedef struct {  /* file open bit fields */
  128.   unsigned int isreadonly:1;    /* read only    - or - read/write (default) */
  129.   unsigned int isshareable:1;   /* shared       - or - single (default) */
  130.   unsigned int isunbuffered:1;  /* no buffering - or - auto buffer (default) */
  131. } SC_FLAGS;
  132.  
  133.  
  134.  
  135. typedef struct {  /* dBASE data file information packet */
  136.   char fname[80];       /* file name */
  137.   char style;           /* file type (dBase3 or dBase4) */
  138.   char memo;            /* memo file required */
  139.   char mdx;             /* dBase4 .MDX file required (true or false) */
  140.   char trans;           /* dBase4 transaction in process (true or false) */
  141.   char encrypt;         /* dBase4 data file encrypted (true or false) */
  142.   char lockt;           /* record/file/no lock */
  143.   unsigned long ladrs;  /* beginning address of locked area */
  144.   unsigned long lsize;  /* length of locked region */
  145.   SC_FLAGS flags;       /* miscellaneous flags */
  146. } SC_DBFINFO;
  147.  
  148. /* SC_DBFINFO style flag */
  149. #define SC_DB3 0                    /* dBase3 type data file */
  150. #define SC_DB4 1                    /* dBase4 type data file */
  151. #define SC_FP1 0x10                 /* FoxPro1 type data file */
  152. #define SC_DBL2 0x42                /* SoftC unique data file */
  153.  
  154. /* SC_DBFINFO memo flag */
  155. #define SC_USEMEMO 1                /* memo file used */
  156. #define SC_NOMEMO 0                 /* no memo file required */
  157.  
  158. /* SC_DBFINFO lockt flag */
  159. #define SC_DRECLCK 0x01             /* record lock active */
  160. #define SC_DFILLCK 0x02             /* file lock active */
  161.  
  162.  
  163. typedef struct {  /* dBASE data file record information packet */
  164.   int reclen;     /* record length in bytes */
  165.   int numflds;    /* number of fields in record */
  166.   char *bfr;      /* address of the record buffer */
  167. } SC_DBFRINFO;
  168.  
  169.  
  170.  
  171. typedef struct {  /* dBASE memo file information packet */
  172.   char fname[80]; /* file name */
  173.   char style;     /* file type (dBase3 or dBase4) */
  174.   SC_FLAGS flags; /* miscellaneous flags */
  175. } SC_DBTINFO;
  176.  
  177.  
  178. typedef struct {  /* FoxPro memo file information packet */
  179.   char fname[80]; /* file name */
  180.   SC_FLAGS flags; /* miscellaneous flags */
  181. } SC_FPTINFO;
  182.  
  183.  
  184. typedef struct {  /* dBASE index file information packet */
  185.   char fname[80]; /* file name */
  186.   char keytype;   /* key type ('C' Character, 'N' Date/Numeric) */
  187.   char keylen;    /* key length */
  188.   int exprlen;    /* key expression length */
  189.   SC_FLAGS flags; /* miscellaneous flags */
  190. } SC_NDXINFO;
  191.  
  192.  
  193.  
  194. typedef struct {  /* Clipper index file information packet */
  195.   char fname[80]; /* file name */
  196.   int keylen;     /* key length */
  197.   int keydpl;     /* number of decimal places in numeric keys */
  198.   int exprlen;    /* key expression length */
  199.   SC_FLAGS flags; /* miscellaneous flags */
  200. } SC_NTXINFO;
  201.  
  202.  
  203. typedef struct {  /* FoxBASE index file information packet */
  204.   char fname[80]; /* file name */
  205.   char keytype;   /* key type ('C' Character, 'N' Date/Numeric) */
  206.   char keylen;    /* key length */
  207.   int exprlen;    /* key expression length */
  208.   SC_FLAGS flags; /* miscellaneous flags */
  209. } SC_IDXINFO;
  210.  
  211. typedef struct {  /* dBASE IV index file information packet */
  212.   char fname[80]; /* data file name */
  213.   int usedtags;   /* number of tags in use */
  214.   SC_FLAGS flags; /* miscellaneous flags */
  215. } SC_MDXINFO;
  216.  
  217.  
  218. typedef struct {  /* dBASE IV tag information packet */
  219.   char tname[80]; /* tag file name */
  220.   char keytype;   /* key type ('C' Character, 'D' Date, 'N' Numeric) */
  221.   char keylen;    /* key length */
  222.   int exprlen;    /* key expression length */
  223. } SC_MDXTINFO;
  224.  
  225.  
  226.  
  227.  
  228. /**********
  229.  *
  230.  *  dBASE Database File Manipulator Prototypes
  231.  *
  232.  **********/
  233.  
  234.  
  235.  
  236.  
  237. int scddbfrsz(  int,              /* data file handle */
  238.                 int *,            /* I/O buffer length in records */
  239.                 int );            /* set or get buffer length */
  240.  
  241. int scddbof(    int );            /* file handle */
  242.  
  243. int scddclose(  int );            /* file handle */
  244.  
  245. int scddcreate( char *,           /* filename */
  246.                 int,              /* number of data fields */
  247.                 SC_FIELD *,       /* field description array */
  248.                 int );            /* dBase version (3 or 4) */
  249.  
  250. int scddeof(    int );            /* file handle */
  251.  
  252. int scddflush(  int );            /* file handle */
  253.  
  254. int scddhget(   int );            /* file handle */
  255.  
  256. int scddinfo(   int,              /* file handle */
  257.                 SC_DBFINFO * );   /* file information & status */
  258.  
  259. int scddlock(   int );            /* file handle */
  260.  
  261. int scddlud(    int,              /* file handle */
  262.                 char *,           /* last update date string */
  263.                 int );            /* date string format */
  264.  
  265. int scddopenx(  int *,            /* file handle */
  266.                 char *,           /* filename */
  267.                 int );            /* open mode & characteristics */
  268.  
  269. int scddpack(   int *);           /* data file handle */
  270.  
  271. int scddsize(   int,              /* file handle */
  272.                 long * );         /* number of data records */
  273.  
  274. int scddunlock( int );            /* file handle */
  275.  
  276.  
  277.  
  278.  
  279. /**********
  280.  *
  281.  *  dBASE Database Field Manipulator Prototypes
  282.  *
  283.  **********/
  284.  
  285.  
  286.  
  287.  
  288. int scddfgets(  int,              /* file handle */
  289.                 int,              /* field number */
  290.                 char * );         /* buffer for field data */
  291.  
  292. int scddfget(   int,              /* file handle */
  293.                 int,              /* field number */
  294.                 void * );         /* buffer for field data */
  295.  
  296. int scddfinfo(  int,              /* file handle */
  297.                 int *,            /* length of longest field */
  298.                 SC_FIELD * );     /* field description array */
  299.  
  300. int scddfnam2no(int,              /* file handle */
  301.                 int *,            /* field number */
  302.                 char *);          /* field name */
  303.  
  304. int scddfputs(  int,              /* file handle */
  305.                 int,              /* field number */
  306.                 char * );         /* buffer for field data */
  307.  
  308. int scddfput(   int,              /* file handle */
  309.                 int,              /* field number */
  310.                 void * );         /* buffer for field data */
  311.  
  312.  
  313.  
  314.  
  315. /**********
  316.  *
  317.  *  dBASE Database Record Manipulator Prototypes
  318.  *
  319.  **********/
  320.  
  321.  
  322.  
  323.  
  324. int scddrclear( int );            /* file handle */
  325.  
  326. int scddrdel(   int,              /* file handle */
  327.                 long );           /* record number to delete */
  328.  
  329. int scddrget(   int,              /* file handle */
  330.                 long );           /* record number to read */
  331.  
  332. int scddrgetx(  int,              /* file handle */
  333.                 char *,           /* input buffer address */
  334.                 long );           /* record number to read */
  335.  
  336. int scddrinfo(  int,              /* file handle */
  337.                 SC_DBFRINFO * );  /* record info structure */
  338.  
  339. int scddrlock(  int,              /* file handle */
  340.                 long );           /* record number to lock */
  341.  
  342. int scddrnum(   int,              /* file handle */
  343.                 long * );         /* current data record number */
  344.  
  345. int scddrput (  int,              /* file handle */
  346.                 long *,           /* record number */
  347.                 int );            /* append or update record */
  348.  
  349. int scddrputx(  int,              /* file handle */
  350.         char *,           /* output buffer address */
  351.                 long *,           /* record number */
  352.                 int );            /* append or update record */
  353.  
  354. int scddrstat(  int );            /* file handle */
  355.  
  356. int scddrundel( int,              /* fiel handle */
  357.                 long );           /* record number */
  358.  
  359.  
  360.  
  361. /**********
  362.  *
  363.  *  dBase Memo File Manipulator Prototypes
  364.  *
  365.  **********/
  366.  
  367.  
  368.  
  369.  
  370. int scdtclose(  int );            /* file handle */
  371.  
  372. int scdtcreate( char * );         /* filename */
  373.  
  374. int scdtcreatex(char *,           /* filename */
  375.         int,              /* block size in 512 byte blocks */
  376.         int );            /* file format (dBASE 3/4) */
  377.  
  378. int scdthget(   int );            /* file handle */
  379.  
  380. int scdtinfo(   int,              /* file handle */
  381.                 SC_DBTINFO * );   /* file information and status */
  382.  
  383. int scdtopenx(  int *,            /* file handle */
  384.                 char *,           /* filename */
  385.                 int );            /* open mode & characteristics */
  386.  
  387. int scdtpack(   int,              /* data file handle */
  388.                 int *);           /* memo file handle */
  389.  
  390. int scdtrget(   int,              /* file handle */
  391.                 long,             /* record number */
  392.                 char **,          /* buffer for record number */
  393.                 int );            /* remove soft carriage returns? */
  394.  
  395. int scdtrput(   int,              /* file handle */
  396.                 long *,           /* record number */
  397.                 char *,           /* buffer for record data */
  398.                 int );            /* insert soft carriage returns? */
  399.  
  400.  
  401.  
  402.  
  403.  
  404.  
  405. /**********
  406.  *
  407.  *  dBASE Index File Manipulators Prototypes
  408.  *
  409.  **********/
  410.  
  411.  
  412.  
  413.  
  414. int scdnbfrsz(  int,              /* index file handle */
  415.                 int *,            /* buffer length in pages */
  416.                 int );            /* set or get buffer length */
  417.  
  418. int scdnclose(  int );            /* file handle */
  419.  
  420. int scdncreate( char *,           /* filename */
  421.                 int,              /* index key type */
  422.                 char *,           /* key expression */
  423.                 int );            /* key length */
  424.  
  425. int scdnexpr(   int,              /* file handle */
  426.                 char * );         /* key expression */
  427.  
  428. int scdnflush(  int );            /* file handle */
  429.  
  430. int scdnhget(   int );            /* file handle */
  431.  
  432. int scdnindex(  int,              /* data file handle */
  433.                 char *,           /* new file name */
  434.                 int,              /* index key type */
  435.                 char *,           /* key expression */
  436.                 int );            /* key length */
  437.  
  438. int scdninfo(   int,              /* file handle */
  439.                 SC_NDXINFO * );   /* file information and status */
  440.  
  441. int scdnopenx(  int *,            /* file handle */
  442.                 char *,           /* filename */
  443.                 int );            /* open mode and characteristics */
  444.  
  445.  
  446.  
  447.  
  448. /**********
  449.  *
  450.  *  dBASE Index Key Building Prototypes
  451.  *
  452.  **********/
  453.  
  454.  
  455.  
  456.  
  457. int scdnkdate(  double *,         /* numeric date */
  458.                 char *,           /* date string */
  459.                 int );            /* date string format type */
  460.  
  461. int scdnkmake(  int,              /* .DBF file handle */
  462.                 int,              /* .NDX file handle */
  463.                 void ** );        /* index key */
  464.  
  465.  
  466.  
  467.  
  468. /**********
  469.  *
  470.  *  dBASE Index Key Manipulator Prototypes
  471.  *
  472.  **********/
  473.  
  474.  
  475.  
  476.  
  477. int scdnkadd(   int,              /* file handle */
  478.                 void *,           /* key string */
  479.                 long );           /* data record number */
  480.  
  481. int scdnkbot(   int,              /* file handle */
  482.                 void *,           /* key string */
  483.                 long *);          /* data record number */
  484.  
  485. int scdnkcur(   int,              /* file handle */
  486.                 void *,           /* key string */
  487.                 long *);          /* data record number */
  488.  
  489. int scdnkdel(   int,              /* file handle */
  490.                 void *,           /* key string */
  491.                 long );           /* data record number */
  492.  
  493. int scdnkfind(  int,              /* file handle */
  494.                 void *,           /* key string */
  495.                 long *,           /* data record number */
  496.                 int);             /* exact match or first */
  497.  
  498. int scdnknext(  int,              /* file handle */
  499.                 void *,           /* key string */
  500.                 long *);          /* data record number */
  501.  
  502. int scdnkprev(  int,              /* file handle */
  503.                 void *,           /* key string */
  504.                 long *);          /* data record number */
  505.  
  506. int scdnktop(   int,              /* file handle */
  507.                 void *,           /* key string */
  508.                 long *);          /* data record number */
  509.  
  510.  
  511.  
  512.  
  513.  
  514. /**********
  515.  *
  516.  *  Clipper Index File Manipulators Prototypes
  517.  *
  518.  **********/
  519.  
  520.  
  521.  
  522.  
  523. int scdcbfrsz(  int,              /* index file handle */
  524.                 int *,            /* buffer length in pages */
  525.                 int );            /* set or get buffer length */
  526.  
  527. int scdcclose(  int );            /* file handle */
  528.  
  529. int scdccreate( char *,           /* filename */
  530.                 int,              /* index key type */
  531.                 char *,           /* key expression */
  532.                 int,              /* key length */
  533.                 int );            /* number of decimal places */
  534.  
  535. int scdcexpr(   int,              /* file handle */
  536.                 char * );         /* key expression */
  537.  
  538. int scdcflush(  int );            /* file handle */
  539.  
  540. int scdchget(   int );            /* file handle */
  541.  
  542. int scdcindex(  int,              /* data file handle */
  543.                 char *,           /* new file name */
  544.                 int,              /* index key type */
  545.                 char *,           /* key expression */
  546.                 int,              /* key length */
  547.                 int );            /* number of decimal places */
  548.  
  549. int scdcinfo(   int,              /* file handle */
  550.                 SC_NTXINFO * );   /* file information and status */
  551.  
  552. int scdcopenx(  int *,            /* file handle */
  553.                 char *,           /* filename */
  554.                 int );            /* open mode and characteristics */
  555.  
  556.  
  557.  
  558.  
  559. /**********
  560.  *
  561.  *  Clipper Index Key Building Prototypes
  562.  *
  563.  **********/
  564.  
  565.  
  566.  
  567.  
  568. int scdckmake(  int,              /* .DBF file handle */
  569.                 int,              /* .NTX file handle */
  570.                 void ** );        /* index key */
  571.  
  572.  
  573.  
  574.  
  575. /**********
  576.  *
  577.  *  Clipper Index Key Manipulator Prototypes
  578.  *
  579.  **********/
  580.  
  581.  
  582.  
  583.  
  584. int scdckadd(   int,              /* file handle */
  585.                 void *,           /* key string */
  586.                 long );           /* data record number */
  587.  
  588. int scdckbot(   int,              /* file handle */
  589.                 void *,           /* key string */
  590.                 long *);          /* data record number */
  591.  
  592. int scdckcur(   int,              /* file handle */
  593.                 void *,           /* key string */
  594.                 long *);          /* data record number */
  595.  
  596. int scdckdel(   int,              /* file handle */
  597.                 void *,           /* key string */
  598.                 long );           /* data record number */
  599.  
  600. int scdckfind(  int,              /* file handle */
  601.                 void *,           /* key string */
  602.                 long *,           /* data record number */
  603.                 int);             /* exact match or first */
  604.  
  605. int scdcknext(  int,              /* file handle */
  606.                 void *,           /* key string */
  607.                 long *);          /* data record number */
  608.  
  609. int scdckprev(  int,              /* file handle */
  610.                 void *,           /* key string */
  611.                 long *);          /* data record number */
  612.  
  613. int scdcktop(   int,              /* file handle */
  614.                 void *,           /* key string */
  615.                 long *);          /* data record number */
  616.  
  617.  
  618.  
  619.  
  620.  
  621. /**********
  622.  *
  623.  *  FoxBASE+/FoxPro Index File Manipulators Prototypes
  624.  *
  625.  **********/
  626.  
  627.  
  628.  
  629.  
  630. int scdibfrsz(  int,              /* index file handle */
  631.                 int *,            /* buffer length in pages */
  632.                 int );            /* set or get buffer length */
  633.  
  634. int scdiclose(  int );            /* file handle */
  635.  
  636. int scdicreate( char *,           /* filename */
  637.                 int,              /* index key type */
  638.                 char *,           /* key expression */
  639.                 int );            /* key length */
  640.  
  641. int scdiexpr(   int,              /* file handle */
  642.                 char * );         /* key expression */
  643.  
  644. int scdiflush(  int );            /* file handle */
  645.  
  646. int scdihget(   int );            /* file handle */
  647.  
  648. int scdiindex(  int,              /* data file handle */
  649.                 char *,           /* new file name */
  650.                 int,              /* index key type */
  651.                 char *,           /* key expression */
  652.                 int );            /* key length */
  653.  
  654. int scdiinfo(   int,              /* file handle */
  655.                 SC_IDXINFO * );   /* file information and status */
  656.  
  657. int scdiopenx(  int *,            /* file handle */
  658.                 char *,           /* filename */
  659.                 int );            /* open mode and characteristics */
  660.  
  661.  
  662.  
  663.  
  664. /**********
  665.  *
  666.  *  FoxBASE+/FoxPro Index Key Building Prototypes
  667.  *
  668.  **********/
  669.  
  670.  
  671.  
  672.  
  673. int scdikdate(  char *,           /* FoxBASE date */
  674.                 char *,           /* date string */
  675.                 int );            /* date string format type */
  676.  
  677. int scdikmake(  int,              /* .DBF file handle */
  678.                 int,              /* .NTX file handle */
  679.                 void ** );        /* index key */
  680.  
  681. int scdiknum(   char *,           /* FoxBASE double */
  682.                 double );         /* C double */
  683.  
  684.  
  685.  
  686.  
  687.  
  688.  
  689. /**********
  690.  *
  691.  *  FoxBASE+/FoxPro Index Key Manipulator Prototypes
  692.  *
  693.  **********/
  694.  
  695.  
  696.  
  697.  
  698. int scdikadd(   int,              /* file handle */
  699.                 void *,           /* key string */
  700.                 long );           /* data record number */
  701.  
  702. int scdikbot(   int,              /* file handle */
  703.                 void *,           /* key string */
  704.                 long *);          /* data record number */
  705.  
  706. int scdikcur(   int,              /* file handle */
  707.                 void *,           /* key string */
  708.                 long *);          /* data record number */
  709.  
  710. int scdikdel(   int,              /* file handle */
  711.                 void *,           /* key string */
  712.                 long );           /* data record number */
  713.  
  714. int scdikfind(  int,              /* file handle */
  715.                 void *,           /* key string */
  716.                 long *,           /* data record number */
  717.                 int);             /* exact match or first */
  718.  
  719. int scdiknext(  int,              /* file handle */
  720.                 void *,           /* key string */
  721.                 long *);          /* data record number */
  722.  
  723. int scdikprev(  int,              /* file handle */
  724.                 void *,           /* key string */
  725.                 long *);          /* data record number */
  726.  
  727. int scdiktop(   int,              /* file handle */
  728.                 void *,           /* key string */
  729.                 long *);          /* data record number */
  730.  
  731.  
  732.  
  733.  
  734.  
  735. /**********
  736.  *
  737.  *  FoxPro Memo File Manipulator Prototypes
  738.  *
  739.  **********/
  740.  
  741.  
  742.  
  743.  
  744. int scdwclose(  int );            /* file handle */
  745.  
  746. int scdwcreate( char *,           /* filename */
  747.         int );            /* number of bytes per memo block */
  748.  
  749. int scdwinfo(   int,              /* file handle */
  750.         SC_FPTINFO * );   /* file information and status */
  751.  
  752. int scdwhget(   int );            /* file handle */
  753.  
  754. int scdwopenx(  int *,            /* file handle */
  755.                 char *,           /* filename */
  756.         int );            /* open mode & characteristics */
  757.  
  758. int scdwpack(   int,              /* data file handle */
  759.                 int *);           /* memo file handle */
  760.  
  761. int scdwrget(   int,              /* file handle */
  762.                 long,             /* record number */
  763.         char ** );        /* buffer for record number */
  764.  
  765. int scdwrput(   int,              /* file handle */
  766.                 long *,           /* record number */
  767.                 char *,           /* buffer for record data */
  768.         int );            /* add/update switch */
  769.  
  770.  
  771.  
  772. /**********
  773.  *
  774.  *  External Variables
  775.  *
  776.  **********/
  777.  
  778.  
  779. extern int sc_date_style;   /* date string format for scddfget/scddfput */
  780.  
  781.  
  782.  
  783.  
  784.  
  785. /**********
  786.  *
  787.  *  Compatibility Definitions
  788.  *
  789.  **********/
  790.  
  791.  
  792.  
  793. #define scdfget(a,b,c)      scddfget(a,b,c)
  794. #define scdfgetx(a,b,c,d)   scddfget(a,b,c)
  795. #define scdfgets(a,b,c)     scddfgets(a,b,c)
  796. #define scdfgetsx(a,b,c,d)  scddfgets(a,b,c)
  797.  
  798. #define scdfput(a,b,c)      scddfput(a,b,c)
  799. #define scdfputx(a,b,c,d)   scddfput(a,b,c)
  800. #define scdfputs(a,b,c)     scddfputs(a,b,c)
  801. #define scdfputsx(a,b,c,d)  scddfputs(a,b,c)
  802.  
  803. #define scdfinfo(a,b,c)     scddfinfo(a,b,c)
  804. #define scdfnam2no(a,b,c)   scddfnam2no(a,b,c)
  805.  
  806. #define scdrclear(a,b)      scddrclear(a)
  807. #define scdrdel(a,b)        scddrdel(a,b)
  808. #define scdrget(a,b)        scddrgetx(a,NULL,b)
  809. #define scdrinfo(a,b,c,d,e) scddrinfo(a,b,c,d)
  810. #define scdrput(a,b,c)      scddrputx(a,NULL,b,c)
  811. #define scdrundel(a,b)      scddrundel(a,b)
  812.  
  813. #define scdfgett(a,b,c)     scdtrget(a,b,c,SC_CRDELETE)
  814. #define scdfgettx(a,b,c,d)  scdtrget(a,b,c,d)
  815. #define scdfputt(a,b,c)     scdtrput(a,b,c,66)
  816. #define scdfputtx(a,b,c,d)  scdtrput(a,b,c,d)
  817.  
  818. #define scdkadd(a,b,c)      scdnkadd(a,b,c);
  819. #define scdkcur(a,b,c)      scdnkcur(a,b,c);
  820. #define scdkdate(a,b)       scdnkdate(a,b,SC_YMD)
  821. #define scdkdatex(a,b,c)    scdnkdate(a,b,c)
  822. #define scdkdel(a,b,c)      scdnkdel(a,b,c)
  823. #define scdkfind(a,b,c,d)   scdnkfind(a,b,c,d)
  824. #define scdkfirst(a,b,c)    scdnktop(a,b,c)
  825. #define scdklast(a,b,c)     scdnkbot(a,b,c)
  826. #define scdkmake(a,b,c)     scdnkmake(a,b,c)
  827. #define scdkmakex(a,b,c,d)  scdnkmake(a,b,c)
  828. #define scdknext(a,b,c)     scdnknext(a,b,c)
  829. #define scdkprev(a,b,c)     scdnkprev(a,b,c)
  830.  
  831. #define scdnopen(a,b)       scdnopenx(a,b,SC_RDWR | SC_FLUSH | SC_EXCLUDE)
  832. #define scdpinfo(a,b)       scdnbfrsz(a,b,SC_GETSZ)
  833. #define scdpnum(a,b)        scdnbfrsz(a,b,SC_SETSZ)
  834.  
  835. #define scdtopen(a,b)       scdtopenx(a,b,SC_RDWR | SC_FLUSH | SC_EXCLUDE)
  836.