🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.amiga.tech
Article #6528

Re: How do you send a DosPacket to a handler directly?

#6528
From: Root
Date: Tue, 17 Nov 2020 00:37
47 lines
2896 bytes
deven@rpi.edu (Deven T. Corzine) writes:

>On 7 Nov 90 18:52:24 GMT, gregg@cbnewsc.att.com (gregg.g.wonderly) said:

>According to the AmigaDOS Technical Reference Manual, (yes, it exists,
>but is very hard to read and understand) dp_Arg1 should be the BPTR to
>the file handle.  That is, that field should contain your return value
>from Open().  Apart from that, I don't know what may be wrong with
>your code without trying it...  But the documentation says the file
>handle.  (and remember, MSH is a handler; it's on the other end of the
>transaction.)

I've written one file handler myself (L:NetworkFileSystem was my name
for it, actually, but its not NFS from Unix), and studied others, and I
can tell you from all the weird things I had to do to make it work
exactly what is going on. 

When you call to open a file, via ACTION_OPENOLD, ACTION_OPENNEW, or
ACTION_OPENRW (not sure that these are the actual names, or if they're
even included in the .h files, but they correspond exactly to the MODE_*
that you pass to Open()), dp_Arg1 is a BPTR to a (struct FileHandle).

When you call any other action on that file (ie ACTION_READ,
ACTION_SEEK, ACTION_CLOSE, &c) you pass the fh_Arg1 field of the file
handle in dp_Arg1.  This field was set by the open call. 

Noteworthy detail: You allocate the memory for the file handle, and pass
it to the filehandler, which will initialize its contents.  You must
free this memory as well after you close the file.

Now, if you'll all carefully consult dosextens.h, you'll next ask "what
about those fh_Buffer and related fields - how are they used?".  My best
answer is that beyond the fh_Task and fh_Arg1 fields, the filesystem is
not supposed to change anything.  And the application program isn't
supposed to change anything period.  So I presume they're dead space,
left over from BCPL and TriPos.  (My money says ed and/or edit use
them though). 

>Deven T. Corzine        Internet:  deven@rpi.edu, shadow@pawl.rpi.edu
>Snail:  2214 12th St. Apt. 2, Troy, NY 12180   Phone:  (518) 271-0750
>Bitnet:  deven@rpitsmts, userfxb6@rpitsmts     UUCP:  uunet!rpi!deven
>Simple things should be simple and complex things should be possible.
--
  Gregory Kritsch                          | University of Waterloo
    Fido:  1:221/208.11110  [1:163/109.30] | 1A Computer Engineering
    UUCP:  ggk@tirith.UUCP                 |--------------------------
           ...!watmath!xenitec!tirith!ggk  | Amiga Fanatic
Technical Details
Message-ID: <root.658802253@tirith.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watserv1!maytag!xenitec!tirith!root
References: <DEVEN.90Nov8180332@netserv2.rpi.edu> <1990Nov7.185224.4215@cbnewsc.att.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watserv1!maytag!xenitec!tirith!root
From: root@tirith.UUCP (Root)
Message-ID: <root.658802253@tirith.UUCP>
Date: 17 Nov 20 00:37:33 
Newsgroups: comp.sys.amiga.tech
Subject: Re: How do you send a DosPacket to a handler directly?
In-Reply-To: deven@rpi.edu (Deven T. Corzine)
References: <DEVEN.90Nov8180332@netserv2.rpi.edu>
 <1990Nov7.185224.4215@cbnewsc.att.com>