TABLE OF CONTENTS

FatalRequest.module/ask
FatalRequest.module/fatal
FatalRequest.module/notice
FatalRequest.module/SetFatalWindow
FatalRequest.module/warning
FatalRequest.module/__background__
GadgetIntTools
Librarian.module
mwlib.library/GadgetTools
MWLib.library/PString
mwlib.library/RequesterTools
mwlib/BSTRcptoSTR
mwlib/BSTRtoSTR
MWLib/c/ShutDown
mwlib/c/StrDupVec
MWLib/c/TokenTools
MWLib/c/TokenTools/tt_GetToken
MWlib/fuckup
MWLib/keyStrDup
mwlib/LinkTools
mwlib/LinkTools/AddLinkHead
mwlib/LinkTools/AddLinkTail
MWLib/MenuTools
MWLib/SpriteTools
MWLib/SpriteTools/BitMapToSprite
MWLib/StrFlag
MWLib/TextTools
FatalRequest.module/ask                               FatalRequest.module/ask

    NAME
        ask -- Display a query.

    SYNOPSIS
        bool = ask( message1 )
        bool = ask2( message1, message2 )
        bool = ask3( message1, message2, message3 )

        BOOL ask( char * );
        BOOL ask2( char *, char * );
        BOOL ask3( char *, char *, char * );

    FUNCTION
        Displays the given query messages as a requester, then waits for user
        to respond by clicking the YES or NO gadget. ask() is normally
        used for querying the user just before doing something unrecoverable,
        such as overwriting a file or deleting information.

    INPUTS
        message1    - First line of text to be displayed. Generally used for
                      explaining the nature of the question.

        message2    - Second line of text to be displayed. Usually for
                      discriptive information.

        message3    - Third line of text to be displayed. Usually for more
                      explicit discriptive information.


    RESULT
        Displays a requester (or an alert, if out of memory), and waits for
        user response. Returns a BOOLean indicating the user's response.

    EXAMPLE

    NOTES

    BUGS

    SEE ALSO
        warning(), SetFatalScreen().

FatalRequest.module/fatal                           FatalRequest.module/fatal

    NAME
        fatal -- Display a fatal alert to user, then exit.

    SYNOPSIS
        bool = fatal( message1 )
        bool = fatal2( message1, message2 )
        bool = fatal3( message1, message2, message3 )

        BOOL fatal( char * );
        BOOL fatal2( char *, char * );
        BOOL fatal3( char *, char *, char * );

    FUNCTION
        Displays the given fatal messages as a requester, then waits for user
        to respond by clicking the YES or NO gadget. If he clicks YES, then
        the programmer-defined routine StateSave() will be called before
        exiting. Exiting is expected to be performed via the
        programmer-defined ShutDown() routine, which should never return.

        fatal() is generally used in the case that your program has reached
        an unrecoverable state, and must exit. It provides the user with
        some useful information, and a last chance to save any work he has
        done up to this point.

        It may be that your program is too cripled to actually save
        sucessfully at this point. That is why the user is told
        (automatically) that a StateSave will be ATTEMPTED.

        Please keep in mind that a fatal request is normally used to indicate
        that a bug in the software has been decteded. Users should
        normally never see a fatal request ootherwise.

    INPUTS
        message1    - First line of text to be displayed. Generally used for
                      explaining the nature of the bug.

        message2    - Second line of text to be displayed. Usually for
                      diagnostic information.

        message3    - Third line of text to be displayed. Usually for more
                      explicit diagnostic information.

    RESULT
        Displays a requester (or an alert, if out of memory), and waits for
        user response. Calls your StateSave() on a positive (YES) response,
        and in both cases calls your ShutDown(). If ShutDown() returns,
        which it should never do, fatal() returns a BOOLean representing
        the user's response.

    EXAMPLE

    NOTES

    BUGS

    SEE ALSO
        warning(), SetFatalScreen().

FatalRequest.module/notice                         FatalRequest.module/notice

    NAME
        notice -- Display information.

    SYNOPSIS
        notice( format, arg1, arg2, ... )

        void notice( char *, arg ... );

    FUNCTION
        Displays the given message as a requester, then waits for user
        to respond by clicking the OK gadget. notice() is normally
        used for giving the user information that a specific event did or
        did not occur.

    INPUTS
        format          - printf() type format.

        arg1, arg2 ...  - arguments for the notice.

    RESULT
        Displays a requester (or an alert, if out of memory), and waits for
        user response. Returns nothing.

    EXAMPLE

    NOTES

    BUGS

    SEE ALSO
        ask(), SetFatalScreen().
FatalRequest.module/SetFatalWindow         FatalRequest.module/SetFatalWindow

    NAME
        SetFatalWindow -- (OBSOLETE) Tell FatalRequest where to put the reques
        ters

    SYNOPSIS
        SetFatalWindow( window )

        void SetFatalWindow( struct Window * );

    FUNCTION
        Tells FatalRequest what screen to place the requesters on. If this
        function is not executed, or if a NULL is pass, then the requesters
        will appear on the Workbench screen.

    INPUTS
        window      - reference window from which to determine screen.

    RESULT
        none.

    EXAMPLE

    NOTES

    BUGS
        Not reentrant. Window is stored in a static area.
        No longer works. 25 Sep 1991 FM

    SEE ALSO

FatalRequest.module/warning                       FatalRequest.module/warning

    NAME
        warning -- Display a warning requester, and await user's response

    SYNOPSIS
        bool = warning( message1 )
        bool = warning2( message1, message2 )
        bool = warning3( message1, message2, message3 )

        BOOL warning( char * );
        BOOL warning2( char *, char * );
        BOOL warning3( char *, char *, char * );

    FUNCTION
        Displays the given warning messages as a requester, then waits for use
        r
        to respond by clicking the YES or NO gadget. warning() is normally
        used to indicate a user error.

    INPUTS
        message1    - First line of text to be displayed. Generally used for
                      explaining the nature of the warning.

        message2    - Second line of text to be displayed. Usually for
                      discriptive information.

        message3    - Third line of text to be displayed. Usually for more
                      explicit discriptive information.

    RESULT
        Displays a requester (or an alert, if out of memory), and waits for
        user response. Returns a BOOLean indicating the user's response.

    EXAMPLE

    NOTES

    BUGS

    SEE ALSO
        fatal(), ask(), SetFatalScreen().

FatalRequest.module/__background__         FatalRequest.module/__background__
    NAME
        FatalRequest -- The Ultra-easy request system

    AUTHOR
        Mitchell/Ware Systems, Inc

    FUNCTION
        Requesters/Alerts that apprise user of a possibly serious condition,
        or ask a YES/NO question.

        FatalRequest will attempt to open these up as system requests.
        Failing that, they will default to an Alert.

GadgetIntTools                                                 GadgetIntTools
    GadgetIntTools.c

    Mitchell/Ware Systems           Version 1.01            12-Sep-90

    Tools for Creating Gadgets for InterfaceTools. Reies on GadgetTools.

    Make a Border list
        MakeIntGEBorders(struct Remember **key, IntGEntry ige[])

    Make a IntGE Gadget list
        MakeIntGEList(struct Remember **key, IntGEActive list[],
                        struct CustomGadgetClass *class_list)

    Refresh a IntGE Gadget list - currently only does the string gadgets
        RefreshIntGEList(IntGEActive list[], struct Window *win)

    NOTE: A NULL GADGET is one with type NULL (in the IntGEList). Such a gadge
        t
          is used for boxing large regions not directly related to the
          normal action of a gadget. MakeRGList is set up to ignore such
          'gadgets'.

Librarian.module                                             Librarian.module
    Librarian -- Opens and Closes Resident Libraries

    Mitchell/Ware           Version 3.02            3/19/88

    Three calls:

        SetLibraryVersion(ver)  Sets version number to pass to OpenLibrary.

        Librarian (string)      Opens specified libraries, returns false if
                                one or more failed. Attempts to open all
                                libraries specified, so that user can be
                                aprised of all the missing libraries
                                in one execute attempt.

        CloseLibrarian (string) close specified libraries, or all if NULL.
                                no errors. WARNING: CloseLibrarian(NULL)
                                must be the LAST thing called just before
                                a program exit, or CLOSE attention must be
                                paid to calls made after the close, making
                                sure the calls aren't library dependent.

    Codes are as follows:

        asl.library          a          math.library                 0
        battclock.library    b          mathieeedoubbas.library      1
        battmem.library      B          mathieeedoubtrans.library    2
        clist.library        C          mathieeesingbas.library      3
        console.device       c          mathieeesingtrans.library    4
                                        mathtrans.library            5
        cx.library           X
        dos.library          D          misc.library                 m
        diskfont.library     d          potgo.library                p
        expansion.library    e          ramdrive.device              ^
        gadtools.library     G          rexxsyslib.library           x
                                        sys.library                  |
        graphics.library     g
        iffparse.library     I          timer.library                T
        icon.library         O          translator.library           t
        input.library        #          utility.library              u
        intuition.library    i          workbench.library            w

        keymap.library       k
        layers.library       l

mwlib.library/GadgetTools                           mwlib.library/GadgetTools
    GadgetTools.c

    Mitchell/Ware Systems           Version 4.16            06-Dec-88

    Tools for Creating Gadgets.

    Set the ID Counter:
    SetGadgetIDCounter (number)
        number - first number to start ID with. Will be incremented...

    Make BOOLEAN Gadget with imagery:
        MakeBGadget (key, image, alternate, left, top, flags, activation)
            key - a Remember pointer
            image - the Rendering image
            alternate - the alternate SELECT image, or NULL if none
            left - LeftEdge
            top - TopEdge
            flags - Gadget Flags - GADGIMAGE set always, GADGHCOMP
                    default if no GADGHIGHBITS specified.
            activation - Gadget Activation - defaults to RELVERIFY

    Make CUSTOM REQUEST BOOLEAN GADGET:
        MakeCRBGadget (key, left, top, width, height, flags, activation, type)

    Make a PROPORTIONAL Gadget
        MakePropGadget (key, knob_image, left, top, width, height,
                                               flags, prop_flags, activation)

    Make a STRING Gadget
        MakeStrGadget (key, left, top, width, height, maxchars, buf, undobuf,
                                                        flags, activation, typ
        e)

    Make a Border list
        MakeRTGBorders(key, rtglist)

    Make a Requester Gadget list
        MakeRTGList(key, rtglist, class_list)
            struct Remember **key;
            RTGList rtglist[];
            struct CustomGadgetClass *class_list;

    Refresh a Requester Gadget list - currently only does the string gadgets
        RefreshRTGList(rtglist, win, req)

    Count all the gadgets in a list of gadgets
        GadgetCount(gadlist)
            struct *Gadget *gadlist;

    NOTE: A NULL GADGET is one with type NULL (in the RTGList). Such a gadget
          is used for boxing large regions not directly related to the
          normal action of a gadget. MakeRGList is set up to ignore such
          'gadgets'.

MWLib.library/PString                                   MWLib.library/PString

    NAME
        PString -- construct a parameter string

    AUTHOR
        Copyright © 1992 Mitchell/Ware Systems, Inc.

    SYNOPSIS
        long PString(char *dest, char *parm, char *keys, void *arg, ...);

    FUNCTION
        Assembles a ParmString based on the placement and matching
        of parameters and keys. The keys string is a null-terminated
        array of character-format pairs that map the following
        arguments. The arguments, which can be strings or longs,
        will be substituted for the occurence of the %key sequence
        in the parm string.

        dest points to a buffer assumed long enough to contain the
        generated string.

    INPUTS
        dest    - Destination buffer. Assumed large enough to contain string.
        parm    - Parameter string. Describes the method of substitution.
        keys    - Keys for the arguments that follow. Ordinal position
                  of the character pairs in the keys string MUST
                  correspond to the arguments presented. The format of
                  the character-pairs are as follows:

                    *f

                  Where * repesents the key character, and f represents
                  the format. The following formats are as follows:

                    s   - string
                    c   - single character
                    d   - decimal signed number
                    D   - decimal unsigned number
                    h   - hex signed number
                    H   - hex unsigned number
                    g   - double-length IEEE floating-point number (NIY)

        arg,... - Sequence of arguments that follow. NULL pointers are
                  allowed for strings.

    RESULTS
        Returns the actual number of bytes processed, and is present
        in dest. If there has been an error, will return -1 instead.

    EXAMPLE
        PString(buf, "copy from DF%d:%f to %t %a", "ddfstsas", 0, from, to, ar
        guments);

    SEE ALSO

mwlib.library/RequesterTools                     mwlib.library/RequesterTools
    RequesterTools.c

    Mitchell/Ware Systems           Version 4.03            06-Dec-88

    Tools used for Custom Requesters
  ****************************************************************************
        *
    NOTE1: Windows must have the IDCMP REQCLEAR flag set.

    NOTE2: If rtg[].rfunct is non-null, then it is called:
                BOOL (*rfunct)(req, window, class, r, gadget, x, y, code, udat
        a)
                    strucr Requester *req
                    struct Window *window;  Window requester is in
                    ULONG class, code;      IDCMP class & code of message
                    struct RTGList *r;             RTG structure for this gadg
        et
                    struct Gadget *gadget;  Gadget requesting service
                    int x, y;               Mouse x&y pos. in message
                    void *udata;             user data

                If (*rfunct)() returns TRUE, then this is taken
                as a notice to immediatly EndRequest() and clean up.
                AT THE MOMENT, THIS IS DANGEROUS- if user-gadget
                activity is taking place when this occurs, you'll
                lock-up the system!!!

    NOTE3: MutualExclude will not work for gadgets until 1.4, so....
            They are implemented here. GadgetTools DOES NOT use them
            anymore (version 3.05), and will be dealt with later.
            GADGHCOMP must be used with MutualExclude for now, because
            RequesterTools uses RectFill to uncomplement the area.

    NOTE3a: The FIX field is now used by BOOLEAN TOGGLE Gadgets for 16
            more mutually exclusive gadgets Total number is now 48.

    DoRequest(pkey, bitmap, list, text, window, left, top, width, height, udat
        a)
            list - the special RTGLIST in tools.h
            text - an IntuiText structure describing text
            pkey - the Remember key, or NULL. If null, then all the
                    gadgets allocated during the creation of the
                    requestor will be deleted. Otherwise, they will be
                    retained.
            window - The window the requestor is to appear in. Later,
                    a NULL will prompt a window to be created for this.
                    For now, a window MUST be given.
            udata  - pointer to user data area. Not needed. Will be passed to
                    callbacks.

    AllocateReqStrBuffs(key, rtg_list)
        struct Remember **key;
        struct RTGList rtg_list[]

        Allocates all STRGADGET r->string areas to Buffer Length + 1.
        All allocation is performed using AllocRemember.

    ClearSelect(rtg_list)
        struct RTGList rtg_list[]

        Clears the Selected flags

    ClearGadgets(rtg_list)

        Clears the gadget pointers in list.

    UpdateStringEntry(r)
        struct RTGLIST *r; - entry to be updated
        Updates the .value or .string entry of given RTGLIST entry.
        WARNING: Use on strings ONLY!

    SetReqBackFill(n)
        Does as it says!

    SetIdleRoutine(rou)
        Routine to execute when no events are pending
        Routine is passed:
            (*rou)(key, rtglist, window, request);
        Routine must either return periodically or check the window UserPort
        periodically for any impending messages, at which point it
        must return immediately.
        NOTE: idle routine is cleared on exit from DoRequest.

    UpdateRTGList(rlist)
        Updates the RTGList from the gadgets

    void DoRugTopRequest (pkey, rlist, ilist, win, req)
        add this sub-requester

    void RugPullRequest (rlist, win, req)
        Snatch this sub-requester out, and all those on top
        If rlist is null, then snatch out ALL of them!


    short RegisterCGC(class, create, handler, remove, refresh, update, idle)
        short class;
        BOOL (*create)();
        BOOL (*handler)();
        BOOL (*remove)();
        BOOL (*refresh)();
        BOOL (*update)();
        BOOL (*idle)();

        Registers a new class of gadget with the RequesterTools. The class
        can either be specified, or NULL. If NULL, then a class value will
        be generated. In either case, the class will be returned, and will
        always be negative. (If the return is 0 then either a duplicate
        class was specified, or you're out of memory.) The three methods,
        (*create)(), (*handler)(), and (*remove)() perform the expected
        functions. (*create)() actually will create this gadget by allocating
        a Gadget structure, setting it up, and allocating any other resources
        that it needs.  (*handler)() will handle (and perhaps modify)
        incomming input events.  (*remove)() will be responsible for removing
        the gadget. Not all of these need be present with the exception of
        (*create)(); as long as the memory allocated was done so with the
        provided key (and no other types of resources were used) (*remove)()
        need not be done, and can just be NULL. It is also not mandatory to
        have a (*handler)(), unless special rendering will be done for this
        class.

        The methods are as follows:

            (*create)(key, rtg, cgc)    - Create this gadget

                struct Remember **key;      -All memory needed by this gadget
                                             is to be allocated here.

                RTGList *rtg;               -The single RTG entry that is an
                                             instance of this class.

                CustomGadgetClass *cgc;     -The class structure.

                Return TRUE if successful, or FALSE if not.

            (*handle)(key, rp, rtg, pclass, pcode, px, py)

                struct Remember **key;      -You shouldn't have to allocate
                                             more memory, but just in case...
                                             Be warned- this key may belong to
                                             the Requester and will be freed
                                             upon exit from DoRequest()!

                struct RastPort *rp;        -A special RastPort that represent
        s
                                             your imagery area. Origin is set
                                             to the upper-left corner of this
                                             instance of the gadget, and is
                                             clipped to the width and height.

                RTGList *rtg;               -The instance of this class

                ULONG *pclass;              -The Intuition Class responsible
                                             for this invocation. You are free
                                             to modify this entry, as this wil
        l
                                             also be passed on to the gadget's
                                             method. If you make this NULL, th
        en
                                             the gadget's method WILL NOT be
                                             called.

                USHORT *pcode;              -The Intuition Code. You are free
                                             to modify this entry. This entry
                                             will also be passed to the gadget
        's
                                             method.

                short *px, *py              -These are equivalent to the
                                             MouseX and MouseY of IntuiMessage
        ,
                                             adjusted for the new origin. You
                                             may modify these, as well, and
                                             the degree of modification will
                                             be reflected in the original
                                             IntuiMessage that will eventually
                                             go out to the Gadget's method.

                Return TRUE if successful, or FALSE if not.

            (*remove)(key, rtg, cgc)    - Remove this gadget

                struct Remember **key;      -You shouldn't need to use this.

                RTGList *rtg;               -The single RTG entry that is an
                                             instance of this class.

                CustomGadgetClass *cgc;     -The class structure.

                Return TRUE if successful, or FALSE if not.

            (*refresh)(key, rp, rtg)    - Refresh Gadgets with new information

                struct Remember **key;      -A key to be used for memory alloc
        ation.
                                             Normally, you should avoid alloca
        ting
                                             more memory at this point, but it
         is
                                             diffucult to forsee all possible
                                             new uses. Your application
                                             will supply this, or make it NULL
        .
                                             NOTE: You should be able to handl
        e
                                             the NULL case here.

                struct RastPort *rp;        -A special RastPort that represent
        s
                                             your imagery area. Origin is set
                                             to the upper-left corner of this
                                             instance of the gadget, and is
                                             clipped to the width and height.
                                             Since you will not be calling
                                             this directly, this will automagi
        cally
                                             be set up for you.

                RTGEntry *rtg;              -The instance of this class.

            (*update)(key, rtg)         - Update RTGEntry from Gadget (note th
        at
                                            this would normally be done from
                                            within your handler).

                struct Remember **key;      -A key to be used for memory alloc
        ation.
                                             Your application will supply this
        ,
                                             or make it NULL.

                                             NOTE: You should be able to handl
        e
                                             the NULL case here.

                RTGEntry *rtg;              -The instance of this class.

    NOTE 4:
        for now, the Rug Requesters' gadgets are totally removed when pulled!

mwlib/BSTRcptoSTR                                           mwlib/BSTRcptoSTR
    Mitchell/Ware Systems           Version 1.00            08-Dec-88

    NAME
        BSTRcptoSTR -- copy a BSTR to a 'C' STR.

    SYNOPSIS
        void BSTRcptoSTR (UBYTE *bstr, UBYTE *buf)

    FUNCTION
        Copies a BSTR to 'C' string buffer. The buffer is assumed to
        be large enough to contain the string plus the terminating NULL.

    INPUT
        bstr    - The BSTR
        buf     - The receiving 'C' string buffer.

    RESULT
        None.
        Fills the given buffer with the C-style string.

    SEE ALSO
        BSTRtoSTR()
mwlib/BSTRtoSTR                                               mwlib/BSTRtoSTR
    Mitchell/Ware Systems           Version 1.01            08-Dec-88

    NAME
        BSTRtoSTR -- allocate and copy BSTR to a STR.

    SYNOPSIS
        UBYTE *BSTRtoSTR(BPTR b)

    FUNCTION
        Converts a BSTR to 'C' STRING, allocating a new string with calloc().

    INPUT
        b   - The BSTR

    RESULT
        Returns a pointer to a 'C' string, or NULL if out of memory.

    SEE ALSO
        BSTRcptoSTR()
MWLib/c/ShutDown                                             MWLib/c/ShutDown

    NAME
        ShutDown -- ShutDown stub

    SYNOPSIS
        ShutDown()

    FUNCTION
        Calls exit(20) after displaying a warning.

mwlib/c/StrDupVec                                           mwlib/c/StrDupVec

    NAME
        StrDupVec -- Copy a string using AllocVec()

    SYNOPSIS
        char *StrDupVec(char *string)

    FUNCTION
        Copies string, allocating space for it using AllocVec().
        Null pointers and null strings are allowed.

        This allows a way to pass ownership of strings to other
        tasks.

    INPUTS
        string  - string to be duplicated

    RESULTS
        Returns NULL if out of memory or a NULL pointer was passed,
        else a pointer to the copy of string is returned.

        NOTE, unlike strdup(), strings copied with StrDupVec()
        must be freed with FreeVec() when you are done.

    NOTES

    SEE ALSO
        keyStrDup()

MWLib/c/TokenTools                                         MWLib/c/TokenTools

    NAME
        TokenTools -- tools for parsing and tokenization

    AUTHOR
        Copyright © 1990-91 Mitchell/Ware Systems. All rights reserved.

    SYNOPSIS
        tt_GetToken -- parse a buffer into tokens

MWLib/c/TokenTools/tt_GetToken                 MWLib/c/TokenTools/tt_GetToken

    NAME
        tt_GetToken -- parse a buffer into tokens

    SYNOPSIS
        char *tt_GetToken(  char    *buf,
                            char    *tok_buf,
                            TTBreak *break_array,
                            TTBreak **bentry,
                            TTBreak *keyword_array,
                            TTBreak **kentry,
                            char    *keyword_break)

    FUNCTION
        Parses and tokenizes the given buffer one token per call. Passes
        token and next position in buffer to parse back to caller.

        Parse information present in the TTBreak array must conform to the
        wildcard conventions of stcpm(). This may change in the future.

        Escape-sequences are processed within string-tokens, as follows:

            \a
            \b
            \f      form-feed
            \n      newline
            \r      carriage-return
            \t      tab
            \v      vertical tab
            \0nnn   octal character
            \xnnn   hex character
            \dnnn   decimal character

    INPUTS
        buf             - buffer to tokenize

        tok_buf         - where to place NULL-terminated token (size
                          of 256 is assumed- you were warned!)

        break_array     - NULL-ENTRY-terminated array of break sequence
                          or NULL

        pentry          - place to return either NULL or break entry.
                          If token was found in break array, returns
                          pointer to entry. Otherwise, returns NULL
                          here if token was not a break sequence.

        keyword_array   - NULL-ENTRY-terminated array of keywords
                          or NULL.

        kentry          - place to return either NULL or break entry.
                          If token was found in break array, returns
                          pointer to entry. Otherwise, returns NULL
                          here if token was not a break sequence. kentry
                          can also be NULL if you like.

        keyword_break   - characters that MUST surrond the keyword
                          for it to be considered a keyword! MUST be
                          present if keyword_array is given.

                          tt_GetToken() will process characters between
                          two '"'s as a single token UNLESS the '"' DOES NOT
                          appears as one of the keyword_break characters.
                          In that case, the '"' is treated no differently
                          from any other character.

    RESULTS
        Returns a pointer to the next token in the sequence, or NULL
        if end of null-terminated buffer is reached.

    NOTES
        Uses SAS's stcpm() pattern matching. TTBreak entries must conform
        to stcpm()'s wildcard spec. This is the most common 'gotcha', so
        be aware of this.

    SEE ALSO

MWlib/fuckup                                                     MWlib/fuckup
    fuckup.c

    Mitchell/Ware Systems           Version DEAD            9/15/88

    OBSOLETE. Use FatalRequest, Instead.
MWLib/keyStrDup                                               MWLib/keyStrDup
    NAME
        keyStrDup -- duplicate a string using AllocRemember()

    SYNOPSIS
        char *keyStrDup(struct Remember **key, char *string)

    FUNCTION
        Creates a duplicate of a string just like strdup() does, except
        AllocRemember() is used to allocate the memory instead of malloc().

    INPUTS
        key     - pointer to pointer to the Remember structure.
        string  - Null-terminated string to be replicated.

    RESULT
        A ptr to a duplicate, NULL-terminated copy of string is returned,
        or NULL if memory could not be allocated. Memory allocated is
        of the type MEMF_PUBLIC.

    SEE ALSO
        intuition/intuition.h
        strdup()

mwlib/LinkTools                                               mwlib/LinkTools
    NAME
        LinkTools -- Tools for link management

    SYNOPSIS

        FUNCTIONS
            void *AddLinkHead(Link *head, Link *link, void *container);
            void *AddLinkTail(Link *head, Link *link, void *container);

        MACROS (see LinkTools.h)
            void InitLinkHead(Link *head);
            void InitCLinkHead(Link *head, void *container);
            Link *NextLink(Link *link);
            Link *PrevLink(Link *link);
            void *Container(Link *link);
            void DeleteLink(Link *link);
            void JoinLinks(Link *h1, Link *h2);
            void FSplitLinks(Link *h1, Link *h2);

    FUNCTION
        Provides a set of tools to manage linked lists. Based on ListTools.

    SEE ALSO
        LinkTools.h
        mwlib/ListTools

mwlib/LinkTools/AddLinkHead                       mwlib/LinkTools/AddLinkHead

    NAME
        AddLinkHead -- Add given link to head of list, setting container

    SYNOPSIS
        void *AddLinkHead(Link *head, Link *link, void *container);

    FUNCTION
        Adds the given link to head of list, and sets the container (myself)
        pointer to 'container'. 'container' can be either a pointer to the
        true container, or NULL to signify the head.

    INPUTS
        head        - The 'head' of the list. Not required to be a true head, 
        but
                      may also be another link in the list.

        link        - The link to be added.

        container   - A pointer to the container of this link. Can be NULL to
                      signify 'link' to really be a head.

    RESULT
        The value of 'container' is returned.

    SEE ALSO
        mwlib/LinkTools/AddLinkTail

mwlib/LinkTools/AddLinkTail                       mwlib/LinkTools/AddLinkTail

    NAME
        AddLinkTail -- Add given link to Tail of list, setting container

    SYNOPSIS
        void *AddLinkTail(Link *head, Link *link, void *container);

    FUNCTION
        Adds the given link to Tail of list, and sets the container (myself)
        pointer to 'container'. 'container' can be either a pointer to the
        true container, or NULL to signify the head.

    INPUTS
        head        - The 'head' of the list. Not required to be a true head, 
        but
                      may also be another link in the list.

        link        - The link to be added.

        container   - A pointer to the container of this link. Can be NULL to
                      signify 'link' to really be a head.

    RESULT
        The value of 'container' is returned.

    SEE ALSO
        mwlib/LinkTools/AddLinkHead

MWLib/MenuTools                                               MWLib/MenuTools
    MenuTools.c

    Mitchell/Ware           Version 3.01            3/12/88

    Routines to make easy the access to windows

    EDIT History:

        3/22/90 (2.00) - Major changes, made reentrant. Code must be updated
                         to the new calls and re-compiled. See SetMenuWidth()
                         and SetMenuHeight().

        8/27/90 (2.10) - added itemdata. Made changes in parameter passing of
                         SetMenuItem() and SetSubItem() due to the fact that
                         no one is using the help facility yet.

        05 Jan 1992 (3.01)  - Changed MenuPac to struct MenuPac
  ****************************************************************************
        *

    PREREQUSITE:    intuition and graphics libraries must be open

    ASSUMPTIONS:    width of characters in menu-strip is assumed to be 8 unles
        s
                    otherwise specified.

    NOTE: All functions return NULL if failed, unless otherwise noted.

    struct MenuPac *InitMP()       returns the initial packet
    VOID    DInitMP(pac)    deallocate everything

    SetMenu (pac, name, seperation)
            pac is the initial packet
            name is the name of menu column
            seperation is the spacing from previous menu

    SetMenuItem(pac, name, flags, exclude, bytecmd, width, funct, itemdata, he
        lpfile, helpfunct)
            name     -the name of this item
            flags    -the additional flags required (Flags are semi-auto)
            exclude  -the MutualExclude
            bytecmd  -NULL or the AmigaKey command
            width    -the width in pixels of the select box, or NULL
            funct    -(optional) is the call-back function to be used with DoM
        enu().
            data     -(optional) a ULONG item data field to be passed to funct
        ions.
                      Normally used as an identifier.
            helpfile -(optional) the name of the helpfile for this function, o
        r NULL
            helpfunct -(optional) helpfunction to call, or NULL

    SetSubItem - same parms as SetMenuItem

    SetMenuFrontPen (pac, num)   change defaults...
    SetMenuBackPen (pac, num)
    SetMenuDrawMode (pac, flags)
    SetMenuWidth (pac, font_width)
    SetMenuHeight (pac, font_height)

    SetMenuHelpDirectory(pac, directory)
    SetMenuHelpDisplay(pac, funct_display)

    EnableMenu(pac, window, string)
    EnableMenuItem(pac, window, #menu, string)
    EnableSubItem(pac, window, #menu, #item, string)
        Where:
            pac     -the MenuPac packet
            window  -the window to which this menu is attached
            string  -string discribing the enabling (see below)
            #menu   -the menu number (first is zero)
            #item   -the item number (first is zero)

        Strings:
            Strings must match the part of the menu in length that they are
            modifying, as well as be null-terminated. Only 3 characters are
            allowed in the string -
                '1' for enable
                '0' for disable
                'x' for don't care- leave unmodified.
                    (Upper & lower case allowed.)

    BOOL DoMenu(pac, code, data1, data2, boolhelp)
            Total Menu Processing. uses callbacks.
                pac      -the MenuPac packet
                code     -the code field given by an menu selection event
                data1    -(optional) data1 packet to be passed to callback
                data2    -(optional) data2 packet to be passed to callback
                boolhelp -(required) TRUE if help is requested instead of
                          actual function.

            The callback receives:
                (*mfunct)(menu, menucode, data1, data2, itemdata)
                    menu        -the MenuPac packet
                    menucode    -the MenuCode for this menu selection
                    data1       -(optional) user data
                    data2       -(optional) user data
                    itemdata    -(optional) item data field

            If a particular menu selection has no corresponding code, it is
            ignored.

            DoMenu returns a TRUE if one or more of the callbacks returned
            TRUE. Otherwise, DoMenu returns FALSE.

            DoMenu, upon request (boolhelp), calls instead of the function
            to handle the menu selection, a specified help function, and will
            pass to it the following parameters:
                void (*helpfunction)(pac, code, pathname, data1, data2, itemda
        ta)
                    pac         -the MenuPac packet
                    code        -the MenuCode responsible
                    pathname    -the (full) pathname for the helpfile
                    data1       -(optional) user data
                    date2       -(optional) user data

            The helpfunction is free to do whatever it wants to display the
            requested help information.

MWLib/SpriteTools                                           MWLib/SpriteTools
    NAME
        SpriteTools -- Tools that aid in the creation of simple sprites

    COPYRIGHT
        Mitchell/Ware Systems, Inc.    Version 1.00                24 Nov 1990

    SYNOPSIS
        struct SimpleSprite *BitMapToSprite(key, bitmap, left, top);

MWLib/SpriteTools/BitMapToSprite             MWLib/SpriteTools/BitMapToSprite
    NAME
        BitMapToSprite -- Convert a bitmap to a SimpleSprite.

    SYNOPSIS
        struct SimpleSprite
            *BitMapToSprite(struct Remember **key,
                            struct BitMap *bitmap, short left, short top);

    FUNCTION
        Converts the given bitmap into a SimpleSprite. The given BitMap must
        be the exact intended size of the target sprite. Extraneous bitplanes
        are ignored.

    INPUTS
        key     - The key used for all memory allocations for this sprite
        bitmap  - The bitmap to be converted
        left    - Initial X position of sprite
        top     - Initial Y position of sprite

    RESULT
        If successful, returns a pointer to a SimpleSprite structure, else
        NULL if there were a problem (like incorrect BitMap dimensions or
        out-of-memory conditions).

    NOTES

    SEE ALSO
        MWLib/ImageTools/BitMapToImage

MWLib/StrFlag                                                   MWLib/StrFlag
    NAME
        StrFlag -- StringFlag Conversion

    SYNOPSIS
        ULONG StrFlag (ULONG *pflag, char *str);

    FUNCTION
        Sets and resets bits according to the given string. String is a
        stream of 1's and 0's with the following interpretation:
            if '1' then set the corresponding bit
            if '0' then reset the corresponding bit
            if 'X' then ignore the bit.
        Least significant bit is to the left, not the right.

    INPUTS
        pflag   - A pointer to the ULONG flag field to be modified.
        str     - The string modifier.

    RESULT
        bits in *pflag become modified according to the specifications. The
        new pattern is also returned.

        If an error is generated, a requester is displayed, and the return
        will not match the contents of *pflag.
MWLib/TextTools                                               MWLib/TextTools
    TextTools.c - Create an IntuiText chain

    Mitchell/Ware Systems       Version 2.00        5/22/88

    ________________________________________________________________________

    IntuiText *MakeIText(key, text, left, top, itchain, ta)
        key         - the Remember structure
        text        - null-terminated text
        left, top   - where it will appear
        itchain     - ptr to next IntuiText structure
        ta          - pointer to a TextAttr or NULL


    void SetITFrontBack(front, back)
            sets the default front pen and back pen

    void SetITDrawMode(mode)
