home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fresh Fish 10
/
Fresh_Fish_10_2352.bin
/
useful
/
util
/
edit
/
mg
/
src.lzh
/
h
/
def.h
< prev
next >
Wrap
C/C++ Source or Header
|
1990-05-23
|
20KB
|
647 lines
#ifndef DEF_H
#define DEF_H
/*
* This file is the general header file for all parts of the MicroEMACS
* display editor. It contains all of the general definitions and macros. It
* _must_ be included in any source file after all the option include files.
*/
#include "sysdef.h" /* Order is critical. */
#include "ttydef.h"
#include "chrdef.h"
/*
* If your system and/or compiler does not support the "void" type then
* define NO_VOID_TYPE in sysdef.h. In the absence of some other definition
* for VOID, the default in that case will be to turn it into an int, which
* works with most compilers that don't support void. In the absence of any
* definition of VOID or NO_VOID_TYPE, the default is to assume void is
* supported, which should be the case for most modern C compilers.
*/
#ifdef NO_VOID_TYPE
# undef VOID
# define VOID int /* Default for no void is int */
#else
#ifndef VOID
# define VOID void /* Just use normal void */
#endif /* VOID */
#endif /* NO_VOID_TYPE */
/*
* If your system and/or compiler doesn't support prototypes, NO_PROTO in
* sysdef.h. This will cause all parameters to vanish.
*/
#ifdef NO_PROTO
#define PROTO(a) ()
#else
#define PROTO(a) a
#endif
/*
* Table sizes, etc.
*/
#define NFILEN 80 /* Length, file name. */
#define NBUFN 24 /* Length, buffer name. */
#define NMACN 80 /* Length, macro name. */
#define NLINE 256 /* Length, line. */
#define PBMODES 4 /* modes per buffer */
#define NKBDM 256 /* Length, keyboard macro. */
#define NPAT 80 /* Length, pattern. */
#define HUGE 1000 /* A rather large number. */
#define NSRCH 128 /* Undoable search commands. */
#define NXNAME 128 /* Length, extended command. */
#define NKNAME 20 /* Length, key names */
/*
* Universal.
*/
#define FALSE 0 /* False, no, bad, etc. */
#define TRUE 1 /* True, yes, good, etc. */
#define ABORT 2 /* Death, ^G, abort, etc. */
#define ERASE ABORT /* epresf -> erase _now_ */
/*
* These flag bits keep track of some aspects of the last command. The CFCPCN
* flag controls goal column setting. The CFKILL flag controls the clearing
* versus appending of data in the kill buffer.
*/
#define CFCPCN 0x0001 /* Last command was C-P, C-N */
#define CFKILL 0x0002 /* Last command was a kill */
#define CFINS 0x0004 /* Last command was self-insert */
/*
* File I/O.
*/
#define FIOSUC 0 /* Success. */
#define FIOFNF 1 /* File not found. */
#define FIOEOF 2 /* End of file. */
#define FIOERR 3 /* Error. */
#define FIOLONG 4 /* long line partially read */
/*
* Directory I/O.
*/
#define DIOSUC 0 /* Success. */
#define DIOEOF 1 /* End of file. */
#define DIOERR 2 /* Error. */
/*
* Display colors.
*/
#define CNONE 0 /* Unknown color. */
#define CTEXT 1 /* Text color. */
#define CMODE 2 /* Mode line color. */
/* Flags for keyboard invoked functions */
#define FFUNIV 1 /* universal argument */
#define FFNEGARG 2 /* negitive only argument */
#define FFOTHARG 4 /* other argument */
#define FFARG 7 /* any argument */
#define FFRAND 8 /* Called by other function */
/*
* Flags for "getkey". SOFTCR first. It should be a KCHAR that's not
* otherwise used. If the defualt won't work, set it in ttydef.h. SOFTCR is
* used to tag the end of strings in macros. You should use SEESCR if you
* want to get a real string, including carriage returns; SOFTCR will be the
* end of string marker. If you're getting some number of keys that
* terminates based on the keys (keymap searches, or some such), you should
* use DISSCR. It will throw out the SOFTCR that follows the argument you're
* reading in the macro (or startup buffer, which uses the same code). If the
* argument doesn't terminate correctly, the next argument read will have
* bogus values (either the end of your arg, or with you getting part of
* theirs). Setting niether causes the SOFTCR to turn into a CR. This is what
* eread and friends do.
*/
#ifndef SOFTCR
#define SOFTCR 0x1000 /* Avoid the metabit */
#endif
#define PROMPT 0x01 /* Delayed prompt, if supported */
#define SEESCR 0x02 /* Pass SOFTCR unmodifed */
#define DISSCR 0x04 /* Discard SOFTCR (with lookahead) */
#define CRFLAGS 0x06 /* All the SOFTCR flags at once */
/*
* Flags for "eread".
*/
#define EFFUNC 0x0001 /* Autocomplete functions. */
#define EFBUF 0x0002 /* Autocomplete buffers. */
#define EFFILE 0x0004 /* " files (maybe someday) */
#define EFMACRO 0x0008 /* Autocomplete only macros */
#define EFFORCE 0x0009 /* Must complete to known name */
#define EFAUTO 0x000F /* Some autocompleteion on */
#define EFNEW 0x0010 /* New prompt. */
#define EFCR 0x0020 /* Echo CR at end; last read. */
/*
* Flags for kinsert
*/
#define KFORW 0
#define KBACK 1
/*
* Externals.
*/
extern int thisflag;
extern int lastflag;
extern int curgoal;
extern int epresf;
extern int sgarbf;
extern int mode;
extern char pat[];
extern int nrow;
extern int ncol;
extern int ttrow;
extern int ttcol;
extern int tceeol;
extern int tcinsl;
extern int tcdell;
extern char cinfo[];
extern char *keystrings[];
#ifdef NO_PROTO
extern VOID ewprintf();
extern VOID update();
extern char *keyname();
extern char *adjustname();
extern VOID kdelete();
extern VOID lchange();
#endif
#ifndef ANSI
/*
* Standard I/O.
*/
extern char *strcpy();
extern char *strcat();
extern char *malloc();
#endif
/*
* This is the beginnings of the prototype list for all externals. We give
* prototypes for all external functions from all files that have arguments
* that are standard C type and return standard C types. Functions that
* return mg-specific types have prototypes in the .h files that define those
* types. Things are set up so that if you take it out of the ifdef's, you
* won't get the parameters unless your compiler can support them. I'm not
* sure what will happen in that case.
*/
#ifndef NO_PROTO
/* Prototypes for functions defined in help.c */
int desckey
PROTO((int f, int n));
int wallchart
PROTO((int f, int n));
int help_help
PROTO((int f, int n));
int apropos_command
PROTO((int f, int n));
/* Prototypes for functions defined in macro.c */
int definemacro
PROTO((int f, int n));
int finishmacro
PROTO((int f, int n));
int executemacro
PROTO((int f, int n));
int insertmacro
PROTO((int f, int n));
int namemacro
PROTO((int f, int n));
int macroset
PROTO((int f, int n));
int macroquery
PROTO((int f, int n));
/* Prototypes for functions defined in keymap.c */
int
complete_function(char *fname, int c);
char *function_name
PROTO((int (*fpoint) ()));
int (*
name_function PROTO((char *fname))) ();
/* Prototypes for functions defined in display.c */
VOID vtinit
PROTO((VOID));
VOID vttidy
PROTO((VOID));
VOID vtmove
PROTO((int row, int col));
VOID vtputc
PROTO((int c));
VOID vtpute
PROTO((int c));
VOID vteeol
PROTO((VOID));
VOID update
PROTO((VOID));
VOID updext
PROTO((int currow, int curcol));
int vtputs
PROTO((char *s));
/* Prototypes for functions defined in version.c */
int showversion
PROTO((int f, int n));
/* Prototypes for functions defined in cinfo.c */
char *keyname
PROTO((char *cp, int k));
/* Prototypes for functions defined in dir.c */
VOID dirinit
PROTO((VOID));
int changedir
PROTO((int f, int n));
int showcwdir
PROTO((int f, int n));
int filevisit
PR