Article View: comp.sys.mac
Article #13634Re: Aztec 'C' problem - help!
From: Rajiv Arora
Date: Wed, 26 Nov 1986 17:22
Date: Wed, 26 Nov 1986 17:22
58 lines
2451 bytes
2451 bytes
In article <864@ur-valhalla.UUCP> I write:
>
>Hi all.
>
>I have a question for those of you who have used the Appletalk Manager
>calls from Aztec 'C'. I'm trying to use the AB Link Access Protocol in
>my application and can't for the life of me get the function
>LAPOpenProtocol () to work. I was wondering if any of you had had the
>same problem and knew of a fix. Shown below is the code illustrating
>the problem:
>
> [Buggy Program]
Here is the corrected code (sorry 'bout that):
#include <stdio.h>
#include <appletalk.h>
#include <syserr.h>
main ()
{
OSErr errcode;
pascal OSErr MPPopen ();
pascal OSErr LAPOpenProtocol ();
ABByte myLAPType; /* ABByte is typedefed as
"unsigned char" and Ptr as
"char *" in appletalk.h */
Ptr myprotoptr;
if ((errcode = MPPOpen ()) != noErr)
{
printf ("error opening MPP\n");
printf ("errorcode = %d\n", errcode);
}
else
{
myLAPType = 53; /* arbitrary protocol number */
myprotoptr = NULL;
if ((errcode = LAPOpenProtocol (myLAPType, myprotoptr)) != noErr)
{
printf ("error opening protocol\n");
printf ("errorcode = %d\n", errcode);
}
}
}
The problem is that LAPOpenProtocol always returns with errorcode -94,
which indicates that either myLAPType (= 53) is out of range, already
present in the protocol handler table, or that the protocol table is
full. Since the table can have upto 4 entries, and only two are used
by DDP (i.e. LAP types 1 and 2), the last should not be the case. The
other two possibilities also seem unlikely.
Any suggestions/comments/help would be greatly appreciated.
Rajiv Arora
--
UUCP: {seismo,cmc12,columbia,cornell,harvard,
ll-xn,nike,topaz}!rochester!ur-valhalla!rajiv
ARPA: ur-valhalla!rajiv@rochester.arpa
Technical Details
Message-ID:
<866@ur-valhalla.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!mnetor!seismo!rochester!ur-tut!ur-valhalla!rajivReferences:
<864@ur-valhalla.UUCP>Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!rochester!ur-tut!ur-valhalla!rajiv From: rajiv@ur-valhalla.UUCP (Rajiv Arora) Newsgroups: comp.sys.mac Subject: Re: Aztec 'C' problem - help! Message-ID: <866@ur-valhalla.UUCP> Date: Wed, 26-Nov-86 12:22:24 EST Article-I.D.: ur-valha.866 Posted: Wed Nov 26 12:22:24 1986 Date-Received: Wed, 26-Nov-86 21:12:25 EST References: <864@ur-valhalla.UUCP> Reply-To: rajiv@ur-valhalla.UUCP (Rajiv Arora) Distribution: net Organization: EE VLSI Graduate Research Facility, UR, Rochester NY Lines: 58 Keywords: Errors in the sample program