TSBTRV.LST 61 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331
  1. Listing:
  2. 1 (* Release 3.10 *)
  3. 2 (*-------------------------------------------------------------------------*
  4. 3 * *
  5. 4 * TopSpeed Modula-2 Interface for BTRIEVE - Supports TopSpeed Extender *
  6. 5 * Public Domain - May be used without restriction *
  7. 6 * *
  8. 7 *--------------------------------------------------------------------------*)
  9. 8 IMPLEMENTATION MODULE TSBTRV;
  10. 9 IMPORT SYSTEM,Lib,Str;
  11. 10 (*%T _XTD*)
  12. 11 IMPORT TSXLIB;
  13. 12 (*%E*)
  14. 13
  15. 14 (****************************************************************************)
  16. 15
  17. 16
  18. 17 PROCEDURE BTRV1(fn : CARDINAL);
  19. 18 VAR
  20. 19 NullControl : FileControlBlock;
  21. ***** ^ undeclared identifier
  22. 20 NullBuffer : LONGCARD;
  23. ***** ^ undeclared identifier
  24. 21 NullBufferSize : CARDINAL;
  25. 22 NullKey : KeyType;
  26. ***** ^ undeclared identifier
  27. 23 BEGIN
  28. 24 NullBufferSize := SIZE(NullBuffer);
  29. ***** ^ undeclared identifier
  30. ***** ^ not supported yet
  31. 25 StatusCode := BTRV(fn,NullControl,NullBuffer,NullBufferSize,NullKey,0);
  32. ***** ^ undeclared identifier
  33. ***** ^ undeclared identifier
  34. ***** ^ not supported yet
  35. ***** ^ not supported yet
  36. ***** ^ not supported yet
  37. ***** ^ not supported yet
  38. 26 END BTRV1;
  39. ***** ^ not supported yet
  40. 27
  41. 28 PROCEDURE BTRV2(fn : CARDINAL;VAR FileControl : FileControlBlock);
  42. ***** ^ undeclared identifier
  43. 29 VAR
  44. 30 NullBuffer : LONGCARD;
  45. ***** ^ undeclared identifier
  46. 31 NullBufferSize : CARDINAL;
  47. 32 NullKey : KeyType;
  48. ***** ^ undeclared identifier
  49. 33 BEGIN
  50. 34 NullBufferSize := SIZE(NullBuffer);
  51. ***** ^ undeclared identifier
  52. ***** ^ not supported yet
  53. 35 StatusCode := BTRV(fn,FileControl,NullBuffer,NullBufferSize,NullKey,0);
  54. ***** ^ undeclared identifier
  55. ***** ^ undeclared identifier
  56. ***** ^ not supported yet
  57. ***** ^ not supported yet
  58. ***** ^ not supported yet
  59. ***** ^ not supported yet
  60. 36 END BTRV2;
  61. ***** ^ not supported yet
  62. 37
  63. 38 PROCEDURE BTRV3(fn : CARDINAL;VAR FileControl : FileControlBlock;Key : SHORTCARD);
  64. ***** ^ undeclared identifier
  65. 39 VAR
  66. 40 NullBuffer : LONGCARD;
  67. ***** ^ undeclared identifier
  68. 41 NullBufferSize : CARDINAL;
  69. 42 NullKey : KeyType;
  70. ***** ^ undeclared identifier
  71. 43 BEGIN
  72. 44 NullBufferSize := SIZE(NullBuffer);
  73. ***** ^ undeclared identifier
  74. ***** ^ not supported yet
  75. 45 StatusCode := BTRV(fn,FileControl,NullBuffer,NullBufferSize,NullKey,Key);
  76. ***** ^ undeclared identifier
  77. ***** ^ undeclared identifier
  78. ***** ^ not supported yet
  79. ***** ^ not supported yet
  80. ***** ^ not supported yet
  81. ***** ^ not supported yet
  82. 46 END BTRV3;
  83. ***** ^ not supported yet
  84. 47
  85. 48 PROCEDURE BTRV4(fn : CARDINAL;VAR FileControl : FileControlBlock;
  86. ***** ^ undeclared identifier
  87. 49 VAR KeyBuffer : ARRAY OF BYTE; Key : SHORTCARD);
  88. ***** ^ undeclared identifier
  89. 50 VAR
  90. 51 NullBuffer : LONGCARD;
  91. ***** ^ undeclared identifier
  92. 52 NullBufferSize : CARDINAL;
  93. 53 BEGIN
  94. 54 NullBufferSize := SIZE(NullBuffer);
  95. ***** ^ undeclared identifier
  96. ***** ^ not supported yet
  97. 55 StatusCode := BTRV(fn,FileControl,NullBuffer,NullBufferSize,KeyBuffer,Key);
  98. ***** ^ undeclared identifier
  99. ***** ^ undeclared identifier
  100. ***** ^ not supported yet
  101. ***** ^ not supported yet
  102. ***** ^ not supported yet
  103. ***** ^ not supported yet
  104. 56 END BTRV4;
  105. ***** ^ not supported yet
  106. 57
  107. 58 (****************************************************************************)
  108. 59
  109. 60 PROCEDURE AbortTransaction;
  110. 61 BEGIN
  111. 62 BTRV1(opAbortTrans);
  112. ***** ^ not supported yet
  113. ***** ^ undeclared identifier
  114. 63 END AbortTransaction;
  115. ***** ^ not supported yet
  116. 64
  117. 65 (****************************************************************************)
  118. 66
  119. 67 PROCEDURE BeginTransaction;
  120. 68 BEGIN
  121. 69 BTRV1(opBeginTrans);
  122. ***** ^ not supported yet
  123. ***** ^ undeclared identifier
  124. 70 END BeginTransaction;
  125. ***** ^ not supported yet
  126. 71
  127. 72 (****************************************************************************)
  128. 73
  129. 74 PROCEDURE ClearOwner(VAR FileControl : FileControlBlock);
  130. ***** ^ undeclared identifier
  131. 75 BEGIN
  132. 76 BTRV2(opClearOwner,FileControl);
  133. ***** ^ not supported yet
  134. ***** ^ undeclared identifier
  135. ***** ^ not supported yet
  136. 77 END ClearOwner;
  137. ***** ^ not supported yet
  138. 78
  139. 79 (****************************************************************************)
  140. 80
  141. 81 PROCEDURE Close(VAR FileControl : FileControlBlock);
  142. ***** ^ undeclared identifier
  143. 82 BEGIN
  144. 83 BTRV2(opClose,FileControl);
  145. ***** ^ not supported yet
  146. ***** ^ undeclared identifier
  147. ***** ^ not supported yet
  148. 84 END Close;
  149. ***** ^ not supported yet
  150. 85
  151. 86 (****************************************************************************)
  152. 87
  153. 88 PROCEDURE Create( VAR FileControl : FileControlBlock;
  154. ***** ^ undeclared identifier
  155. 89 FileDescriptor : ARRAY OF BYTE;
  156. ***** ^ undeclared identifier
  157. 90 DescriptorLength : CARDINAL;
  158. 91 FileName : ARRAY OF CHAR);
  159. ***** ^ not supported yet
  160. 92 VAR
  161. 93 KeyBuffer : KeyType;
  162. ***** ^ undeclared identifier
  163. 94 BEGIN
  164. 95 Str.Copy(KeyBuffer,FileName);
  165. ***** ^ not supported yet
  166. ***** ^ not supported yet
  167. ***** ^ not supported yet
  168. ***** ^ not supported yet
  169. 96 StatusCode := BTRV(opCreate,FileControl,FileDescriptor,DescriptorLength,KeyBuffer,0);
  170. ***** ^ undeclared identifier
  171. ***** ^ undeclared identifier
  172. ***** ^ undeclared identifier
  173. ***** ^ not supported yet
  174. ***** ^ not supported yet
  175. ***** ^ not supported yet
  176. ***** ^ not supported yet
  177. 97 END Create;
  178. ***** ^ not supported yet
  179. 98
  180. 99 (****************************************************************************)
  181. 100 PROCEDURE DeleteRec(VAR FileControl : FileControlBlock; KeyID : SHORTCARD);
  182. ***** ^ undeclared identifier
  183. 101 BEGIN
  184. 102 BTRV3(opDelete,FileControl,KeyID);
  185. ***** ^ not supported yet
  186. ***** ^ undeclared identifier
  187. ***** ^ not supported yet
  188. ***** ^ not supported yet
  189. 103 END DeleteRec;
  190. ***** ^ not supported yet
  191. 104
  192. 105 (****************************************************************************)
  193. 106
  194. 107 PROCEDURE EndTransaction;
  195. 108 BEGIN
  196. 109 BTRV1(opEndTrans);
  197. ***** ^ not supported yet
  198. ***** ^ undeclared identifier
  199. 110 END EndTransaction;
  200. ***** ^ not supported yet
  201. 111
  202. 112 (****************************************************************************)
  203. 113
  204. 114 PROCEDURE Extend(VAR FileControl : FileControlBlock; FileName : ARRAY OF CHAR;
  205. ***** ^ undeclared identifier
  206. ***** ^ not supported yet
  207. 115 UseNow : BOOLEAN);
  208. 116 VAR
  209. 117 KeyBuffer : KeyType;
  210. ***** ^ undeclared identifier
  211. 118 KeyID : SHORTCARD;
  212. 119 BEGIN
  213. 120 Str.Copy(KeyBuffer,FileName);
  214. ***** ^ not supported yet
  215. ***** ^ not supported yet
  216. ***** ^ not supported yet
  217. ***** ^ not supported yet
  218. 121 IF UseNow THEN KeyID := 255 ELSE KeyID := 0; END;
  219. 122 BTRV4(opExtend,FileControl,KeyBuffer,KeyID);
  220. ***** ^ not supported yet
  221. ***** ^ undeclared identifier
  222. ***** ^ not supported yet
  223. ***** ^ not supported yet
  224. ***** ^ not supported yet
  225. 123 END Extend;
  226. ***** ^ not supported yet
  227. 124
  228. 125 (****************************************************************************)
  229. 126
  230. 127 PROCEDURE FindEQ(VAR FileControl : FileControlBlock;
  231. ***** ^ undeclared identifier
  232. 128 VAR KeyBuffer : ARRAY OF BYTE;
  233. ***** ^ undeclared identifier
  234. 129 KeyID : SHORTCARD);
  235. 130 BEGIN
  236. 131 BTRV4(opGetEQ+opKeyOnly,FileControl,KeyBuffer,KeyID);
  237. ***** ^ not supported yet
  238. ***** ^ undeclared identifier
  239. ***** ^ undeclared identifier
  240. ***** ^ not supported yet
  241. ***** ^ not supported yet
  242. ***** ^ not supported yet
  243. 132 END FindEQ;
  244. ***** ^ not supported yet
  245. 133
  246. 134 (****************************************************************************)
  247. 135
  248. 136 PROCEDURE FindGT(VAR FileControl : FileControlBlock;
  249. ***** ^ undeclared identifier
  250. 137 VAR KeyBuffer : ARRAY OF BYTE;
  251. ***** ^ undeclared identifier
  252. 138 KeyID : SHORTCARD);
  253. 139 BEGIN
  254. 140 BTRV4(opGetGT+opKeyOnly,FileControl,KeyBuffer,KeyID);
  255. ***** ^ not supported yet
  256. ***** ^ undeclared identifier
  257. ***** ^ undeclared identifier
  258. ***** ^ not supported yet
  259. ***** ^ not supported yet
  260. ***** ^ not supported yet
  261. 141 END FindGT;
  262. ***** ^ not supported yet
  263. 142
  264. 143 (****************************************************************************)
  265. 144
  266. 145 PROCEDURE FindGE(VAR FileControl : FileControlBlock;
  267. ***** ^ undeclared identifier
  268. 146 VAR KeyBuffer : ARRAY OF BYTE;
  269. ***** ^ undeclared identifier
  270. 147 KeyID : SHORTCARD);
  271. 148 BEGIN
  272. 149 BTRV4(opGetGE+opKeyOnly,FileControl,KeyBuffer,KeyID);
  273. ***** ^ not supported yet
  274. ***** ^ undeclared identifier
  275. ***** ^ undeclared identifier
  276. ***** ^ not supported yet
  277. ***** ^ not supported yet
  278. ***** ^ not supported yet
  279. 150 END FindGE;
  280. ***** ^ not supported yet
  281. 151
  282. 152 (****************************************************************************)
  283. 153
  284. 154 PROCEDURE FindLast(VAR FileControl : FileControlBlock;
  285. ***** ^ undeclared identifier
  286. 155 VAR KeyBuffer : ARRAY OF BYTE;
  287. ***** ^ undeclared identifier
  288. 156 KeyID : SHORTCARD);
  289. 157 BEGIN
  290. 158 BTRV4(opGetLast+opKeyOnly,FileControl,KeyBuffer,KeyID);
  291. ***** ^ not supported yet
  292. ***** ^ undeclared identifier
  293. ***** ^ undeclared identifier
  294. ***** ^ not supported yet
  295. ***** ^ not supported yet
  296. ***** ^ not supported yet
  297. 159 END FindLast;
  298. ***** ^ not supported yet
  299. 160
  300. 161 (****************************************************************************)
  301. 162
  302. 163 PROCEDURE FindLT(VAR FileControl : FileControlBlock;
  303. ***** ^ undeclared identifier
  304. 164 VAR KeyBuffer : ARRAY OF BYTE;
  305. ***** ^ undeclared identifier
  306. 165 KeyID : SHORTCARD);
  307. 166 BEGIN
  308. 167 BTRV4(opGetLT+opKeyOnly,FileControl,KeyBuffer,KeyID);
  309. ***** ^ not supported yet
  310. ***** ^ undeclared identifier
  311. ***** ^ undeclared identifier
  312. ***** ^ not supported yet
  313. ***** ^ not supported yet
  314. ***** ^ not supported yet
  315. 168 END FindLT;
  316. ***** ^ not supported yet
  317. 169
  318. 170 (****************************************************************************)
  319. 171
  320. 172 PROCEDURE FindLE(VAR FileControl : FileControlBlock;
  321. ***** ^ undeclared identifier
  322. 173 VAR KeyBuffer : ARRAY OF BYTE;
  323. ***** ^ undeclared identifier
  324. 174 KeyID : SHORTCARD);
  325. 175 BEGIN
  326. 176 BTRV4(opGetLE+opKeyOnly,FileControl,KeyBuffer,KeyID);
  327. ***** ^ not supported yet
  328. ***** ^ undeclared identifier
  329. ***** ^ undeclared identifier
  330. ***** ^ not supported yet
  331. ***** ^ not supported yet
  332. ***** ^ not supported yet
  333. 177 END FindLE;
  334. ***** ^ not supported yet
  335. 178
  336. 179 (****************************************************************************)
  337. 180
  338. 181 PROCEDURE FindFirst(VAR FileControl : FileControlBlock;
  339. ***** ^ undeclared identifier
  340. 182 VAR KeyBuffer : ARRAY OF BYTE;
  341. ***** ^ undeclared identifier
  342. 183 KeyID : SHORTCARD);
  343. 184 BEGIN
  344. 185 BTRV4(opGetFirst+opKeyOnly,FileControl,KeyBuffer,KeyID);
  345. ***** ^ not supported yet
  346. ***** ^ undeclared identifier
  347. ***** ^ undeclared identifier
  348. ***** ^ not supported yet
  349. ***** ^ not supported yet
  350. ***** ^ not supported yet
  351. 186 END FindFirst;
  352. ***** ^ not supported yet
  353. 187
  354. 188 (****************************************************************************)
  355. 189
  356. 190 PROCEDURE FindNext(VAR FileControl : FileControlBlock;
  357. ***** ^ undeclared identifier
  358. 191 VAR KeyBuffer : ARRAY OF BYTE;
  359. ***** ^ undeclared identifier
  360. 192 KeyID : SHORTCARD);
  361. 193 BEGIN
  362. 194 BTRV4(opGetNext+opKeyOnly,FileControl,KeyBuffer,KeyID);
  363. ***** ^ not supported yet
  364. ***** ^ undeclared identifier
  365. ***** ^ undeclared identifier
  366. ***** ^ not supported yet
  367. ***** ^ not supported yet
  368. ***** ^ not supported yet
  369. 195 END FindNext;
  370. ***** ^ not supported yet
  371. 196
  372. 197 (****************************************************************************)
  373. 198
  374. 199 PROCEDURE FindPrev(VAR FileControl : FileControlBlock;
  375. ***** ^ undeclared identifier
  376. 200 VAR KeyBuffer : ARRAY OF BYTE;
  377. ***** ^ undeclared identifier
  378. 201 KeyID : SHORTCARD);
  379. 202 BEGIN
  380. 203 BTRV4(opGetPrev+opKeyOnly,FileControl,KeyBuffer,KeyID);
  381. ***** ^ not supported yet
  382. ***** ^ undeclared identifier
  383. ***** ^ undeclared identifier
  384. ***** ^ not supported yet
  385. ***** ^ not supported yet
  386. ***** ^ not supported yet
  387. 204 END FindPrev;
  388. ***** ^ not supported yet
  389. 205
  390. 206 (****************************************************************************)
  391. 207
  392. 208 PROCEDURE GetDirect(VAR FileControl : FileControlBlock;
  393. ***** ^ undeclared identifier
  394. 209 VAR DataBuffer : ARRAY OF BYTE;
  395. ***** ^ undeclared identifier
  396. 210 VAR BufferLength : CARDINAL;
  397. 211 VAR KeyBuffer : ARRAY OF BYTE;
  398. ***** ^ undeclared identifier
  399. 212 KeyID : SHORTCARD);
  400. 213 BEGIN
  401. 214 StatusCode := BTRV(opGetDirect,FileControl,DataBuffer,BufferLength,KeyBuffer,KeyID);
  402. ***** ^ undeclared identifier
  403. ***** ^ undeclared identifier
  404. ***** ^ undeclared identifier
  405. ***** ^ not supported yet
  406. ***** ^ not supported yet
  407. ***** ^ not supported yet
  408. ***** ^ not supported yet
  409. 215 END GetDirect;
  410. ***** ^ not supported yet
  411. 216
  412. 217 (****************************************************************************)
  413. 218
  414. 219 PROCEDURE GetDir(Drive : SHORTCARD; VAR DirName : ARRAY OF CHAR);
  415. ***** ^ not supported yet
  416. 220 VAR
  417. 221 NullControl : FileControlBlock;
  418. ***** ^ undeclared identifier
  419. 222 BEGIN
  420. 223 BTRV4(opGetDir,NullControl,DirName,Drive);
  421. ***** ^ not supported yet
  422. ***** ^ undeclared identifier
  423. ***** ^ not supported yet
  424. ***** ^ not supported yet
  425. ***** ^ not supported yet
  426. 224 END GetDir;
  427. ***** ^ not supported yet
  428. 225
  429. 226 (****************************************************************************)
  430. 227
  431. 228 PROCEDURE GetEQ(VAR FileControl : FileControlBlock;
  432. ***** ^ undeclared identifier
  433. 229 VAR DataBuffer : ARRAY OF BYTE;
  434. ***** ^ undeclared identifier
  435. 230 VAR BufferLength : CARDINAL;
  436. 231 VAR KeyBuffer : ARRAY OF BYTE;
  437. ***** ^ undeclared identifier
  438. 232 KeyID : SHORTCARD);
  439. 233 BEGIN
  440. 234 StatusCode := BTRV(opGetEQ,FileControl,DataBuffer,BufferLength,KeyBuffer,KeyID);
  441. ***** ^ undeclared identifier
  442. ***** ^ undeclared identifier
  443. ***** ^ undeclared identifier
  444. ***** ^ not supported yet
  445. ***** ^ not supported yet
  446. ***** ^ not supported yet
  447. ***** ^ not supported yet
  448. 235 END GetEQ;
  449. ***** ^ not supported yet
  450. 236
  451. 237 (****************************************************************************)
  452. 238
  453. 239 PROCEDURE GetGT(VAR FileControl : FileControlBlock;
  454. ***** ^ undeclared identifier
  455. 240 VAR DataBuffer : ARRAY OF BYTE;
  456. ***** ^ undeclared identifier
  457. 241 VAR BufferLength : CARDINAL;
  458. 242 VAR KeyBuffer : ARRAY OF BYTE;
  459. ***** ^ undeclared identifier
  460. 243 KeyID : SHORTCARD);
  461. 244 BEGIN
  462. 245 StatusCode := BTRV(opGetGT,FileControl,DataBuffer,BufferLength,KeyBuffer,KeyID);
  463. ***** ^ undeclared identifier
  464. ***** ^ undeclared identifier
  465. ***** ^ undeclared identifier
  466. ***** ^ not supported yet
  467. ***** ^ not supported yet
  468. ***** ^ not supported yet
  469. ***** ^ not supported yet
  470. 246 END GetGT;
  471. ***** ^ not supported yet
  472. 247
  473. 248 (****************************************************************************)
  474. 249
  475. 250 PROCEDURE GetGE(VAR FileControl : FileControlBlock;
  476. ***** ^ undeclared identifier
  477. 251 VAR DataBuffer : ARRAY OF BYTE;
  478. ***** ^ undeclared identifier
  479. 252 VAR BufferLength : CARDINAL;
  480. 253 VAR KeyBuffer : ARRAY OF BYTE;
  481. ***** ^ undeclared identifier
  482. 254 KeyID : SHORTCARD);
  483. 255 BEGIN
  484. 256 StatusCode := BTRV(opGetGE,FileControl,DataBuffer,BufferLength,KeyBuffer,KeyID);
  485. ***** ^ undeclared identifier
  486. ***** ^ undeclared identifier
  487. ***** ^ undeclared identifier
  488. ***** ^ not supported yet
  489. ***** ^ not supported yet
  490. ***** ^ not supported yet
  491. ***** ^ not supported yet
  492. 257 END GetGE;
  493. ***** ^ not supported yet
  494. 258
  495. 259 (****************************************************************************)
  496. 260
  497. 261 PROCEDURE GetLast(VAR FileControl : FileControlBlock;
  498. ***** ^ undeclared identifier
  499. 262 VAR DataBuffer : ARRAY OF BYTE;
  500. ***** ^ undeclared identifier
  501. 263 VAR BufferLength : CARDINAL;
  502. 264 VAR KeyBuffer : ARRAY OF BYTE;
  503. ***** ^ undeclared identifier
  504. 265 KeyID : SHORTCARD);
  505. 266 BEGIN
  506. 267 StatusCode := BTRV(opGetLast,FileControl,DataBuffer,BufferLength,KeyBuffer,KeyID);
  507. ***** ^ undeclared identifier
  508. ***** ^ undeclared identifier
  509. ***** ^ undeclared identifier
  510. ***** ^ not supported yet
  511. ***** ^ not supported yet
  512. ***** ^ not supported yet
  513. ***** ^ not supported yet
  514. 268 END GetLast;
  515. ***** ^ not supported yet
  516. 269
  517. 270 (****************************************************************************)
  518. 271
  519. 272 PROCEDURE GetLT(VAR FileControl : FileControlBlock;
  520. ***** ^ undeclared identifier
  521. 273 VAR DataBuffer : ARRAY OF BYTE;
  522. ***** ^ undeclared identifier
  523. 274 VAR BufferLength : CARDINAL;
  524. 275 VAR KeyBuffer : ARRAY OF BYTE;
  525. ***** ^ undeclared identifier
  526. 276 KeyID : SHORTCARD);
  527. 277 BEGIN
  528. 278 StatusCode := BTRV(opGetLT,FileControl,DataBuffer,BufferLength,KeyBuffer,KeyID);
  529. ***** ^ undeclared identifier
  530. ***** ^ undeclared identifier
  531. ***** ^ undeclared identifier
  532. ***** ^ not supported yet
  533. ***** ^ not supported yet
  534. ***** ^ not supported yet
  535. ***** ^ not supported yet
  536. 279 END GetLT;
  537. ***** ^ not supported yet
  538. 280
  539. 281 (****************************************************************************)
  540. 282
  541. 283 PROCEDURE GetLE(VAR FileControl : FileControlBlock;
  542. ***** ^ undeclared identifier
  543. 284 VAR DataBuffer : ARRAY OF BYTE;
  544. ***** ^ undeclared identifier
  545. 285 VAR BufferLength : CARDINAL;
  546. 286 VAR KeyBuffer : ARRAY OF BYTE;
  547. ***** ^ undeclared identifier
  548. 287 KeyID : SHORTCARD);
  549. 288 BEGIN
  550. 289 StatusCode := BTRV(opGetLE,FileControl,DataBuffer,BufferLength,KeyBuffer,KeyID);
  551. ***** ^ undeclared identifier
  552. ***** ^ undeclared identifier
  553. ***** ^ undeclared identifier
  554. ***** ^ not supported yet
  555. ***** ^ not supported yet
  556. ***** ^ not supported yet
  557. ***** ^ not supported yet
  558. 290 END GetLE;
  559. ***** ^ not supported yet
  560. 291
  561. 292 (****************************************************************************)
  562. 293
  563. 294 PROCEDURE GetFirst(VAR FileControl : FileControlBlock;
  564. ***** ^ undeclared identifier
  565. 295 VAR DataBuffer : ARRAY OF BYTE;
  566. ***** ^ undeclared identifier
  567. 296 VAR BufferLength : CARDINAL;
  568. 297 VAR KeyBuffer : ARRAY OF BYTE;
  569. ***** ^ undeclared identifier
  570. 298 KeyID : SHORTCARD);
  571. 299 BEGIN
  572. 300 StatusCode := BTRV(opGetFirst,FileControl,DataBuffer,BufferLength,KeyBuffer,KeyID);
  573. ***** ^ undeclared identifier
  574. ***** ^ undeclared identifier
  575. ***** ^ undeclared identifier
  576. ***** ^ not supported yet
  577. ***** ^ not supported yet
  578. ***** ^ not supported yet
  579. ***** ^ not supported yet
  580. 301 END GetFirst;
  581. ***** ^ not supported yet
  582. 302
  583. 303 (****************************************************************************)
  584. 304
  585. 305 PROCEDURE GetNext(VAR FileControl : FileControlBlock;
  586. ***** ^ undeclared identifier
  587. 306 VAR DataBuffer : ARRAY OF BYTE;
  588. ***** ^ undeclared identifier
  589. 307 VAR BufferLength : CARDINAL;
  590. 308 VAR KeyBuffer : ARRAY OF BYTE;
  591. ***** ^ undeclared identifier
  592. 309 KeyID : SHORTCARD);
  593. 310 BEGIN
  594. 311 StatusCode := BTRV(opGetNext,FileControl,DataBuffer,BufferLength,KeyBuffer,KeyID);
  595. ***** ^ undeclared identifier
  596. ***** ^ undeclared identifier
  597. ***** ^ undeclared identifier
  598. ***** ^ not supported yet
  599. ***** ^ not supported yet
  600. ***** ^ not supported yet
  601. ***** ^ not supported yet
  602. 312 END GetNext;
  603. ***** ^ not supported yet
  604. 313
  605. 314 (****************************************************************************)
  606. 315
  607. 316 PROCEDURE GetPosition(VAR FileControl :FileControlBlock;
  608. ***** ^ undeclared identifier
  609. 317 VAR pos : ARRAY OF BYTE);
  610. ***** ^ undeclared identifier
  611. 318 VAR BufferSize : CARDINAL;
  612. 319 NullKey : KeyType;
  613. ***** ^ undeclared identifier
  614. 320 BEGIN
  615. 321 BufferSize := SIZE(pos);
  616. ***** ^ undeclared identifier
  617. ***** ^ not supported yet
  618. 322 StatusCode := BTRV(opGetPos,FileControl,pos,BufferSize,NullKey,0);
  619. ***** ^ undeclared identifier
  620. ***** ^ undeclared identifier
  621. ***** ^ undeclared identifier
  622. ***** ^ not supported yet
  623. ***** ^ not supported yet
  624. ***** ^ not supported yet
  625. ***** ^ not supported yet
  626. 323 END GetPosition;
  627. ***** ^ not supported yet
  628. 324
  629. 325 (****************************************************************************)
  630. 326
  631. 327 PROCEDURE GetPrev(VAR FileControl : FileControlBlock;
  632. ***** ^ undeclared identifier
  633. 328 VAR DataBuffer : ARRAY OF BYTE;
  634. ***** ^ undeclared identifier
  635. 329 VAR BufferLength : CARDINAL;
  636. 330 VAR KeyBuffer : ARRAY OF BYTE;
  637. ***** ^ undeclared identifier
  638. 331 KeyID : SHORTCARD);
  639. 332 BEGIN
  640. 333 StatusCode := BTRV(opGetPrev,FileControl,DataBuffer,BufferLength,KeyBuffer,KeyID);
  641. ***** ^ undeclared identifier
  642. ***** ^ undeclared identifier
  643. ***** ^ undeclared identifier
  644. ***** ^ not supported yet
  645. ***** ^ not supported yet
  646. ***** ^ not supported yet
  647. ***** ^ not supported yet
  648. 334 END GetPrev;
  649. ***** ^ not supported yet
  650. 335
  651. 336 (****************************************************************************)
  652. 337
  653. 338 PROCEDURE Insert(VAR FileControl : FileControlBlock;
  654. ***** ^ undeclared identifier
  655. 339 VAR DataBuffer : ARRAY OF BYTE;
  656. ***** ^ undeclared identifier
  657. 340 VAR BufferLength : CARDINAL;
  658. 341 VAR KeyBuffer : ARRAY OF BYTE;
  659. ***** ^ undeclared identifier
  660. 342 KeyID : SHORTCARD);
  661. 343 BEGIN
  662. 344 StatusCode := BTRV(opInsert,FileControl,DataBuffer,BufferLength,KeyBuffer,KeyID);
  663. ***** ^ undeclared identifier
  664. ***** ^ undeclared identifier
  665. ***** ^ undeclared identifier
  666. ***** ^ not supported yet
  667. ***** ^ not supported yet
  668. ***** ^ not supported yet
  669. ***** ^ not supported yet
  670. 345 END Insert;
  671. ***** ^ not supported yet
  672. 346
  673. 347 (****************************************************************************)
  674. 348
  675. 349 PROCEDURE Open(VAR FileControl : FileControlBlock;
  676. ***** ^ undeclared identifier
  677. 350 FileName,OwnerName : ARRAY OF CHAR;
  678. ***** ^ not supported yet
  679. 351 OpenMode : SHORTCARD);
  680. 352 VAR
  681. 353 DataBuffer : ARRAY [0..7] OF CHAR;
  682. ***** ^ not supported yet
  683. ***** ^ not supported yet
  684. 354 KeyBuffer : KeyType;
  685. ***** ^ undeclared identifier
  686. 355 BufferLength : CARDINAL;
  687. 356
  688. 357 BEGIN
  689. 358 Str.Copy(KeyBuffer,FileName);
  690. ***** ^ not supported yet
  691. ***** ^ not supported yet
  692. ***** ^ not supported yet
  693. ***** ^ not supported yet
  694. 359 Str.Copy(DataBuffer,OwnerName);
  695. ***** ^ not supported yet
  696. ***** ^ not supported yet
  697. ***** ^ not supported yet
  698. ***** ^ not supported yet
  699. 360 DataBuffer[7] := 0C;
  700. ***** ^ not supported yet
  701. ***** ^ not supported yet
  702. 361 BufferLength := Str.Length(DataBuffer) + 1;
  703. ***** ^ not supported yet
  704. ***** ^ not supported yet
  705. ***** ^ not supported yet
  706. 362 StatusCode := BTRV(opOpen,FileControl,DataBuffer,BufferLength,
  707. ***** ^ undeclared identifier
  708. ***** ^ undeclared identifier
  709. ***** ^ undeclared identifier
  710. ***** ^ not supported yet
  711. ***** ^ not supported yet
  712. 363 KeyBuffer,OpenMode);
  713. ***** ^ not supported yet
  714. ***** ^ not supported yet
  715. 364 END Open;
  716. ***** ^ not supported yet
  717. 365
  718. 366 (****************************************************************************)
  719. 367
  720. 368 PROCEDURE Reset;
  721. 369 BEGIN
  722. 370 BTRV1(opReset);
  723. ***** ^ not supported yet
  724. ***** ^ undeclared identifier
  725. 371 END Reset;
  726. ***** ^ not supported yet
  727. 372
  728. 373 (****************************************************************************)
  729. 374
  730. 375 PROCEDURE SetDirectory(DirName : ARRAY OF CHAR);
  731. ***** ^ not supported yet
  732. 376 VAR
  733. 377 KeyBuffer : KeyType;
  734. ***** ^ undeclared identifier
  735. 378 NullControl : FileControlBlock;
  736. ***** ^ undeclared identifier
  737. 379 BEGIN
  738. 380 Str.Copy(KeyBuffer,DirName);
  739. ***** ^ not supported yet
  740. ***** ^ not supported yet
  741. ***** ^ not supported yet
  742. ***** ^ not supported yet
  743. 381 BTRV4(opSetDir,NullControl,KeyBuffer,0);
  744. ***** ^ not supported yet
  745. ***** ^ undeclared identifier
  746. ***** ^ not supported yet
  747. ***** ^ not supported yet
  748. ***** ^ not supported yet
  749. 382 END SetDirectory;
  750. ***** ^ not supported yet
  751. 383
  752. 384 (****************************************************************************)
  753. 385
  754. 386 PROCEDURE SetOwner(VAR FileControl : FileControlBlock;
  755. ***** ^ undeclared identifier
  756. 387 OwnerName : ARRAY OF CHAR;
  757. ***** ^ not supported yet
  758. 388 AccessMode : SHORTCARD);
  759. 389 VAR
  760. 390 DataBuffer : OwnerType;
  761. ***** ^ undeclared identifier
  762. 391 KeyBuffer : KeyType;
  763. ***** ^ undeclared identifier
  764. 392 BufferLength : CARDINAL;
  765. 393
  766. 394 BEGIN
  767. 395 Str.Copy(DataBuffer,OwnerName);
  768. ***** ^ not supported yet
  769. ***** ^ not supported yet
  770. ***** ^ not supported yet
  771. ***** ^ not supported yet
  772. 396 Str.Copy(KeyBuffer,OwnerName);
  773. ***** ^ not supported yet
  774. ***** ^ not supported yet
  775. ***** ^ not supported yet
  776. ***** ^ not supported yet
  777. 397 DataBuffer[7] := 0C;
  778. ***** ^ not supported yet
  779. ***** ^ not supported yet
  780. 398 BufferLength := Str.Length(DataBuffer) + 1;
  781. ***** ^ not supported yet
  782. ***** ^ not supported yet
  783. ***** ^ not supported yet
  784. 399 StatusCode := BTRV(opSetOwner,FileControl,DataBuffer,
  785. ***** ^ undeclared identifier
  786. ***** ^ undeclared identifier
  787. ***** ^ undeclared identifier
  788. ***** ^ not supported yet
  789. ***** ^ not supported yet
  790. 400 BufferLength,KeyBuffer,AccessMode);
  791. ***** ^ not supported yet
  792. ***** ^ not supported yet
  793. 401 END SetOwner;
  794. ***** ^ not supported yet
  795. 402
  796. 403 (****************************************************************************)
  797. 404
  798. 405 PROCEDURE Status(VAR FileControl : FileControlBlock;
  799. ***** ^ undeclared identifier
  800. 406 VAR DataBuffer : ARRAY OF BYTE;
  801. ***** ^ undeclared identifier
  802. 407 VAR BufferLength : CARDINAL;
  803. 408 VAR KeyBuffer : ARRAY OF BYTE;
  804. ***** ^ undeclared identifier
  805. 409 KeyID : SHORTCARD);
  806. 410 BEGIN
  807. 411 StatusCode := BTRV(opStat,FileControl,DataBuffer,BufferLength,KeyBuffer,0);
  808. ***** ^ undeclared identifier
  809. ***** ^ undeclared identifier
  810. ***** ^ undeclared identifier
  811. ***** ^ not supported yet
  812. ***** ^ not supported yet
  813. ***** ^ not supported yet
  814. ***** ^ not supported yet
  815. 412 END Status;
  816. ***** ^ not supported yet
  817. 413
  818. 414 (****************************************************************************)
  819. 415
  820. 416 PROCEDURE StepDirect(VAR FileControl : FileControlBlock;
  821. ***** ^ undeclared identifier
  822. 417 VAR DataBuffer : ARRAY OF BYTE;
  823. ***** ^ undeclared identifier
  824. 418 VAR BufferLength : CARDINAL);
  825. 419 VAR
  826. 420 NullKey : KeyType;
  827. ***** ^ undeclared identifier
  828. 421 BEGIN
  829. 422 StatusCode := BTRV(opStepDirect,FileControl,DataBuffer,
  830. ***** ^ undeclared identifier
  831. ***** ^ undeclared identifier
  832. ***** ^ undeclared identifier
  833. ***** ^ not supported yet
  834. ***** ^ not supported yet
  835. 423 BufferLength,NullKey,0);
  836. ***** ^ not supported yet
  837. ***** ^ not supported yet
  838. 424 END StepDirect;
  839. ***** ^ not supported yet
  840. 425
  841. 426 (****************************************************************************)
  842. 427
  843. 428 PROCEDURE Stop;
  844. 429 BEGIN
  845. 430 BTRV1(opStop);
  846. ***** ^ not supported yet
  847. ***** ^ undeclared identifier
  848. 431 END Stop;
  849. ***** ^ not supported yet
  850. 432
  851. 433 (****************************************************************************)
  852. 434
  853. 435 PROCEDURE Update(VAR FileControl : FileControlBlock;
  854. ***** ^ undeclared identifier
  855. 436 VAR DataBuffer : ARRAY OF BYTE;
  856. ***** ^ undeclared identifier
  857. 437 VAR BufferLength : CARDINAL;
  858. 438 VAR KeyBuffer : ARRAY OF BYTE;
  859. ***** ^ undeclared identifier
  860. 439 KeyID : SHORTCARD);
  861. 440 BEGIN
  862. 441 StatusCode := BTRV(opUpdate,FileControl,DataBuffer,BufferLength,KeyBuffer,0);
  863. ***** ^ undeclared identifier
  864. ***** ^ undeclared identifier
  865. ***** ^ undeclared identifier
  866. ***** ^ not supported yet
  867. ***** ^ not supported yet
  868. ***** ^ not supported yet
  869. ***** ^ not supported yet
  870. 442 END Update;
  871. ***** ^ not supported yet
  872. 443
  873. 444 (****************************************************************************)
  874. 445
  875. 446 PROCEDURE Version(VAR DataBuffer : ARRAY OF BYTE );
  876. ***** ^ undeclared identifier
  877. 447 VAR
  878. 448 NullControl : FileControlBlock;
  879. ***** ^ undeclared identifier
  880. 449 BufferSize : CARDINAL;
  881. 450 NullKey : KeyType;
  882. ***** ^ undeclared identifier
  883. 451 BEGIN
  884. 452 BufferSize := SIZE(DataBuffer);
  885. ***** ^ undeclared identifier
  886. ***** ^ not supported yet
  887. 453 StatusCode := BTRV(opVersion,NullControl,DataBuffer,BufferSize,NullKey,0);
  888. ***** ^ undeclared identifier
  889. ***** ^ undeclared identifier
  890. ***** ^ undeclared identifier
  891. ***** ^ not supported yet
  892. ***** ^ not supported yet
  893. ***** ^ not supported yet
  894. ***** ^ not supported yet
  895. 454 END Version;
  896. ***** ^ not supported yet
  897. 455
  898. 456 (****************************************************************************)
  899. 457 (* Low Level Btrieve Call *)
  900. 458 (****************************************************************************)
  901. 459
  902. 460 VAR
  903. 461 ProcId: CARDINAL; (* initialize to no process id *)
  904. 462 Multi: BOOLEAN; (* set to true if BMulti is loaded *)
  905. 463 VSet: BOOLEAN; (* set to true if we have checked for BMulti *)
  906. 464
  907. 465 (*%T _XTD*)
  908. 466
  909. 467 TYPE
  910. 468 rADDRESS = LONGCARD;
  911. ***** ^ undeclared identifier
  912. 469
  913. 470 PROCEDURE RealAlloc(VAR handle : CARDINAL; size : CARDINAL; VAR src : ARRAY OF BYTE):rADDRESS;
  914. ***** ^ undeclared identifier
  915. 471 (* Needed to copy to Real Memory (i.e. addressable from real mode) *)
  916. 472 VAR csize : CARDINAL;
  917. 473 BEGIN
  918. 474 IF size=0 THEN handle:=0; RETURN 0 END;
  919. ***** ^ bad RETURN
  920. 475 handle := TSXLIB.ALLOCLOWSEG(size);
  921. ***** ^ not supported yet
  922. ***** ^ not supported yet
  923. ***** ^ not supported yet
  924. 476 IF Seg(src)<>0 THEN (* copy in *)
  925. ***** ^ undeclared identifier
  926. ***** ^ not supported yet
  927. 477 (* protect against buffers that are too short *)
  928. 478 csize := TSXLIB.GETSEGLIMIT(Seg(src));
  929. ***** ^ not supported yet
  930. ***** ^ not supported yet
  931. ***** ^ undeclared identifier
  932. ***** ^ not supported yet
  933. 479 IF (csize>=Ofs(src)) THEN
  934. ***** ^ undeclared identifier
  935. ***** ^ not supported yet
  936. 480 DEC(csize,Ofs(src)-1);
  937. ***** ^ undeclared identifier
  938. ***** ^ undeclared identifier
  939. ***** ^ not supported yet
  940. ***** ^ not supported yet
  941. 481 IF (csize=0)OR(csize>size) THEN csize := size END;
  942. 482 Lib.FastMove(ADR(src),[handle:0],csize);
  943. ***** ^ not supported yet
  944. ***** ^ not supported yet
  945. ***** ^ undeclared identifier
  946. ***** ^ not supported yet
  947. ***** ^ not supported yet
  948. ***** ^ not supported yet
  949. 483 END;
  950. 484 ELSE
  951. 485 Lib.Fill([handle:0],size,0);
  952. ***** ^ not supported yet
  953. ***** ^ not supported yet
  954. ***** ^ not supported yet
  955. ***** ^ not supported yet
  956. 486 END;
  957. 487 RETURN TSXLIB.MAKEREALADDR(handle,0);
  958. ***** ^ not supported yet
  959. ***** ^ not supported yet
  960. ***** ^ not supported yet
  961. 488 END RealAlloc;
  962. ***** ^ not supported yet
  963. 489
  964. 490 PROCEDURE RealFree(handle :CARDINAL; size : CARDINAL; VAR dst : ARRAY OF BYTE);
  965. ***** ^ undeclared identifier
  966. 491 VAR csize : CARDINAL;
  967. 492 BEGIN
  968. 493 IF handle=0 THEN RETURN END;
  969. 494 IF Seg(dst)<>0 THEN (* copy out *)
  970. ***** ^ undeclared identifier
  971. ***** ^ not supported yet
  972. 495 (* protect against buffers that are too short *)
  973. 496 csize := TSXLIB.GETSEGLIMIT(Seg(dst));
  974. ***** ^ not supported yet
  975. ***** ^ not supported yet
  976. ***** ^ undeclared identifier
  977. ***** ^ not supported yet
  978. 497 IF (csize>=Ofs(dst)) THEN
  979. ***** ^ undeclared identifier
  980. ***** ^ not supported yet
  981. 498 DEC(csize,Ofs(dst)-1);
  982. ***** ^ undeclared identifier
  983. ***** ^ undeclared identifier
  984. ***** ^ not supported yet
  985. ***** ^ not supported yet
  986. 499 IF (csize=0)OR(csize>size) THEN csize := size END;
  987. 500 Lib.FastMove([handle:0],ADR(dst),csize);
  988. ***** ^ not supported yet
  989. ***** ^ not supported yet
  990. ***** ^ not supported yet
  991. ***** ^ undeclared identifier
  992. ***** ^ not supported yet
  993. ***** ^ not supported yet
  994. 501 END;
  995. 502 END;
  996. 503 TSXLIB.FREESEG(handle);
  997. ***** ^ not supported yet
  998. ***** ^ not supported yet
  999. ***** ^ not supported yet
  1000. 504 END RealFree;
  1001. ***** ^ not supported yet
  1002. 505
  1003. 506 PROCEDURE BTRV ( op: CARDINAL; (* Operation *)
  1004. 507 VAR pos: FileControlBlock; (* Position Block *)
  1005. ***** ^ undeclared identifier
  1006. 508 VAR data: ARRAY OF BYTE; (* Data Buffer *)
  1007. ***** ^ undeclared identifier
  1008. 509 VAR datalen: CARDINAL; (* Data Length *)
  1009. 510 VAR kbuf: ARRAY OF BYTE; (* Key Buffer *)
  1010. ***** ^ undeclared identifier
  1011. 511 key: SHORTCARD (* Key Number *)
  1012. 512
  1013. 513 ): StatusCodes ; (* Btrieve error code *)
  1014. ***** ^ undeclared identifier
  1015. 514
  1016. 515 CONST
  1017. 516 VarID = 06176H; (* id for variable length records - 'va'*)
  1018. 517 BtrInt = 07BH;
  1019. 518 Btr2Int = 02FH;
  1020. 519 BtrOffset = 00033H;
  1021. 520 MultiFunction = 0AB00H;
  1022. 521
  1023. 522 TYPE
  1024. 523 rBtrParms = RECORD
  1025. 524 UserBufAddr : rADDRESS; (* data buffer address *)
  1026. 525 UserBufLen : CARDINAL; (* data buffer length *)
  1027. 526 UserCurAddr : rADDRESS; (* currency block address *)
  1028. 527 UserFCBAddr : rADDRESS; (* file control block address *)
  1029. 528 UserFunction : CARDINAL; (* Btrieve operation *)
  1030. 529 UserKeyAddr : rADDRESS; (* key buffer address *)
  1031. 530 UserKeyLength: SHORTCARD; (* key buffer length *)
  1032. 531 UserKeyNumber: SHORTCARD; (* key number *)
  1033. 532 UserStatAddr : rADDRESS; (* return status address *)
  1034. 533 xFaceID : CARDINAL; (* language interface id *)
  1035. 534 END;
  1036. ***** ^ not supported yet
  1037. 535 VAR
  1038. 536 Stat: CARDINAL; (* Btrieve status code *)
  1039. 537 Params: rBtrParms; (* Btrieve parameter block *)
  1040. ***** ^ not supported yet
  1041. 538 r: SYSTEM.Registers; (* register structure used on interrrupt call *)
  1042. ***** ^ not supported yet
  1043. 539 DataSel,PosSel,KeySel,StatSel,ParamSel : CARDINAL;
  1044. 540 rParams : rADDRESS;
  1045. 541 BEGIN
  1046. 542 Lib.Fill(ADR(r),SIZE(r),0);
  1047. ***** ^ not supported yet
  1048. ***** ^ not supported yet
  1049. ***** ^ undeclared identifier
  1050. ***** ^ not supported yet
  1051. ***** ^ undeclared identifier
  1052. ***** ^ not supported yet
  1053. ***** ^ not supported yet
  1054. 543 r.AX:= 03500H + BtrInt;
  1055. ***** ^ not supported yet
  1056. ***** ^ not supported yet
  1057. 544 TSXLIB.REALINTR(ADR(r), 21H); (* NB using Lib.Intr will return
  1058. ***** ^ not supported yet
  1059. ***** ^ not supported yet
  1060. ***** ^ undeclared identifier
  1061. ***** ^ not supported yet
  1062. ***** ^ not supported yet
  1063. 545 prot mode address *)
  1064. 546 IF r.BX # BtrOffset THEN (* make sure Btrieve is installed *)
  1065. ***** ^ not supported yet
  1066. ***** ^ not supported yet
  1067. 547 RETURN BtrieveAbsent
  1068. ***** ^ undeclared identifier
  1069. 548 END;
  1070. 549 IF NOT VSet THEN (* if we haven't checked for Multi-User version *)
  1071. 550 r.AX:= 03000H;
  1072. ***** ^ not supported yet
  1073. ***** ^ not supported yet
  1074. 551 Lib.Intr(r, 021H);
  1075. ***** ^ not supported yet
  1076. ***** ^ not supported yet
  1077. ***** ^ not supported yet
  1078. ***** ^ not supported yet
  1079. 552 IF r.AL >= 3 THEN (* DOS version >= 3.0 *)
  1080. ***** ^ not supported yet
  1081. ***** ^ not supported yet
  1082. 553 VSet:= TRUE;
  1083. 554 r.AX:= MultiFunction;
  1084. ***** ^ not supported yet
  1085. ***** ^ not supported yet
  1086. 555 Lib.Intr(r, Btr2Int);
  1087. ***** ^ not supported yet
  1088. ***** ^ not supported yet
  1089. ***** ^ not supported yet
  1090. ***** ^ not supported yet
  1091. 556 Multi:= r.AL = 4DH (* ORD('M') *)
  1092. ***** ^ not supported yet
  1093. ***** ^ not supported yet
  1094. 557 ELSE
  1095. 558 Multi:= FALSE
  1096. 559 END
  1097. 560 END; (* make normal btrieve call *)
  1098. 561 IF datalen > HIGH(data)+1 THEN datalen:= HIGH(data)+1 END;
  1099. ***** ^ undeclared identifier
  1100. ***** ^ not supported yet
  1101. ***** ^ undeclared identifier
  1102. ***** ^ not supported yet
  1103. 562 WITH Params DO
  1104. ***** ^ not supported yet
  1105. 563 UserBufAddr := RealAlloc(DataSel,datalen,data); (* set data buffer address *)
  1106. ***** ^ not supported yet
  1107. ***** ^ not supported yet
  1108. ***** ^ not supported yet
  1109. 564 UserBufLen := datalen; (* set length *)
  1110. ***** ^ not supported yet
  1111. ***** ^ incompatible assignment
  1112. 565 UserFCBAddr := RealAlloc(PosSel,38+90,pos); (* set FCB address*)
  1113. ***** ^ not supported yet
  1114. ***** ^ not supported yet
  1115. ***** ^ not supported yet
  1116. 566 UserCurAddr := UserFCBAddr+38;
  1117. ***** ^ not supported yet
  1118. ***** ^ not supported yet
  1119. 567 UserFunction := op; (* set Btrieve operation code *)
  1120. ***** ^ not supported yet
  1121. ***** ^ incompatible assignment
  1122. 568 UserKeyAddr := RealAlloc(KeySel,255,kbuf); (* set key buffer address *)
  1123. ***** ^ not supported yet
  1124. ***** ^ not supported yet
  1125. ***** ^ not supported yet
  1126. 569 UserKeyLength := 255;
  1127. ***** ^ not supported yet
  1128. ***** ^ incompatible assignment
  1129. 570 UserKeyNumber := key; (* set key number *)
  1130. ***** ^ not supported yet
  1131. ***** ^ incompatible assignment
  1132. 571 UserStatAddr := RealAlloc(StatSel,SIZE(Stat),Stat);;
  1133. ***** ^ not supported yet
  1134. ***** ^ not supported yet
  1135. ***** ^ undeclared identifier
  1136. ***** ^ not supported yet
  1137. ***** ^ not supported yet
  1138. 572 xFaceID := VarID; (* set language id *)
  1139. ***** ^ not supported yet
  1140. ***** ^ incompatible assignment
  1141. 573 END;
  1142. ***** ^ not supported yet
  1143. 574 rParams := RealAlloc(ParamSel,SIZE(Params),Params);
  1144. ***** ^ not supported yet
  1145. ***** ^ not supported yet
  1146. ***** ^ undeclared identifier
  1147. ***** ^ not supported yet
  1148. ***** ^ not supported yet
  1149. 575 r.DX := CARDINAL(rParams);
  1150. ***** ^ not supported yet
  1151. ***** ^ not supported yet
  1152. ***** ^ not supported yet
  1153. 576 r.DS := CARDINAL(rParams>>16);
  1154. ***** ^ not supported yet
  1155. ***** ^ not supported yet
  1156. ***** ^ not supported yet
  1157. ***** ^ arithmetic operand must be numeric
  1158. 577 IF NOT Multi THEN (* MultiUser version not installed *)
  1159. 578 TSXLIB.REALINTR(ADR(r), BtrInt); (* passing real addresses *)
  1160. ***** ^ not supported yet
  1161. ***** ^ not supported yet
  1162. ***** ^ undeclared identifier
  1163. ***** ^ not supported yet
  1164. ***** ^ not supported yet
  1165. 579 ELSE
  1166. 580 LOOP
  1167. 581 r.BX:= ProcId;
  1168. ***** ^ not supported yet
  1169. ***** ^ not supported yet
  1170. 582 IF r.BX # 0 THEN r.AX:= 2 ELSE r.AX:= 1 END;
  1171. ***** ^ not supported yet
  1172. ***** ^ not supported yet
  1173. ***** ^ not supported yet
  1174. ***** ^ not supported yet
  1175. ***** ^ not supported yet
  1176. ***** ^ not supported yet
  1177. 583 INC(r.AX, MultiFunction);
  1178. ***** ^ undeclared identifier
  1179. ***** ^ not supported yet
  1180. ***** ^ not supported yet
  1181. ***** ^ not supported yet
  1182. 584 Lib.Intr(r, Btr2Int);
  1183. ***** ^ not supported yet
  1184. ***** ^ not supported yet
  1185. ***** ^ not supported yet
  1186. ***** ^ not supported yet
  1187. 585 IF r.AL = 0 THEN EXIT END;
  1188. ***** ^ not supported yet
  1189. ***** ^ not supported yet
  1190. 586 r.AX:= 200H;
  1191. ***** ^ not supported yet
  1192. ***** ^ not supported yet
  1193. 587 TSXLIB.REALINTR(ADR(r), 07FH); (* passing real addresses *)
  1194. ***** ^ not supported yet
  1195. ***** ^ not supported yet
  1196. ***** ^ undeclared identifier
  1197. ***** ^ not supported yet
  1198. ***** ^ not supported yet
  1199. 588 END;
  1200. 589 IF ProcId = 0 THEN ProcId:= r.BX END
  1201. ***** ^ not supported yet
  1202. ***** ^ not supported yet
  1203. 590 END;
  1204. 591 RealFree(ParamSel,SIZE(Params),Params);
  1205. ***** ^ not supported yet
  1206. ***** ^ undeclared identifier
  1207. ***** ^ not supported yet
  1208. ***** ^ not supported yet
  1209. 592 RealFree(DataSel,datalen,data);
  1210. ***** ^ not supported yet
  1211. ***** ^ not supported yet
  1212. 593 RealFree(PosSel,38,pos);
  1213. ***** ^ not supported yet
  1214. ***** ^ not supported yet
  1215. 594 RealFree(KeySel,255,kbuf);
  1216. ***** ^ not supported yet
  1217. ***** ^ not supported yet
  1218. 595 RealFree(StatSel,SIZE(Stat),Stat);
  1219. ***** ^ not supported yet
  1220. ***** ^ undeclared identifier
  1221. ***** ^ not supported yet
  1222. ***** ^ not supported yet
  1223. 596 datalen:= Params.UserBufLen;
  1224. ***** ^ not supported yet
  1225. ***** ^ not supported yet
  1226. 597 RETURN StatusCodes(Stat);
  1227. ***** ^ undeclared identifier
  1228. ***** ^ not supported yet
  1229. 598 END BTRV;
  1230. ***** ^ not supported yet
  1231. 599
  1232. 600 (*%E*)
  1233. 601
  1234. 602 (*%F _XTD*)
  1235. 603
  1236. 604
  1237. 605 PROCEDURE BTRV ( op: CARDINAL; (* Operation *)
  1238. 606 VAR pos: FileControlBlock; (* Position Block *)
  1239. 607 VAR data: ARRAY OF BYTE; (* Data Buffer *)
  1240. 608 VAR datalen: CARDINAL; (* Data Length *)
  1241. 609 VAR kbuf: ARRAY OF BYTE; (* Key Buffer *)
  1242. 610 key: SHORTCARD (* Key Number *)
  1243. 611 ): StatusCodes ; (* Btrieve error code *)
  1244. 612 CONST
  1245. 613 VarID = 06176H; (* id for variable length records - 'va'*)
  1246. 614 BtrInt = 07BH;
  1247. 615 Btr2Int = 02FH;
  1248. 616 BtrOffset = 00033H;
  1249. 617 MultiFunction = 0AB00H;
  1250. 618
  1251. 619 TYPE
  1252. 620 BtrParms = RECORD
  1253. 621 UserBufAddr : ADDRESS; (* data buffer address *)
  1254. 622 UserBufLen : CARDINAL; (* data buffer length *)
  1255. 623 UserCurAddr : ADDRESS; (* currency block address *)
  1256. 624 UserFCBAddr : ADDRESS; (* file control block address *)
  1257. 625 UserFunction : CARDINAL; (* Btrieve operation *)
  1258. 626 UserKeyAddr : ADDRESS; (* key buffer address *)
  1259. 627 UserKeyLength: SHORTCARD; (* key buffer length *)
  1260. 628 UserKeyNumber: SHORTCARD; (* key number *)
  1261. 629 UserStatAddr : ADDRESS; (* return status address *)
  1262. 630 xFaceID : CARDINAL; (* language interface id *)
  1263. 631 END;
  1264. 632 VAR
  1265. 633 Stat: CARDINAL; (* Btrieve status code *)
  1266. 634 XData: BtrParms; (* Btrieve parameter block *)
  1267. 635 r: SYSTEM.Registers; (* register structure used on interrrupt call *)
  1268. 636
  1269. 637 BEGIN
  1270. 638 r.AX:= 03500H + BtrInt;
  1271. 639 Lib.Intr(r, 021H);
  1272. 640 IF r.BX # BtrOffset THEN (* make sure Btrieve is installed *)
  1273. 641 RETURN BtrieveAbsent
  1274. 642 END;
  1275. 643 IF NOT VSet THEN (* if we haven't checked for Multi-User version *)
  1276. 644 r.AX:= 03000H;
  1277. 645 Lib.Intr(r, 021H);
  1278. 646 IF r.AL >= 3 THEN (* DOS version >= 3.0 *)
  1279. 647 VSet:= TRUE;
  1280. 648 r.AX:= MultiFunction;
  1281. 649 Lib.Intr(r, Btr2Int);
  1282. 650 Multi:= r.AL = 4DH (* ORD('M') *)
  1283. 651 ELSE
  1284. 652 Multi:= FALSE
  1285. 653 END
  1286. 654 END; (* make normal btrieve call *)
  1287. 655 IF datalen > HIGH(data)+1 THEN datalen:= HIGH(data)+1 END;
  1288. 656 WITH XData DO
  1289. 657 UserBufAddr := ADR(data); (* set data buffer address *)
  1290. 658 UserBufLen := datalen; (* set length *)
  1291. 659 UserFCBAddr := ADR(pos); (* set FCB address*)
  1292. 660 UserCurAddr := ADR(pos[38]);
  1293. 661 UserFunction := op; (* set Btrieve operation code *)
  1294. 662 UserKeyAddr := ADR(kbuf); (* set key buffer address *)
  1295. 663 UserKeyLength := 255;
  1296. 664 UserKeyNumber:= key; (* set key number *)
  1297. 665 UserStatAddr := ADR(Stat); (* set status address *)
  1298. 666 xFaceID := VarID; (* set language id *)
  1299. 667 END;
  1300. 668 r.DX:= SYSTEM.Ofs(XData);
  1301. 669 r.DS:= SYSTEM.Seg(XData);
  1302. 670 IF NOT Multi THEN (* MultiUser version not installed *)
  1303. 671 Lib.Intr(r, BtrInt)
  1304. 672 ELSE
  1305. 673 LOOP
  1306. 674 r.BX:= ProcId;
  1307. 675 IF r.BX # 0 THEN r.AX:= 2 ELSE r.AX:= 1 END;
  1308. 676 INC(r.AX, MultiFunction);
  1309. 677 Lib.Intr(r, Btr2Int);
  1310. 678 IF r.AL = 0 THEN EXIT END;
  1311. 679 r.AX:= 200H;
  1312. 680 Lib.Intr(r, 07FH)
  1313. 681 END;
  1314. 682 IF ProcId = 0 THEN ProcId:= r.BX END
  1315. 683 END;
  1316. 684 datalen:= XData.UserBufLen;
  1317. 685 RETURN StatusCodes(Stat);
  1318. 686 END BTRV;
  1319. 687 (*%E*)
  1320. 688
  1321. 689 BEGIN
  1322. 690 VSet := FALSE;
  1323. 691 Multi := FALSE;
  1324. 692 ProcId:= 0;
  1325. 693 END TSBTRV.
  1326. ***** ^ not supported yet
  1327. 632 errors