Path: utzoo!attcan!uunet!spool.mu.edu!think.com!hsdndev!husc6!zariski!fry From: fry@math.harvard.edu (David Fry) Newsgroups: comp.sys.mac.programmer Subject: Using THINK C from THINK Pascal Message-ID: <5845@husc6.harvard.edu> Date: 1 Mar 91 12:06:12 GMT Sender: news@husc6.harvard.edu Organization: Harvard Math Department Lines: 25 Originator: fry@zariski I'm trying to interface a THINK C library with a friend's THINK Pascal program. My C function is defined: pascal void MyFunc(Ptr aPtr, short aShort, unsigned char aByte); The problem is how to define it in Pascal and pass parameters to it so that aByte gets the proper values. I've tried a variety of things, and only PROCEDURE MyFunc(aPtr: Ptr; aShort: INTEGER; aByte: BOOLEAN); comes close. Defining aByte as a CHAR or Byte still uses 16-bits, so only the high byte is getting passed to the C routine. BOOLEAN uses 8-bits, but it is equivalent to a char, rather than an unsigned char, so the high bit is unusable. Should I define a type of PACKED ARRAY [1..1] of CHAR, or some such? Thanks for any help. David Fry fry@math.harvard.EDU Department of Mathematics fry@huma1.bitnet Harvard University ...!harvard!huma1!fry Cambridge, MA 02138