home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Database / CLIPR503.W96 / RDD.AP_ / RDD.AP
Text File  |  1995-06-26  |  43KB  |  1,161 lines

  1. /***
  2. *
  3. *  Rdd.api
  4. *
  5. *  C language definitions for the Clipper RDD API
  6. *
  7. *  Copyright (c) 1990-1995 Computer Associates International, Inc.
  8. *  All rights reserved.
  9. *
  10. */
  11.  
  12.  
  13. #ifndef RDDAPI_E_INCLUDED
  14. #define RDDAPI_E_INCLUDED
  15.  
  16. #ifdef __cplusplus
  17.     extern "C" {
  18. #endif
  19.  
  20. #ifndef _CLIPDEFS_H
  21. #include "clipdefs.h"
  22. #endif
  23.  
  24. #ifndef _ITEM_API
  25. #include "item.api"
  26. #endif
  27.  
  28. #ifndef _FILESYS_API
  29. #include "filesys.api"
  30. #endif
  31.  
  32.  
  33. // RDD method return codes
  34. #define SUCCESS 0
  35. #define FAILURE 1
  36.  
  37.  
  38. /*
  39. *  DBFIELDINFO
  40. *  -----------
  41. *  The field structure
  42. */
  43.  
  44. typedef struct
  45. {
  46.    BYTEP  atomName;        // FIELD (symbol) name
  47.    USHORT uiType;          // FIELD type
  48.    USHORT typeExtended;    // FIELD type extended
  49.    USHORT uiLen;           // Overall FIELD length
  50.    USHORT uiDec;           // Decimal places of numeric FIELD
  51. } DBFIELDINFO;
  52.  
  53. typedef DBFIELDINFO far * LPDBFIELDINFO;
  54.  
  55.  
  56.  
  57. /*
  58. *  DBOPENINFO
  59. *  ----------
  60. *  The Open Info structure
  61. */
  62.  
  63. typedef struct
  64. {
  65.    USHORT uiArea;    // Work Area number of the data store
  66.    BYTEP  abName;    // The qualified name of the data store
  67.    BYTEP  atomAlias; // The logical name of the data store
  68.    BOOL   fShared;   // Share mode of the data store
  69.    BOOL   fReadonly; // Readonly mode of the data store
  70.  
  71.    FARP   lpdbHeader;  // Pointer to a header of the data store
  72. } DBOPENINFO;
  73.  
  74. typedef DBOPENINFO far * LPDBOPENINFO;
  75.  
  76.  
  77.  
  78. /*
  79. *  DBORDERCONDINFO
  80. *  ---------------
  81. *  The Create Order conditional Info structure
  82. */
  83.  
  84. typedef struct _DBORDERCONDINFO
  85. {
  86.    BOOL  fActive;
  87.    BYTEP abFor;
  88.    ITEM  itmCobFor;
  89.    ITEM  itmCobWhile;
  90.    ITEM  itmCobEval;
  91.    LONG  lStep;
  92.    LONG  lStartRecno;
  93.    LONG  lNextCount;
  94.    LONG  lRecno;
  95.    BOOL  fRest;
  96.    BOOL  fDescending;
  97.    BOOL  fScoped;
  98.    BOOL  fAll;
  99.  
  100.    BOOL  fAdditive;
  101.    BOOL  fUseCurrent;
  102.    BOOL  fCustom;
  103.    BOOL  fNoOptimize;
  104.    FARP  lpvCargo;
  105.  
  106. } DBORDERCONDINFO;
  107.  
  108. typedef DBORDERCONDINFO far * LPDBORDERCONDINFO;
  109.  
  110.  
  111.  
  112. /*
  113. *  DBORDERCREATE
  114. *  -------------
  115. *  The Create Order Info structure
  116. */
  117.  
  118. typedef struct
  119. {
  120.    LPDBORDERCONDINFO lpdbOrdCondInfo; // conditional information
  121.    BYTEP             abBagName;       // Name of the Order bag
  122.    BYTEP             atomBagName;     //
  123.    ITEM              itmOrder;        //
  124.    BOOL              fUnique;         // Flag to deterimine if all keys are unique
  125.  
  126.    ITEM              itmCobExpr;      // Code block containing the KEY expression
  127.    ITEM              abExpr;          // String containing the KEY expression
  128. } DBORDERCREATEINFO;
  129.  
  130. typedef DBORDERCREATEINFO far * LPDBORDERCREATEINFO;
  131.  
  132.  
  133.  
  134. /*
  135. *  DBORDERINFO
  136. *  -----------
  137. *  The Set Index Info structure
  138. */
  139.  
  140. typedef struct
  141. {
  142.    ITEM atomBagName;  // Name of the Order Bag
  143.    ITEM itmOrder;     // Name or Number of the Order
  144.  
  145.    ITEM itmCobExpr;   // Code block containing the KEY expression
  146.  
  147.    ITEM itmResult;    // Operation result
  148.  
  149.    BOOL fAllTags;     // Flag for all tags to be opened
  150.  
  151. } DBORDERINFO;
  152.  
  153. typedef DBORDERINFO far * LPDBORDERINFO;
  154.  
  155.  
  156.  
  157. /*
  158. *  DBSCOPEINFO
  159. *  -----------
  160. *  The Scope Info structure
  161. */
  162.  
  163. typedef struct
  164. {
  165.    ITEM itmCobFor;   // Code Block representation of a FOR clause
  166.    ITEM lpstrFor;    // String representation of a FOR clause
  167.    ITEM itmCobWhile; // Code Block representation of a WHILE clause
  168.    ITEM lpstrWhile;  // String representation of a WHILE clause
  169.    ITEM lNext;
  170.    ITEM itmRecID;
  171.    ITEM fRest;       // TRUE if start from the current record
  172.  
  173.    BOOL fIgnoreFilter;
  174.    BOOL fIncludeDeleted;
  175.    BOOL fLast;
  176.    BOOL fIgnoreDuplicates;
  177.  
  178. } DBSCOPEINFO;
  179.  
  180. typedef DBSCOPEINFO far * LPDBSCOPEINFO;
  181.  
  182.  
  183.  
  184. /*
  185. *  DBFILTERINFO
  186. *  ------------
  187. *  The Filter Info structure
  188. */
  189.  
  190. typedef struct
  191. {
  192.    ITEM itmCobExpr;       // Block representation of the FILTER expression
  193.    ITEM abFilterText;     // String representation of FILTER expression
  194.    BOOL fFilter;
  195. } DBFILTERINFO;
  196.  
  197. typedef DBFILTERINFO far * LPDBFILTERINFO;
  198.  
  199.  
  200.  
  201. /*
  202. *  DBRELINFO
  203. *  ------------
  204. *  The Relationship Info structure
  205. */
  206.  
  207. typedef struct _DBRELINFO
  208. {
  209.    ITEM itmCobExpr;   // Block representation of the relational SEEK key
  210.    ITEM abKey;        // String representation of the relational SEEK key
  211.  
  212.    struct _AREA far *lpaParent; // The parent of this relation
  213.    struct _AREA far *lpaChild;  // The parents children
  214.  
  215.    struct _DBRELINFO far *lpdbriNext;   // Next child or parent
  216.  
  217. } DBRELINFO;
  218.  
  219. typedef DBRELINFO far * LPDBRELINFO;
  220.  
  221.  
  222.  
  223. /*
  224. *  DBEVALINFO
  225. *  ------------
  226. *  The Evaluation Info structure
  227. *
  228. *  Contains information necessary for a block evaluation
  229. *  on each record of the workarea
  230. */
  231.  
  232. typedef struct
  233. {
  234.    ITEM        itmBlock;  // The block to be evaluated
  235.    DBSCOPEINFO dbsci;     // Scope info that limits the evaluation
  236. } DBEVALINFO;
  237.  
  238. typedef DBEVALINFO far * LPDBEVALINFO;
  239.  
  240.  
  241. /*
  242. *  DBTRANSITEM
  243. *  ------------
  244. *  The Transfer Item structure
  245. *
  246. *  Defines a single transfer item (usually a field) from
  247. *  one database to another; used by DBTRANSINFO
  248. */
  249.  
  250. typedef struct
  251. {
  252.    USHORT uiSource;       // Field index number from the source
  253.    USHORT uiDest;         // Destination field index number
  254. } DBTRANSITEM;
  255.  
  256. typedef DBTRANSITEM far * LPDBTRANSITEM;
  257.  
  258.  
  259. /*
  260. *  DBTRANSINFO
  261. *  ------------
  262. *  The Transfer Info structure
  263. *
  264. *  Defines a global transfer of data items from on workarea
  265. *  to another
  266. */
  267.  
  268. typedef struct
  269. {
  270.    struct _AREA far *lpaSource; // Pointer to source work area
  271.    struct _AREA far *lpaDest;   // Pointer to dest work area
  272.    DBSCOPEINFO   dbsci;         // Scope to limit transfer
  273.  
  274.    USHORT        uiFlags;       // Transfer attributes
  275.  
  276.    USHORT        uiItemCount;   // Number of items below
  277.    LPDBTRANSITEM lpTransItems;  // Array of items.
  278. } DBTRANSINFO;
  279.  
  280. typedef DBTRANSINFO far * LPDBTRANSINFO;
  281.  
  282. // Flags for DBTRANSINFO
  283. #define DBTF_MATCH   0x0001
  284. #define DBTF_PUTREC  0x0002
  285.  
  286.  
  287.  
  288. /*
  289. *  DBSORTITEM
  290. *  ----------
  291. *  The Sort Item Structure
  292. *
  293. *  An array of items that, together, indicate the key value to
  294. *  use while sorting data. The order of the array determines the
  295. *  order of the sorting.
  296. */
  297.  
  298. typedef struct
  299. {
  300.    USHORT uiField;        // Index into the workarea->fields structure
  301.    USHORT uiFlags;        // sort flags
  302. } DBSORTITEM;
  303.  
  304. typedef DBSORTITEM far * LPDBSORTITEM;
  305.  
  306. // Flags for DBSORTITEM
  307. #define SF_ASCEND       1
  308. #define SF_CASE            2
  309. #define SF_DESCEND      4
  310. #define SF_NUM         32
  311. #define SF_DOUBLE      64
  312. #define SF_LONG       128
  313.  
  314.  
  315.  
  316. /*
  317. *  DBSORTINFO
  318. *  ----------
  319. *  The Sort Info Structure
  320. *
  321. *  Information for a physical sort on the workarea
  322. */
  323.  
  324. typedef struct
  325. {
  326.    DBTRANSINFO   dbtri;        // Destination workarea transfer information
  327.  
  328.    LPDBSORTITEM  lpdbsItem;    // Fields which compose the key values for the sort
  329.    USHORT        uiItemCount;  // the number of fields above
  330.  
  331. } DBSORTINFO;
  332.  
  333. typedef DBSORTINFO far * LPDBSORTINFO;
  334.  
  335.  
  336. /*
  337. *  DBLOCKINFO
  338. *  ----------
  339. *  The Lock Info Structure
  340. *
  341. *  Information for a record or file lock
  342. */
  343.  
  344. typedef struct
  345. {
  346.    ULONG  itmRecID;
  347.    USHORT uiMethod;
  348.    BOOL   fResult;
  349. } DBLOCKINFO;
  350.  
  351. typedef DBLOCKINFO far * LPDBLOCKINFO;
  352.  
  353.  
  354.  
  355. /*
  356. *  FIELD
  357. *  -----
  358. *  The Field structure
  359. *
  360. *  This is the basic unit of access for a workarea
  361. */
  362.  
  363. typedef struct _FIELD
  364. {
  365.    USHORT  uiType;           // Field type
  366.    USHORT  uiTypeExtended;   // Field type - extended
  367.    USHORT  uiLen;            // Field length
  368.    USHORT  uiDec;            // Decimal length
  369.    USHORT  uiArea;           // Area this field resides in
  370.    FARP    sym;              // Symbol that represents the field
  371.  
  372.    struct _FIELD *lpfNext;   // The next field in the list
  373.  
  374. } FIELD;
  375.  
  376. typedef FIELD far * LPFIELD;
  377.  
  378.  
  379.  
  380. /*--------------------* WORKAREA structure *----------------------*/
  381.  
  382. /*
  383. *  WORKAREA
  384. *  --------
  385. *  The Workarea Structure
  386. *
  387. *  Information to administrate the workarea
  388. */
  389.  
  390. typedef struct _AREA
  391. {
  392.    struct _RDDFUNCS far * lprfsHost; // Virtual method table for this workarea
  393.  
  394.    USHORT  uiArea;             // The number assigned to this workarea
  395.    FARP    atomAlias;          // Pointer to the alias symbol for this workarea
  396.  
  397.    USHORT  uiFieldExtent;      // Total number of fields allocated
  398.    USHORT  uiFieldCount;       // Total number of fields used
  399.    LPFIELD lpFields;           // Pointer to an array of fields
  400.  
  401.    FARP lpFieldExtents;        // Void ptr for additional field properties
  402.  
  403.    ITEM valResult;             // All purpose result holder
  404.  
  405.    BOOL fTop;                  // TRUE if "top"
  406.    BOOL fBottom;               // TRUE if "bottom"
  407.    BOOL fBof;                  // TRUE if "bof"
  408.    BOOL fEof;                  // TRUE if "eof"
  409.    BOOL fFound;                // TRUE if "found"
  410.  
  411.    DBSCOPEINFO  dbsi;          // Info regarding last LOCATE
  412.    DBFILTERINFO dbfi;          // Filter in effect
  413.  
  414.    LPDBORDERCONDINFO lpdbOrdCondInfo;
  415.  
  416.    LPDBRELINFO  lpdbRelations; // Parent/Child relationships used
  417.    USHORT       uiParents;     // Number of parents for this area
  418.  
  419.    HANDLE   heap;
  420.    USHORT   heapSize;
  421.  
  422.    USHORT   rddID;
  423.  
  424. } AREA;
  425.  
  426. typedef AREA far * LPAREA;
  427.  
  428. #ifndef AREAP
  429. #define AREAP   LPAREA
  430. #endif
  431.  
  432.  
  433. #ifdef __cplusplus
  434.  
  435. /*--------------------* Virtual Method Table *----------------------*/
  436.  
  437. typedef struct _RDDFUNCS
  438. {
  439.    /* Movement and positioning methods */
  440.  
  441.    ERRCODE ( __cdecl __far * bof )             ( LPAREA, BOOL * );
  442.    ERRCODE ( __cdecl __far * eof )             ( LPAREA, BOOL * );
  443.    ERRCODE ( __cdecl __far * found )           ( LPAREA, BOOL * );
  444.    ERRCODE ( __cdecl __far * goBottom )        ( LPAREA );
  445.    ERRCODE ( __cdecl __far * go )              ( LPAREA, ULONG );
  446.    ERRCODE ( __cdecl __far * goToId )          ( LPAREA, ITEM );
  447.    ERRCODE ( __cdecl __far * goTop )           ( LPAREA );
  448.    ERRCODE ( __cdecl __far * seek )            ( LPAREA, BOOL, ITEM );
  449.    ERRCODE ( __cdecl __far * skip )            ( LPAREA, LONG );
  450.    ERRCODE ( __cdecl __far * skipFilter )      ( LPAREA, LONG );
  451.    ERRCODE ( __cdecl __far * skipRaw )         ( LPAREA, LONG );
  452.  
  453.    /* Data management */
  454.  
  455.    ERRCODE ( __cdecl __far * addField )        ( LPAREA, LPDBFIELDINFO );
  456.    ERRCODE ( __cdecl __far * append )          ( LPAREA, BOOL );
  457.    ERRCODE ( __cdecl __far * createFields )    ( LPAREA, void * );
  458.    ERRCODE ( __cdecl __far * deleterec )       ( LPAREA );
  459.    ERRCODE ( __cdecl __far * deleted )         ( LPAREA, BOOL * );
  460.    ERRCODE ( __cdecl __far * fieldCount )      ( LPAREA, USHORT * );
  461.    ERRCODE ( __cdecl __far * fieldDisplay )    ( LPAREA, void * );
  462.    ERRCODE ( __cdecl __far * fieldInfo )       ( LPAREA, USHORT, USHORT, ITEM );
  463.    ERRCODE ( __cdecl __far * fieldName )       ( LPAREA, USHORT, BYTEP );
  464.    ERRCODE ( __cdecl __far * flush )           ( LPAREA );
  465.    ERRCODE ( __cdecl __far * getRec )          ( LPAREA, BYTEP * );
  466.    ERRCODE ( __cdecl __far * getValue )        ( LPAREA, USHORT, ITEM );
  467.    ERRCODE ( __cdecl __far * getVarLen )       ( LPAREA, USHORT, ULONG * );
  468.    ERRCODE ( __cdecl __far * goCold )          ( LPAREA );
  469.    ERRCODE ( __cdecl __far * goHot )           ( LPAREA );
  470.    ERRCODE ( __cdecl __far * putRec )          ( LPAREA, BYTEP );
  471.    ERRCODE ( __cdecl __far * putValue )        ( LPAREA, USHORT, ITEM );
  472.    ERRCODE ( __cdecl __far * recall )          ( LPAREA );
  473.    ERRCODE ( __cdecl __far * reccount )        ( LPAREA, ULONG * );
  474.    ERRCODE ( __cdecl __far * recInfo )         ( LPAREA, ITEM, USHORT, ITEM );
  475.    ERRCODE ( __cdecl __far * recno )           ( LPAREA, ITEM );
  476.    ERRCODE ( __cdecl __far * setFieldExtent )  ( LPAREA, LONG );
  477.  
  478.    /* WorkArea/Database management */
  479.  
  480.    ERRCODE ( __cdecl __far * alias )           ( LPAREA, BYTEP );
  481.    ERRCODE ( __cdecl __far * close )           ( LPAREA );
  482.    ERRCODE ( __cdecl __far * create )          ( LPAREA, LPDBOPENINFO );
  483.    ERRCODE ( __cdecl __far * info )            ( LPAREA, USHORT, ITEM );
  484.    ERRCODE ( __cdecl __far * newarea )         ( LPAREA );
  485.    ERRCODE ( __cdecl __far * open )            ( LPAREA, LPDBOPENINFO );
  486.    ERRCODE ( __cdecl __far * release )         ( LPAREA );
  487.    ERRCODE ( __cdecl __far * structSize )      ( LPAREA, USHORT * );
  488.    ERRCODE ( __cdecl __far * sysName )         ( LPAREA, BYTEP );
  489.    ERRCODE ( __cdecl __far * dbEval )          ( LPAREA, LPDBEVALINFO );
  490.    ERRCODE ( __cdecl __far * pack )            ( LPAREA );
  491.    ERRCODE ( __cdecl __far * packRec )         ( LPAREA, LONG, BOOL * );
  492.    ERRCODE ( __cdecl __far * sort )            ( LPAREA, LPDBSORTINFO );
  493.    ERRCODE ( __cdecl __far * trans )           ( LPAREA, LPDBTRANSINFO );
  494.    ERRCODE ( __cdecl __far * transRec )        ( LPAREA, LPDBTRANSINFO );
  495.    ERRCODE ( __cdecl __far * zap )             ( LPAREA );
  496.  
  497.    /* Relational Methods */
  498.  
  499.    ERRCODE ( __cdecl __far * childEnd )        ( LPAREA, LPDBRELINFO );
  500.    ERRCODE ( __cdecl __far * childStart )      ( LPAREA, LPDBRELINFO );
  501.    ERRCODE ( __cdecl __far * childSync )       ( LPAREA, LPDBRELINFO );
  502.    ERRCODE ( __cdecl __far * syncChildren )    ( LPAREA );
  503.    ERRCODE ( __cdecl __far * clearRel )        ( LPAREA );
  504.    ERRCODE ( __cdecl __far * forceRel )        ( LPAREA );
  505.    ERRCODE ( __cdecl __far * relArea )         ( LPAREA, USHORT, USHORT * );
  506.    ERRCODE ( __cdecl __far * relEval )         ( LPAREA, LPDBRELINFO );
  507.    ERRCODE ( __cdecl __far * relText )         ( LPAREA, USHORT, BYTEP );
  508.    ERRCODE ( __cdecl __far * setRel )          ( LPAREA, LPDBRELINFO );
  509.  
  510.    /* Order Management */
  511.  
  512.    ERRCODE ( __cdecl __far * orderListAdd )    ( LPAREA, LPDBORDERINFO );
  513.    ERRCODE ( __cdecl __far * orderListClear )  ( LPAREA );
  514.    ERRCODE ( __cdecl __far * orderListDelete ) ( LPAREA, LPDBORDERINFO );
  515.    ERRCODE ( __cdecl __far * orderListFocus )  ( LPAREA, LPDBORDERINFO );
  516.    ERRCODE ( __cdecl __far * orderListRebuild )( LPAREA );
  517.  
  518.    ERRCODE ( __cdecl __far * orderCondition )  ( LPAREA, LPDBORDERCONDINFO );
  519.    ERRCODE ( __cdecl __far * orderCreate )     ( LPAREA, LPDBORDERCREATEINFO );
  520.    ERRCODE ( __cdecl __far * orderDestroy )    ( LPAREA, LPDBORDERINFO );
  521.    ERRCODE ( __cdecl __far * orderInfo )       ( LPAREA, USHORT, LPDBORDERINFO );
  522.  
  523.    /* Filters and Scope Settings */
  524.  
  525.    ERRCODE ( __cdecl __far * clearFilter )     ( LPAREA );
  526.    ERRCODE ( __cdecl __far * clearLocate )     ( LPAREA );
  527.    ERRCODE ( __cdecl __far * clearScope )      ( LPAREA, void * );
  528.    ERRCODE ( __cdecl __far * countScope )      ( LPAREA, void *, LONG * );
  529.    ERRCODE ( __cdecl __far * filterText )      ( LPAREA, BYTEP );
  530.    ERRCODE ( __cdecl __far * scopeInfo )       ( LPAREA, USHORT, ITEM );
  531.    ERRCODE ( __cdecl __far * setFilter )       ( LPAREA, LPDBFILTERINFO );
  532.    ERRCODE ( __cdecl __far * setLocate )       ( LPAREA, LPDBFILTERINFO );
  533.    ERRCODE ( __cdecl __far * setScope )        ( LPAREA, LPDBSCOPEINFO, void ** );
  534.    ERRCODE ( __cdecl __far * skipScope )       ( LPAREA, void *, LONG );
  535.  
  536.    /* Miscellaneous */
  537.  
  538.    ERRCODE ( __cdecl __far * compile )         ( LPAREA, BYTEP );
  539.    ERRCODE ( __cdecl __far * error )           ( LPAREA, ERRORP );
  540.    ERRCODE ( __cdecl __far * evalBlock )       ( LPAREA, ITEM );
  541.  
  542.    /* Network operations */
  543.  
  544.    ERRCODE ( __cdecl __far * rawLock )         ( LPAREA, USHORT, LONG );
  545.    ERRCODE ( __cdecl __far * lock )            ( LPAREA, LPDBLOCKINFO );
  546.    ERRCODE ( __cdecl __far * unlock )          ( LPAREA, ITEM );
  547.  
  548.    /* Memofile functions */
  549.  
  550.    ERRCODE ( __cdecl __far * closeMemFile )    ( LPAREA );
  551.    ERRCODE ( __cdecl __far * createMemFile )   ( LPAREA, LPDBOPENINFO );
  552.    ERRCODE ( __cdecl __far * getValueFile )    ( LPAREA, USHORT, BYTEP, BOOL );
  553.    ERRCODE ( __cdecl __far * openMemFile )     ( LPAREA, LPDBOPENINFO );
  554.    ERRCODE ( __cdecl __far * putValueFile )    ( LPAREA, USHORT, BYTEP );
  555.  
  556.    /* Database file header handling */
  557.  
  558.    ERRCODE ( __cdecl __far * readDBHeader )    ( LPAREA );
  559.    ERRCODE ( __cdecl __far * writeDBHeader )   ( LPAREA );
  560.  
  561.    /* Special and reserved methods */
  562.  
  563.    ERRCODE ( __cdecl __far * whoCares )        ( LPAREA, USHORT, void * );
  564.  
  565. }
  566. RDDFUNCS;
  567.  
  568. typedef RDDFUNCS far * LPRDDFUNCS;
  569. typedef LPRDDFUNCS far * LPLPRDDFUNCS;
  570.  
  571. #define RDDFUNCSCOUNT ( sizeof( RDDFUNCS ) / sizeof( void __far * ) )
  572.  
  573.  
  574. #else
  575. /*--------------------* Entry Point prototypes *----------------------*/
  576.  
  577. typedef USHORT (far * DBENTRYP_V)(AREAP area);
  578. typedef USHORT (far * DBENTRYP_S)(AREAP area, USHORT param);
  579. typedef USHORT (far * DBENTRYP_L)(AREAP area, LONG param);
  580. typedef USHORT (far * DBENTRYP_SP)(AREAP area, USHORTP param);
  581. typedef USHORT (far * DBENTRYP_LP)(AREAP area, LONGP param);
  582. typedef USHORT (far * DBENTRYP_VP)(AREAP area, FARP param);
  583. typedef USHORT (far * DBENTRYP_PP)(AREAP area, FARPP param);
  584. typedef USHORT (far * DBENTRYP_SVP)(AREAP area, USHORT index, FARP param);
  585. typedef USHORT (far * DBENTRYP_SVPB)(AREAP area, USHORT index, FARP param, USHORT mode);
  586. typedef USHORT (far * DBENTRYP_VPL)(AREAP area, FARP p1, LONG p2);
  587. typedef USHORT (far * DBENTRYP_VPLP)(AREAP area, FARP p1, LONGP p2);
  588. typedef USHORT (far * DBENTRYP_LSP)(AREAP area, LONG p1, USHORTP p2);
  589. typedef USHORT (far * DBENTRYP_I)  (AREAP area, ITEM param);
  590. typedef USHORT (far * DBENTRYP_SI) (AREAP area, USHORT index, ITEM param);
  591. typedef USHORT (far * DBENTRYP_SSI) (AREAP area, USHORT p1, USHORT p2, ITEM p3);
  592. typedef USHORT (far * DBENTRYP_ISI) (AREAP area, ITEM p1, USHORT p2, ITEM p3);
  593. typedef USHORT (far * DBENTRYP_VSP) (AREAP area, USHORT action, LONG lRecord);
  594.  
  595.  
  596.  
  597. /*--------------------* Virtual Method Table *----------------------*/
  598.  
  599. typedef struct _RDDFUNCS
  600. {
  601.  
  602.    /* Movement and positioning methods */
  603.  
  604.    DBENTRYP_SP  bof;             /* SP  */
  605.    DBENTRYP_SP  eof;             /* SP  */
  606.    DBENTRYP_SP  found;           /* SP  */
  607.    DBENTRYP_V   goBottom;        /* V   */
  608.    DBENTRYP_L   go;              /* L   */
  609.    DBENTRYP_I   goToId;          /* I   */
  610.    DBENTRYP_V   goTop;           /* V   */
  611.    DBENTRYP_SI  seek;            /* SI  */
  612.    DBENTRYP_L   skip;            /* L   */
  613.    DBENTRYP_L   skipFilter;      /* L   */
  614.    DBENTRYP_L   skipRaw;         /* L   */
  615.  
  616.  
  617.    /* Data management */
  618.  
  619.    DBENTRYP_VP  addField;        /* VP  */
  620.    DBENTRYP_S   append;          /* S   */
  621.    DBENTRYP_I   createFields;    /* I   */
  622.    DBENTRYP_V   deleterec;       /* V   */
  623.    DBENTRYP_SP  deleted;         /* SP  */
  624.    DBENTRYP_SP  fieldCount;      /* SP  */
  625.    DBENTRYP_VP  fieldDisplay;    /* VP  */
  626.    DBENTRYP_SSI fieldInfo;       /* SSI */
  627.    DBENTRYP_SVP fieldName;       /* SVP */
  628.    DBENTRYP_V   flush;           /* V   */
  629.    DBENTRYP_PP  getRec;          /* PP  */
  630.    DBENTRYP_SI  getValue;        /* SI  */
  631.    DBENTRYP_SVP getVarLen;       /* SVP */
  632.    DBENTRYP_V   goCold;          /* V   */
  633.    DBENTRYP_V   goHot;           /* V   */
  634.    DBENTRYP_VP  putRec;          /* VP  */
  635.    DBENTRYP_SI  putValue;        /* SI  */
  636.    DBENTRYP_V   recall;          /* V   */
  637.    DBENTRYP_LP  reccount;        /* LP  */
  638.    DBENTRYP_ISI recInfo;         /* ISI */
  639.    DBENTRYP_I   recno;           /* I   */
  640.    DBENTRYP_S   setFieldExtent;  /* S   */
  641.  
  642.    /* WorkArea/Database management */
  643.  
  644.    DBENTRYP_VP  alias;           /* VP  */
  645.    DBENTRYP_V   close;           /* V   */
  646.    DBENTRYP_VP  create;          /* VP  */
  647.    DBENTRYP_SI  info;            /* SI  */
  648.    DBENTRYP_V   newarea;         /* V   */
  649.    DBENTRYP_VP  open;            /* VP  */
  650.    DBENTRYP_V   release;         /* V   */
  651.    DBENTRYP_SP  structSize;      /* SP  */
  652.    DBENTRYP_VP  sysName;         /* VP  */
  653.    DBENTRYP_VP  dbEval;          /* VP  */
  654.    DBENTRYP_V   pack;            /* V   */
  655.    DBENTRYP_LSP packRec;         /* LSP */
  656.    DBENTRYP_VP  sort;            /* VP  */
  657.    DBENTRYP_VP  trans;           /* VP  */
  658.    DBENTRYP_VP  transRec;        /* VP  */
  659.    DBENTRYP_V   zap;             /* V   */
  660.  
  661.  
  662.    /* Relational Methods */
  663.  
  664.    DBENTRYP_VP  childEnd;        /* VP  */
  665.    DBENTRYP_VP  childStart;      /* VP  */
  666.    DBENTRYP_VP  childSync;       /* VP  */
  667.    DBENTRYP_V   syncChildren;    /* V   */
  668.    DBENTRYP_V   clearRel;        /* V   */
  669.    DBENTRYP_V   forceRel;        /* V   */
  670.    DBENTRYP_SVP relArea;         /* SVP */
  671.    DBENTRYP_VP  relEval;         /* VP  */
  672.    DBENTRYP_SVP relText;         /* SVP */
  673.    DBENTRYP_VP  setRel;          /* VP  */
  674.  
  675.  
  676.    /* Order Management */
  677.  
  678.    DBENTRYP_VP  orderListAdd;     /* VP  */
  679.    DBENTRYP_V   orderListClear;   /* V   */
  680.    DBENTRYP_VP  orderListDelete;  /* VP  */
  681.    DBENTRYP_VP  orderListFocus;   /* VP */
  682.    DBENTRYP_V   orderListRebuild; /* V   */
  683.  
  684.    DBENTRYP_VP  orderCondition;   /* VP  */
  685.    DBENTRYP_VP  orderCreate;      /* VP  */
  686.    DBENTRYP_VP  orderDestroy;     /* VP  */
  687.    DBENTRYP_SVP orderInfo;        /* SVP */
  688.  
  689.    /* Filters and Scope Settings */
  690.  
  691.    DBENTRYP_V   clearFilter;     /* V   */
  692.    DBENTRYP_V   clearLocate;     /* V   */
  693.    DBENTRYP_V   clearScope;      /* V   */
  694.    DBENTRYP_VPLP countScope;     /* VPLP*/
  695.    DBENTRYP_VP  filterText;      /* VP  */
  696.    DBENTRYP_SI  scopeInfo;       /* SI  */
  697.    DBENTRYP_VP  setFilter;       /* VP  */
  698.    DBENTRYP_VP  setLocate;       /* VP  */
  699.    DBENTRYP_VP  setScope;        /* VP  */
  700.    DBENTRYP_VPL skipScope;       /* VPL */
  701.  
  702.    /* Miscellaneous */
  703.  
  704.    DBENTRYP_VP  compile;         /* VP */
  705.    DBENTRYP_VP  error;           /* VP */
  706.    DBENTRYP_I   evalBlock;       /* I  */
  707.  
  708.  
  709.    /* Network operations */
  710.  
  711.    DBENTRYP_VSP rawlock;         /* VSP */
  712.    DBENTRYP_VP  lock;            /* VP  */
  713.    DBENTRYP_L   unlock;          /* L   */
  714.  
  715.  
  716.     /* Memofile functions */
  717.  
  718.    DBENTRYP_V   closeMemFile;    /* V   */
  719.    DBENTRYP_VP  createMemFile;   /* VP  */
  720.    DBENTRYP_SVPB getValueFile;    /* SVPB */
  721.    DBENTRYP_VP  openMemFile;     /* VP  */
  722.    DBENTRYP_SVP putValueFile;    /* SVP */
  723.  
  724.  
  725.     /* Database file header handling */
  726.  
  727.    DBENTRYP_V   readDBHeader;    /* V   */
  728.    DBENTRYP_V   writeDBHeader;   /* V   */
  729.  
  730.  
  731.     /* Special and reserved methods */
  732.  
  733.    DBENTRYP_SVP whoCares;        /* SVP */
  734.  
  735. } RDDFUNCS;
  736.  
  737. typedef RDDFUNCS far * LPRDDFUNCS;
  738. typedef LPRDDFUNCS far * LPLPRDDFUNCS;
  739.  
  740. #define RDDFUNCSCOUNT   ( sizeof(RDDFUNCS) / sizeof(DBENTRYP_V) )
  741.  
  742. #endif
  743.  
  744. /*--------------------* Defines *---------------------*/
  745.  
  746. /* Codes for Locking methods */
  747.  
  748. #define DBLM_EXCLUSIVE     1
  749. #define DBLM_MULTIPLE      2
  750. #define DBLM_FILE          3
  751.  
  752. /* Codes for SELF_ORDINFO() */
  753.  
  754. #define DBOI_CONDITION     1  /* Get the order condition     */
  755. #define DBOI_EXPRESSION    2  /* Get the order expression    */
  756. #define DBOI_POSITION      3  /* Get the order position      */
  757. #define DBOI_RECNO         4  /* Get the order record number */
  758. #define DBOI_NAME          5  /* Get the order list name     */
  759. #define DBOI_NUMBER        6  /* Get the order list position */
  760. #define DBOI_BAGNAME       7  /* Get the order Bag name      */
  761. #define DBOI_BAGEXT        8  /* Get the order Bag Extension */
  762. #define DBOI_INDEXEXT      DBOI_BAGEXT
  763. #define DBOI_INDEXNAME     DBOI_BAGNAME
  764. #define DBOI_ORDERCOUNT    9  /* Get the number of orders in the index file */
  765. #define DBOI_FILEHANDLE   10  /* Get the handle of the index file */
  766. #define DBOI_ISCOND       11  /* Get the flag if the order has a for condition */
  767. #define DBOI_ISDESC       12  /* Get the flag if the order is descending */
  768. #define DBOI_UNIQUE       13  /* Get the flag if the order has the unique attribute set */
  769.  
  770. /* Codes for SELF_INFO() */
  771.  
  772. #define DBI_ISDBF          1  /* Logical: RDD support DBF file format? */
  773. #define DBI_CANPUTREC      2  /* Logical: RDD support Putting Records? */
  774. #define DBI_GETHEADERSIZE  3  /* Numeric: Get header size of the file  */
  775. #define DBI_LASTUPDATE     4  /* Date:    Last date RDD file updated   */
  776. #define DBI_GETDELIMITER   5  /* String:  Get default delimiter        */
  777. #define DBI_SETDELIMITER   6  /* String:  Set default delimiter        */
  778. #define DBI_GETRECSIZE     7  /* Numeric: Get record size of the file  */
  779. #define DBI_GETLOCKARRAY   8  /* Array: Get an array of locked records */
  780. #define DBI_TABLEEXT       9  /* String:  Get table file extension     */
  781.  
  782. #define DBI_ISFLOCK       20  /* Get file lock status             */
  783.  
  784. #define DBI_CHILDCOUNT    22  /* Number of opened relations       */
  785. #define DBI_FILEHANDLE    23  /* Handle of opened file            */
  786.  
  787. #define DBI_BOF           26  /* BOF flag - alternate to bof()    */
  788. #define DBI_EOF           27  /* EOF flag - alternate to eof()    */
  789. #define DBI_DBFILTER      28  /* Filter expression                */
  790. #define DBI_FOUND         29  /* FOUND flag - alternate to found  */
  791. #define DBI_FCOUNT        30  /* Number of fields                 */
  792. #define DBI_LOCKCOUNT     31  /* Get record size of the file      */
  793. #define DBI_VALIDBUFFER   32  /* Is the current buffer valid      */
  794. #define DBI_ALIAS         33  /* Alias name of workarea           */
  795. #define DBI_GETSCOPE      34  /* Locate codeblock                 */
  796. #define DBI_LOCKOFFSET    35  /* New locking offset               */
  797. #define DBI_SHARED        36  /* Gets/Sets the shared flag        */
  798.  
  799. #define DBI_MEMOEXT       37  /* Gets/Sets the shared flag        */
  800. #define DBI_MEMOHANDLE    38  /* Dos handle for memo file         */
  801. #define DBI_MEMOBLOCKSIZE 39  /* Blocksize in memo files          */
  802.  
  803. #define DBI_DB_VERSION   101  /* HOST driver Version              */
  804. #define DBI_RDD_VERSION  102  /* RDD version (current RDD)        */
  805.  
  806. #define DBI_USER        1000  /* Start of user definable DBI_ values   */
  807.  
  808.  
  809. /* codes for SELF_RECINFO() */
  810.  
  811. #define DBRI_DELETED      1
  812. #define DBRI_LOCKED       2
  813. #define DBRI_RECSIZE      3
  814. #define DBRI_RECNO        4
  815. #define DBRI_UPDATED      5
  816.  
  817.  
  818. /* codes for SELF_FIELDINFO() */
  819.  
  820. #define DBS_NAME          1
  821. #define DBS_TYPE          2
  822. #define DBS_LEN           3
  823. #define DBS_DEC           4
  824.  
  825. /* codes for RawLock types */
  826.  
  827. #define FILE_LOCK         1
  828. #define FILE_UNLOCK       2
  829. #define REC_LOCK          3
  830. #define REC_UNLOCK        4
  831. #define HEADER_LOCK       5
  832. #define HEADER_UNLOCK     6
  833. #define APPEND_LOCK       7
  834. #define APPEND_UNLOCK     8
  835.  
  836.  
  837. /*--------------------* SELF Methods *------------------------*/
  838.  
  839. /* Movement and positioning methods */
  840.  
  841. #define SELF_BOF(w, sp)            ((*(w)->lprfsHost->bof)(w, sp))
  842. #define SELF_EOF(w, sp)            ((*(w)->lprfsHost->eof)(w, sp))
  843. #define SELF_FOUND(w, sp)          ((*(w)->lprfsHost->found)(w, sp))
  844. #define SELF_GOTO(w, l)            ((*(w)->lprfsHost->go)(w, l))
  845. #define SELF_GOTOID(w, sp)         ((*(w)->lprfsHost->goToId)(w, sp))
  846. #define SELF_GOBOTTOM(w)           ((*(w)->lprfsHost->goBottom)(w))
  847. #define SELF_GOTOP(w)              ((*(w)->lprfsHost->goTop)(w))
  848. #define SELF_SEEK(w, i, v)         ((*(w)->lprfsHost->seek)(w, i, v))
  849. #define SELF_SKIP(w, l)            ((*(w)->lprfsHost->skip)(w, l))
  850. #define SELF_SKIPFILTER(w, l)      ((*(w)->lprfsHost->skipFilter)(w, l))
  851. #define SELF_SKIPRAW(w, l)         ((*(w)->lprfsHost->skipRaw)(w, l))
  852.  
  853.  
  854. /* Data management */
  855.  
  856. #define SELF_ADDFIELD(w, ip)       ((*(w)->lprfsHost->addField)(w, ip))
  857. #define SELF_APPEND(w,l)           ((*(w)->lprfsHost->append)(w,l))
  858. #define SELF_CREATEFIELDS(w, v)    ((*(w)->lprfsHost->createFields)(w, v))
  859. #define SELF_DELETE(w)             ((*(w)->lprfsHost->deleterec)(w))
  860. #define SELF_DELETED(w, sp)        ((*(w)->lprfsHost->deleted)(w, sp))
  861. #define SELF_FIELDCOUNT(w, sp)     ((*(w)->lprfsHost->fieldCount)(w, sp))
  862. #define SELF_FIELDDISPLAY(w, sp)   ((*(w)->lprfsHost->fieldDisplay)(w, sp))
  863. #define SELF_FIELDINFO(w,s1,s2,v)  ((*(w)->lprfsHost->fieldInfo)(w,s1,s2,v))
  864. #define SELF_FIELDNAME(w, i, bp)   ((*(w)->lprfsHost->fieldName)(w, i, bp))
  865. #define SELF_FLUSH(w)              ((*(w)->lprfsHost->flush)(w))
  866. #define SELF_GETREC(w, bpp)        ((*(w)->lprfsHost->getRec)(w, bpp))
  867. #define SELF_GETVALUE(w, i, v)     ((*(w)->lprfsHost->getValue)(w, i, v))
  868. #define SELF_GETVARLEN(w, i, lp)   ((*(w)->lprfsHost->getVarLen)(w, i, lp))
  869. #define SELF_GOCOLD(w)             ((*(w)->lprfsHost->goCold)(w))
  870. #define SELF_GOHOT(w)              ((*(w)->lprfsHost->goHot)(w))
  871. #define SELF_PUTVALUE(w, i, v)     ((*(w)->lprfsHost->putValue)(w, i, v))
  872. #define SELF_PUTREC(w, bp)         ((*(w)->lprfsHost->putRec)(w, bp))
  873. #define SELF_RECALL(w)             ((*(w)->lprfsHost->recall)(w))
  874. #define SELF_RECCOUNT(w, sp)       ((*(w)->lprfsHost->reccount)(w, sp))
  875. #define SELF_RECINFO(w,v1,i,v2)    ((*(w)->lprfsHost->recInfo)(w,v1,i,v2))
  876. #define SELF_RECNO(w, i)           ((*(w)->lprfsHost->recno)(w, i))
  877. #define SELF_SETFIELDEXTENT(w, s)  ((*(w)->lprfsHost->setFieldExtent)(w, s))
  878.  
  879.  
  880. /* WorkArea/Database management */
  881.  
  882. #define SELF_ALIAS(w, bp)          ((*(w)->lprfsHost->alias)(w, bp))
  883. #define SELF_CLOSE(w)              ((*(w)->lprfsHost->close)(w))
  884. #define SELF_CREATE(w, ip)         ((*(w)->lprfsHost->create)(w, ip))
  885. #define SELF_INFO(w, i, g)         ((*(w)->lprfsHost->info)(w, i, g))
  886. #define SELF_NEW(w)                ((*(w)->lprfsHost->newarea)(w))
  887. #define SELF_OPEN(w, ip)           ((*(w)->lprfsHost->open)(w, ip))
  888. #define SELF_RELEASE(w)            ((*(w)->lprfsHost->release)(w))
  889. #define SELF_STRUCTSIZE(w, sp)     ((*(w)->lprfsHost->structSize)(w,sp))
  890. #define SELF_SYSNAME(w, bp)        ((*(w)->lprfsHost->sysName)(w, bp))
  891. #define SELF_DBEVAL(w, ip)         ((*(w)->lprfsHost->dbEval)(w, ip))
  892. #define SELF_PACK(w)               ((*(w)->lprfsHost->pack)(w))
  893. #define SELF_PACKREC(w, l, sp)     ((*(w)->lprfsHost->packRec)(w, l, sp))
  894. #define SELF_SORT(w, ip)           ((*(w)->lprfsHost->sort)(w, ip))
  895. #define SELF_TRANS(w, ip)          ((*(w)->lprfsHost->trans)(w, ip))
  896. #define SELF_TRANSREC(w, ip)       ((*(w)->lprfsHost->transRec)(w, ip))
  897. #define SELF_ZAP(w)                ((*(w)->lprfsHost->zap)(w))
  898.  
  899.  
  900. /* Relational Methods */
  901.  
  902. #define SELF_CHILDEND(w, ip)       ((*(w)->lprfsHost->childEnd)(w, ip))
  903. #define SELF_CHILDSTART(w, ip)     ((*(w)->lprfsHost->childStart)(w, ip))
  904. #define SELF_CHILDSYNC(w, ip)      ((*(w)->lprfsHost->childSync)(w, ip))
  905. #define SELF_SYNCCHILDREN(w)       ((*(w)->lprfsHost->syncChildren)(w))
  906. #define SELF_CLEARREL(w)           ((*(w)->lprfsHost->clearRel)(w))
  907. #define SELF_FORCEREL(w)           ((*(w)->lprfsHost->forceRel)(w))
  908. #define SELF_RELAREA(w, s, sp)     ((*(w)->lprfsHost->relArea)(w, s, sp))
  909. #define SELF_RELEVAL(w, ip)        ((*(w)->lprfsHost->relEval)(w, ip))
  910. #define SELF_RELTEXT(w, s, bp)     ((*(w)->lprfsHost->relText)(w, s, bp))
  911. #define SELF_SETREL(w, ip)         ((*(w)->lprfsHost->setRel)(w, ip))
  912.  
  913.  
  914. /* Order Management */
  915.  
  916. #define SELF_ORDLSTADD(w, lp)     ((*(w)->lprfsHost->orderListAdd)(w, lp))
  917. #define SELF_ORDLSTDELETE(w, lp)  ((*(w)->lprfsHost->orderListDelete)(w, lp))
  918. #define SELF_ORDLSTFOCUS(w, lp)   ((*(w)->lprfsHost->orderListFocus)(w,lp))
  919. #define SELF_ORDLSTREBUILD(w)     ((*(w)->lprfsHost->orderListRebuild)(w))
  920. #define SELF_ORDLSTCLEAR(w)       ((*(w)->lprfsHost->orderListClear)(w))
  921.  
  922. #define SELF_ORDSETCOND(w, ip) ((*(w)->lprfsHost->orderCondition)(w, ip))
  923. #define SELF_ORDCREATE(w, ip)  ((*(w)->lprfsHost->orderCreate)(w, ip))
  924. #define SELF_ORDDESTROY(w, p)  ((*(w)->lprfsHost->orderDestroy)(w, p))
  925. #define SELF_ORDINFO(w, i, p)  ((*(w)->lprfsHost->orderInfo)(w, i, p))
  926. #define SELF_ORDEXPR(w, p)     ((*(w)->lprfsHost->orderInfo)(w, DBOI_EXPRESSION, p))
  927. #define SELF_ORDCOND(w, p)     ((*(w)->lprfsHost->orderInfo)(w, DBOI_CONDITION,  p))
  928. #define SELF_ORDRECNO(w, p)    ((*(w)->lprfsHost->orderInfo)(w, DBOI_RECNO,      p))
  929. #define SELF_ORDPOS(w, p)      ((*(w)->lprfsHost->orderInfo)(w, DBOI_POSITION,   p))
  930. #define SELF_ORDNUMBER(w, p)   ((*(w)->lprfsHost->orderInfo)(w, DBOI_NUMBER,     p))
  931. #define SELF_ORDNAME(w, p)     ((*(w)->lprfsHost->orderInfo)(w, DBOI_NAME,       p))
  932. #define SELF_ORDBAGNAME(w, p)  ((*(w)->lprfsHost->orderInfo)(w, DBOI_BAGNAME,    p))
  933. #define SELF_ORDBAGEXT(w,  p)  ((*(w)->lprfsHost->orderInfo)(w, DBOI_BAGEXT,     p))
  934.  
  935.  
  936. /* Filters and Scope Settings */
  937.  
  938. #define SELF_CLEARFILTER(w)        ((*(w)->lprfsHost->clearFilter)(w))
  939. #define SELF_CLEARLOCATE(w)        ((*(w)->lprfsHost->clearLocate)(w))
  940. #define SELF_CLEARSCOPE(w)         ((*(w)->lprfsHost->clearScope)(w))
  941. #define SELF_COUNTSCOPE(w,ip,lp)   ((*(w)->lprfsHost->countScope)(w,ip,lp))
  942. #define SELF_FILTERTEXT(w, bp)     ((*(w)->lprfsHost->filterText)(w, bp))
  943. #define SELF_SCOPEINFO(w,i,v)      ((*(w)->lprfsHost->scopeInfo)(w,i,v))
  944. #define SELF_SETFILTER(w, ip)      ((*(w)->lprfsHost->setFilter)(w, ip))
  945. #define SELF_SETLOCATE(w, ip)      ((*(w)->lprfsHost->setLocate)(w, ip))
  946. #define SELF_SETSCOPE(w, ip)       ((*(w)->lprfsHost->setScope)(w, ip))
  947. #define SELF_SKIPSCOPE(w, bp, l)   ((*(w)->lprfsHost->skipScope)(w, bp, l))
  948.  
  949.  
  950. /* Miscellaneous */
  951.  
  952. #define SELF_COMPILE(w, bp)        ((*(w)->lprfsHost->compile)(w, bp))
  953. #define SELF_ERROR(w, ip)          ((*(w)->lprfsHost->error)(w, ip))
  954. #define SELF_EVALBLOCK(w, v)       ((*(w)->lprfsHost->evalBlock)(w, v))
  955.  
  956.  
  957. /* Network operations */
  958.  
  959. #define SELF_GETLOCKS(w, g)        ((*(w)->lprfsHost->info)(w, DBI_GETLOCKARRAY, g))
  960. #define SELF_RAWLOCK(w, i, l)      ((*(w)->lprfsHost->rawlock)(w, i, l))
  961. #define SELF_LOCK(w, sp)           ((*(w)->lprfsHost->lock)(w, sp))
  962. #define SELF_UNLOCK(w, l)          ((*(w)->lprfsHost->unlock)(w, l))
  963.  
  964.  
  965. /* Memofile functions */
  966.  
  967. #define SELF_CLOSEMEMFILE(w)       ((*(w)->lprfsHost->closeMemFile)(w))
  968. #define SELF_CREATEMEMFILE(w,bp)   ((*(w)->lprfsHost->createMemFile)(w,bp))
  969. #define SELF_GETVALUEFILE(w,i,bp,b) ((*(w)->lprfsHost->getValueFile)(w,i,bp,b))
  970. #define SELF_OPENMEMFILE(w,bp)     ((*(w)->lprfsHost->openMemFile)(w,bp))
  971. #define SELF_PUTVALUEFILE(w,i,bp)  ((*(w)->lprfsHost->putValueFile)(w,i,bp))
  972.  
  973.  
  974. /* Database file header handling */
  975.  
  976. #define SELF_READDBHEADER(w)       ((*(w)->lprfsHost->readDBHeader)(w))
  977. #define SELF_WRITEDBHEADER(w)      ((*(w)->lprfsHost->writeDBHeader)(w))
  978.  
  979.  
  980. /* Info operations */
  981.  
  982. #define SELF_RECSIZE(w, lp)        ((*(w)->lprfsHost->info)(w, DBI_GETRECSIZE, lp))
  983. #define SELF_HEADERSIZE(w, fp)     ((*(w)->lprfsHost->info)(w, DBI_GETHEADERSIZE, fp))
  984. #define SELF_LUPDATE(w, fp)        ((*(w)->lprfsHost->info)(w, DBI_LASTUPDATE, fp ))
  985. #define SELF_SETDELIM(w, fp)       ((*(w)->lprfsHost->info)(w, DBI_SETDELIMITER, fp))
  986. #define SELF_GETDELIM(w, fp)       ((*(w)->lprfsHost->info)(w, DBI_GETDELIMITER, fp))
  987. #define SELF_TABLEEXT(w, fp)       ((*(w)->lprfsHost->info)(w, DBI_TABLEEXT, fp))
  988.  
  989.  
  990. /*--------------------* SUPER Methods *------------------------*/
  991.  
  992. /* Movement and positioning methods */
  993.  
  994. #define SUPER_BOF(w, sp)            ((*(SUPERTABLE)->bof)(w, sp))
  995. #define SUPER_EOF(w, sp)            ((*(SUPERTABLE)->eof)(w, sp))
  996. #define SUPER_FOUND(w, sp)          ((*(SUPERTABLE)->found)(w, sp))
  997. #define SUPER_GOTO(w, l)            ((*(SUPERTABLE)->go)(w, l))
  998. #define SUPER_GOTOID(w, sp)         ((*(SUPERTABLE)->goToId)(w, sp))
  999. #define SUPER_GOBOTTOM(w)           ((*(SUPERTABLE)->goBottom)(w))
  1000. #define SUPER_GOTOP(w)              ((*(SUPERTABLE)->goTop)(w))
  1001. #define SUPER_SEEK(w, i, v)         ((*(SUPERTABLE)->seek)(w, i, v))
  1002. #define SUPER_SKIP(w, l)            ((*(SUPERTABLE)->skip)(w, l))
  1003. #define SUPER_SKIPFILTER(w, l)      ((*(SUPERTABLE)->skipFilter)(w, l))
  1004. #define SUPER_SKIPRAW(w, l)         ((*(SUPERTABLE)->skipRaw)(w, l))
  1005.  
  1006.  
  1007. /* Data management */
  1008.  
  1009. #define SUPER_ADDFIELD(w, ip)       ((*(SUPERTABLE)->addField)(w, ip))
  1010. #define SUPER_APPEND(w,l)           ((*(SUPERTABLE)->append)(w,l))
  1011. #define SUPER_CREATEFIELDS(w, v)    ((*(SUPERTABLE)->createFields)(w, v))
  1012. #define SUPER_DELETE(w)             ((*(SUPERTABLE)->deleterec)(w))
  1013. #define SUPER_DELETED(w, sp)        ((*(SUPERTABLE)->deleted)(w, sp))
  1014. #define SUPER_FIELDCOUNT(w, sp)     ((*(SUPERTABLE)->fieldCount)(w, sp))
  1015. #define SUPER_FIELDDISPLAY(w, sp)   ((*(SUPERTABLE)->fieldDisplay)(w, sp))
  1016. #define SUPER_FIELDINFO(w,s1,s2,v)  ((*(SUPERTABLE)->fieldInfo)(w,s1,s2,v))
  1017. #define SUPER_FIELDNAME(w, i, bp)   ((*(SUPERTABLE)->fieldName)(w, i, bp))
  1018. #define SUPER_FLUSH(w)              ((*(SUPERTABLE)->flush)(w))
  1019. #define SUPER_GETREC(w, bpp)        ((*(SUPERTABLE)->getRec)(w, bpp))
  1020. #define SUPER_GETVALUE(w, i, v)     ((*(SUPERTABLE)->getValue)(w, i, v))
  1021. #define SUPER_GETVARLEN(w, i, lp)   ((*(SUPERTABLE)->getVarLen)(w, i, lp))
  1022. #define SUPER_GOCOLD(w)             ((*(SUPERTABLE)->goCold)(w))
  1023. #define SUPER_GOHOT(w)              ((*(SUPERTABLE)->goHot)(w))
  1024. #define SUPER_PUTVALUE(w, i, v)     ((*(SUPERTABLE)->putValue)(w, i, v))
  1025. #define SUPER_PUTREC(w, bp)         ((*(SUPERTABLE)->putRec)(w, bp))
  1026. #define SUPER_RECALL(w)             ((*(SUPERTABLE)->recall)(w))
  1027. #define SUPER_RECCOUNT(w, sp)       ((*(SUPERTABLE)->reccount)(w, sp))
  1028. #define SUPER_RECINFO(w,v1,i,v2)    ((*(SUPERTABLE)->recInfo)(w,v1,i,v2))
  1029. #define SUPER_RECNO(w, sp)          ((*(SUPERTABLE)->recno)(w, sp))
  1030. #define SUPER_SETFIELDEXTENT(w, s)  ((*(SUPERTABLE)->setFieldExtent)(w, s))
  1031.  
  1032.  
  1033. /* WorkArea/Database management */
  1034.  
  1035. #define SUPER_ALIAS(w, bp)        ((*(SUPERTABLE)->alias)(w, bp))
  1036. #define SUPER_CLOSE(w)            ((*(SUPERTABLE)->close)(w))
  1037. #define SUPER_CREATE(w, ip)       ((*(SUPERTABLE)->create)(w, ip))
  1038. #define SUPER_INFO(w, i, g)       ((*(SUPERTABLE)->info)(w, i, g))
  1039. #define SUPER_NEW(w)              ((*(SUPERTABLE)->newarea)(w))
  1040. #define SUPER_OPEN(w, ip)         ((*(SUPERTABLE)->open)(w, ip))
  1041. #define SUPER_RELEASE(w)          ((*(SUPERTABLE)->release)(w))
  1042. #define SUPER_STRUCTSIZE(w, sp)   ((*(SUPERTABLE)->structSize)(w, sp))
  1043. #define SUPER_SYSNAME(w, bp)      ((*(SUPERTABLE)->sysName)(w, bp))
  1044. #define SUPER_DBEVAL(w, ip)       ((*(SUPERTABLE)->dbEval)(w, ip))
  1045. #define SUPER_PACK(w)             ((*(SUPERTABLE)->pack)(w))
  1046. #define SUPER_PACKREC(w, l, sp)   ((*(SUPERTABLE)->packRec)(w, l, sp))
  1047. #define SUPER_SORT(w, ip)         ((*(SUPERTABLE)->sort)(w, ip))
  1048. #define SUPER_TRANS(w, ip)        ((*(SUPERTABLE)->trans)(w, ip))
  1049. #define SUPER_TRANSREC(w, ip)     ((*(SUPERTABLE)->transRec)(w, ip))
  1050. #define SUPER_ZAP(w)              ((*(SUPERTABLE)->zap)(w))
  1051.  
  1052.  
  1053. /* Relational Methods */
  1054.  
  1055. #define SUPER_CHILDEND(w, ip)     ((*(SUPERTABLE)->childEnd)(w, ip))
  1056. #define SUPER_CHILDSTART(w, ip)   ((*(SUPERTABLE)->childStart)(w, ip))
  1057. #define SUPER_CHILDSYNC(w, ip)    ((*(SUPERTABLE)->childSync)(w, ip))
  1058. #define SUPER_SYNCCHILDREN(w)     ((*(SUPERTABLE)->syncChildren)(w))
  1059. #define SUPER_CLEARREL(w)         ((*(SUPERTABLE)->clearRel)(w))
  1060. #define SUPER_FORCEREL(w)         ((*(SUPERTABLE)->forceRel)(w))
  1061. #define SUPER_RELAREA(w, s, sp)   ((*(SUPERTABLE)->relArea)(w, s, sp))
  1062. #define SUPER_RELEVAL(w, ip)      ((*(SUPERTABLE)->relEval)(w, ip))
  1063. #define SUPER_RELTEXT(w, s, bp)   ((*(SUPERTABLE)->relText)(w, s, bp))
  1064. #define SUPER_SETREL(w, ip)       ((*(SUPERTABLE)->setRel)(w, ip))
  1065.  
  1066.  
  1067. /* Order Management */
  1068.  
  1069. #define SUPER_ORDLSTADD(w, lp)    ((*(SUPERTABLE)->orderListAdd)(w, lp))
  1070. #define SUPER_ORDLSTDELETE(w, lp) ((*(SUPERTABLE)->orderListDelete)(w, lp))
  1071. #define SUPER_ORDLSTFOCUS(w, lp)  ((*(SUPERTABLE)->orderListFocus)(w, lp))
  1072. #define SUPER_ORDLSTREBUILD(w)    ((*(SUPERTABLE)->orderListRebuild)(w))
  1073. #define SUPER_ORDLSTCLEAR(w)      ((*(SUPERTABLE)->orderListClear)(w))
  1074.  
  1075. #define SUPER_ORDSETCOND(w,ip) ((*(SUPERTABLE)->orderCondition)(w, ip))
  1076. #define SUPER_ORDCREATE(w, ip) ((*(SUPERTABLE)->orderCreate)(w, ip))
  1077. #define SUPER_ORDDELETE(w, ip) ((*(SUPERTABLE)->orderDelete)(w, ip))
  1078. #define SUPER_ORDINFO(w, i, p) ((*(SUPERTABLE)->orderInfo)(w, i, p))
  1079. #define SUPER_ORDEXPR(w, p)    ((*(SUPERTABLE)->orderInfo)(w, DBOI_EXPRESSION, p))
  1080. #define SUPER_ORDCOND(w, p)    ((*(SUPERTABLE)->orderInfo)(w, DBOI_CONDITION,  p))
  1081. #define SUPER_ORDRECNO(w, p)   ((*(SUPERTABLE)->orderInfo)(w, DBOI_RECNO,      p))
  1082. #define SUPER_ORDPOS(w, p)     ((*(SUPERTABLE)->orderInfo)(w, DBOI_POSITION,   p))
  1083. #define SUPER_ORDNUMBER(w, p)  ((*(SUPERTABLE)->orderInfo)(w, DBOI_NUMBER,     p))
  1084. #define SUPER_ORDNAME(w, p)    ((*(SUPERTABLE)->orderInfo)(w, DBOI_NAME,       p))
  1085. #define SUPER_ORDBAGNAME(w, p) ((*(SUPERTABLE)->orderInfo)(w, DBOI_BAGNAME,    p))
  1086. #define SUPER_ORDBAGEXT(w,  p) ((*(SUPERTABLE)->orderInfo)(w, DBOI_BAGEXT,     p))
  1087.  
  1088.  
  1089. /* Filters and Scope Settings */
  1090.  
  1091. #define SUPER_CLEARFILTER(w)      ((*(SUPERTABLE)->clearFilter)(w))
  1092. #define SUPER_CLEARLOCATE(w)      ((*(SUPERTABLE)->clearLocate)(w))
  1093. #define SUPER_CLEARSCOPE(w)       ((*(SUPERTABLE)->clearScope)(w))
  1094. #define SUPER_COUNTSCOPE(w,ip,lp) ((*(SUPERTABLE)->countScope)(w,ip,lp))
  1095. #define SUPER_FILTERTEXT(w, bp)   ((*(SUPERTABLE)->filterText)(w, bp))
  1096. #define SUPER_SCOPEINFO(w,i,v)    ((*(SUPERTABLE)->scopeInfo)(w,i,v))
  1097. #define SUPER_SETFILTER(w, ip)    ((*(SUPERTABLE)->setFilter)(w, ip))
  1098. #define SUPER_SETLOCATE(w, ip)    ((*(SUPERTABLE)->setLocate)(w, ip))
  1099. #define SUPER_SETSCOPE(w, ip)     ((*(SUPERTABLE)->setScope)(w, ip))
  1100. #define SUPER_SKIPSCOPE(w, bp, l) ((*(SUPERTABLE)->skipScope)(w, bp, l))
  1101.  
  1102.  
  1103. /* Miscellaneous */
  1104.  
  1105. #define SUPER_COMPILE(w, bp)      ((*(SUPERTABLE)->compile)(w, bp))
  1106. #define SUPER_ERROR(w, ip)        ((*(SUPERTABLE)->error)(w, ip))
  1107. #define SUPER_EVALBLOCK(w, v)     ((*(SUPERTABLE)->evalBlock)(w, v))
  1108.  
  1109.  
  1110. /* Network operations */
  1111.  
  1112. #define SUPER_GETLOCKS(w, g)      ((*(SUPERTABLE)->info)(w, DBI_GETLOCKARRAY, g))
  1113. #define SUPER_RAWLOCK(w, i, l)    ((*(SUPERTABLE)->rawlock)(w, i, l))
  1114. #define SUPER_LOCK(w, sp)         ((*(SUPERTABLE)->lock)(w, sp))
  1115. #define SUPER_UNLOCK(w)           ((*(SUPERTABLE)->unlock)(w))
  1116.  
  1117.  
  1118. /* Memofile functions */
  1119.  
  1120. #define SUPER_CLOSEMEMFILE(w)       ((*(SUPERTABLE)->closeMemFile)(w))
  1121. #define SUPER_CREATEMEMFILE(w,bp)   ((*(SUPERTABLE)->createMemFile)(w,bp))
  1122. #define SUPER_GETVALUEFILE(w,i,bp,b) ((*(SUPERTABLE)->getValueFile)(w,i,bp,b))
  1123. #define SUPER_OPENMEMFILE(w,bp)     ((*(SUPERTABLE)->openMemFile)(w,bp))
  1124. #define SUPER_PUTVALUEFILE(w,i,bp)  ((*(SUPERTABLE)->putValueFile)(w,i,bp))
  1125.  
  1126.  
  1127. /* Database file header handling */
  1128.  
  1129. #define SUPER_READDBHEADER(w)       ((*(SUPERTABLE)->readDBHeader)(w))
  1130. #define SUPER_WRITEDBHEADER(w)      ((*(SUPERTABLE)->writeDBHeader)(w))
  1131.  
  1132.  
  1133. /* Info operations */
  1134.  
  1135. #define SUPER_RECSIZE(w, lp)      ((*(SUPERTABLE)->info)(w, DBI_GETRECSIZE, lp))
  1136. #define SUPER_HEADERSIZE(w, fp)   ((*(SUPERTABLE)->info)(w, DBI_GETHEADERSIZE, fp))
  1137. #define SUPER_LUPDATE(w, fp)      ((*(SUPERTABLE)->info)(w, DBI_LASTUPDATE, fp ))
  1138. #define SUPER_SETDELIM(w, fp)     ((*(SUPERTABLE)->info)(w, DBI_SETDELIMITER, fp))
  1139. #define SUPER_GETDELIM(w, fp)     ((*(SUPERTABLE)->info)(w, DBI_GETDELIMITER, fp))
  1140. #define SUPER_TABLEEXT(w, fp)     ((*(SUPERTABLE)->info)(w, DBI_TABLEEXT, fp))
  1141.  
  1142.  
  1143.  
  1144. /*
  1145. *  PROTOTYPES
  1146. *  ----------
  1147. */
  1148. extern ERRCODE _rddInherit( LPRDDFUNCS table, LPRDDFUNCS subTable, LPRDDFUNCS superTable, BYTEP drvName );
  1149. extern ERRCODE _rddDisinherit( BYTEP drvName );
  1150. extern USHORT  _rddExtendType( USHORT fieldType );
  1151. extern USHORT  _rddFieldType( USHORT extendType );
  1152.  
  1153.  
  1154. #ifdef __cplusplus
  1155.     }
  1156. #endif
  1157.  
  1158. #endif // RDDAPI_E_INCLUDED
  1159.  
  1160. /*--------------------------- EOF  RDD.API ----------------------------*/
  1161.