Article View: comp.sys.amiga.tech
Article #7561Re: Asynchronous I/O, Packet Interface (Need Help)
From: Randell Jesup
Date: Wed, 19 Dec 1990 01:05
Date: Wed, 19 Dec 1990 01:05
50 lines
2594 bytes
2594 bytes
In article <126865@linus.mitre.org> duncant@mbunix.mitre.org (Thomson) writes:
>1) Is the following the correct way to set up the arguments
> of the packet structure?
>
> std_pkt->sp_Pkt.dp_Type = ACTION_READ;
> std_pkt->sp_Pkt.dp_Arg1 = (LONG) in_hdl; /* BPTR to file handle */
> std_pkt->sp_Pkt.dp_Arg2 = (LONG) storage; /* Normal C pointer to storage */
> std_pkt->sp_Pkt.dp_Arg3 = size; /* Number of bytes to read */
Whoops! dp_Arg1 for read should be fh->fh_Arg1, not fh!
>2) The StandardPacket structure contains a Message structure and a DosPacket
> structure. Is the following the correct way to initialize these
> structures?
>
> /* Initialize the Message structure within the StandardPacket structure */
> std_pkt->sp_Msg.mn_Node.ln_Name = (char *) &(std_pkt->sp_Pkt);
> std_pkt->sp_Msg.mn_Node.ln_Type = NT_MESSAGE;
> std_pkt->sp_Msg.mn_ReplyPort = reply_port;
> std_pkt->sp_Msg.mn_Length = sizeof( struct DosPacket );
OK. Strictly speaking, the NT_MESSAGE and sizeof(struct DosPacket)
aren't needed (actually replyport isn't either).
> /* Initialize the DosPacket structure within the StandardPacket structure */
> std_pkt->sp_Pkt.dp_Link = &(std_pkt->sp_Msg);
> std_pkt->sp_Pkt.dp_Port = reply_port;
Fine.
>Any help that could be offered would REALLY be appreciated. Perhaps someone
>from Commodore that works on AmigaDOS????? This is something I asked about
>on the net many months ago. Nobody was able to offer any help then, but
>I've since dug the program out and I'd really like to get it working.
Sorry this reply took so long, I get way behind on the nets at times.
Information overload.
> /* Wait for the reply and tae reply port */
> WaitPort( reply_port );
> GetMsg( reply_port );
You should really make sure you got a message back...
--
Randell Jesup, Keeper of AmigaDos, Commodore Engineering.
{uunet|rutgers}!cbmvax!jesup, jesup@cbmvax.commodore.com BIX: rjesup
The compiler runs
Like a swift-flowing river
I wait in silence. (From "The Zen of Programming") ;-)
Technical Details
Message-ID:
<16649@cbmvax.commodore.com>Path:
arc1-ca.pugleaf.net!utzoo!mnetor!tmsoft!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!uunet!cbmvax!jesupReferences:
<126865@linus.mitre.org>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!mnetor!tmsoft!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!uunet!cbmvax!jesup From: jesup@cbmvax.commodore.com (Randell Jesup) Newsgroups: comp.sys.amiga.tech Subject: Re: Asynchronous I/O, Packet Interface (Need Help) Message-ID: <16649@cbmvax.commodore.com> Date: 19 Dec 90 01:05:14 GMT References: <126865@linus.mitre.org> Reply-To: jesup@cbmvax.commodore.com (Randell Jesup) Organization: Commodore, West Chester, PA Lines: 50