v07i083: xmail -- Mail front end for X11, Patch1, Part03/06
news
news at sun.Eng.Sun.COM
Fri Jun 1 13:41:12 AEST 1990
Submitted-by: parns.nsc.com!michael (Michael C. Wagnitz)
Posting-number: Volume 7, Issue 83
Archive-name: xmail/patch1.03
Patch-To: xmail: Volume 6, Issue 41-46
#! /bin/sh
# This is a shell archive. Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file". To overwrite existing
# files, type "sh file -c". You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g.. If this archive is complete, you
# will see the following message at the end:
# "End of archive 3 (of 5)."
# Contents: Patch.01c
# Wrapped by michael at harley on Tue May 29 10:33:50 1990
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'Patch.01c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'Patch.01c'\"
else
echo shar: Extracting \"'Patch.01c'\" \(51482 characters\)
sed "s/^X//" >'Patch.01c' <<'END_OF_FILE'
X! else {
X if ((s = getenv("HOME")) == NULL) s = "";
X sprintf(buf, "%s/.mailrc", s);
X }
X return((char *)buf);
X } /* mailrcFile */
X***************
X*** 210,233 ****
X char *item;
X {
X FILE *fp;
X! char *s, buf[BUFSIZ];
X
X
X- s = "";
X if ((fp = fopen(mailrcFile(), "r")) != NULL) {
X while (s = fgets(buf, BUFSIZ, fp)) {
X! if (strncmp(buf, "set", 3) == 0) {
X! for (s = &buf[3]; *s == ' ' || *s == '\t'; s++);
X! if (strncmp(s, item, strlen(item)) == 0) {
X! s = s + strlen(item) + 1;
X! if (*s == '\"') /* if surrounded by quotes */
X! buf[strlen(buf) - 2] = '\0';
X! else {
X! buf[strlen(buf) - 1] = '\0';
X! --s;
X }
X! strcpy(buf, ++s);
X! s = XtNewString(buf);
X break;
X }
X }
X--- 245,280 ----
X char *item;
X {
X FILE *fp;
X! char *s = NULL;
X! char buf[BUFSIZ];
X
X
X if ((fp = fopen(mailrcFile(), "r")) != NULL) {
X while (s = fgets(buf, BUFSIZ, fp)) {
X! if (strncmp(buf, "set", 3) == 0) { /* if this is a 'set' record */
X! s = &buf[3]; /* starting just beyond the 'set'... */
X! while (*s) { /* there may be multiple assignments */
X! for (; *s && (*s == ' ' || *s == '\t' || *s == '\n'); s++);
X! if (*s) {
X! if (strncmp(s, item, strlen(item)) == 0)
X! break;
X }
X! for (; *s && *s != ' ' && *s != '\t' && *s != '\n'; s++);
X! }
X! if (*s) { /* we have found a match */
X! s = s + strlen(item); /* look for a value to it */
X! if (*s++ != '=') { /* variable only, no value */
X! s = XtNewString("True"); /* return a boolean string */
X! } else {
X! if (*s == '\"') /* if surrounded by quotes */
X! buf[strlen(buf) - 2] = '\0';
X! else {
X! buf[strlen(buf) - 1] = '\0';
X! --s;
X! }
X! strcpy(buf, ++s);
X! s = XtNewString(buf);
X! }
X break;
X }
X }
X*** ../v1.0/global.h Sun May 27 21:05:51 1990
X--- global.h Sun May 27 21:09:59 1990
X***************
X*** 44,49 ****
X--- 44,50 ----
X
X /* HelpText.c */
X
X+ extern String Bcc_Help_Text;
X extern String Cc_Help_Text;
X extern String Copy_Help_Text;
X extern String Delete_Help_Text;
X***************
X*** 68,73 ****
X--- 69,76 ----
X
X /* actions.c */
X
X+ extern XtActionProc CheckInsert(); /* for the file window */
X+ extern XtActionProc DeleteChar(); /* for deletes (file window) */
X extern XtActionProc DeleteLine(); /* in the file window */
X extern XtActionProc DeleteWord(); /* also in the file window */
X extern XtActionProc DoAutograph(); /* call Autograph callback */
X***************
X*** 79,85 ****
X extern XtActionProc DoSelected(); /* DoCmd w/ selected message */
X extern XtActionProc Folder(); /* execute folder command */
X extern XtActionProc Iconify(); /* iconification request */
X- extern XtActionProc InsertSpace(); /* for deletes (file window) */
X extern XtActionProc MyNotify(); /* invokes callbacks w/ param */
X extern XtActionProc NextField(); /* warps pointer to data fld */
X extern XtActionProc PrintMsg(); /* send mail to the printer */
X--- 82,87 ----
X***************
X*** 88,93 ****
X--- 90,96 ----
X extern XtActionProc SetDirectory(); /* create folder files list */
X extern XtActionProc SetFolders(); /* create a list of folders */
X extern XtActionProc SetHelp(); /* Position help popup text */
X+ extern XtActionProc SetMenu(); /* Position set_menu popup */
X extern XtActionProc SetPopup(); /* Position relative to owner */
X extern XtActionProc SetSelect(); /* reposition select mark */
X extern XtActionProc Quit(); /* termination procedure */
X***************
X*** 99,104 ****
X--- 102,108 ----
X extern XtCallbackProc DoIt(); /* callback do specified cmd */
X extern XtCallbackProc DoPrint(); /* callback printer execution */
X extern XtCallbackProc DoQuit(); /* callback termination func */
X+ extern XtCallbackProc DoSet(); /* callback to toggle options */
X extern XtCallbackProc DoWith(); /* do cmd with arguments */
X extern XtCallbackProc GetAliasName(); /* retrieve alias name */
X extern XtCallbackProc GetFolderName(); /* retrieve folder name */
X***************
X*** 121,126 ****
X--- 125,131 ----
X
X extern int index_handler(); /* highlight the msg number */
X extern int file_handler(); /* handle change of folder */
X+ extern XtEventHandler icon_handler(); /* handle iconify changes */
X
X /* mail.c */
X
X***************
X*** 137,147 ****
X /* utils.c */
X
X extern void Bell(); /* disp. error and sound bell */
X extern void Normalize(); /* position to end of text */
X extern int PositionToMsgNumber(); /* convert pos to msg number */
X extern void writeText(); /* write text to buffer */
X extern XtTextPosition TextGetLastPos(); /* get last pos of text */
X! extern void UpdateTitleBar(); /* file name and msg count */
X extern void writeTo(); /* send text data to window */
X
X /* windows.c */
X--- 142,153 ----
X /* utils.c */
X
X extern void Bell(); /* disp. error and sound bell */
X+ extern void markIndex(); /* add/replace index marker */
X extern void Normalize(); /* position to end of text */
X extern int PositionToMsgNumber(); /* convert pos to msg number */
X extern void writeText(); /* write text to buffer */
X extern XtTextPosition TextGetLastPos(); /* get last pos of text */
X! extern int UpdateTitleBar(); /* file name and msg count */
X extern void writeTo(); /* send text data to window */
X
X /* windows.c */
X***************
X*** 159,165 ****
X extern void CreateSubWindows(); /* all subwindows of xmail */
X extern void CreateTextWindow(); /* another text window */
X extern void CreateTitleBar(); /* a text output window */
X! extern Widget CreateInputWindow(); /* for To, Subject, and Cc */
X
X /* xmail.c */
X
X--- 165,171 ----
X extern void CreateSubWindows(); /* all subwindows of xmail */
X extern void CreateTextWindow(); /* another text window */
X extern void CreateTitleBar(); /* a text output window */
X! extern Widget CreateInputWindow(); /* To, Subject, Cc, and Bcc */
X
X /* xmail.c */
X
X***************
X*** 175,183 ****
X extern char SubjBuf[BUFSIZ]; /* message subject */
X extern char InReply[BUFSIZ]; /* reply reference string */
X extern char CcBuf[BUFSIZ]; /* message Cc list */
X extern char tmpName[BUFSIZ]; /* message temporary filename */
X! extern char MailPrompt[20]; /* mail program prompt string */
X! extern char *HelpNames[23]; /* array of help window names */
X extern char **mailargv; /* array passed to mail child */
X
X extern Pixmap hatch; /* cross_weave, used for Newmail */
X--- 181,190 ----
X extern char SubjBuf[BUFSIZ]; /* message subject */
X extern char InReply[BUFSIZ]; /* reply reference string */
X extern char CcBuf[BUFSIZ]; /* message Cc list */
X+ extern char BccBuf[BUFSIZ]; /* message Bcc list */
X extern char tmpName[BUFSIZ]; /* message temporary filename */
X! extern char *MailPrompt; /* mail program prompt string */
X! extern char *HelpNames[24]; /* array of help window names */
X extern char **mailargv; /* array passed to mail child */
X
X extern Pixmap hatch; /* cross_weave, used for Newmail */
X***************
X*** 187,196 ****
X
X extern AliasRecPtr *aliases; /* array of mail alias strings */
X extern XmailResources XMail; /* XMail application resources */
X! extern XtTextSource HelpStrings[22];
X extern XFontStruct *TextFontStr, *HelpFontStr;
X
X- extern FILE *mailfp; /* file pointer to mail process */
X extern int mail_fd; /* descriptor to mail process i/o */
X
X extern int mailargc; /* counter passed to mail child */
X--- 194,202 ----
X
X extern AliasRecPtr *aliases; /* array of mail alias strings */
X extern XmailResources XMail; /* XMail application resources */
X! extern XtTextSource HelpStrings[23];
X extern XFontStruct *TextFontStr, *HelpFontStr;
X
X extern int mail_fd; /* descriptor to mail process i/o */
X
X extern int mailargc; /* counter passed to mail child */
X*** ../v1.0/handler.c Sun May 27 21:05:52 1990
X--- handler.c Sun May 27 21:11:36 1990
X***************
X*** 38,45 ****
X * The following software modules were created and are Copyrighted by National
X * Semiconductor Corporation:
X *
X! * 1. index_handler: and
X! * 2. file_handler.
X *
X * Author: Michael C. Wagnitz - National Semiconductor Corporation
X *
X--- 38,47 ----
X * The following software modules were created and are Copyrighted by National
X * Semiconductor Corporation:
X *
X! * 1. In_System_Folder:
X! * 2. icon_handler:
X! * 3. index_handler: and
X! * 4. file_handler.
X *
X * Author: Michael C. Wagnitz - National Semiconductor Corporation
X *
X***************
X*** 49,66 ****
X #include <ctype.h>
X #include "global.h"
X #include "xmailregex.h"
X
X /*
X ** @(#)index_handler() - mark index line of specified or current mail message
X */
X int
X! index_handler(msg_num)
X int msg_num;
X {
X! char *c, *s, *strchr();
X Arg args[2];
X Cardinal j, k;
X! Widget w;
X XtTextPosition pos, top;
X
X
X--- 51,169 ----
X #include <ctype.h>
X #include "global.h"
X #include "xmailregex.h"
X+ #include "MailwatchP.h"
X
X+ #if XtSpecificationRelease >= 4
X+ #include <X11/Xaw/LabelP.h> /* R4 */
X+ #else
X+ #include <X11/LabelP.h> /* R3 */
X+ #endif
X+
X /*
X+ ** This is unwise, because it depends on a Label Widget's private parts.
X+ ** Examine the current value of the titleBar label and return true/false
X+ ** does it match the system mail folder name?
X+ */
X+ int
X+ In_System_Folder(w)
X+ Widget w;
X+ {
X+ int result;
X+ char *cp, *index(), *rindex(), buf[BUFSIZ];
X+ MailwatchWidget mb = (MailwatchWidget) WidgetOf(w, "mailbox");
X+ LabelWidget tb = (LabelWidget) WidgetOf(WidgetOf(WidgetOf(toplevel,
X+ "topBox"), "titleBar"), "titleBar");
X+
X+ strcpy(buf, tb->label.label); /* XtGetValues didn't work in R3 */
X+ if ((cp = rindex(buf, '"')) == NULL) result = FALSE;
X+ else { /* if a current folder name exists */
X+ *cp = NULL; /* chop off the rest of the label */
X+ if ((cp = index(buf, '"')) == NULL) result = FALSE;
X+ else result = (strcmp(mb->mailbox.filename, ++cp) == 0) ? TRUE : FALSE;
X+ }
X+ return(result);
X+ } /* In_System_Folder */
X+
X+
X+ /*
X+ ** Process map and unmap events for the icon widget to manage iconify and
X+ ** deiconify events and switch to/from a bogus mail folder. This allows users
X+ ** to access mail from another process without colliding with an open folder.
X+ ** Once the bogus mail folder is accessed, we unlink it, to avoid having to
X+ ** explicitly remove it later.
X+ */
X+ XtEventHandler
X+ icon_handler(w, client_data, event)
X+ Widget w;
X+ caddr_t client_data;
X+ XEvent *event;
X+ {
X+ FILE *fp;
X+ char *cp, cmd[BUFSIZ];
X+ static Boolean In_Bogus_Mail_File = False; /* TRUE when we go iconic */
X+ static Boolean Was_System_Folder = False; /* TRUE if we had been in */
X+
X+
X+ if (mailpid) {
X+ switch (event->type) {
X+ case MapNotify :
X+ if (! In_Bogus_Mail_File) {
X+ if (In_System_Folder(w))
X+ Was_System_Folder = True;
X+ (void) sprintf(cmd, "%s+", tmpName);
X+ if (fp = fopen(cmd, "w")) { /* create a bogus mail file */
X+ (void) fprintf(fp, "\n");
X+ fclose(fp);
X+ (void) sprintf(cmd, "file %s+", tmpName);
X+ cp = QueryMail(cmd); /* focus our attention there */
X+ XtFree(cp);
X+ (void) sprintf(cmd, "%s+", tmpName);
X+ (void) unlink(cmd); /* toss it now that we're in */
X+ In_Bogus_Mail_File = True;
X+ }
X+ }
X+ break;
X+ case UnmapNotify :
X+ if (In_Bogus_Mail_File) {
X+ if (strcmp(Command, "Start") != 0) { /* if not starting up */
X+ if (Was_System_Folder) { /* go to system file */
X+ (void) strcpy(Command, "file %\n");
X+ } else { /* go to prev. file */
X+ (void) strcpy(Command, "file #\n");
X+ }
X+ } else {
X+ if (XMail.MFileName) { /* start in specified folder */
X+ (void) sprintf(Command, "file %s\n", XMail.MFileName);
X+ } else { /* or else use system folder */
X+ (void) strcpy(Command, "file %\n");
X+ }
X+ }
X+ writeMail(Command); /* let parser do the updating */
X+ In_Bogus_Mail_File = False;
X+ Was_System_Folder = False;
X+ } else if (In_System_Folder(w))
X+ UnsetNewmail(WidgetOf(WidgetOf(WidgetOf(toplevel,
X+ "topBox"), "commandPanel"), "Folder"));
X+ break;
X+ default:
X+ break;
X+ } /* end - switch on event type */
X+ } /* end - if mail is active */
X+ } /* icon_handler */
X+
X+
X+ /*
X ** @(#)index_handler() - mark index line of specified or current mail message
X */
X int
X! index_handler(msg_num, undeleting)
X int msg_num;
X+ int undeleting;
X {
X! char *c, *s, *index();
X Arg args[2];
X Cardinal j, k;
X! Widget iw;
X XtTextPosition pos, top;
X
X
X***************
X*** 74,80 ****
X }
X
X if (k <= 50)
X! for (s = IndexBuf, j = k; j > 1 && (c = strchr(s,'\n')); j--) s = c + 1;
X else { /* if index is fairly large */
X for (s = &IndexBuf[strlen(IndexBuf) - 2]; s > IndexBuf && *s != '\n'; s--);
X for (c = s + 1; *c && !isdigit(*c); c++);
X--- 177,183 ----
X }
X
X if (k <= 50)
X! for (s = IndexBuf, j = k; j > 1 && (c = index(s,'\n')); j--) s = c + 1;
X else { /* if index is fairly large */
X for (s = &IndexBuf[strlen(IndexBuf) - 2]; s > IndexBuf && *s != '\n'; s--);
X for (c = s + 1; *c && !isdigit(*c); c++);
X***************
X*** 91,99 ****
X s++;
X }
X
X! if (*(s + 1) == 'D') { /* If this is a deleted msg */
X for (;*s && *(s + 1) == 'D';) { /* try looking above deletes */
X! if (! (c = strchr(s,'\n'))) break; /* don't go past end of buf */
X s = c + 1;
X }
X for (;s > IndexBuf && *(s + 1) == 'D';) {
X--- 194,202 ----
X s++;
X }
X
X! if (! undeleting && *(s + 1) == 'D') { /* If this is a deleted msg */
X for (;*s && *(s + 1) == 'D';) { /* try looking above deletes */
X! if (! (c = index(s,'\n'))) break; /* don't go past end of buf */
X s = c + 1;
X }
X for (;s > IndexBuf && *(s + 1) == 'D';) {
X***************
X*** 106,123 ****
X
X pos = s - IndexBuf; /* resolve our position */
X
X! w = WidgetOf(WidgetOf(toplevel, "vpane"), "indexWindow");
X
X! XtTextSetInsertionPoint(w, pos);
X
X- SetSelect(w, NULL, NULL, NULL);
X-
X return(j); /* return msg actually found */
X } /* index_handler */
X
X
X /*
X! ** @(#)file_handler() - Handle output of Start, file, and delete commands
X ** If *Show_Last: resource is NOT False and show_latest is true, show last
X ** message in list, if none are marked as new.
X */
X--- 209,224 ----
X
X pos = s - IndexBuf; /* resolve our position */
X
X! iw = WidgetOf(WidgetOf(toplevel, "topBox"), "indexWindow");
X
X! XtTextSetInsertionPoint(iw, pos);
X
X return(j); /* return msg actually found */
X } /* index_handler */
X
X
X /*
X! ** @(#)file_handler() - Handle output of Start and file commands
X ** If *Show_Last: resource is NOT False and show_latest is true, show last
X ** message in list, if none are marked as new.
X */
X***************
X*** 124,132 ****
X file_handler(show_latest)
X int show_latest;
X {
X! Widget w;
X! char msgnum_str[10], *c, *s, *p, *strchr();
X! int msg_num = 0; /* zero means no message */
X
X
X c = QueryMail("="); /* Get current mail msg num. */
X--- 225,233 ----
X file_handler(show_latest)
X int show_latest;
X {
X! char *c, *s, *p, *index(), msgnum_str[10];
X! int more_than_one, msg_num = 0; /* zero means no message */
X! Widget iw = WidgetOf(WidgetOf(toplevel, "topBox"), "indexWindow");
X
X
X c = QueryMail("="); /* Get current mail msg num. */
X***************
X*** 136,142 ****
X XtFree(c);
X
X c = QueryMail("file"); /* Forces current msg to one */
X! UpdateTitleBar(c);
X XtFree(c);
X
X if (strcmp(Command, "Start") == 0) { /* unless we're at Start, in */
X--- 237,243 ----
X XtFree(c);
X
X c = QueryMail("file"); /* Forces current msg to one */
X! (void) UpdateTitleBar(c);
X XtFree(c);
X
X if (strcmp(Command, "Start") == 0) { /* unless we're at Start, in */
X***************
X*** 148,155 ****
X s = QueryMail("h");
X if (strncmp(s, "No applicable messages", 22) == 0) {
X Bell(s);
X! writeText(WidgetOf(WidgetOf(toplevel, "vpane"), "indexWindow"), " ", 0);
X! writeTo(WidgetOf(WidgetOf(toplevel, "vpane"), "textWindow"), " ");
X } else {
X /*
X ** find message pointer caret and replace it with a space
X--- 249,256 ----
X s = QueryMail("h");
X if (strncmp(s, "No applicable messages", 22) == 0) {
X Bell(s);
X! writeText(iw, " ", FALSE);
X! writeTo(WidgetOf(WidgetOf(toplevel, "topBox"), "textWindow"), " ");
X } else {
X /*
X ** find message pointer caret and replace it with a space
X***************
X*** 164,174 ****
X }
X }
X /*
X! ** If current message is not marked as new or unread, show_latest is true, and
X! ** the Show_Last resource is not false, select the last message in the header.
X */
X! if (show_latest && XMail.Show_Last) {
X! if (*(c+1) != 'N' && *(c+1) != 'U') { /* If this is not a special */
X p = c; /* find the last message */
X if (c == s) { /* if would've started @ One */
X for (p = &s[strlen(s)-2]; p > s && *p != '\n'; p--);
X--- 265,279 ----
X }
X }
X /*
X! ** If current message is marked new or unread, ensure as many of new message
X! ** headers as possible are displayed in the index window (especially the
X! ** current one), else if show_latest is true, and the Show_Last resource is
X! ** not false, select the last message in the header.
X */
X! more_than_one = FALSE; /* set a flag for new/unread */
X! if (*(c+1) == 'N' || *(c+1) == 'U') more_than_one = TRUE;
X! else {
X! if (show_latest && XMail.Show_Last) {
X p = c; /* find the last message */
X if (c == s) { /* if would've started @ One */
X for (p = &s[strlen(s)-2]; p > s && *p != '\n'; p--);
X***************
X*** 175,181 ****
X p++; /* go to last line of buffer */
X } else {
X for (;*++c && *(c+1) != 'N' && *(c+1) != 'U';) {
X! if (! (c = strchr(p,'\n')))
X break; /* don't go past end of buf */
X p = c + 1;
X }
X--- 280,286 ----
X p++; /* go to last line of buffer */
X } else {
X for (;*++c && *(c+1) != 'N' && *(c+1) != 'U';) {
X! if (! (c = index(p,'\n')))
X break; /* don't go past end of buf */
X p = c + 1;
X }
X***************
X*** 186,202 ****
X }
X }
X /*
X! ** write the header info to the index window
X */
X! writeText(WidgetOf(WidgetOf(toplevel, "vpane"), "indexWindow"), s, 0);
X /*
X! ** return the current mail message number
X */
X msg_num = atoi(msgnum_str);
X /*
X ** highlight the current message's header line index number
X */
X! index_handler(msg_num);
X }
X XtFree(s);
X return(msg_num);
X--- 291,314 ----
X }
X }
X /*
X! ** Write the header info into the index window buffer, replacing existing info.
X */
X! writeText(iw, s, FALSE);
X /*
X! ** Ensure if we are seeing new or unread messages that as many as possible are
X! ** displayed in the index window, to reduce the amount of scrolling required
X! ** when reading(/deleting) them.
X */
X+ if (more_than_one)
X+ XtTextSetInsertionPoint(iw, TextGetLastPos(iw));
X+ /*
X+ ** Return the current mail message number.
X+ */
X msg_num = atoi(msgnum_str);
X /*
X ** highlight the current message's header line index number
X */
X! index_handler(msg_num, 0);
X }
X XtFree(s);
X return(msg_num);
X*** ../v1.0/mail.c Sun May 27 21:05:53 1990
X--- mail.c Sun May 27 21:11:36 1990
X***************
X*** 47,54 ****
X
X #include "global.h"
X
X! #ifndef DEFAULT_EDITOR
X! #define DEFAULT_EDITOR "/usr/ucb/vi";
X #endif
X
X /*
X--- 47,54 ----
X
X #include "global.h"
X
X! #ifndef DEFAULT_VISUAL
X! #define DEFAULT_VISUAL "/usr/ucb/vi"
X #endif
X
X /*
X***************
X*** 74,81 ****
X writeMail(s)
X char *s;
X {
X! fputs(s, mailfp);
X! fflush(mailfp);
X } /* writeMail */
X
X
X--- 74,80 ----
X writeMail(s)
X char *s;
X {
X! write(mail_fd, s, strlen(s));
X } /* writeMail */
X
X
X***************
X*** 87,188 ****
X sendMail(parent)
X Widget parent;
X {
X! Arg args[MAXARGS];
X! Cardinal n;
X Display *ad;
X Widget Popup, Layout;
X! Widget lab1, lab2, lab3;
X! Widget To, Subject, Cclist, Last;
X Window aw, dumy;
X! String Editor;
X menuList_p *list;
X menuList b1, b2, b3;
X! char cmd[BUFSIZ];
X int x, y, scn;
X
X
X! aw = XtWindow(WidgetOf(WidgetOf(toplevel, "vpane"), "statusWindow"));
X! ad = XtDisplay(WidgetOf(WidgetOf(toplevel, "vpane"), "statusWindow"));
X scn = DefaultScreen(ad);
X
X! XTranslateCoordinates(ad, aw, RootWindow(ad, scn), XMail.menuX, XMail.menuY,
X! &x, &y, &dumy);
X
X scn = XMail.shellWidth - 100;
X
X! n = 0;
X! XtSetArg(args[n], XtNinput, True); n++;
X! XtSetArg(args[n], XtNwidth, scn); n++;
X! XtSetArg(args[n], XtNheight, XMail.textMinHeight); n++;
X! XtSetArg(args[n], XtNborderWidth, 2); n++;
X! XtSetArg(args[n], XtNx, x); n++;
X! XtSetArg(args[n], XtNy, y); n++;
X! Popup = XtCreatePopupShell("popup", overrideShellWidgetClass,parent,args,n);
X
X! n = 0;
X! XtSetArg(args[n], XtNdefaultDistance, 2); n++;
X! Layout = XtCreateManagedWidget("SubjCc", formWidgetClass, Popup, args, n);
X
X! n = 0;
X! XtSetArg(args[n], XtNfromVert, NULL); n++;
X! XtSetArg(args[n], XtNfromHoriz, NULL); n++;
X! XtSetArg(args[n], XtNlabel, "To: "); n++;
X! XtSetArg(args[n], XtNborderWidth, 0); n++;
X! XtSetArg(args[n], XtNfont, TextFontStr); n++;
X! XtSetArg(args[n], XtNheight, XMail.buttonHeight); n++;
X! XtSetArg(args[n], XtNjustify, XtJustifyLeft); n++;
X! XtSetArg(args[n], XtNinternalHeight, 0); n++;
X! XtSetArg(args[n], XtNinternalWidth, 1); n++;
X! lab1 = XtCreateManagedWidget("SubjCc", labelWidgetClass, Layout, args, n);
X
X To = CreateInputWindow(Layout, "To", Recipient, BUFSIZ);
X- n = 0;
X- XtSetArg(args[n], XtNfromVert, NULL); n++;
X- XtSetArg(args[n], XtNfromHoriz, lab1); n++;
X- XtSetValues(To, args, n);
X
X AddHelpText(To, "To", To_Help_Text);
X
X! n = 0;
X! XtSetArg(args[n], XtNfromVert, lab1); n++;
X! XtSetArg(args[n], XtNfromHoriz, NULL); n++;
X! XtSetArg(args[n], XtNlabel, "Subject: "); n++;
X! n = 9;
X! lab2 = XtCreateManagedWidget("SubjCc", labelWidgetClass, Layout, args, n);
X
X Subject = CreateInputWindow(Layout, "Subject", SubjBuf, BUFSIZ);
X- n = 0;
X- XtSetArg(args[n], XtNfromVert, To); n++;
X- XtSetArg(args[n], XtNfromHoriz, lab2); n++;
X- XtSetValues(Subject, args, n);
X
X AddHelpText(Subject, "Subject", Subject_Help_Text);
X
X! n = 0;
X! XtSetArg(args[n], XtNfromVert, lab2); n++;
X! XtSetArg(args[n], XtNfromHoriz, NULL); n++;
X! XtSetArg(args[n], XtNlabel, "Cc: "); n++;
X! n = 9;
X! lab3 = XtCreateManagedWidget("SubjCc", labelWidgetClass, Layout, args, n);
X
X Cclist = CreateInputWindow(Layout, "Cc", CcBuf, BUFSIZ);
X- n = 0;
X- XtSetArg(args[n], XtNfromVert, Subject); n++;
X- XtSetArg(args[n], XtNfromHoriz, lab3); n++;
X- XtSetValues(Cclist, args, n);
X
X AddHelpText(Cclist, "Cc", Cc_Help_Text);
X
X! n = 0;
X! XtSetArg(args[n], XtNfromVert, lab3); n++;
X! XtSetArg(args[n], XtNfromHoriz, NULL); n++;
X! XtSetArg(args[n], XtNwidth, scn / 2); n++;
X! XtSetArg(args[n], XtNheight, XMail.buttonHeight); n++;
X! XtSetArg(args[n], XtNfont, TextFontStr); n++;
X! lab2 = XtCreateManagedWidget("Autograph", commandWidgetClass, Layout, args, n);
X
X! XtAddCallback(lab2, XtNcallback, (XtCallbackProc) Autograph, (caddr_t) NULL);
X
X list = (menuList **) XtMalloc(4 * sizeof(menuList *));
X
X b1.label = "Add your autograph string Sign (~A)";
X--- 86,190 ----
X sendMail(parent)
X Widget parent;
X {
X! Arg args[10];
X Display *ad;
X Widget Popup, Layout;
X! Widget lab1, lab2, lab3, lab4;
X! Widget To, Subject, Cclist, Bcc, Last;
X Window aw, dumy;
X! String Editor, pgm;
X menuList_p *list;
X menuList b1, b2, b3;
X! char *rindex(), cmd[BUFSIZ];
X int x, y, scn;
X
X
X! aw = XtWindow(WidgetOf(WidgetOf(toplevel, "topBox"), "statusWindow"));
X! ad = XtDisplay(WidgetOf(WidgetOf(toplevel, "topBox"), "statusWindow"));
X scn = DefaultScreen(ad);
X
X! XTranslateCoordinates(ad,aw,RootWindow(ad,scn),XMail.menuX,0,&x,&y,&dumy);
X
X scn = XMail.shellWidth - 100;
X
X! XtSetArg(args[0], XtNinput, True);
X! XtSetArg(args[1], XtNwidth, scn);
X! XtSetArg(args[2], XtNheight, 20 + XMail.buttonHeight * 5);
X! XtSetArg(args[3], XtNborderWidth, 2);
X! XtSetArg(args[4], XtNx, x);
X! XtSetArg(args[5], XtNy, y);
X! Popup = XtCreatePopupShell("popup", transientShellWidgetClass,parent,args,6);
X
X! XtSetArg(args[0], XtNdefaultDistance, 2);
X! Layout = XtCreateManagedWidget("SubjCc", formWidgetClass, Popup, args, 1);
X
X! XtSetArg(args[0], XtNfromVert, NULL);
X! XtSetArg(args[1], XtNfromHoriz, NULL);
X! XtSetArg(args[2], XtNlabel, "To: ");
X! XtSetArg(args[3], XtNborderWidth, 0);
X! XtSetArg(args[4], XtNfont, TextFontStr);
X! XtSetArg(args[5], XtNheight, XMail.buttonHeight);
X! XtSetArg(args[6], XtNjustify, XtJustifyLeft);
X! XtSetArg(args[7], XtNinternalHeight, 0);
X! XtSetArg(args[8], XtNinternalWidth, 1);
X! lab1 = XtCreateManagedWidget("SubjCc", labelWidgetClass, Layout, args, 9);
X
X To = CreateInputWindow(Layout, "To", Recipient, BUFSIZ);
X
X+ XtSetArg(args[0], XtNfromVert, NULL);
X+ XtSetArg(args[1], XtNfromHoriz, lab1);
X+ XtSetValues(To, args, 2);
X+
X AddHelpText(To, "To", To_Help_Text);
X
X! XtSetArg(args[0], XtNfromVert, lab1);
X! XtSetArg(args[1], XtNfromHoriz, NULL);
X! XtSetArg(args[2], XtNlabel, "Subject: ");
X! lab2 = XtCreateManagedWidget("SubjCc", labelWidgetClass, Layout, args, 9);
X
X Subject = CreateInputWindow(Layout, "Subject", SubjBuf, BUFSIZ);
X
X+ XtSetArg(args[0], XtNfromVert, To);
X+ XtSetArg(args[1], XtNfromHoriz, lab2);
X+ XtSetValues(Subject, args, 2);
X+
X AddHelpText(Subject, "Subject", Subject_Help_Text);
X
X! XtSetArg(args[0], XtNfromVert, lab2);
X! XtSetArg(args[1], XtNfromHoriz, NULL);
X! XtSetArg(args[2], XtNlabel, "Cc: ");
X! lab3 = XtCreateManagedWidget("SubjCc", labelWidgetClass, Layout, args, 9);
X
X Cclist = CreateInputWindow(Layout, "Cc", CcBuf, BUFSIZ);
X
X+ XtSetArg(args[0], XtNfromVert, Subject);
X+ XtSetArg(args[1], XtNfromHoriz, lab3);
X+ XtSetValues(Cclist, args, 2);
X+
X AddHelpText(Cclist, "Cc", Cc_Help_Text);
X
X! XtSetArg(args[0], XtNfromVert, lab3);
X! XtSetArg(args[1], XtNfromHoriz, NULL);
X! XtSetArg(args[2], XtNlabel, "Bcc: ");
X! lab4 = XtCreateManagedWidget("SubjCc", labelWidgetClass, Layout, args, 9);
X
X! Bcc = CreateInputWindow(Layout, "Bcc", BccBuf, BUFSIZ);
X
X+ XtSetArg(args[0], XtNfromVert, Cclist);
X+ XtSetArg(args[1], XtNfromHoriz, lab4);
X+ XtSetValues(Bcc, args, 2);
X+
X+ AddHelpText(Bcc, "Bcc", Bcc_Help_Text);
X+
X+ XtSetArg(args[0], XtNfromVert, Bcc);
X+ XtSetArg(args[1], XtNfromHoriz, NULL);
X+ XtSetArg(args[2], XtNwidth, scn / 2);
X+ XtSetArg(args[3], XtNheight, XMail.buttonHeight);
X+ XtSetArg(args[4], XtNfont, TextFontStr);
X+ lab2 = XtCreateManagedWidget("Autograph", commandWidgetClass, Layout, args, 5);
X+
X+ XtAddCallback(lab2, XtNcallback, (XtCallbackProc) Autograph, (caddr_t) "A");
X+
X list = (menuList **) XtMalloc(4 * sizeof(menuList *));
X
X b1.label = "Add your autograph string Sign (~A)";
X***************
X*** 220,242 ****
X Normalize(To);
X Normalize(Subject);
X Normalize(Cclist);
X
X XtFree(list);
X
X! n = 1;
X! if ((Editor = GetMailEnv("EDITOR")) == NULL &&
X! (Editor = GetMailEnv("VISUAL")) == NULL) {
X! Editor = DEFAULT_EDITOR;
X! n = 0;
X! }
X
X! sprintf(cmd,
X! "xterm -display %s -T \"xmail message entry - using %s\" -n xmail_%s -e %s %s",
X! ad->display_name, Editor, Editor, Editor, tmpName);
X system(cmd);
X
X! if (n)
X! XtFree(Editor);
X
X XtPopup(Popup, XtGrabNone);
X
X--- 222,243 ----
X Normalize(To);
X Normalize(Subject);
X Normalize(Cclist);
X+ Normalize(Bcc);
X
X XtFree(list);
X
X! if ((Editor = GetMailEnv("VISUAL")) == NULL)
X! Editor = XtNewString(DEFAULT_VISUAL);
X
X! if ((pgm = rindex(Editor, '/')) == NULL) pgm = Editor;
X! else ++pgm;
X!
X! sprintf(cmd, "xterm -display %s -name \"XMail\" -T \"xmail message entry\" \
X! -n xmail_%s -e %s %s", ad->display_name, pgm, Editor, tmpName);
X!
X system(cmd);
X
X! XtFree(Editor);
X
X XtPopup(Popup, XtGrabNone);
X
X*** ../v1.0/make.file Sun May 27 22:22:46 1990
X--- make.file Sun May 27 22:23:35 1990
X***************
X*** 32,39 ****
X #
X # Add -lXext if compiling under X11 Release 4 or later
X #
X! # LIBRARIES = -lXaw -lXmu -lXt -lX11 -lm
X! LIBRARIES = -lXaw -lXmu -lXt -lXext -lX11 -lm
X PROGRAM = xmail
X SRCS = \
X Mailwatch.c \
X--- 32,39 ----
X #
X # Add -lXext if compiling under X11 Release 4 or later
X #
X! # LIBRARIES = -lXaw -lXmu -lXt -lX11
X! LIBRARIES = -lXaw -lXmu -lXt -lXext -lX11
X PROGRAM = xmail
X SRCS = \
X Mailwatch.c \
X*** ../v1.0/parser.c Sun May 27 21:05:56 1990
X--- parser.c Sun May 27 21:11:37 1990
X***************
X*** 122,131 ****
X Cardinal j, k, msgnum;
X XtTextBlock textblock;
X XtTextPosition pos;
X! Widget button, popup;
X char tmp[128], *c, *index();
X static String old_msg = NULL;
X- static int shown_msg = 0;
X
X
X j = match(command_pattern, Command);
X--- 122,132 ----
X Cardinal j, k, msgnum;
X XtTextBlock textblock;
X XtTextPosition pos;
X! Widget button, icon, popup, iw;
X char tmp[128], *c, *index();
X+ int num;
X+ static Boolean first_time = True;
X static String old_msg = NULL;
X
X
X j = match(command_pattern, Command);
X***************
X*** 134,187 ****
X ** If error on startup, mail has terminated connection. Remove our input
X ** handler, close the file from our end, and indicate that no connection
X ** exists. Otherwise, establish conversation requirements and display the
X! ** current message. Track current message shown for delete display control.
X! ** If *Show_Last: resource is NOT False, show latest message, if none new.
X */
X case C_START : if (O_BELL == match(output_pattern, msg)) {
X XtRemoveInput(mailInputId);
X- fclose(mailfp);
X close(mail_fd);
X mailpid = 0;
X LASTCH(msg) = '\0'; /* Don't ring Bell() for this */
X Bell(msg);
X! UpdateTitleBar("No current folder");
X XtFree(msg);
X *msg = '\0';
X } else {
X! #ifdef X11R3
X! XtFree(QueryMail("set screen=100 nocrt noautoprint"));
X #else
X! XtFree(QueryMail("set screen=500 nocrt noautoprint"));
X #endif
X if (msgnum = file_handler(1)) {
X sprintf(tmp, "size %d", msgnum);
X XtFree(msg);
X msg = QueryMail(tmp);
X! c = index(msg, '/');
X! if (65536 < atoi(++c))
X strcpy(msg, " "); /* Don't auto-read huge msgs */
X else {
X sprintf(tmp, "%d", msgnum);
X XtFree(msg);
X msg = QueryMail(tmp);
X! shown_msg = msgnum;
X }
X }
X }
X break;
X /*
X ** In response to normal or change folder commands, test output. If an
X! ** error, display message in status window and ring bell. If we have
X! ** text of next mail message, tell index_handler to mark its number, else
X! ** retrieve the appropriate message text (which also marks its number).
X! ** If *Show_Last: resource is NOT False, file cmd shows latest, if none new.
X! ** Track current message shown for delete display control.
X */
X case C_EXEC :
X case C_FILE : j = match(output_pattern, msg);
X switch (j) {
X! case O_BELL : Bell(msg); XtFree(msg); *msg='\0'; break;
X! case O_EXEC : shown_msg = index_handler(0); break;
X case O_FILE : msgnum = file_handler(1);
X c = index(msg, '\n');
X if ((int)(c - msg) < strlen(msg) - 1) {
X--- 135,219 ----
X ** If error on startup, mail has terminated connection. Remove our input
X ** handler, close the file from our end, and indicate that no connection
X ** exists. Otherwise, establish conversation requirements and display the
X! ** current message. If *Show_Last: resource is NOT False, show latest, if
X! ** none are newer. We delay setting the icon event handler until now, to
X! ** ensure mail startup completed before being interrupted by a map event,
X! ** for the case where we have been started iconic.
X */
X case C_START : if (O_BELL == match(output_pattern, msg)) {
X XtRemoveInput(mailInputId);
X close(mail_fd);
X mailpid = 0;
X LASTCH(msg) = '\0'; /* Don't ring Bell() for this */
X Bell(msg);
X! (void) UpdateTitleBar("No current folder");
X XtFree(msg);
X *msg = '\0';
X } else {
X! #if XtSpecificationRelease >= 4
X! strcpy(tmp, "set screen=500 ");
X #else
X! strcpy(tmp, "set screen=100 ");
X #endif
X+ /* default action for xmail is hold (ala mailtool) */
X+ if (c = GetMailrc("nohold")) XtFree(c);
X+ else strcat(tmp, "hold ");
X+
X+ strcat(tmp, "nocrt noreplyall");
X+
X+ c = QueryMail(tmp);
X+ XtFree(c);
X+
X if (msgnum = file_handler(1)) {
X sprintf(tmp, "size %d", msgnum);
X XtFree(msg);
X msg = QueryMail(tmp);
X! if (! (c = index(msg, '/'))) /* UCB #: lines/size */
X! c = index(msg, ' '); /* Ultrix = #: size */
X! if (c && 65536 < atoi(++c))
X strcpy(msg, " "); /* Don't auto-read huge msgs */
X else {
X sprintf(tmp, "%d", msgnum);
X XtFree(msg);
X msg = QueryMail(tmp);
X! markIndex(" ");
X }
X }
X }
X+ if (first_time) { /* only need to do this once */
X+ icon = XtNameToWidget(toplevel, "icon");
X+ XtAddEventHandler(icon, StructureNotifyMask, False,
X+ icon_handler, NULL);
X+ first_time = False;
X+ }
X break;
X /*
X ** In response to normal or change folder commands, test output. If an
X! ** error, display message in status window and ring bell. If current
X! ** folder is our bogus folder, erase any text and index and note state.
X! ** If we have text of next mail message, tell index_handler to mark its
X! ** number, else retrieve the appropriate message text (which also marks
X! ** its number). If *Show_Last: resource is NOT False, file cmd shows
X! ** latest, if none new.
X */
X case C_EXEC :
X case C_FILE : j = match(output_pattern, msg);
X switch (j) {
X! case O_BELL : Bell(msg);
X! XtFree(msg);
X! msg = QueryMail("file");
X! if (strncmp(&msg[1], tmpName, strlen(tmpName)) == 0) {
X! UpdateTitleBar("No current folder");
X! iw = WidgetOf(toplevel, "topBox");
X! writeText(WidgetOf(iw, "indexWindow"), " ", FALSE);
X! writeTo(WidgetOf(iw, "textWindow"), " ");
X! }
X! XtFree(msg);
X! *msg='\0';
X! break;
X! case O_EXEC : msgnum = index_handler(0, 0);
X! markIndex(" ");
X! break;
X case O_FILE : msgnum = file_handler(1);
X c = index(msg, '\n');
X if ((int)(c - msg) < strlen(msg) - 1) {
X***************
X*** 193,206 ****
X if (msgnum) {
X sprintf(tmp, "size %d", msgnum);
X msg = QueryMail(tmp);
X! c = index(msg, '/');
X! if (65536 < atoi(++c))
X strcpy(msg, " ");
X else {
X sprintf(tmp, "%d", msgnum);
X XtFree(msg);
X msg = QueryMail(tmp);
X! shown_msg = msgnum;
X }
X }
X break;
X--- 225,239 ----
X if (msgnum) {
X sprintf(tmp, "size %d", msgnum);
X msg = QueryMail(tmp);
X! if (! (c = index(msg, '/')))
X! c = index(msg, ' ');
X! if (c && 65536 < atoi(++c))
X strcpy(msg, " ");
X else {
X sprintf(tmp, "%d", msgnum);
X XtFree(msg);
X msg = QueryMail(tmp);
X! markIndex(" ");
X }
X }
X break;
X***************
X*** 207,216 ****
X }
X break;
X /*
X! ** When deleting a message, if the message deleted was not the one currently
X! ** shown, simply mark that message's index line with a capital 'D'. Else, if
X! ** we deleted the currently displayed message, or we undeleted one, display
X! ** the next (or undeleted) message, and track our message shown number.
X */
X case C_DELETE : if (O_BELL == match(output_pattern, msg)) {
X Bell(msg);
X--- 240,248 ----
X }
X break;
X /*
X! ** When deleting a message, simply mark that index line with a capital 'D'.
X! ** If un-deleting, mark that index line with a blank ' '. If no current
X! ** index, restore it.
X */
X case C_DELETE : if (O_BELL == match(output_pattern, msg)) {
X Bell(msg);
X***************
X*** 218,267 ****
X *msg = '\0';
X } else {
X pos = XtTextGetInsertionPoint(WidgetOf(WidgetOf(toplevel,
X! "vpane"), "indexWindow")) + 1;
X msgnum = PositionToMsgNumber(pos);
X! if (*Command == 'd' && msgnum && msgnum != shown_msg) {
X! XtTextSetInsertionPoint(WidgetOf(WidgetOf(toplevel,
X! "vpane"), "indexWindow"), pos);
X! textblock.firstPos = 0;
X! textblock.length = 1;
X! textblock.ptr = "D";
X! textblock.format = FMT8BIT;
X! XtTextReplace(WidgetOf(WidgetOf(toplevel, "vpane"),
X! "indexWindow"), pos, pos+1, &textblock);
X! index_handler(++msgnum); /* point to next msg */
X! XtFree(msg);
X! *msg = '\0';
X! } else {
X! if (msgnum = file_handler(0)) {
X! sprintf(tmp, "size %d", msgnum);
X! XtFree(msg);
X! msg = QueryMail(tmp);
X! c = index(msg, '/');
X! if (65536 < atoi(++c))
X! strcpy(msg, " ");
X! else {
X! sprintf(tmp, "%d", msgnum);
X! XtFree(msg);
X! msg = QueryMail(tmp);
X! shown_msg = msgnum;
X }
X }
X }
X- }
X break;
X /*
X ** In response to a request to view new mail, first reset the mailbox flag.
X ** If mail came back with an error, complain to the user. Otherwise, clear
X ** the Newmail command button highlighting, and (if it exists) destroy the
X! ** current folder popup list. Then display new mail text and track number.
X */
X case C_NEWMAIL:
X! reset_mailbox(WidgetOf(WidgetOf(toplevel,"icon"),"mailbox"));
X! UnsetNewmail(WidgetOf(WidgetOf(toplevel, "vpane"),
X! "commandPanel"), NULL, NULL);
X! button = WidgetOf(WidgetOf(WidgetOf(toplevel, "vpane"),
X "commandPanel"), "Folder");
X if (popup = WidgetOf(button, "popupList"))
X XtDestroyWidget(popup);
X if (O_BELL == match(output_pattern, msg)) {
X--- 250,293 ----
X *msg = '\0';
X } else {
X pos = XtTextGetInsertionPoint(WidgetOf(WidgetOf(toplevel,
X! "topBox"), "indexWindow")) + 1;
X msgnum = PositionToMsgNumber(pos);
X! if (*Command == 'd' && msgnum) {
X! markIndex("D");
X! num = msgnum;
X! msgnum = index_handler(++msgnum, 0); /* next msg */
X! if (msgnum != num) markIndex(" ");
X! }
X! if (*Command == 'u') {
X! c = QueryMail("=");
X! sscanf(c, "%d", &msgnum);
X! XtFree(c);
X! iw = WidgetOf(WidgetOf(toplevel, "topBox"),"indexWindow");
X! if (TextGetLastPos(iw) < (XtTextPosition) 4) {
X! c = QueryMail("h");
X! writeText(iw, c, FALSE);
X! XtFree(c);
X }
X+ msgnum = index_handler(msgnum, 1);
X+ markIndex(" ");
X }
X+ c = QueryMail("file"); /* resets current msg to 1 */
X+ (void) UpdateTitleBar(c);
X+ sprintf(tmp, "f %d", msgnum);
X+ c = QueryMail(tmp); /* reset real current msg */
X+ XtFree(c);
X }
X break;
X /*
X ** In response to a request to view new mail, first reset the mailbox flag.
X ** If mail came back with an error, complain to the user. Otherwise, clear
X ** the Newmail command button highlighting, and (if it exists) destroy the
X! ** current folder popup list. Then display any new mail text.
X */
X case C_NEWMAIL:
X! button = WidgetOf(WidgetOf(WidgetOf(toplevel, "topBox"),
X "commandPanel"), "Folder");
X+ UnsetNewmail(button, NULL, NULL);
X if (popup = WidgetOf(button, "popupList"))
X XtDestroyWidget(popup);
X if (O_BELL == match(output_pattern, msg)) {
X***************
X*** 282,295 ****
X if (msgnum) {
X sprintf(tmp, "size %d", msgnum);
X msg = QueryMail(tmp);
X! c = index(msg, '/');
X! if (65536 < atoi(++c))
X strcpy(msg, " ");
X else {
X sprintf(tmp, "%d", msgnum);
X XtFree(msg);
X msg = QueryMail(tmp);
X! shown_msg = msgnum;
X }
X }
X }
X--- 308,322 ----
X if (msgnum) {
X sprintf(tmp, "size %d", msgnum);
X msg = QueryMail(tmp);
X! if (! (c = index(msg, '/')))
X! c = index(msg, ' ');
X! if (c && 65536 < atoi(++c))
X strcpy(msg, " ");
X else {
X sprintf(tmp, "%d", msgnum);
X XtFree(msg);
X msg = QueryMail(tmp);
X! markIndex(" "); /* 'cause we just read it */
X }
X }
X }
X***************
X*** 307,313 ****
X */
X case O_PRINT:
X sscanf(&Command[2], "%d", &j);
X! sscanf(&msg[26], "%*d/%d", &k);
X sprintf(tmp,
X "Message %d sent to printer -- %d bytes\n", j, k);
X Bell(tmp);
X--- 334,341 ----
X */
X case O_PRINT:
X sscanf(&Command[2], "%d", &j);
X! c = rindex(msg, '/');
X! sscanf(c, "/%d", &k);
X sprintf(tmp,
X "Message %d sent to printer -- %d bytes\n", j, k);
X Bell(tmp);
X***************
X*** 327,338 ****
X for (j = strlen(msg)-1; j > 1 && msg[j] == '\n' && msg[j-1] == '\n'; j--);
X msg[++j] = '\0'; /* drop all but the last newline */
X
X! writeTo(WidgetOf(WidgetOf(toplevel, "vpane"), "textWindow"), msg);
X }
X } /* parse */
X
X! #undef BUFSIZ
X! #define BUFSIZ 8192
X
X /*
X ** @(#)QueryMail() - Sends a command and returns corresponding output.
X--- 355,365 ----
X for (j = strlen(msg)-1; j > 1 && msg[j] == '\n' && msg[j-1] == '\n'; j--);
X msg[++j] = '\0'; /* drop all but the last newline */
X
X! writeTo(WidgetOf(WidgetOf(toplevel, "topBox"), "textWindow"), msg);
X }
X } /* parse */
X
X! #define FILEBUF 8192
X
X /*
X ** @(#)QueryMail() - Sends a command and returns corresponding output.
X***************
X*** 344,350 ****
X {
X Widget w, x, y, z;
X int j, outputsize, size, length = strlen(MailPrompt);
X! char *output = "", s[BUFSIZ];
X
X
X if (! mailpid)
X--- 371,377 ----
X {
X Widget w, x, y, z;
X int j, outputsize, size, length = strlen(MailPrompt);
X! char *output = "", s[FILEBUF];
X
X
X if (! mailpid)
X***************
X*** 358,364 ****
X writeMail(s);
X }
X
X! w = WidgetOf(toplevel, "vpane");
X x = WidgetOf(w, "indexWindow");
X y = WidgetOf(w, "textWindow");
X z = WidgetOf(WidgetOf(w, "commandPanel"), "fileWindow");
X--- 385,391 ----
X writeMail(s);
X }
X
X! w = WidgetOf(toplevel, "topBox");
X x = WidgetOf(w, "indexWindow");
X y = WidgetOf(w, "textWindow");
X z = WidgetOf(WidgetOf(w, "commandPanel"), "fileWindow");
X***************
X*** 370,389 ****
X /*
X ** allocate one block to 'output' to begin with
X */
X! outputsize = BUFSIZ;
X output = XtMalloc(outputsize);
X strcpy(output, "");
X
X for (;;) {
X! while ((size = read(mail_fd, s, BUFSIZ)) == -1);
X
X! if (size == 0) break; /* END-OF-FILE? should never happen */
X!
X! if (size < BUFSIZ)
X s[size] = '\0';
X
X if (strlen(output) + size > outputsize) {
X! outputsize += BUFSIZ;
X output = XtRealloc(output, outputsize);
X }
X strcat(output, s);
X--- 397,415 ----
X /*
X ** allocate one block to 'output' to begin with
X */
X! outputsize = FILEBUF;
X output = XtMalloc(outputsize);
X strcpy(output, "");
X
X for (;;) {
X! if ((size = read(mail_fd, s, FILEBUF)) == 0)
X! break; /* END-OF-FILE? should never happen */
X
X! if (size < FILEBUF)
X s[size] = '\0';
X
X if (strlen(output) + size > outputsize) {
X! outputsize += FILEBUF;
X output = XtRealloc(output, outputsize);
X }
X strcat(output, s);
X*** ../v1.0/regex.c Sun May 27 21:06:01 1990
X--- regex.c Sun May 27 21:10:02 1990
X***************
X*** 112,117 ****
X--- 112,119 ----
X #include <alloca.h>
X #endif
X
X+ static int bcmp_translate();
X+
X #ifdef emacs
X
X /* The `emacs' switch turns on certain special matching commands
X*** ../v1.0/utils.c Sun May 27 21:05:57 1990
X--- utils.c Sun May 27 21:11:37 1990
X***************
X*** 38,45 ****
X * The following software modules were created and are Copyrighted by National
X * Semiconductor Corporation:
X *
X! * 1. Normalize: and
X! * 2. PositionToMsgNumber.
X *
X * Author: Michael C. Wagnitz - National Semiconductor Corporation
X *
X--- 38,46 ----
X * The following software modules were created and are Copyrighted by National
X * Semiconductor Corporation:
X *
X! * 1. Normalize:
X! * 2. MarkIndex: and
X! * 3. PositionToMsgNumber.
X *
X * Author: Michael C. Wagnitz - National Semiconductor Corporation
X *
X***************
X*** 48,53 ****
X--- 49,55 ----
X
X #include <ctype.h>
X #include "global.h"
X+ #include "patchlevel.h"
X
X
X /*
X***************
X*** 63,68 ****
X--- 65,99 ----
X
X
X /*
X+ ** @(#)markIndex() - add or remove tag from head of index line
X+ */
X+ void
X+ markIndex(s)
X+ char *s;
X+ {
END_OF_FILE
if test 51482 -ne `wc -c <'Patch.01c'`; then
echo shar: \"'Patch.01c'\" unpacked with wrong size!
fi
# end of 'Patch.01c'
fi
echo shar: End of archive 3 \(of 5\).
cp /dev/null ark3isdone
MISSING=""
for I in 1 2 3 4 5 ; do
if test ! -f ark${I}isdone ; then
MISSING="${MISSING} ${I}"
fi
done
if test "${MISSING}" = "" ; then
echo You have unpacked all 5 archives.
rm -f ark[1-9]isdone
else
echo You still need to unpack the following archives:
echo " " ${MISSING}
fi
## End of shell archive.
exit 0
dan
----------------------------------------------------
O'Reilly && Associates argv at sun.com / argv at ora.com
Opinions expressed reflect those of the author only.
More information about the Comp.sources.x
mailing list