Annotation of 43BSDReno/contrib/jove/jove.h, revision 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: /* jove.h header file to be included by EVERYONE */
        !             9: 
        !            10: #include <setjmp.h>
        !            11: #ifndef TUNED
        !            12: # include "tune.h"
        !            13: #endif
        !            14: 
        !            15: #if !defined(MAC)
        !            16: # include <sys/types.h>
        !            17: # include <string.h>
        !            18: #else
        !            19: # include <types.h>
        !            20: #endif
        !            21: 
        !            22: /* proto: macro to allow us to prototype any function declaration
        !            23:  * without upsetting old compilers.
        !            24:  */
        !            25: 
        !            26: #if defined(__STDC__) || defined(USE_PROTOTYPES)
        !            27: # define proto(x)        x
        !            28: #else
        !            29: # define proto(x)              ()
        !            30: #endif
        !            31: 
        !            32: /* UNDEF: macro to allow is to use ansi style undefinition of macros when
        !            33:  * declaring functions. i.e. 
        !            34:  *     extern int (vfork) (void)
        !            35:  * is declared as
        !            36:  *     extern int UNDEF(vfork) proto((void))
        !            37:  */
        !            38: #if defined(__STDC__)
        !            39: # define UNDEF(proc)   (proc)
        !            40: #else
        !            41: # define UNDEF(proc)   proc
        !            42: #endif
        !            43: 
        !            44: #if defined(__STDC__)
        !            45: #define        STDARGS 1
        !            46: # define       va_init(ap, parmN)      { va_start((ap), (parmN)); }
        !            47: #else
        !            48: # define       va_init(ap, parmN)      { va_start((ap)); }
        !            49: #endif
        !            50: 
        !            51: /* const: readonly type qualifier */
        !            52: #ifndef        __STDC__
        !            53: #define        const   /* Only in ANSI C.  Pity */
        !            54: #endif /* !__STDC__ */
        !            55: 
        !            56: /* UnivPtr: universal pointer type */
        !            57: #ifdef __STDC__
        !            58: typedef void   *UnivPtr;
        !            59: typedef const void     *UnivConstPtr;
        !            60: #else  /* !__STDC__ */
        !            61: typedef char   *UnivPtr;
        !            62: typedef const char     *UnivConstPtr;
        !            63: #endif /* !__STDC__ */
        !            64: 
        !            65: #ifndef        EOF
        !            66: #define EOF    (-1)
        !            67: #endif
        !            68: 
        !            69: /* typedef structure definitions */
        !            70: #ifdef IPROCS
        !            71: typedef struct process Process;
        !            72: #endif
        !            73: typedef struct window  Window;
        !            74: typedef struct position        Bufpos;
        !            75: typedef struct mark    Mark;
        !            76: typedef struct buffer  Buffer;
        !            77: typedef struct line    Line;
        !            78: typedef struct iobuf   IOBUF;
        !            79: 
        !            80: #include "buf.h"
        !            81: #include "wind.h"
        !            82: #include "io.h"
        !            83: #include "dataobj.h"
        !            84: #include "keymaps.h"
        !            85: #include "argcount.h"
        !            86: #include "util.h"
        !            87: #include "vars.h"
        !            88: #include "screen.h"
        !            89: #include "style.h"
        !            90: 
        !            91: /* return codes for command completion (all < 0 because >= 0 are
        !            92:    legitimate offsets into array of strings */
        !            93: 
        !            94: #define AMBIGUOUS      (-2)    /* matches more than one at this point */
        !            95: #define UNIQUE         (-3)    /* matches only one string */
        !            96: #define ORIGINAL       (-4)    /* matches no strings at all! */
        !            97: #define NULLSTRING     (-5)    /* just hit return without typing anything */
        !            98: 
        !            99: /* values for the `flags' argument to complete */
        !           100: #define NOTHING                0       /* opposite of RET_STATE */
        !           101: #define RET_STATE      1       /* return state when we hit return */
        !           102: #define RCOMMAND       2       /* we are reading a joverc file */
        !           103: #define CASEIND                4       /* map all to lower case */
        !           104: 
        !           105: #define FORWARD                1
        !           106: #define BACKWARD       (-1)
        !           107: 
        !           108: #define ARG_CMD                1
        !           109: #define LINECMD                2
        !           110: #define KILLCMD                3       /* so we can merge kills */
        !           111: #define YANKCMD                4       /* so we can do ESC Y (yank-pop) */
        !           112: 
        !           113: extern jmp_buf mainjmp;
        !           114: 
        !           115: /* setjmp/longjmp args for DoKeys() mainjmp */
        !           116: #define FIRSTCALL      0
        !           117: #define ERROR          1
        !           118: #define COMPLAIN       2       /* do the error without a getDOT */
        !           119: #define QUIT           3       /* leave this level of recursion */
        !           120: 
        !           121: #define YES_NODIGIT    2
        !           122: 
        !           123: #define INT_OKAY       0
        !           124: #define INT_BAD                (-1)
        !           125: 
        !           126: extern char    NullStr[];
        !           127: extern char    *ProcFmt;
        !           128: 
        !           129: extern int
        !           130:        InMacDefine,    /* are we defining a macro right now? */
        !           131: 
        !           132:        LastKeyStruck,
        !           133: 
        !           134:        TOabort,        /* flag set by Typeout() */
        !           135:        errormsg,       /* last message was an error message
        !           136:                           so don't erase the error before it
        !           137:                           has been read */
        !           138:        RecDepth,       /* recursion depth */
        !           139:        InputPending,   /* nonzero if there is input waiting to
        !           140:                           be processed */
        !           141: 
        !           142:        InJoverc,
        !           143:        Interactive,
        !           144: 
        !           145:        Crashing,       /* we are in the middle of crashing */
        !           146:        Asking,         /* are we on read a string from the terminal? */
        !           147:        InRealAsk,      /* are we currently executing real_ask()? */
        !           148:        inIOread;       /* so we know whether we can do a redisplay. */
        !           149: 
        !           150: extern char
        !           151:        *Inputp,
        !           152:        Minibuf[LBSIZE],
        !           153:        ShcomBuf[LBSIZE],
        !           154:        *version;
        !           155: 
        !           156: #define MESG_SIZE 128
        !           157: extern char    mesgbuf[MESG_SIZE];
        !           158: 
        !           159: #define CATCH \
        !           160: {\
        !           161:        jmp_buf sav_jmp; \
        !           162: \
        !           163:        push_env(sav_jmp); \
        !           164:        if (setjmp(mainjmp) == 0) {
        !           165: 
        !           166: #define ONERROR \
        !           167:        } else { \
        !           168: 
        !           169: #define ENDCATCH \
        !           170:        } \
        !           171:        pop_env(sav_jmp); \
        !           172: }
        !           173: 
        !           174: #include "externs.h"

unix.superglobalmegacorp.com

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