|
|
DataMuseum.dkPresents historical artifacts from the history of: DKUUG/EUUG Conference tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about DKUUG/EUUG Conference tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: T m
Length: 2358 (0x936)
Types: TextFile
Names: »m_whatnow.c«
└─⟦9ae75bfbd⟧ Bits:30007242 EUUGD3: Starter Kit
└─⟦3658e588a⟧ »EurOpenD3/mail/mh/mh-6.7.tar.Z«
└─⟦c75e36ecb⟧
└─⟦this⟧ »mh-6.7/sbr/m_whatnow.c«
/* m_whatnow.c - exec whatnowproc */
#include "../h/mh.h"
#include <stdio.h>
m_whatnow (ed, nedit, use, file, altmsg, dist, mp, text, inplace, cwd)
struct msgs *mp;
char *ed,
*file,
*altmsg,
*text,
*cwd;
int nedit,
use,
dist,
inplace;
{
int found,
k,
msgnum,
vecp;
register char *bp;
char buffer[BUFSIZ],
*vec[MAXARGS];
vecp = 0;
vec[vecp++] = r1bindex (whatnowproc, '/');
vec[vecp] = NULL;
(void) putenv ("mhdraft", file);
if (mp)
(void) putenv ("mhfolder", mp -> foldpath);
else
(void) unputenv ("mhfolder");
if (altmsg)
if (mp == NULL || *altmsg == '/' || cwd == NULL)
(void) putenv ("mhaltmsg", altmsg);
else {
(void) sprintf (buffer, "%s/%s", mp -> foldpath, altmsg);
(void) putenv ("mhaltmsg", buffer);
}
else
(void) unputenv ("mhaltmsg");
if (bp = getenv ("mhaltmsg"))/* XXX */
(void) putenv ("editalt", bp);
(void) sprintf (buffer, "%d", dist);
(void) putenv ("mhdist", buffer);
if (nedit)
(void) unputenv ("mheditor");
else
(void) putenv ("mheditor", ed ? ed : (ed = m_find ("editor")) ? ed : sysed);
(void) sprintf (buffer, "%d", use);
(void) putenv ("mhuse", buffer);
(void) unputenv ("mhmessages");
(void) unputenv ("mhannotate");
(void) unputenv ("mhinplace");
if (text && mp && !(mp -> msgflags & READONLY)) {
found = 0;
bp = buffer;
for (msgnum = mp -> lowmsg; msgnum <= mp -> hghmsg; msgnum++)
if (mp -> msgstats[msgnum] & SELECTED) {
(void) sprintf (bp, "%s%s", found ? " " : "", m_name (msgnum));
bp += strlen (bp);
for (k = msgnum + 1;
k <= mp -> hghmsg && mp -> msgstats[k] & SELECTED;
k++)
continue;
if (--k > msgnum) {
(void) sprintf (bp, "-%s", m_name (k));
bp += strlen (bp);
}
msgnum = k + 1;
found++;
}
if (found) {
(void) putenv ("mhmessages", buffer);
(void) putenv ("mhannotate", text);
(void) sprintf (buffer, "%d", inplace);
(void) putenv ("mhinplace", buffer);
}
}
m_update ();
(void) fflush (stdout);
if (cwd)
(void) chdir (cwd);
if (strcmp (vec[0], "whatnow") == 0) {
WhatNow (vecp, vec);
done (0);
}
execvp (whatnowproc, vec);
fprintf (stderr, "unable to exec ");
perror (whatnowproc);
return 0;
}