Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!cbatt!ucbvax!ULKYVX.BITNET!RDROYA01 From: RDROYA01@ULKYVX.BITNET.UUCP Newsgroups: comp.sys.atari.st Subject: Uemail source (3 of 12) Message-ID: <8702051710.AA10252@ucbvax.Berkeley.EDU> Date: Thu, 5-Feb-87 06:22:00 EST Article-I.D.: ucbvax.8702051710.AA10252 Posted: Thu Feb 5 06:22:00 1987 Date-Received: Sat, 7-Feb-87 12:46:11 EST Sender: daemon@ucbvax.BERKELEY.EDU Organization: University of Louisville Lines: 538 # This is a shell archive. # Remove everything above and including the cut line. # Then run the rest of the file through sh. #----cut here-----cut here-----cut here-----cut here----# #!/bin/sh # shar: Shell Archiver # Run the following text with /bin/sh to create: # ed.h # errno.h # kermit.h # keycode.h # printer.h # shell.h # This archive created: Tue Feb 3 18:00:56 1987 cat << \SHAR_EOF > ed.h /* * This file is the general header file for * all parts of the MicroEMACS display editor. It contains * definitions used by everyone, and it contains the stuff * you have to edit to create a version of the editor for * a specific operating system and terminal. */ #define V7 0 /* V7 UN*X or Coherent */ #define VMS 0 /* VAX/VMS */ #define CPM 0 /* CP/M-86 */ #define ST 1 #define ALCYON 1 /* Alcyon C compiler */ #define MSDOS 0 /* MS-DOS */ #define ANSI 0 #define ADM3 0 /* [Kaypro] Lear Siegler */ #define VT52 0 /* VT52 terminal (Zenith). */ #define VT100 0 /* Handle VT100 style keypad. */ #define LK201 0 /* Handle LK201 style keypad. */ #define RAINBOW 0 /* Use Rainbow fast video. */ #define TERMCAP 0 /* Use TERMCAP */ #define CVMVAS 1 /* C-V, M-V arg. in screens. */ #define NFILEN 80 /* # of bytes, file name */ #define NBUFN 16 /* # of bytes, buffer name */ #define NLINE 256 /* # of bytes, line */ #define NKBDM 256 /* # of strokes, keyboard macro */ #define NPAT 80 /* # of bytes, pattern */ #define HUGE 1000 /* Huge number */ #define AGRAVE 0x60 /* M- prefix, Grave (LK201) */ #define METACH 0x1B /* M- prefix, Control-[, ESC */ #define CTMECH 0x1C /* C-M- prefix, Control-\ */ #define EXITCH 0x1D /* Exit level, Control-] */ #define CTRLCH 0x1E /* C- prefix, Control-^ */ #define HELPCH 0x1F /* Help key, Control-_ */ #define CTRL 0x0100 /* Control flag, or'ed in */ #define META 0x0200 /* Meta flag, or'ed in */ #define CTLX 0x0400 /* ^X flag, or'ed in */ #define SPEC 0x0800 /* Special scancode keys */ #define MAYBE -1 /* Conditional based on query */ #define FALSE 0 /* False, no, bad, etc. */ #define TRUE 1 /* True, yes, good, etc. */ #define ABORT 2 /* Death, ^G, abort, etc. */ #define FIOSUC 0 /* File I/O, success. */ #define FIOFNF 1 /* File I/O, file not found. */ #define FIOEOF 2 /* File I/O, end of file. */ #define FIOERR 3 /* File I/O, error. */ #define CFCPCN 0x0001 /* Last command was C-P, C-N */ #define CFKILL 0x0002 /* Last command was a kill */ #define PRNRDY gemdos(0x11) /* LST: status for print buffer */ /* * There is a window structure allocated for * every active display window. The windows are kept in a * big list, in top to bottom screen order, with the listhead at * "wheadp". Each window contains its own values of dot and mark. * The flag field contains some bits that are set by commands * to guide redisplay; although this is a bit of a compromise in * terms of decoupling, the full blown redisplay is just too * expensive to run for every input character. */ typedef struct WINDOW { struct WINDOW *w_wndp; /* Next window */ struct BUFFER *w_bufp; /* Buffer displayed in window */ struct LINE *w_linep; /* Top line in the window */ struct LINE *w_dotp; /* Line containing "." */ short w_doto; /* Byte offset for "." */ struct LINE *w_markp; /* Line containing "mark" */ short w_marko; /* Byte offset for "mark" */ char w_toprow; /* Origin 0 top row of window */ char w_ntrows; /* # of rows of text in window */ char w_force; /* If NZ, forcing row. */ char w_flag; /* Flags. */ } WINDOW; #define WFFORCE 0x01 /* Window needs forced reframe */ #define WFMOVE 0x02 /* Movement from line to line */ #define WFEDIT 0x04 /* Editing within a line */ #define WFHARD 0x08 /* Better to a full display */ #define WFMODE 0x10 /* Update mode line. */ /* * Text is kept in buffers. A buffer header, described * below, exists for every buffer in the system. The buffers are * kept in a big list, so that commands that search for a buffer by * name can find the buffer header. There is a safe store for the * dot and mark in the header, but this is only valid if the buffer * is not being displayed (that is, if "b_nwnd" is 0). The text for * the buffer is kept in a circularly linked list of lines, with * a pointer to the header line in "b_linep". */ typedef struct BUFFER { struct BUFFER *b_bufp; /* Link to next BUFFER */ struct LINE *b_dotp; /* Link to "." LINE structure */ short b_doto; /* Offset of "." in above LINE */ struct LINE *b_markp; /* The same as the above two, */ short b_marko; /* but for the "mark" */ struct LINE *b_linep; /* Link to the header LINE */ char b_nwnd; /* Count of windows on buffer */ char b_flag; /* Flags */ char b_bmode; /* This buffer's current modes */ char b_fname[NFILEN]; /* File name */ char b_bname[NBUFN]; /* Buffer name */ } BUFFER; #define BFTEMP 0x01 /* Internal temporary buffer */ #define BFCHG 0x02 /* Changed since last write */ #define BMNWRAP 0x0001 /* Buffer is in No-Wrap mode */ #define BMWRAP 0x0002 /* Buffer is in Wrap mode */ #define BMCMODE 0x0004 /* Buffer is in C-Mode */ #define NUMMODES 3 /* * The starting position of a * region, and the size of the region in * characters, is kept in a region structure. * Used by the region commands. */ typedef struct { struct LINE *r_linep; /* Origin LINE address. */ short r_offset; /* Origin LINE offset. */ short r_size; /* Length in characters. */ } REGION; /* * All text is kept in circularly linked * lists of "LINE" structures. These begin at the * header line (which is the blank line beyond the * end of the buffer). This line is pointed to by * the "BUFFER". Each line contains a the number of * bytes in the line (the "used" size), the size * of the text array, and the text. The end of line * is not stored as a byte; it's implied. Future * additions will include update hints, and a * list of marks into the line. */ typedef struct LINE { struct LINE *l_fp; /* Link to the next line */ struct LINE *l_bp; /* Link to the previous line */ short l_size; /* Allocated size */ short l_used; /* Used size */ char l_text[]; /* A bunch of characters. */ } LINE; #define lforw(lp) ((lp)->l_fp) #define lback(lp) ((lp)->l_bp) #define lgetc(lp, n) ((lp)->l_text[(n)]&0xFF) #define lputc(lp, n, c) ((lp)->l_text[(n)]=(c)) #define llength(lp) ((lp)->l_used) /* * The editor communicates with the display * using a high level interface. A "TERM" structure * holds useful variables, and indirect pointers to * routines that do useful operations. The low level get * and put routines are here too. This lets a terminal, * in addition to having non standard commands, have * funny get and put character code too. The calls * might get changed to "termp->t_field" style in * the future, to make it possible to run more than * one terminal type. */ typedef struct { short t_nrow; /* Number of rows. */ short t_ncol; /* Number of columns. */ short t_margin; /* Min marg for extended lines */ short t_scrsiz; /* Size of scroll reg. " " */ int (*t_open)(); /* Open terminal at the start. */ int (*t_close)(); /* Close terminal at end. */ int (*t_getchar)(); /* Get character from keyboard. */ int (*t_putchar)(); /* Put character to display. */ int (*t_flush)(); /* Flush output buffers. */ int (*t_move)(); /* Move the cursor, origin 0. */ int (*t_eeol)(); /* Erase to end of line. */ int (*t_eeop)(); /* Erase to end of page. */ int (*t_beep)(); /* Beep. */ int (*t_rev)(); /* Set reverse video state */ } TERM; extern int fillcol; /* Fill column */ extern int indcol; /* Indent column */ extern int pagelen; /* Page size for print/paginate */ extern int currow; /* Cursor row */ extern int curcol; /* Cursor column */ extern int thisflag; /* Flags, this command */ extern int lastflag; /* Flags, last command */ extern int curgoal; /* Goal for C-P, C-N */ extern int mpresf; /* Stuff in message line */ extern int sgarbf; /* State of screen unknown */ extern int glmode; /* Global mode value */ extern WINDOW *curwp; /* Current window */ extern BUFFER *curbp; /* Current buffer */ extern WINDOW *wheadp; /* Head of list of windows */ extern BUFFER *bheadp; /* Head of list of buffers */ extern BUFFER *blistp; /* Buffer for C-X C-B */ extern BUFFER *bmacrp; /* Buffer for compiled macros */ extern short kbdm[]; /* Holds keyboard macro data */ extern short *kbdmip; /* Input pointer for above */ extern short *kbdmop; /* Output pointer for above */ extern char pat[]; /* Search pattern */ extern char rpat[]; /* Replacement pattern */ extern char prnhdr[]; /* Print header */ extern char prndate[]; /* Print date */ extern char lastbuf[]; /* Saved name of last used buf */ extern char fillprefix[]; /* String to append filled lines*/ extern char *modes[]; /* The mode names */ extern TERM term; /* Terminal information. */ extern BUFFER *bfind(); /* Lookup a buffer by name */ extern WINDOW *wpopup(); /* Pop up window creation */ extern LINE *lalloc(); /* Allocate a line */ #if ALCYON /* CPM-68K Alcyon C compiler */ extern char *malloc(); extern FILE *fopen(); extern char *strcpy(), *strncpy(), *alias(); #endif #if ST extern long gemdos(); extern int scancode; /* most recent key scancode */ extern int shiftstat; /* most recent status of shift */ #endif SHAR_EOF cat << \SHAR_EOF > errno.h /* * errno.h - error codes */ #define EPERM 1 #define ENOENT 2 #define ESRCH 3 #define EINTR 4 #define EIO 5 #define ENXIO 6 #define E2BIG 7 #define ENOEXEC 8 #define EBADF 9 #define ECHILD 10 #define EAGAIN 11 #define ENOMEM 12 #define EACCES 13 #define EFAULT 14 #define ENOTBLK 15 #define EBUSY 16 #define EEXIST 17 #define EXDEV 18 #define ENODEV 19 #define ENOTDIR 20 #define EISDIR 21 #define EINVAL 22 #define ENFILE 23 #define EMFILE 24 #define ENOTTY 25 #define ETXTBSY 26 #define EFBIG 27 #define ENOSPC 28 #define ESPIPE 29 #define EROFS 30 #define EMLINK 31 #define EPIPE 32 /* math software */ #define EDOM 33 #define ERANGE 34 /* hereafter is available to CP/M specials */ #define ENODSPC 35 #define ERENAME 36 /****** end of errno.h ******/ SHAR_EOF cat << \SHAR_EOF > kermit.h /* * K e r m i t File Transfer Utility * Header file for uEmail */ /* Symbol Definitions */ #define MAXPACKSIZ 94 /* Maximum packet size */ #define MYPACKSIZ 94 /* My packet size */ #define SOH 1 /* Start of header */ #define CLEAR 26 /* ^Z clear screen */ #define LF 10 /* ASCII Line Feed */ #define CR 13 /* ASCII Carriage Return */ #define SP 32 /* ASCII space */ #define DEL 127 /* Delete (rubout) */ #define ESCCHR 0x1c /* Default escape character for CONNECT */ #define REMOTE 1 #define HOST 2 #define SHOWHELP 3 #define DEFLO 1 /* default == XON/XOFF */ #define NOFLO 0 #define XON 1 #define RTS 2 #define DEFBPS 1200 #define BORDER 0 #define CURSOR 1 #define STATUS 2 #define LETTER 3 #define BLACK 0 #define COBALT 7 #define RED 0x700 #define TEAL 0x55 #define DEFPAR '\0' /* Default no parity */ #define MAXTRY 10 /* Times to retry a packet */ #define MYQUOTE '#' /* Quote character I will use */ #define MYPAD 0 /* Number of padding characters I will need */ #define MYPCHAR 0 /* Padding character I need (0) */ #define DEFMAXL 80 /* Default packer size */ #define DEFTIME 5 /* Default timeout */ #define DEFPAD 0 /* Default pad characters */ #define DEFPADC 0 /* Default pad character */ #define DEFEOL '\n' /* Default EOL character */ #define DEFQUOTE '#' /* Default QUOTE character */ #define DEFQBIN 'N' /* Default QBIN character */ #define QBIN '&' /* Character for binary quoting */ #define MYEOL '\r' /* End-Of-Line character I need */ #define MYTIME 10 /* Seconds after which I should be timed out */ #define MAXTIM 60 /* Maximum timeout interval */ #define MINTIM 2 /* Minumum timeout interval */ /* Macro Definitions */ /* * tochar: converts a control character to a printable one by adding a * space. * * unchar: undoes tochar. * * ctl: converts between control characters and printable characters by * toggling the control bit (ie. ^A becomes A and A becomes ^A). */ #define tochar(ch) ((ch) + ' ') #define unchar(ch) ((ch) - ' ') #define ctl(ch) ((ch) ^ 64 ) /* Global Variables */ int size, spsiz, /* Maximum send packet size */ pad, /* How much padding to send */ timint, /* Timeout for foreign host on sends */ n, /* Packet number */ np, /* Packet count for display */ numtry, /* Times this packet retried */ oldtry, /* Times previous packet retried */ parity, /* o,e,s,m or 0 */ logfile, /* log session to buffer */ qflag; /* -1 if doing 8 bit quoting */ char state, /* Present state of the automaton */ padchar, /* Padding character to send */ eol, /* End-Of-Line character to send */ quotech, /* Quote character in incoming data */ qbin, /* character for binary quoting */ *filnam, /* Current file name */ recpkt[MAXPACKSIZ], /* Receive packet buffer */ packet[MAXPACKSIZ]; /* Packet buffer */ extern char deflow[]; extern int flow, defbaud, bps; extern void spack(), rpar(); extern char rinit(), rfile(), rdata(), rpack(), sinit(), sfile(), sdata(), seof(), sbreak(); SHAR_EOF cat << \SHAR_EOF > keycode.h /* return the ascii value of a scan coded key */ int keyscan[] = { /* ASCII */ /* scan */ 0x00, /* keycode value = 0x00 */ 0x1b, /* 0x01 */ 0x31, /* 0x02 */ 0x32, /* 0x03 */ 0x33, /* 0x04 */ 0x34, /* 0x05 */ 0x35, /* 0x06 */ 0x36, /* 0x07 */ 0x37, /* 0x08 */ 0x38, /* 0x09 */ 0x39, /* 0x0A */ 0x30, /* 0x0B */ 0x2d, /* 0x0C */ 0x3d, /* 0x0D */ 0x08, /* 0x0E */ 0x09, /* 0x0F */ 0x51, /* 0x10 */ 0x57, /* 0x11 */ 0x45, /* 0x12 */ 0x52, /* 0x13 */ 0x54, /* 0x14 */ 0x59, /* 0x15 */ 0x55, /* 0x16 */ 0x49, /* 0x17 */ 0x4f, /* 0x18 */ 0x50, /* 0x19 */ 0x5b, /* 0x1A */ 0x5d, /* 0x1B */ 0x0d, /* 0x1C */ 0x00, /* 0x1D */ 0x41, /* 0x1E */ 0x53, /* 0x1F */ 0x44, /* 0x20 */ 0x46, /* 0x21 */ 0x47, /* 0x22 */ 0x48, /* 0x23 */ 0x4a, /* 0x24 */ 0x4b, /* 0x25 */ 0x4c, /* 0x26 */ 0x3b, /* 0x27 */ 0x27, /* 0x28 */ 0x60, /* 0x29 */ 0x00, /* 0x2A */ 0x5c, /* 0x2B */ 0x5a, /* 0x2C */ 0x58, /* 0x2D */ 0x43, /* 0x2E */ 0x56, /* 0x2F */ 0x42, /* 0x30 */ 0x4e, /* 0x31 */ 0x4d /* 0x32 */ }; SHAR_EOF cat << \SHAR_EOF > printer.h /* Printer defines for Brother Letter quality printers */ #define BUFSIZE 512 /* 4 * 128 */ #define MYBUF 1536 /* 3/4 of my print buffer */ #define ESC 0x1b #define FORMFEED '\f' #define TAB 0x09 #define SPACE ' ' #define NEWLINE '\n' #define CR '\r' #define RS 0x1e #define US 0x1f #define RN 0x50 extern int tabsize; extern int isnprint; static int in; /* file descriptor for low level printer I/O */ static int spacing; static int temptab; static int linecnt; static char *prnstr; int pagecnt; #define RESET Cprnout(ESC);Cprnout(CR);Cprnout(RN) #define NEWPAGE Cprnout(FORMFEED);Cprnout(CR) #define PRINT(arg) Cprnout((arg)) #define SET_LMARG Cprnout(ESC);Cprnout(0x39);\ Cprnout(CR) #define SET_TAB Cprnout(ESC);Cprnout(0x31) #define SET_PITCH(arg) Cprnout(ESC);Cprnout(US);\ Cprnout((arg)) #define SET_HEIGHT(arg) Cprnout(ESC);Cprnout(RS);\ Cprnout((arg)) #define PRNOUT(arg1,arg2) Cprnout(ESC);Cprnout((arg1));\ Cprnout((arg2)) SHAR_EOF cat << \SHAR_EOF > shell.h /* shell.h header for uemail files shell.c, emcc.c, and path.c */ #include #include #include #include "ed.h" #define GEMLOAD /* if prog was loaded from GEM give back 256K to OS */ #define MAXPATH 128 #define MAXINPUT 80 extern long adderr, buserr; /* default GEMDOS error handlers */ extern int errexit(); /* my error handler */ extern char cline[MAXINPUT+1]; /* holds the command line and other thin gs */ extern char pnam[MAXINPUT+1]; /* program name */ extern char source[MAXINPUT+1]; /* name of file for cc() */ extern char path[MAXPATH+1]; /* current path string */ extern int delete; /* on/off for above */ extern int dolink; /* link a program */ extern int temdrv; extern int curdrv; /* aliases are kept in dynamically allocated tables. Space for each alias * and its associated value is allocated as needed. */ typedef struct ALITAB { struct ALITAB *a_forw; /* next table */ char *alias; /* alias */ char *value; /* actual value */ } ALITAB; extern ALITAB *aheadp; /* structure header */ SHAR_EOF # End of shell archive exit 0 %NONAME-W-NOMSG, Message number 00000000