home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-04-08 | 3.9 KB | 125 lines | [TEXT/PJMM] |
-
-
- { Digital Money Pascal Interface }
- { courtesy of }
- { John Mancino }
- { Decision Maker's Software }
- { mancino@decismkr.com }
-
- { Please address all questions first to Digital Money, Inc. }
- { last updated April 5, 1995 }
-
-
- {3/16/95 NOTE: This interface has undergone moderate testing. The data structures and code for calling DMM seem to be correct.}
- { The data returned by AutoPay has not been exhaustively checked but results should be identical to that obtained from}
- { using the C headers}
-
-
-
-
- unit DMInterface;
-
- interface
-
- uses
- SANE; {If your implementation supports 4 byte Reals, you can probably remove SANE and change the "Singles" to "Reals"}
-
- type
- purchaseItemType = record
- quantity: integer;
- name: array[1..40] of signedbyte;
- prodCode: array[1..16] of signedbyte;
- varCode: array[1..16] of signedbyte;
- price: single;
- maxPurchase: integer;
- minPurchase: integer;
- editable: integer; {boolean interpretation}
- shUSA: single;
- shFOR: single;
- end;
-
- catalogItemType = record
- name: array[1..40] of signedbyte;
- price: single;
- maxPurchase: integer;
- minPurchase: integer;
- prodCode: array[1..16] of signedbyte;
- shUSA: single;
- shFOR: single;
- numVarCodes: integer;
- numPurchased: integer;
- varCode1: array[1..16] of signedbyte;
- varCode2: array[1..16] of signedbyte;
- varCode3: array[1..16] of signedbyte;
- varCode4: array[1..16] of signedbyte;
- varCode5: array[1..16] of signedbyte;
- varCode6: array[1..16] of signedbyte;
- varCode7: array[1..16] of signedbyte;
- varCode8: array[1..16] of signedbyte;
- end;
- catalogItemTypePtr = ^catalogItemType;
-
- digiMonBlock = record
- userAborted: integer; {boolean interpretation}
- userChoseWhichOption: integer;
- modemPaymentAccepted: integer; {boolean interpretation}
- userSuccessfullyTelUnlocked: integer; {boolean interpretation}
- userSuccessfullyMailUnlocked: integer; {boolean interpretation}
- modemPaymentIncludedReg: integer; {boolean interpretation}
- finalPurchaseAmount: single;
- orderNumber: array[1..16] of signedbyte;
- serialNumber: array[1..30] of signedbyte;
- unlockCode: array[1..30] of signedbyte;
- usersName: array[1..80] of signedbyte;
- programName: array[1..30] of signedbyte;
- programSource: array[1..20] of signedbyte;
- encodeMeth: array[1..30] of signedbyte;
- privateKey: array[1..30] of signedbyte;
- programID: array[1..20] of signedbyte;
- programPassword: array[1..20] of signedbyte;
- returnSerialNum: integer; {boolean interpretation}
- areAdditionalItemsForSale: integer; {boolean interpretation}
- screenText: array[1..10] of ptr;
- textSize: array[1..10] of integer;
- textFont: array[1..10] of integer;
- numItemsInCatalog: integer;
- catalogItem: array[1..20] of catalogItemTypePtr;
- numItemsPrepurchased: integer;
- prepurchaseItem: array[1..6] of purchaseItemType;
- end;
- digiMonBlockPtr = ^digiMonBlock;
-
- { The following function is meant to duplicate the C calling procedure presented in the manual. Simply provide a pointer to the}
- { digiMonBlock record which you have already allocated and initialized according to the documentation}
-
- function RunDM (theDMBlockPtr: digiMonBlockPtr): oserr;
-
-
- implementation
-
-
- function RunDMCR (theDMBlockPtr: digiMonBlockPtr; theCodePtr: ptr): oserr;
- inline
- $205F, { Move.l (SP)+,A0}
- $4E90; { JSR(A0) }
-
- function RunDM (theDMBlockPtr: digiMonBlockPtr): oserr;
- var
- theCRHandle: handle;
- theLoadErr: oserr;
- begin
- theCRHandle := GetResource('CODE', 60);
- theLoadErr := ResError;
- if (theLoadErr = noErr) & (theCRHandle <> nil) then
- begin
- MoveHHi(theCRHandle);
- HLock(theCRHandle);
- RunDM := RunDMCR(theDMBlockPtr, theCRHandle^);
- HUnlock(theCRHandle);
- ReleaseResource(theCRHandle);
- end
- else
- RunDM := resNotFound;
- end;
-
- end.