home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / progm / crde1.zip / CRDE.H next >
Text File  |  1990-11-27  |  6KB  |  163 lines

  1. /* crde.h */
  2.  
  3. /*
  4. The C Relational Database Engine.
  5. Copyright (c) 1990, Mark Lang.
  6. All Rights Reserved.
  7. */
  8.  
  9. #ifndef __LARGE__
  10. #error Must compile in LARGE memory model to use CRDE!
  11. #endif
  12.  
  13. #ifndef __CRDE__
  14. #define __CRDE__
  15.  
  16. #ifdef  __STDC__
  17. #define tdecl(type) type
  18. #else
  19. #define tdecl(type) type cdecl
  20. #endif
  21.  
  22. /* TABLE type */
  23.  
  24. typedef void TABLE;
  25.  
  26. /* dollar type */
  27.  
  28. typedef double dollar_t;
  29.  
  30. /* table limits */
  31.  
  32. #define MAXTABLES     128
  33. #define MAXTABLENAME  64
  34. #define MAXROWSIZE    4000
  35. #define MAXCOLNAME    16
  36. #define MAXCOLSIZE    256
  37. #define MAXKEYCOLS    8
  38. #define MAXKEYSIZE    256
  39. #define MAXROWS       2147483647
  40. #define MAXCOLS       256
  41. #define MAXINDEXES    8
  42. #define MAXJOINCOLS   256
  43. #define MAXEXPR       16
  44. #define MAXCHANGES    16
  45.  
  46. /* search relops */
  47.  
  48. #define EQ  0
  49. #define LT  1
  50. #define GT  2
  51. #define LE  3
  52. #define GE  4
  53. #define NE  5
  54.  
  55. #define LTE LE
  56. #define GTE GE
  57. #define NEQ NE
  58.  
  59. /* temporary table id's */
  60.  
  61. #define TEMP    ((char *)0)
  62. #define STATIC  ((char *)1)
  63.  
  64. /* table modes */
  65.  
  66. #define T_NORMAL 0
  67. #define T_WRITEC 1
  68. #define T_TEMP   2
  69. #define T_STATIC 3
  70.  
  71. /* function prototypes */
  72.  
  73. tdecl(int)     taccess     (TABLE *t, int mode);
  74. tdecl(long)    tadd        (TABLE *t1, TABLE *t2);
  75. tdecl(int)     tall        (tdecl(int) (*func)(TABLE *));
  76. tdecl(int)     taverage    (TABLE *t, char *c, void *result);
  77. tdecl(TABLE *) tborrow     (char *name, TABLE *t);
  78. tdecl(long)    tchange     (TABLE *t, ...);
  79. tdecl(long)    tchangeif   (TABLE *t, tdecl(int) (*action)(void *), ...);
  80. tdecl(int)     tchcol      (TABLE *t, char *old, char *new);
  81. tdecl(int)     tclose      (TABLE *t);
  82. tdecl(int)     tcmpstruct  (TABLE *t1, TABLE *t2);
  83. tdecl(int)     tcols       (TABLE *t);
  84. tdecl(int)     tcolsize    (TABLE *t, char *c);
  85. tdecl(char)    tcoltype    (TABLE *t, char *c);
  86. tdecl(int)     tcommit     (TABLE *t);
  87. tdecl(TABLE *) tcopy       (char *name, TABLE *t);
  88. tdecl(int)     tcount      (TABLE *t, char *c, void *result);
  89. tdecl(TABLE *) tcreat      (char *name, char *td);
  90. tdecl(TABLE *) tcrstruct   (char *name, TABLE *t);
  91. tdecl(long)    tdelete     (TABLE *t, ...);
  92. tdecl(long)    tdeleteif   (TABLE *t, tdecl(int) (*action)(void *), ...);
  93. tdecl(TABLE *) tdiff       (char *name, TABLE *t1, TABLE *t2);
  94. tdecl(int)     tdrop       (TABLE *t);
  95. tdecl(int)     tdropindex  (TABLE *t, char *id);
  96. tdecl(int)     tempty      (TABLE *t);
  97. tdecl(int)     terase      (char *name);
  98. tdecl(long)    texportascii(TABLE *t, char *dest);
  99. tdecl(long)    texportdBASE(TABLE *t, char *dest);
  100. tdecl(int)     tflush      (TABLE *t);
  101. tdecl(long)    tget        (TABLE *t, void *buf, long n, ...);
  102. tdecl(long)    tgetif      (TABLE *t, void *buf, long n,
  103.                 tdecl(int) (*action)(void *), ...);
  104. tdecl(TABLE *) tgroup      (char *name, TABLE *t, char *id, char *td,
  105.                 tdecl(int) (*summary)(void *, void *, int));
  106. tdecl(int)     tindex      (TABLE *t, char *id);
  107. tdecl(int)     tindexes    (TABLE *t);
  108. tdecl(TABLE *) timportascii(char *name, char *td, char *source);
  109. tdecl(TABLE *) timportdBASE(char *name, char *source);
  110. tdecl(long)    tinsert     (TABLE *t, void *recs, long n);
  111. tdecl(TABLE *) tintersect  (char *name, TABLE *t1, TABLE *t2);
  112. tdecl(TABLE *) tjoin       (char *name, TABLE *t1, char *cl1, TABLE *t2,
  113.                 char *cl2, char *pl);
  114. tdecl(int)     tload       (TABLE *t, ...);
  115. tdecl(int)     tlookup     (TABLE *t, ...);
  116. tdecl(int)     tlookupif   (TABLE *t, tdecl(int) (*action)(void *), ...);
  117. tdecl(int)     tkeyed      (TABLE *t);
  118. tdecl(TABLE *) tkeys       (char *name, TABLE *t);
  119. tdecl(int)     tmark       (TABLE *t);
  120. tdecl(int)     tmax        (TABLE *t, char *c, void *result);
  121. tdecl(int)     tmin        (TABLE *t, char *c, void *result);
  122. tdecl(int)     tmode       (TABLE *t);
  123. tdecl(int)     tnormal     (TABLE *t);
  124. tdecl(TABLE *) topen       (char *name);
  125. tdecl(TABLE *) tproject    (char *name, TABLE *t, char *pl, ...);
  126. tdecl(TABLE *) tprojectif  (char *name, TABLE *t, char *pl,
  127.                 tdecl(int) (*action)(void *), ...);
  128. tdecl(int)     trelease    (TABLE *t);
  129. tdecl(int)     trename     (char *old, char *new);
  130. tdecl(TABLE *) trepair     (char *name, char *td);
  131. tdecl(long)    treplace    (TABLE *t, void *recs, long n);
  132. tdecl(TABLE *) trestruct   (char *name, TABLE *t, char *td);
  133. tdecl(int)     trollback   (TABLE *t);
  134. tdecl(long)    trows       (TABLE *t);
  135. tdecl(int)     trowsize    (TABLE *t);
  136. tdecl(long)    tscan       (TABLE *t, ...);
  137. tdecl(long)    tscanif     (TABLE *t, tdecl(int) (*action)(void *), ...);
  138. tdecl(TABLE *) tselect     (char *name, TABLE *t, ...);
  139. tdecl(TABLE *) tselectif   (char *name, TABLE *t,
  140.                 tdecl(int) (*action)(void *), ...);
  141. tdecl(TABLE *) tsort       (char *name, TABLE *t, char *id);
  142. tdecl(TABLE *) tstruct     (char *name, TABLE *t);
  143. tdecl(long)    tsubtract   (TABLE *t1, TABLE *t2);
  144. tdecl(int)     tsum        (TABLE *t, char *c, void *result);
  145. tdecl(int)     ttransact   (TABLE *t);
  146. tdecl(TABLE *) tunion      (char *name, TABLE *t1, TABLE *t2);
  147. tdecl(long)    tupdate     (TABLE *t1, TABLE *t2);
  148. tdecl(int)     tview       (TABLE *t, char *cl, char *id, int ax, int ay,
  149.                 int bx, int by, int cattr, int fattr, int battr,
  150.                 void *rec);
  151. tdecl(int)     twritec     (TABLE *t);
  152.  
  153.  
  154. /* global variables */
  155.  
  156. extern tdecl(int)  terrno;            /* contains last error code        */
  157. extern tdecl(long) trowsfound;        /* rows involved in last operation */
  158.  
  159. #endif
  160.  
  161. /* end of crde.h */
  162.  
  163.