9 date 92.12.15.00.20.22; author jromine; state Exp;
14 date 92.11.04.00.36.34; author jromine; state Exp;
19 date 92.02.04.17.46.56; author jromine; state Exp;
24 date 92.02.04.17.44.08; author jromine; state Exp;
30 @formerly sbr/m_whatnow.c
39 @/* whatnowproc.c - exec whatnowproc */
41 static char ident[] = "@@(#)$Id: whatnowproc.c,v 1.3 1992/11/04 00:36:34 jromine Exp jromine $";
47 what_now (ed, nedit, use, file, altmsg, dist, mp, text, inplace, cwd)
68 vec[vecp++] = r1bindex (whatnowproc, '/');
71 (void) m_putenv ("mhdraft", file);
73 (void) m_putenv ("mhfolder", mp -> foldpath);
75 (void) unputenv ("mhfolder");
77 if (mp == NULL || *altmsg == '/' || cwd == NULL)
78 (void) m_putenv ("mhaltmsg", altmsg);
80 (void) sprintf (buffer, "%s/%s", mp -> foldpath, altmsg);
81 (void) m_putenv ("mhaltmsg", buffer);
84 (void) unputenv ("mhaltmsg");
85 if (bp = getenv ("mhaltmsg"))/* XXX */
86 (void) m_putenv ("editalt", bp);
87 (void) sprintf (buffer, "%d", dist);
88 (void) m_putenv ("mhdist", buffer);
90 (void) unputenv ("mheditor");
92 (void) m_putenv ("mheditor", ed ? ed : (ed = m_find ("editor")) ? ed : sysed);
93 (void) sprintf (buffer, "%d", use);
94 (void) m_putenv ("mhuse", buffer);
96 (void) unputenv ("mhmessages");
97 (void) unputenv ("mhannotate");
98 (void) unputenv ("mhinplace");
99 if (text && mp && !(mp -> msgflags & READONLY)) {
102 for (msgnum = mp -> lowmsg; msgnum <= mp -> hghmsg; msgnum++)
103 if (mp -> msgstats[msgnum] & SELECTED) {
104 (void) sprintf (bp, "%s%s", found ? " " : "", m_name (msgnum));
107 k <= mp -> hghmsg && mp -> msgstats[k] & SELECTED;
111 (void) sprintf (bp, "-%s", m_name (k));
118 (void) m_putenv ("mhmessages", buffer);
119 (void) m_putenv ("mhannotate", text);
120 (void) sprintf (buffer, "%d", inplace);
121 (void) m_putenv ("mhinplace", buffer);
126 (void) fflush (stdout);
131 if (strcmp (vec[0], "whatnow") == 0) {
136 execvp (whatnowproc, vec);
137 fprintf (stderr, "unable to exec ");
138 perror (whatnowproc);
152 static char ident[] = "@@(#)$Id: whatnowproc.c,v 1.2 1992/02/04 17:46:56 jromine Exp jromine $";
159 @rename m_whatnow() to what_now() since it's not a m_ routine
164 static char ident[] = "@@(#)$Id: whatnowproc.c,v 1.1 1992/02/04 17:44:08 jromine Exp jromine $";
167 (void) putenv ("mhdraft", file);
170 (void) putenv ("mhfolder", mp -> foldpath);
173 (void) putenv ("mhaltmsg", altmsg);
176 (void) putenv ("mhaltmsg", buffer);
179 (void) putenv ("editalt", bp);
182 (void) putenv ("mhdist", buffer);
185 (void) putenv ("mheditor", ed ? ed : (ed = m_find ("editor")) ? ed : sysed);
188 (void) putenv ("mhuse", buffer);
191 (void) putenv ("mhmessages", buffer);
192 (void) putenv ("mhannotate", text);
195 (void) putenv ("mhinplace", buffer);
206 /* m_whatnow.c - exec whatnowproc */
209 static char ident[] = "@@(#)$Id: scan.c,v 1.11 1992/02/03 22:45:20 jromine Exp $";
212 m_whatnow (ed, nedit, use, file, altmsg, dist, mp, text, inplace, cwd)