[TUHS] Obscure Blit menu data structure

Noel Hunt noel.hunt at gmail.com
Fri Jun 23 15:56:25 AEST 2017

I was hoping someone on the list who remembers 'mhit.c' from
the Blit library code could shed some light on some members
of the 'NMitem' structure. I believe that 'mhit' (sometimes
'hmenunit') was written by Andrew Hume.

The structure in question is this:

typedef struct NMitem
    char    *text;
    char    *help;
    struct NMenu *next;
    void    (*dfn)(), (*bfn)(), (*hfn)();
    long    data;        /* user only */
} NMitem;

The three functions are called at different times when a menu
is being traversed, but 'dfn' and 'bfn' are only called before
a submenu is entered, and after a submenu is exited, respectively.
'hfn' is called whenever an item has been selected.

I have never seen 'dfn' and 'bfn' used in any Bell Labs code so
I was wondering what the rationale for their existence was.

Noel Hunt
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://minnie.tuhs.org/pipermail/tuhs/attachments/20170623/3eeb1491/attachment.html>

More information about the TUHS mailing list