Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!mit-eddie!ll-xn!adelie!necntc!ncoast!allbery From: nwd@j.cc.purdue.edu (Daniel Lawrence) Newsgroups: comp.sources.misc Subject: MicroEmacs 3.9 (Part 15 of 16) Message-ID: <5691@ncoast.UUCP> Date: Mon, 16-Nov-87 21:37:00 EST Article-I.D.: ncoast.5691 Posted: Mon Nov 16 21:37:00 1987 Date-Received: Fri, 20-Nov-87 06:47:26 EST Sender: allbery@ncoast.UUCP Lines: 1138 Approved: allbery@ncoast.UUCP X-Archive: comp.sources.misc/microemacs-3.9/14 # This is a shar archive. # Remove everything above this line. # Run the file through sh, not csh. # (type `sh mes.15') # If you do not see the message # `mes.15 completed!' # then the file was incomplete. echo extracting - ebind.h sed 's/^X//' > ebind.h << 'FRIDAY_NIGHT' X/* EBIND: Initial default key to function bindings for X MicroEMACS 3.7 X*/ X X/* X * Command table. X * This table is *roughly* in ASCII order, left to right across the X * characters of the command. This explains the funny location of the X * control-X commands. X */ XKEYTAB keytab[NBINDS] = { X {CTRL|'A', gotobol}, X {CTRL|'B', backchar}, X {CTRL|'C', insspace}, X {CTRL|'D', forwdel}, X {CTRL|'E', gotoeol}, X {CTRL|'F', forwchar}, X {CTRL|'G', ctrlg}, X {CTRL|'H', backdel}, X {CTRL|'I', tab}, X {CTRL|'J', indent}, X {CTRL|'K', killtext}, X {CTRL|'L', refresh}, X {CTRL|'M', newline}, X {CTRL|'N', forwline}, X {CTRL|'O', openline}, X {CTRL|'P', backline}, X {CTRL|'Q', quote}, X {CTRL|'R', backsearch}, X {CTRL|'S', forwsearch}, X {CTRL|'T', twiddle}, X {CTRL|'U', unarg}, X {CTRL|'V', forwpage}, X {CTRL|'W', killregion}, X {CTRL|'X', cex}, X {CTRL|'Y', yank}, X {CTRL|'Z', backpage}, X {CTRL|']', meta}, X {CTLX|CTRL|'B', listbuffers}, X {CTLX|CTRL|'C', quit}, /* Hard quit. */ X#if AEDIT X {CTLX|CTRL|'D', detab}, X {CTLX|CTRL|'E', entab}, X#endif X {CTLX|CTRL|'F', filefind}, X {CTLX|CTRL|'I', insfile}, X {CTLX|CTRL|'L', lowerregion}, X {CTLX|CTRL|'M', delmode}, X {CTLX|CTRL|'N', mvdnwind}, X {CTLX|CTRL|'O', deblank}, X {CTLX|CTRL|'P', mvupwind}, X {CTLX|CTRL|'R', fileread}, X {CTLX|CTRL|'S', filesave}, X#if AEDIT X {CTLX|CTRL|'T', trim}, X#endif X {CTLX|CTRL|'U', upperregion}, X {CTLX|CTRL|'V', viewfile}, X {CTLX|CTRL|'W', filewrite}, X {CTLX|CTRL|'X', swapmark}, X {CTLX|CTRL|'Z', shrinkwind}, X {CTLX|'?', deskey}, X {CTLX|'!', spawn}, X {CTLX|'@', pipecmd}, X {CTLX|'#', filter}, X {CTLX|'$', execprg}, X {CTLX|'=', showcpos}, X {CTLX|'(', ctlxlp}, X {CTLX|')', ctlxrp}, X {CTLX|'^', enlargewind}, X {CTLX|'0', delwind}, X {CTLX|'1', onlywind}, X {CTLX|'2', splitwind}, X {CTLX|'A', setvar}, X {CTLX|'B', usebuffer}, X {CTLX|'C', spawncli}, X#if BSD X {CTLX|'D', bktoshell}, X#endif X {CTLX|'E', ctlxe}, X {CTLX|'F', setfillcol}, X {CTLX|'K', killbuffer}, X {CTLX|'M', setmode}, X {CTLX|'N', filename}, X {CTLX|'O', nextwind}, X {CTLX|'P', prevwind}, X#if ISRCH X {CTLX|'R', risearch}, X {CTLX|'S', fisearch}, X#endif X {CTLX|'W', resize}, X {CTLX|'X', nextbuffer}, X {CTLX|'Z', enlargewind}, X#if WORDPRO X {META|CTRL|'C', wordcount}, X#endif X#if PROC X {META|CTRL|'E', execproc}, X#endif X#if CFENCE X {META|CTRL|'F', getfence}, X#endif X {META|CTRL|'H', delbword}, X {META|CTRL|'K', unbindkey}, X {META|CTRL|'L', reposition}, X {META|CTRL|'M', delgmode}, X {META|CTRL|'N', namebuffer}, X {META|CTRL|'R', qreplace}, X {META|CTRL|'S', newsize}, X {META|CTRL|'T', newwidth}, X {META|CTRL|'V', scrnextdw}, X#if WORDPRO X {META|CTRL|'W', killpara}, X#endif X {META|CTRL|'Z', scrnextup}, X {META|' ', setmark}, X {META|'?', help}, X {META|'!', reposition}, X {META|'.', setmark}, X {META|'>', gotoeob}, X {META|'<', gotobob}, X {META|'~', unmark}, X#if APROP X {META|'A', apro}, X#endif X {META|'B', backword}, X {META|'C', capword}, X {META|'D', delfword}, X#if CRYPT X {META|'E', setkey}, X#endif X {META|'F', forwword}, X {META|'G', gotoline}, X {META|'K', bindtokey}, X {META|'L', lowerword}, X {META|'M', setgmode}, X#if WORDPRO X {META|'N', gotoeop}, X {META|'P', gotobop}, X {META|'Q', fillpara}, X#endif X {META|'R', sreplace}, X#if BSD X {META|'S', bktoshell}, X#endif X {META|'U', upperword}, X {META|'V', backpage}, X {META|'W', copyregion}, X {META|'X', namedcmd}, X {META|'Z', quickexit}, X {META|0x7F, delbword}, X X#if MSDOS & (HP150 == 0) & (WANGPC == 0) & (HP110 == 0) X {SPEC|CTRL|'_', forwhunt}, X {SPEC|CTRL|'S', backhunt}, X {SPEC|71, gotobob}, X {SPEC|72, backline}, X {SPEC|73, backpage}, X {SPEC|75, backchar}, X {SPEC|77, forwchar}, X {SPEC|79, gotoeob}, X {SPEC|80, forwline}, X {SPEC|81, forwpage}, X {SPEC|82, insspace}, X {SPEC|83, forwdel}, X {SPEC|115, backword}, X {SPEC|116, forwword}, X#if WORDPRO X {SPEC|132, gotobop}, X {SPEC|118, gotoeop}, X#endif X {SPEC|84, cbuf1}, X {SPEC|85, cbuf2}, X {SPEC|86, cbuf3}, X {SPEC|87, cbuf4}, X {SPEC|88, cbuf5}, X {SPEC|89, cbuf6}, X {SPEC|90, cbuf7}, X {SPEC|91, cbuf8}, X {SPEC|92, cbuf9}, X {SPEC|93, cbuf10}, X#endif X X#if HP150 X {SPEC|32, backline}, X {SPEC|33, forwline}, X {SPEC|35, backchar}, X {SPEC|34, forwchar}, X {SPEC|44, gotobob}, X {SPEC|46, forwpage}, X {SPEC|47, backpage}, X {SPEC|82, nextwind}, X {SPEC|68, openline}, X {SPEC|69, killtext}, X {SPEC|65, forwdel}, X {SPEC|64, ctlxe}, X {SPEC|67, refresh}, X {SPEC|66, reposition}, X {SPEC|83, help}, X {SPEC|81, deskey}, X#endif X X#if HP110 X {SPEC|0x4b, backchar}, X {SPEC|0x4d, forwchar}, X {SPEC|0x48, backline}, X {SPEC|0x50, forwline}, X {SPEC|0x43, help}, X {SPEC|0x73, backword}, X {SPEC|0x74, forwword}, X {SPEC|0x49, backpage}, X {SPEC|0x51, forwpage}, X {SPEC|84, cbuf1}, X {SPEC|85, cbuf2}, X {SPEC|86, cbuf3}, X {SPEC|87, cbuf4}, X {SPEC|88, cbuf5}, X {SPEC|89, cbuf6}, X {SPEC|90, cbuf7}, X {SPEC|91, cbuf8}, X#endif X X#if AMIGA X {SPEC|'?', help}, X {SPEC|'A', backline}, X {SPEC|'B', forwline}, X {SPEC|'C', forwchar}, X {SPEC|'D', backchar}, X {SPEC|'T', backpage}, X {SPEC|'S', forwpage}, X {SPEC|'a', backword}, X {SPEC|'`', forwword}, X {SPEC|'P', cbuf1}, X {SPEC|'Q', cbuf2}, X {SPEC|'R', cbuf3}, X {SPEC|'S', cbuf4}, X {SPEC|'T', cbuf5}, X {SPEC|'U', cbuf6}, X {SPEC|'V', cbuf7}, X {SPEC|'W', cbuf8}, X {SPEC|'X', cbuf9}, X {SPEC|'Y', cbuf10}, X {127, forwdel}, X#endif X X#if ST520 X {SPEC|'b', help}, X {SPEC|'H', backline}, X {SPEC|'P', forwline}, X {SPEC|'M', forwchar}, X {SPEC|'K', backchar}, X {SPEC|'t', setmark}, X {SPEC|'a', yank}, X {SPEC|'R', insspace}, X {SPEC|'G', gotobob}, X {127, forwdel}, X {SPEC|84, cbuf1}, X {SPEC|85, cbuf2}, X {SPEC|86, cbuf3}, X {SPEC|87, cbuf4}, X {SPEC|88, cbuf5}, X {SPEC|89, cbuf6}, X {SPEC|90, cbuf7}, X {SPEC|91, cbuf8}, X {SPEC|92, cbuf9}, X {SPEC|93, cbuf10}, X#endif X X#if WANGPC X SPEC|0xE0, quit, /* Cancel */ X SPEC|0xE1, help, /* Help */ X SPEC|0xF1, help, /* ^Help */ X SPEC|0xE3, ctrlg, /* Print */ X SPEC|0xF3, ctrlg, /* ^Print */ X SPEC|0xC0, backline, /* North */ X SPEC|0xD0, gotobob, /* ^North */ X SPEC|0xC1, forwchar, /* East */ X SPEC|0xD1, gotoeol, /* ^East */ X SPEC|0xC2, forwline, /* South */ X SPEC|0xD2, gotobop, /* ^South */ X SPEC|0xC3, backchar, /* West */ X SPEC|0xD3, gotobol, /* ^West */ X SPEC|0xC4, ctrlg, /* Home */ X SPEC|0xD4, gotobob, /* ^Home */ X SPEC|0xC5, filesave, /* Execute */ X SPEC|0xD5, ctrlg, /* ^Execute */ X SPEC|0xC6, insfile, /* Insert */ X SPEC|0xD6, ctrlg, /* ^Insert */ X SPEC|0xC7, forwdel, /* Delete */ X SPEC|0xD7, killregion, /* ^Delete */ X SPEC|0xC8, backpage, /* Previous */ X SPEC|0xD8, prevwind, /* ^Previous */ X SPEC|0xC9, forwpage, /* Next */ X SPEC|0xD9, nextwind, /* ^Next */ X SPEC|0xCB, ctrlg, /* Erase */ X SPEC|0xDB, ctrlg, /* ^Erase */ X SPEC|0xDC, ctrlg, /* ^Tab */ X SPEC|0xCD, ctrlg, /* BackTab */ X SPEC|0xDD, ctrlg, /* ^BackTab */ X SPEC|0x80, ctrlg, /* Indent */ X SPEC|0x90, ctrlg, /* ^Indent */ X SPEC|0x81, ctrlg, /* Page */ X SPEC|0x91, ctrlg, /* ^Page */ X SPEC|0x82, ctrlg, /* Center */ X SPEC|0x92, ctrlg, /* ^Center */ X SPEC|0x83, ctrlg, /* DecTab */ X SPEC|0x93, ctrlg, /* ^DecTab */ X SPEC|0x84, ctrlg, /* Format */ X SPEC|0x94, ctrlg, /* ^Format */ X SPEC|0x85, ctrlg, /* Merge */ X SPEC|0x95, ctrlg, /* ^Merge */ X SPEC|0x86, setmark, /* Note */ X SPEC|0x96, ctrlg, /* ^Note */ X SPEC|0x87, ctrlg, /* Stop */ X SPEC|0x97, ctrlg, /* ^Stop */ X SPEC|0x88, forwsearch, /* Srch */ X SPEC|0x98, backsearch, /* ^Srch */ X SPEC|0x89, sreplace, /* Replac */ X SPEC|0x99, qreplace, /* ^Replac */ X SPEC|0x8A, ctrlg, /* Copy */ X SPEC|0x9A, ctrlg, /* ^Copy */ X SPEC|0x8B, ctrlg, /* Move */ X SPEC|0x9B, ctrlg, /* ^Move */ X SPEC|0x8C, namedcmd, /* Command */ X SPEC|0x9C, spawn, /* ^Command */ X SPEC|0x8D, ctrlg, /* ^ */ X SPEC|0x9D, ctrlg, /* ^^ */ X SPEC|0x8E, ctrlg, /* Blank */ X SPEC|0x9E, ctrlg, /* ^Blank */ X SPEC|0x8F, gotoline, /* GoTo */ X SPEC|0x9F, usebuffer, /* ^GoTo */ X#endif X X {0x7F, backdel}, X X /* special internal bindings */ X SPEC|META|'W', wrapword, /* called on word wrap */ X SPEC|META|'C', nullproc, /* every command input */ X SPEC|META|'R', nullproc, /* on file read */ X {0, NULL} X}; X X#if RAINBOW X X#include "rainbow.h" X X/* X * Mapping table from the LK201 function keys to the internal EMACS character. X */ X Xshort lk_map[][2] = { X Up_Key, CTRL+'P', X Down_Key, CTRL+'N', X Left_Key, CTRL+'B', X Right_Key, CTRL+'F', X Shift+Left_Key, META+'B', X Shift+Right_Key, META+'F', X Control+Left_Key, CTRL+'A', X Control+Right_Key, CTRL+'E', X Prev_Scr_Key, META+'V', X Next_Scr_Key, CTRL+'V', X Shift+Up_Key, META+'<', X Shift+Down_Key, META+'>', X Cancel_Key, CTRL+'G', X Find_Key, CTRL+'S', X Shift+Find_Key, CTRL+'R', X Insert_Key, CTRL+'Y', X Options_Key, CTRL+'D', X Shift+Options_Key, META+'D', X Remove_Key, CTRL+'W', X Shift+Remove_Key, META+'W', X Select_Key, CTRL+'@', X Shift+Select_Key, CTLX+CTRL+'X', X Interrupt_Key, CTRL+'U', X Keypad_PF2, META+'L', X Keypad_PF3, META+'C', X Keypad_PF4, META+'U', X Shift+Keypad_PF2, CTLX+CTRL+'L', X Shift+Keypad_PF4, CTLX+CTRL+'U', X Keypad_1, CTLX+'1', X Keypad_2, CTLX+'2', X Do_Key, CTLX+'E', X Keypad_4, CTLX+CTRL+'B', X Keypad_5, CTLX+'B', X Keypad_6, CTLX+'K', X Resume_Key, META+'!', X Control+Next_Scr_Key, CTLX+'N', X Control+Prev_Scr_Key, CTLX+'P', X Control+Up_Key, CTLX+CTRL+'P', X Control+Down_Key, CTLX+CTRL+'N', X Help_Key, CTLX+'=', X Shift+Do_Key, CTLX+'(', X Control+Do_Key, CTLX+')', X Keypad_0, CTLX+'Z', X Shift+Keypad_0, CTLX+CTRL+'Z', X Main_Scr_Key, CTRL+'C', X Keypad_Enter, CTLX+'!', X Exit_Key, CTLX+CTRL+'C', X Shift+Exit_Key, CTRL+'Z' X}; X X#define lk_map_size (sizeof(lk_map)/2) X#endif X FRIDAY_NIGHT echo extracting - edef.h sed 's/^X//' > edef.h << 'FRIDAY_NIGHT' X/* EDEF: Global variable definitions for X MicroEMACS 3.9 X X written by Dave G. Conroy X modified by Steve Wilhite, George Jones X greatly modified by Daniel Lawrence X*/ X X/* some global fuction declarations */ X Xchar *flook(); Xchar *getctext(); Xchar *getfname(); Xchar *getval(); Xchar *gtenv(); Xchar *gtfun(); Xchar *gtusr(); Xchar *itoa(); Xchar *ltos(); Xchar *malloc(); Xchar *mklower(); Xchar *mkupper(); Xchar *strcat(); Xchar *strcpy(); Xchar *strncpy(); Xchar *token(); Xchar *transbind(); Xunsigned int getckey(); Xunsigned int stock(); X X#ifdef maindef X X/* for MAIN.C */ X X/* initialized global definitions */ X Xint fillcol = 72; /* Current fill column */ Xshort kbdm[NKBDM]; /* Macro */ Xchar *execstr = NULL; /* pointer to string to execute */ Xchar golabel[NPAT] = ""; /* current line to go to */ Xint execlevel = 0; /* execution IF level */ Xint eolexist = TRUE; /* does clear to EOL exist */ Xint revexist = FALSE; /* does reverse video exist? */ Xint flickcode = FALSE; /* do flicker supression? */ Xchar *modename[] = { /* name of modes */ X "WRAP", "CMODE", "SPELL", "EXACT", "VIEW", "OVER", X "MAGIC", "CRYPT", "ASAVE"}; Xchar modecode[] = "WCSEVOMYA"; /* letters to represent modes */ Xint gmode = 0; /* global editor mode */ Xint gflags = GFREAD; /* global control flag */ Xint gfcolor = 7; /* global forgrnd color (white) */ Xint gbcolor = 0; /* global backgrnd color (black)*/ Xint gasave = 256; /* global ASAVE size */ Xint gacount = 256; /* count until next ASAVE */ Xint sgarbf = TRUE; /* TRUE if screen is garbage */ Xint mpresf = FALSE; /* TRUE if message in last line */ Xint clexec = FALSE; /* command line execution flag */ Xint mstore = FALSE; /* storing text to macro flag */ Xint discmd = TRUE; /* display command flag */ Xint disinp = TRUE; /* display input characters */ Xstruct BUFFER *bstore = NULL; /* buffer to store macro text to*/ Xint vtrow = 0; /* Row location of SW cursor */ Xint vtcol = 0; /* Column location of SW cursor */ Xint ttrow = HUGE; /* Row location of HW cursor */ Xint ttcol = HUGE; /* Column location of HW cursor */ Xint lbound = 0; /* leftmost column of current line X being displayed */ Xint taboff = 0; /* tab offset for display */ Xint metac = CTRL | '['; /* current meta character */ Xint ctlxc = CTRL | 'X'; /* current control X prefix char */ Xint reptc = CTRL | 'U'; /* current universal repeat char */ Xint abortc = CTRL | 'G'; /* current abort command char */ X Xint quotec = 0x11; /* quote char during mlreply() */ Xchar *cname[] = { /* names of colors */ X "BLACK", "RED", "GREEN", "YELLOW", "BLUE", X "MAGENTA", "CYAN", "WHITE"}; XKILL *kbufp = NULL; /* current kill buffer chunk pointer */ XKILL *kbufh = NULL; /* kill buffer header pointer */ Xint kused = KBLOCK; /* # of bytes used in kill buffer */ XWINDOW *swindow = NULL; /* saved window pointer */ Xint cryptflag = FALSE; /* currently encrypting? */ Xshort *kbdptr; /* current position in keyboard buf */ Xshort *kbdend = &kbdm[0]; /* ptr to end of the keyboard */ Xint kbdmode = STOP; /* current keyboard macro mode */ Xint kbdrep = 0; /* number of repetitions */ Xint restflag = FALSE; /* restricted use? */ Xint lastkey = 0; /* last keystoke */ Xint seed = 0; /* random number seed */ Xlong envram = 0l; /* # of bytes current in use by malloc */ Xint macbug = FALSE; /* macro debuging flag */ Xchar errorm[] = "ERROR"; /* error literal */ Xchar truem[] = "TRUE"; /* true literal */ Xchar falsem[] = "FALSE"; /* false litereal */ Xint cmdstatus = TRUE; /* last command status */ Xchar palstr[49] = ""; /* palette string */ Xint saveflag = 0; /* Flags, saved with the $target var */ Xchar *fline = NULL; /* dynamic return line */ Xint flen = 0; /* current length of fline */ Xint rval = 0; /* return value of a subprocess */ X#if CALLED Xint eexitflag = FALSE; /* EMACS exit flag */ Xint eexitval = 0; /* and the exit return value */ X#endif X X/* uninitialized global definitions */ X Xint currow; /* Cursor row */ Xint curcol; /* Cursor column */ Xint thisflag; /* Flags, this command */ Xint lastflag; /* Flags, last command */ Xint curgoal; /* Goal for C-P, C-N */ XWINDOW *curwp; /* Current window */ XBUFFER *curbp; /* Current buffer */ XWINDOW *wheadp; /* Head of list of windows */ XBUFFER *bheadp; /* Head of list of buffers */ XBUFFER *blistp; /* Buffer for C-X C-B */ X XBUFFER *bfind(); /* Lookup a buffer by name */ XWINDOW *wpopup(); /* Pop up window creation */ XLINE *lalloc(); /* Allocate a line */ Xchar sres[NBUFN]; /* current screen resolution */ X Xchar pat[NPAT]; /* Search pattern */ Xchar tap[NPAT]; /* Reversed pattern array. */ Xchar rpat[NPAT]; /* replacement pattern */ X X/* The variable matchlen holds the length of the matched X * string - used by the replace functions. X * The variable patmatch holds the string that satisfies X * the search command. X * The variables matchline and matchoff hold the line and X * offset position of the *start* of match. X */ Xunsigned int matchlen = 0; Xunsigned int mlenold = 0; Xchar *patmatch = NULL; XLINE *matchline = NULL; Xint matchoff = 0; X X#if MAGIC X/* X * The variables magical and rmagical determine if there X * were actual metacharacters in the search and replace strings - X * if not, then we don't have to use the slower MAGIC mode X * search functions. X */ Xshort int magical = FALSE; Xshort int rmagical = FALSE; XMC mcpat[NPAT]; /* the magic pattern */ XMC tapcm[NPAT]; /* the reversed magic pattern */ XRMC rmcpat[NPAT]; /* the replacement magic array */ X X#endif X X/* directive name table: X This holds the names of all the directives.... */ X Xchar *dname[] = { X "if", "else", "endif", X "goto", "return", "endm", X "while", "endwhile", "break", X "force" X}; X X#if DEBUGM X/* vars needed for macro debugging output */ Xchar outline[NSTRING]; /* global string to hold debug line text */ X#endif X X#else X X/* for all the other .C files */ X X/* initialized global external declarations */ X Xextern int fillcol; /* Fill column */ Xextern short kbdm[]; /* Holds kayboard macro data */ Xextern char pat[]; /* Search pattern */ Xextern char rpat[]; /* Replacement pattern */ Xextern char *execstr; /* pointer to string to execute */ Xextern char golabel[]; /* current line to go to */ Xextern int execlevel; /* execution IF level */ Xextern int eolexist; /* does clear to EOL exist? */ Xextern int revexist; /* does reverse video exist? */ Xextern int flickcode; /* do flicker supression? */ Xextern char *modename[]; /* text names of modes */ Xextern char modecode[]; /* letters to represent modes */ Xextern KEYTAB keytab[]; /* key bind to functions table */ Xextern NBIND names[]; /* name to function table */ Xextern int gmode; /* global editor mode */ Xextern int gflags; /* global control flag */ Xextern int gfcolor; /* global forgrnd color (white) */ Xextern int gbcolor; /* global backgrnd color (black)*/ Xextern int gasave; /* global ASAVE size */ Xextern int gacount; /* count until next ASAVE */ Xextern int sgarbf; /* State of screen unknown */ Xextern int mpresf; /* Stuff in message line */ Xextern int clexec; /* command line execution flag */ Xextern int mstore; /* storing text to macro flag */ Xextern int discmd; /* display command flag */ Xextern int disinp; /* display input characters */ Xextern struct BUFFER *bstore; /* buffer to store macro text to*/ Xextern int vtrow; /* Row location of SW cursor */ Xextern int vtcol; /* Column location of SW cursor */ Xextern int ttrow; /* Row location of HW cursor */ Xextern int ttcol; /* Column location of HW cursor */ Xextern int lbound; /* leftmost column of current line X being displayed */ Xextern int taboff; /* tab offset for display */ Xextern int metac; /* current meta character */ Xextern int ctlxc; /* current control X prefix char */ Xextern int reptc; /* current universal repeat char */ Xextern int abortc; /* current abort command char */ X Xextern int quotec; /* quote char during mlreply() */ Xextern char *cname[]; /* names of colors */ Xextern KILL *kbufp; /* current kill buffer chunk pointer */ Xextern KILL *kbufh; /* kill buffer header pointer */ Xextern int kused; /* # of bytes used in KB */ Xextern WINDOW *swindow; /* saved window pointer */ Xextern int cryptflag; /* currently encrypting? */ Xextern short *kbdptr; /* current position in keyboard buf */ Xextern short *kbdend; /* ptr to end of the keyboard */ Xextern int kbdmode; /* current keyboard macro mode */ Xextern int kbdrep; /* number of repetitions */ Xextern int restflag; /* restricted use? */ Xextern int lastkey; /* last keystoke */ Xextern int seed; /* random number seed */ Xextern long envram; /* # of bytes current in use by malloc */ Xextern int macbug; /* macro debuging flag */ Xextern char errorm[]; /* error literal */ Xextern char truem[]; /* true literal */ Xextern char falsem[]; /* false litereal */ Xextern int cmdstatus; /* last command status */ Xextern char palstr[]; /* palette string */ Xextern int saveflag; /* Flags, saved with the $target var */ Xextern char *fline; /* dynamic return line */ Xextern int flen; /* current length of fline */ Xextern int rval; /* return value of a subprocess */ X#if CALLED Xextern int eexitflag; /* EMACS exit flag */ Xextern int eexitval; /* and the exit return value */ X#endif X X/* uninitialized global external declarations */ X Xextern int currow; /* Cursor row */ Xextern int curcol; /* Cursor column */ Xextern int thisflag; /* Flags, this command */ Xextern int lastflag; /* Flags, last command */ Xextern int curgoal; /* Goal for C-P, C-N */ Xextern WINDOW *curwp; /* Current window */ Xextern BUFFER *curbp; /* Current buffer */ Xextern WINDOW *wheadp; /* Head of list of windows */ Xextern BUFFER *bheadp; /* Head of list of buffers */ Xextern BUFFER *blistp; /* Buffer for C-X C-B */ X Xextern BUFFER *bfind(); /* Lookup a buffer by name */ Xextern WINDOW *wpopup(); /* Pop up window creation */ Xextern LINE *lalloc(); /* Allocate a line */ Xextern char sres[NBUFN]; /* current screen resolution */ Xextern char pat[]; /* Search pattern */ Xextern char tap[]; /* Reversed pattern array. */ Xextern char rpat[]; /* replacement pattern */ X Xextern unsigned int matchlen; Xextern unsigned int mlenold; Xextern char *patmatch; Xextern LINE *matchline; Xextern int matchoff; X X#if MAGIC Xextern short int magical; Xextern short int rmagical; Xextern MC mcpat[NPAT]; /* the magic pattern */ Xextern MC tapcm[NPAT]; /* the reversed magic pattern */ Xextern RMC rmcpat[NPAT]; /* the replacement magic array */ X#endif X Xextern char *dname[]; /* directive name table */ X X#if DEBUGM X/* vars needed for macro debugging output */ Xextern char outline[]; /* global string to hold debug line text */ X#endif X X#endif X X/* terminal table defined only in TERM.C */ X X#ifndef termdef Xextern TERM term; /* Terminal information. */ X#endif X X FRIDAY_NIGHT echo extracting - efunc.h sed 's/^X//' > efunc.h << 'FRIDAY_NIGHT' X/* EFUNC.H: MicroEMACS function declarations and names X X This file list all the C code functions used by MicroEMACS X and the names to use to bind keys to them. To add functions, X declare it here in both the extern function list and the name X binding table. X X*/ X X/* External function declarations */ X Xextern int ctrlg(); /* Abort out of things */ Xextern int quit(); /* Quit */ Xextern int ctlxlp(); /* Begin macro */ Xextern int ctlxrp(); /* End macro */ Xextern int ctlxe(); /* Execute macro */ Xextern int fileread(); /* Get a file, read only */ Xextern int filefind(); /* Get a file, read write */ Xextern int filewrite(); /* Write a file */ Xextern int filesave(); /* Save current file */ Xextern int filename(); /* Adjust file name */ Xextern int getccol(); /* Get current column */ Xextern int gotobol(); /* Move to start of line */ Xextern int forwchar(); /* Move forward by characters */ Xextern int gotoeol(); /* Move to end of line */ Xextern int backchar(); /* Move backward by characters */ Xextern int forwline(); /* Move forward by lines */ Xextern int backline(); /* Move backward by lines */ Xextern int forwpage(); /* Move forward by pages */ Xextern int backpage(); /* Move backward by pages */ Xextern int gotobob(); /* Move to start of buffer */ Xextern int gotoeob(); /* Move to end of buffer */ Xextern int setfillcol(); /* Set fill column. */ Xextern int setmark(); /* Set mark */ Xextern int swapmark(); /* Swap "." and mark */ Xextern int forwsearch(); /* Search forward */ Xextern int backsearch(); /* Search backwards */ Xextern int sreplace(); /* search and replace */ Xextern int qreplace(); /* search and replace w/query */ Xextern int showcpos(); /* Show the cursor position */ Xextern int nextwind(); /* Move to the next window */ Xextern int prevwind(); /* Move to the previous window */ Xextern int onlywind(); /* Make current window only one */ Xextern int splitwind(); /* Split current window */ Xextern int mvdnwind(); /* Move window down */ Xextern int mvupwind(); /* Move window up */ Xextern int enlargewind(); /* Enlarge display window. */ Xextern int shrinkwind(); /* Shrink window. */ Xextern int listbuffers(); /* Display list of buffers */ Xextern int usebuffer(); /* Switch a window to a buffer */ Xextern int killbuffer(); /* Make a buffer go away. */ Xextern int reposition(); /* Reposition window */ Xextern int refresh(); /* Refresh the screen */ Xextern int twiddle(); /* Twiddle characters */ Xextern int tab(); /* Insert tab */ Xextern int newline(); /* Insert CR-LF */ Xextern int indent(); /* Insert CR-LF, then indent */ Xextern int openline(); /* Open up a blank line */ Xextern int deblank(); /* Delete blank lines */ Xextern int quote(); /* Insert literal */ Xextern int backword(); /* Backup by words */ Xextern int forwword(); /* Advance by words */ Xextern int forwdel(); /* Forward delete */ Xextern int backdel(); /* Backward delete */ Xextern int killtext(); /* Kill forward */ Xextern int yank(); /* Yank back from killbuffer. */ Xextern int upperword(); /* Upper case word. */ Xextern int lowerword(); /* Lower case word. */ Xextern int upperregion(); /* Upper case region. */ Xextern int lowerregion(); /* Lower case region. */ Xextern int capword(); /* Initial capitalize word. */ Xextern int delfword(); /* Delete forward word. */ Xextern int delbword(); /* Delete backward word. */ Xextern int killregion(); /* Kill region. */ Xextern int copyregion(); /* Copy region to kill buffer. */ Xextern int spawncli(); /* Run CLI in a subjob. */ Xextern int spawn(); /* Run a command in a subjob. */ X#if BSD Xextern int bktoshell(); /* suspend emacs to parent shell*/ Xextern int rtfrmshell(); /* return from a suspended state*/ X#endif Xextern int quickexit(); /* low keystroke style exit. */ Xextern int setmode(); /* set an editor mode */ Xextern int delmode(); /* delete a mode */ Xextern int gotoline(); /* go to a numbered line */ Xextern int namebuffer(); /* rename the current buffer */ X#if WORDPRO Xextern int gotobop(); /* go to beginning/paragraph */ Xextern int gotoeop(); /* go to end/paragraph */ Xextern int fillpara(); /* fill current paragraph */ X#endif Xextern int help(); /* get the help file here */ Xextern int deskey(); /* describe a key's binding */ Xextern int viewfile(); /* find a file in view mode */ Xextern int insfile(); /* insert a file */ Xextern int scrnextup(); /* scroll next window back */ Xextern int scrnextdw(); /* scroll next window down */ Xextern int bindtokey(); /* bind a function to a key */ Xextern int unbindkey(); /* unbind a key's function */ Xextern int namedcmd(); /* execute named command */ Xextern int desbind(); /* describe bindings */ Xextern int execcmd(); /* execute a command line */ Xextern int execbuf(); /* exec commands from a buffer */ Xextern int execfile(); /* exec commands from a file */ Xextern int nextbuffer(); /* switch to the next buffer */ X#if WORDPRO Xextern int killpara(); /* kill the current paragraph */ X#endif Xextern int setgmode(); /* set a global mode */ Xextern int delgmode(); /* delete a global mode */ Xextern int insspace(); /* insert a space forword */ Xextern int forwhunt(); /* hunt forward for next match */ Xextern int backhunt(); /* hunt backwards for next match*/ Xextern int pipecmd(); /* pipe command into buffer */ Xextern int filter(); /* filter buffer through dos */ Xextern int delwind(); /* delete the current window */ Xextern int cbuf1(); /* execute numbered comd buffer */ Xextern int cbuf2(); Xextern int cbuf3(); Xextern int cbuf4(); Xextern int cbuf5(); Xextern int cbuf6(); Xextern int cbuf7(); Xextern int cbuf8(); Xextern int cbuf9(); Xextern int cbuf10(); Xextern int cbuf11(); Xextern int cbuf12(); Xextern int cbuf13(); Xextern int cbuf14(); Xextern int cbuf15(); Xextern int cbuf16(); Xextern int cbuf17(); Xextern int cbuf18(); Xextern int cbuf19(); Xextern int cbuf20(); Xextern int cbuf21(); Xextern int cbuf22(); Xextern int cbuf23(); Xextern int cbuf24(); Xextern int cbuf25(); Xextern int cbuf26(); Xextern int cbuf27(); Xextern int cbuf28(); Xextern int cbuf29(); Xextern int cbuf30(); Xextern int cbuf31(); Xextern int cbuf32(); Xextern int cbuf33(); Xextern int cbuf34(); Xextern int cbuf35(); Xextern int cbuf36(); Xextern int cbuf37(); Xextern int cbuf38(); Xextern int cbuf39(); Xextern int cbuf40(); Xextern int storemac(); /* store text for macro */ Xextern int resize(); /* resize current window */ Xextern int clrmes(); /* clear the message line */ Xextern int meta(); /* meta prefix dummy function */ Xextern int cex(); /* ^X prefix dummy function */ Xextern int unarg(); /* ^U repeat arg dummy function */ Xextern int istring(); /* insert string in text */ Xextern int unmark(); /* unmark current buffer */ X#if ISRCH Xextern int fisearch(); /* forward incremental search */ Xextern int risearch(); /* reverse incremental search */ X#endif X#if WORDPRO Xextern int wordcount(); /* count words in region */ X#endif Xextern int savewnd(); /* save current window */ Xextern int restwnd(); /* restore current window */ Xextern int upscreen(); /* force screen update */ Xextern int writemsg(); /* write text on message line */ X#if FLABEL Xextern int fnclabel(); /* set function key label */ X#endif X#if APROP Xextern int apro(); /* apropos fuction */ X#endif X#if CRYPT Xextern int setkey(); /* set encryption key */ X#endif Xextern int wrapword(); /* wordwrap function */ X#if CFENCE Xextern int getfence(); /* move cursor to a matching fence */ X#endif Xextern int newsize(); /* change the current screen size */ Xextern int setvar(); /* set a variables value */ Xextern int newwidth(); /* change the current screen width */ X#if AEDIT Xextern int trim(); /* trim whitespace from end of line */ Xextern int detab(); /* detab rest of line */ Xextern int entab(); /* entab rest of line */ X#endif X#if PROC Xextern int storeproc(); /* store names procedure */ Xextern int execproc(); /* execute procedure */ X#endif Xextern int nullproc(); /* does nothing... */ Xextern int ovstring(); /* overwrite a string */ Xextern int execprg(); /* execute a program */ X X/* Name to function binding table X X This table gives the names of all the bindable functions X end their C function address. These are used for the bind-to-key X function. X*/ X XNBIND names[] = { X {"abort-command", ctrlg}, X {"add-mode", setmode}, X {"add-global-mode", setgmode}, X#if APROP X {"apropos", apro}, X#endif X {"backward-character", backchar}, X {"begin-macro", ctlxlp}, X {"beginning-of-file", gotobob}, X {"beginning-of-line", gotobol}, X {"bind-to-key", bindtokey}, X {"buffer-position", showcpos}, X {"case-region-lower", lowerregion}, X {"case-region-upper", upperregion}, X {"case-word-capitalize", capword}, X {"case-word-lower", lowerword}, X {"case-word-upper", upperword}, X {"change-file-name", filename}, X {"change-screen-size", newsize}, X {"change-screen-width", newwidth}, X {"clear-and-redraw", refresh}, X {"clear-message-line", clrmes}, X {"copy-region", copyregion}, X#if WORDPRO X {"count-words", wordcount}, X#endif X {"ctlx-prefix", cex}, X {"delete-blank-lines", deblank}, X {"delete-buffer", killbuffer}, X {"delete-mode", delmode}, X {"delete-global-mode", delgmode}, X {"delete-next-character", forwdel}, X {"delete-next-word", delfword}, X {"delete-other-windows", onlywind}, X {"delete-previous-character", backdel}, X {"delete-previous-word", delbword}, X {"delete-window", delwind}, X {"describe-bindings", desbind}, X {"describe-key", deskey}, X#if AEDIT X {"detab-line", detab}, X#endif X {"end-macro", ctlxrp}, X {"end-of-file", gotoeob}, X {"end-of-line", gotoeol}, X#if AEDIT X {"entab-line", entab}, X#endif X {"exchange-point-and-mark", swapmark}, X {"execute-buffer", execbuf}, X {"execute-command-line", execcmd}, X {"execute-file", execfile}, X {"execute-macro", ctlxe}, X {"execute-macro-1", cbuf1}, X {"execute-macro-2", cbuf2}, X {"execute-macro-3", cbuf3}, X {"execute-macro-4", cbuf4}, X {"execute-macro-5", cbuf5}, X {"execute-macro-6", cbuf6}, X {"execute-macro-7", cbuf7}, X {"execute-macro-8", cbuf8}, X {"execute-macro-9", cbuf9}, X {"execute-macro-10", cbuf10}, X {"execute-macro-11", cbuf11}, X {"execute-macro-12", cbuf12}, X {"execute-macro-13", cbuf13}, X {"execute-macro-14", cbuf14}, X {"execute-macro-15", cbuf15}, X {"execute-macro-16", cbuf16}, X {"execute-macro-17", cbuf17}, X {"execute-macro-18", cbuf18}, X {"execute-macro-19", cbuf19}, X {"execute-macro-20", cbuf20}, X {"execute-macro-21", cbuf21}, X {"execute-macro-22", cbuf22}, X {"execute-macro-23", cbuf23}, X {"execute-macro-24", cbuf24}, X {"execute-macro-25", cbuf25}, X {"execute-macro-26", cbuf26}, X {"execute-macro-27", cbuf27}, X {"execute-macro-28", cbuf28}, X {"execute-macro-29", cbuf29}, X {"execute-macro-30", cbuf30}, X {"execute-macro-31", cbuf31}, X {"execute-macro-32", cbuf32}, X {"execute-macro-33", cbuf33}, X {"execute-macro-34", cbuf34}, X {"execute-macro-35", cbuf35}, X {"execute-macro-36", cbuf36}, X {"execute-macro-37", cbuf37}, X {"execute-macro-38", cbuf38}, X {"execute-macro-39", cbuf39}, X {"execute-macro-40", cbuf40}, X {"execute-named-command", namedcmd}, X#if PROC X {"execute-procedure", execproc}, X#endif X {"execute-program", execprg}, X {"exit-emacs", quit}, X#if WORDPRO X {"fill-paragraph", fillpara}, X#endif X {"filter-buffer", filter}, X {"find-file", filefind}, X {"forward-character", forwchar}, X {"goto-line", gotoline}, X#if CFENCE X {"goto-matching-fence", getfence}, X#endif X {"grow-window", enlargewind}, X {"handle-tab", tab}, X {"hunt-forward", forwhunt}, X {"hunt-backward", backhunt}, X {"help", help}, X {"i-shell", spawncli}, X#if ISRCH X {"incremental-search", fisearch}, X#endif X {"insert-file", insfile}, X {"insert-space", insspace}, X {"insert-string", istring}, X#if WORDPRO X {"kill-paragraph", killpara}, X#endif X {"kill-region", killregion}, X {"kill-to-end-of-line", killtext}, X#if FLABEL X {"label-function-key", fnclabel}, X#endif X {"list-buffers", listbuffers}, X {"meta-prefix", meta}, X {"move-window-down", mvdnwind}, X {"move-window-up", mvupwind}, X {"name-buffer", namebuffer}, X {"newline", newline}, X {"newline-and-indent", indent}, X {"next-buffer", nextbuffer}, X {"next-line", forwline}, X {"next-page", forwpage}, X#if WORDPRO X {"next-paragraph", gotoeop}, X#endif X {"next-window", nextwind}, X {"next-word", forwword}, X {"nop", nullproc}, X {"open-line", openline}, X {"overwrite-string", ovstring}, X {"pipe-command", pipecmd}, X {"previous-line", backline}, X {"previous-page", backpage}, X#if WORDPRO X {"previous-paragraph", gotobop}, X#endif X {"previous-window", prevwind}, X {"previous-word", backword}, X {"query-replace-string", qreplace}, X {"quick-exit", quickexit}, X {"quote-character", quote}, X {"read-file", fileread}, X {"redraw-display", reposition}, X {"resize-window", resize}, X {"restore-window", restwnd}, X {"replace-string", sreplace}, X#if ISRCH X {"reverse-incremental-search", risearch}, X#endif X#if PROC X {"run", execproc}, X#endif X {"save-file", filesave}, X {"save-window", savewnd}, X {"scroll-next-up", scrnextup}, X {"scroll-next-down", scrnextdw}, X {"search-forward", forwsearch}, X {"search-reverse", backsearch}, X {"select-buffer", usebuffer}, X {"set", setvar}, X#if CRYPT X {"set-encryption-key", setkey}, X#endif X {"set-fill-column", setfillcol}, X {"set-mark", setmark}, X {"shell-command", spawn}, X {"shrink-window", shrinkwind}, X {"split-current-window", splitwind}, X {"store-macro", storemac}, X#if PROC X {"store-procedure", storeproc}, X#endif X#if BSD X {"suspend-emacs", bktoshell}, X#endif X {"transpose-characters", twiddle}, X#if AEDIT X {"trim-line", trim}, X#endif X {"unbind-key", unbindkey}, X {"universal-argument", unarg}, X {"unmark-buffer", unmark}, X {"update-screen", upscreen}, X {"view-file", viewfile}, X {"wrap-word", wrapword}, X {"write-file", filewrite}, X {"write-message", writemsg}, X {"yank", yank}, X X {"", NULL} X}; FRIDAY_NIGHT echo mes.15 completed! # That's all folksmb