[comp.sys.amiga.tech] Handlers

ddave@pnet02.cts.com (David Donley) (03/25/89)

Could somebody please tell me the name of a book about devices/handlers,
and/or some example code?  I have the source to a pipe handler, but can't
figure it out.  I need something that just does absolutly nothing except print
out what it ought to be doing (Like it will say Rename %s to %s, Open %s,%d,
ect...) I have the source code to a device, but it is in assembler, and
doesn't read it's own mountlist entry to figure out how to set itself up...
Thanks for any help!

              Don't call my BBS, my harddisk left me for a 2500.
          Disclaimer: If it doesn't work, I guess it's broken ain't it?
     ddave@pnet02.CTS.COM ddave@pnet.gryphon.COM killer!gryphon!pnet02!ddave

sie@fulcrum.bt.co.uk (Simon Raybould) (04/11/90)

I want to write a handler, similar to AUX:, but with some escape sequence
mapping. Where is there some documentation on handlers ??

I have the RKM's so direction to the relevant sections would be enough.
I had a quick look but couldn't see any info on this.

Of course, if I am missing the point totally and AUX: allows you to set
up mappings then let me know.

Cheers for any info.




+-=-=-=-=-=-=-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-+
|   Simon J Raybould         |                                            |
|   British Telecom Fulcrum  |                                            |
|   Fordrough Lane           |                                            |
|   Birmingham               |                                            |
|   B9 5LD                   |                                            |
|   ENGLAND                  +-----------+--------------------------------|
|                            |   //      | AMIGA B2000HD 3MB 8088BB       |
|   sie@fulcrum.bt.co.uk     | \X/AMIGA  | Lattice C V5.05                |
+-=-=-=-=-=-=-=-=-=-=-=-=-=-=+=-=-=-=-=-=+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-+

new@udel.EDU (Darren New) (04/12/90)

>I want to write a handler, similar to AUX:, but with some escape sequence
>mapping. Where is there some documentation on handlers ??

I would like to have an AUX:-style handler that could handle multiple
serial ports and have (user-programable) timeouts on reads. I'm working
on one, but I would rather spend the time doing other code.  I heard there
was a device in the UUCP distribution that had timeouts on reads -- 
can somebody summarize more info so's I don't have to download gobs to
find out it's not what I want?  THANKS!   -- Darren

deven@rpi.edu (Deven T. Corzine) (04/12/90)

On 11 Apr 90 15:19:18 GMT, sie@fulcrum.bt.co.uk (Simon Raybould) said:

Simon> I want to write a handler, similar to AUX:, but with some
Simon> escape sequence mapping.

[See below.]

Simon> Where is there some documentation on handlers ??

There is some documentation on the packet system in the AmgiaDOS
Technical Manual (Bantam Books) and a sample handler...  in BCPL.
(ugh.)  This documentation is rather poor in that it doesn't tell you
much of what you need to know to write a proper handler in C or
assembly.  Apparently the Software Distillery (Walker, et al) have
some good example handler code that may be worth getting a hold of.
(I've been intending to, but haven't gotten around to it...  Doug, if
you're reading this, could you Email me the info you guys have on
handlers to deven@rpi.edu?  Thanks...)

You could also look at the NULL: source, which is okay, but doesn't DO
much...  Dillon's nfs-handler for DNet is another possible example,
but Dillon's code tends to be written in a rather difficult-to-read
fashion, so caution may be in order.  That's all the sources that leap
to mind.

Simon> I have the RKM's so direction to the relevant sections would be
Simon> enough.  I had a quick look but couldn't see any info on this.

The RKM's are absolutely essential reference materials, but
unfortunately, they have virtually no information on AmigaDOS.  Check
the include files <libraries/dos.h>, <libraries/dosextens.h> and
<libraries/filehandler.h> for what little extra information you can
glean from the data structures defined and the comments accompanying
them...  [these should be in the includes section of the 1.3 Includes
and Autodocs RKM, as well as on your compiler disks.]

Simon> Of course, if I am missing the point totally and AUX: allows
Simon> you to set up mappings then let me know.

AUX: is pretty dumb, but I would advise anyone using AUX: to run a CLI
on a terminal to get ConMan 1.3 by Bill Hawes, (Shareware product,
widely available) and try its CNX: handler.  It allows you to use a
"console" over any exec device.  Or at least, you can attempt to.  (I
wouldn't suggest trying to use CNX:trackdisk.device!)

Anyway, if you use "CNX:serial.device", [as in the command "NewCLI
CNX:serial.device"] you will get an effect similar to AUX:, except
that you get ConMan's input editing as a bonus.  For anyone not
familiar with ConMan, the input editing is similar to that of C-A's
NEWCON: handler, except that it is far more flexible and powerful than
the C-A handler, and I think it may even be smaller.  [or I could be
thinking of ASH, the ARP shell, compared to AmigaShell -- ASH is
smaller and much better...]

ConMan 1.3 is well worth getting simply for the Amiga console
enhancements, but if you're using AUX: now, it is doubly invaluable
for CNX:...  [by the way, the "serial.device" part of the CNX:
"filename" is almost certainly case sensitive.  That is, you can use
"cnx:serial.device", but "CNX:SERIAL.DEVICE" is probably right out.]

I don't know if CNX: does the sort of mapping you're looking for, but
take a look at it first; it may.

Deven
-- 
Deven T. Corzine        Internet:  deven@rpi.edu, shadow@pawl.rpi.edu
Snail:  2151 12th St. Apt. 4, Troy, NY 12180   Phone:  (518) 274-0327
Bitnet:  deven@rpitsmts, userfxb6@rpitsmts     UUCP:  uunet!rpi!deven
Simple things should be simple and complex things should be possible.

thyssen@batserver.cs.uq.oz.au (Anthony Thyssen) (04/13/90)

In article <DEVEN.90Apr12053135@netserv2.rpi.edu> deven@rpi.edu (Deven T. Corzine) writes:
>For anyone not
>familiar with ConMan, the input editing is similar to that of C-A's
>NEWCON: handler, except that it is far more flexible and powerful than
>the C-A handler, and I think it may even be smaller.  [or I could be
>thinking of ASH, the ARP shell, compared to AmigaShell -- ASH is
>smaller and much better...]

  I am currently useing the NEWCON: handler for my console input
But I also have ConMan's PIP: device to do the piping in the ARP ASH
I would like to use ConMan for the console as well (to save the memory used
by NEWCON: ) by I ABSOULUTELY CAN NOT STAND conman's history list
I don't mind the idea of only one copy of repeated commands in the history
list - prefer it in fact. But I must have the last command I execute
as the last command on the history list. This conman does not do.

Can anyone help?  Has anyone got the conman source?  Does anyone have
just the PIP: handler from conman? 

--
  Anthony Thyssen - (Dragon Computing!)         thyssen@batserver.cs.uq.oz.au
-------------------------------------------------------------------------------
        The only way to learn a new programming language
               is by writing programs in it.     - Brian Kernighan

lphillips@lpami.wimsey.bc.ca (Larry Phillips) (04/13/90)

In <DEVEN.90Apr13052538@netserv2.rpi.edu>, deven@rpi.edu (Deven T. Corzine) writes:
>
>Well, PIP: is another alternate name for ConMan, as is CNX:...  I can
>see your problem with the history, but I don't find it critical.  I
>suppose it could move the command to the bottom of the history list,
>but then it's missing from the sequence above.  What I do when I want
>to force the command I'm repeating to the bottom of the list is just
>hit space and backspace, which modifies the line, so it's not
>considered the same line.  That's a workaround, but it works okay.  On
>the other hand, I believe there is a "true history" option on ConMan;
>check the doc file...

Right.

>From the ConMan docs:

 ConMan maintains the history in one of two modes.  In the default mode,
 recalled lines are not re-entered into the history buffer unless the
 line was "touched," and the history index pointer is left positioned at
 the retrieved line.  This mode is convenient if you often go back into
 the buffer to retrieve sequences of commands.
 
 In "true history" mode, every line is re-entered into the history buffer,
 even if it hasn't been modified after being recalled.  The history pointer
 is always reset (to the most recent line) whenever a line is added to the
 buffer.  The history mode can be selected when ConMan is installed or
 by using the SetCMan utility.
 
 
--
Entomology bugs me.
+-----------------------------------------------------------------------+ 
|   //   Larry Phillips                                                 |
| \X/    lphillips@lpami.wimsey.bc.ca -or- uunet!van-bc!lpami!lphillips |
|        COMPUSERVE: 76703,4322  -or-  76703.4322@compuserve.com        |
+-----------------------------------------------------------------------+

deven@rpi.edu (Deven T. Corzine) (04/13/90)

In article <DEVEN.90Apr12053135@netserv2.rpi.edu> I write:

Deven> For anyone not familiar with ConMan, the input editing is
Deven> similar to that of C-A's NEWCON: handler, except that it is far
Deven> more flexible and powerful than the C-A handler, and I think it
Deven> may even be smaller.  [or I could be thinking of ASH, the ARP
Deven> shell, compared to AmigaShell -- ASH is smaller and much
Deven> better...]

On 13 Apr 90 00:33:23 GMT,
thyssen@batserver.cs.uq.oz.au (Anthony Thyssen) said:

Anthony> I am currently useing the NEWCON: handler for my console
Anthony> input But I also have ConMan's PIP: device to do the piping
Anthony> in the ARP ASH I would like to use ConMan for the console as
Anthony> well (to save the memory used by NEWCON: ) by I ABSOULUTELY
Anthony> CAN NOT STAND conman's history list I don't mind the idea of
Anthony> only one copy of repeated commands in the history list -
Anthony> prefer it in fact. But I must have the last command I execute
Anthony> as the last command on the history list. This conman does not
Anthony> do.

Well, PIP: is another alternate name for ConMan, as is CNX:...  I can
see your problem with the history, but I don't find it critical.  I
suppose it could move the command to the bottom of the history list,
but then it's missing from the sequence above.  What I do when I want
to force the command I'm repeating to the bottom of the list is just
hit space and backspace, which modifies the line, so it's not
considered the same line.  That's a workaround, but it works okay.  On
the other hand, I believe there is a "true history" option on ConMan;
check the doc file...

Anthony> Can anyone help?  Has anyone got the conman source?  Does
Anthony> anyone have just the PIP: handler from conman?

Well, Bill Hawes has the source, of course.  :-)

Deven
-- 
Deven T. Corzine        Internet:  deven@rpi.edu, shadow@pawl.rpi.edu
Snail:  2151 12th St. Apt. 4, Troy, NY 12180   Phone:  (518) 274-0327
Bitnet:  deven@rpitsmts, userfxb6@rpitsmts     UUCP:  uunet!rpi!deven
Simple things should be simple and complex things should be possible.

waggoner@dtg.nsc.com (Mark Waggoner) (04/14/90)

In article <3244@moondance.cs.uq.oz.au> thyssen@batserver.cs.uq.oz.au writes:
>  I am currently useing the NEWCON: handler for my console input
>But I also have ConMan's PIP: device to do the piping in the ARP ASH
>I would like to use ConMan for the console as well (to save the memory used
>by NEWCON: ) by I ABSOULUTELY CAN NOT STAND conman's history list
>I don't mind the idea of only one copy of repeated commands in the history
>list - prefer it in fact. But I must have the last command I execute
>as the last command on the history list. This conman does not do.

You can set conman to behave almost as you desire.  Conman includes a
program to set conman options, which I believe is called setcman.
One of the options is for conman to keep a true history.  It will then
put every command on the history buffer, even if it is a repeated
command.  You get the last command you executed at the end of the
history list, but you lose the advantage of having only a single copy
of the command in the list.




-- 
Mark Waggoner  Santa Clara, CA    (408) 721-6306         waggoner@dtg.nsc.com 
 Unofficially representing National Semiconductor Local Area Networks Group
                   Officially misrepresenting myself.

riley@batcomputer.tn.cornell.edu (Daniel S. Riley) (04/14/90)

In article <DEVEN.90Apr12053135@netserv2.rpi.edu> deven@rpi.edu (Deven T. Corzine) writes:
>You could also look at the NULL: source, which is okay, but doesn't DO
>much...  Dillon's nfs-handler for DNet is another possible example,
>but Dillon's code tends to be written in a rather difficult-to-read
>fashion, so caution may be in order.  That's all the sources that leap
>to mind.

Other possible examples are Matt Dillon's and Ed Puckett's pipe: handlers.
Source for both should be avaible on Fish disks (several hundred disks
back).  Since those are fairly old, you may still want to look at the
more recent Dillon and Software Distillery code.  pipe:, however, is
nice to look at because there isn't a lot to a pipe handler besides the
basic handler code.

-Dan Riley (riley@tcgould.tn.cornell.edu, cornell!batcomputer!riley)
-Wilson Lab, Cornell University

bleys@tronsbox.UUCP (Bill Cavanaugh) (04/15/90)

>On 13 Apr 90 00:33:23 GMT,
>thyssen@batserver.cs.uq.oz.au (Anthony Thyssen) said:
>
>Anthony> I am currently useing the NEWCON: handler for my console
>Anthony> input But I also have ConMan's PIP: device to do the piping
>Anthony> in the ARP ASH I would like to use ConMan for the console as
>Anthony> well (to save the memory used by NEWCON: ) by I ABSOULUTELY
>Anthony> CAN NOT STAND conman's history list I don't mind the idea of
>Anthony> only one copy of repeated commands in the history list -
>Anthony> prefer it in fact. But I must have the last command I execute
>Anthony> as the last command on the history list. This conman does not
>Anthony> do.

Try using this in your startup-sequence or it's equivalent...

     conman -c -t

There are several other switches available.  -c mean "install as CON:", -o
means "overstrike mode", -r means "install as RAW:", -s means "sticky mode",
-t means "true history", and -w means "wrap-around history".

     /************************************************************
     *                                                           *
     * Everything above is copyright me.  All rights unreserved. *
     *                uunet!tronsbox!bleys                       *
     *                                                           *
     * "The perversity of the universe tends to a maximum"       *
     *                              Finagle's First Law          *
     *                                 J. Pournelle              *
     *                                                           *     
     ************************************************************/