Annotation of 43BSDReno/contrib/jove/dataobj.h, revision 1.1.1.1

1.1       root        1: /***************************************************************************
                      2:  * This program is Copyright (C) 1986, 1987, 1988 by Jonathan Payne.  JOVE *
                      3:  * is provided to you without charge, and with no warranty.  You may give  *
                      4:  * away copies of JOVE, including sources, provided that this notice is    *
                      5:  * included in all the files.                                              *
                      6:  ***************************************************************************/
                      7: 
                      8: #define FUNCTION       1
                      9: #define VARIABLE       2
                     10: #define MACRO          3
                     11: #define KEYMAP         4
                     12: #ifdef MAC
                     13: # define BUFFER                6       /* menus can point to buffers, too */
                     14: # define STRING                7       /* a menu string or divider */
                     15: #endif
                     16: 
                     17: #define TYPEMASK       07
                     18: #define obj_type(o)    ((o)->Type & TYPEMASK)
                     19: #define MAJOR_MODE     010
                     20: #define MINOR_MODE     020
                     21: #define MODIFIER       040
                     22: #define MODFUNC                (FUNCTION|MODIFIER)
                     23: #define DefMajor(x)    (FUNCTION|MAJOR_MODE|((x) << 8))
                     24: #define DefMinor(x)    (FUNCTION|MINOR_MODE|((x) << 8))
                     25: 
                     26: struct macro {
                     27:        int     Type;           /* in this case a macro */
                     28:        char    *Name;          /* name is always second ... */
                     29:        int     m_len,          /* length of macro so we can use ^@ */
                     30:                m_buflen,       /* memory allocated for it */
                     31:                m_flags;
                     32:        char    *m_body;        /* actual body of the macro */
                     33:        struct macro
                     34:                *m_nextm;
                     35: };
                     36: 
                     37: struct cmd {
                     38:        int     Type;
                     39:        char    *Name;
                     40:        void (*c_proc) proto((void));
                     41: #ifdef MAC
                     42:        char c_map;                     /* prefix map for About Jove... */
                     43:        char c_key;                     /* key binding for About Jove... */
                     44: #endif
                     45: };
                     46: 
                     47: typedef struct data_obj {
                     48:        int     Type;
                     49:        char    *Name;
                     50: } data_obj;    /* points to cmd, macro, keymap or variable */
                     51: 
                     52: extern data_obj        *LastCmd;       /* last command invoked */
                     53: 
                     54: extern const struct cmd        commands[];
                     55: extern struct macro    *macros;
                     56: 
                     57: extern struct macro
                     58:        *macstack[],
                     59:        KeyMacro;
                     60: 
                     61: extern const struct cmd
                     62:        *FindCmd proto((void (*proc) proto((void))));
                     63: 
                     64: extern data_obj
                     65:        *findcom proto((char *prompt)),
                     66:        *findmac proto((char *prompt)),
                     67:        *findvar proto((char *prompt));

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.