9 date 92.12.15.00.20.22; author jromine; state Exp;
14 date 92.11.04.00.38.29; author jromine; state Exp;
19 date 92.01.31.22.07.02; author jromine; state Exp;
24 date 90.04.05.15.35.14; author sources; state Exp;
29 date 90.04.05.14.54.59; author sources; state Exp;
34 date 90.02.06.13.15.50; author sources; state Exp;
39 date 89.11.17.15.57.49; author sources; state Exp;
44 date 88.06.30.08.28.24; author sources; state Exp;
49 date 88.06.30.08.27.05; author sources; state Exp;
55 @Original with no mods.
64 @/* anno.c - annotate messages */
66 static char ident[] = "@@(#)$Id: anno.c,v 2.5 1992/11/04 00:38:29 jromine Exp jromine $";
79 static struct swit switches[] = {
127 setlocale(LC_ALL, "");
129 invo_name = r1bindex (argv[0], '/');
130 if ((cp = m_find (invo_name)) != NULL) {
131 ap = brkstring (cp = getcpy (cp), " ", "\n");
132 ap = copyip (ap, arguments);
136 (void) copyip (argv + 1, ap);
141 while (cp = *argp++) {
143 switch (smatch (++cp, switches)) {
145 ambigsw (cp, switches);
148 adios (NULLCP, "-%s unknown", cp);
150 (void) sprintf (buf, "%s [+folder] [msgs] [switches]",
152 help (buf, switches);
157 adios (NULLCP, "only one component at a time!");
158 if (!(comp = *argp++) || *comp == '-')
159 adios (NULLCP, "missing argument to %s", argp[-2]);
178 adios (NULLCP, "only one body at a time!");
179 if (!(text = *argp++) || *text == '-')
180 adios (NULLCP, "missing argument to %s", argp[-2]);
183 if (*cp == '+' || *cp == '@@') {
185 adios (NULLCP, "only one folder at a time!");
187 folder = path (cp + 1, *cp == '+' ? TFOLDER : TSUBCWF);
193 if (strcmp(invo_name, "fanno") == 0) /* ugh! */
199 if (!m_find ("path"))
200 free (path ("./", TFOLDER));
202 msgs[msgp++] = "cur";
204 folder = m_getfolder ();
205 maildir = m_maildir (folder);
207 if (chdir (maildir) == NOTOK)
208 adios (maildir, "unable to change directory to");
209 if (!(mp = m_gmsg (folder)))
210 adios (NULLCP, "unable to read folder %s", folder);
211 if (mp -> hghmsg == 0)
212 adios (NULLCP, "no messages in %s", folder);
214 for (msgnum = 0; msgnum < msgp; msgnum++)
215 if (!m_convert (mp, msgs[msgnum]))
220 for (msgnum = mp -> lowsel; msgnum <= mp -> hghsel; msgnum++)
221 if (mp -> msgstats[msgnum] & SELECTED)
222 (void) annotate (m_name (msgnum), comp, text, inplace, datesw);
224 m_replace (pfolder, folder);
225 if (mp -> lowsel != mp -> curmsg)
226 m_setcur (mp, mp -> lowsel);
235 static make_comp (ap)
242 printf ("Enter component name: ");
243 (void) fflush (stdout);
245 if (fgets (buffer, sizeof buffer, stdin) == NULL)
247 *ap = trimcpy (buffer);
250 if ((cp = *ap + strlen (*ap) - 1) > *ap && *cp == ':')
252 if (strlen (*ap) == 0)
253 adios (NULLCP, "null component name");
255 adios (NULLCP, "invalid component name %s", *ap);
256 if (strlen (*ap) >= NAMESZ)
257 adios (NULLCP, "too large component name %s", *ap);
259 for (cp = *ap; *cp; cp++)
260 if (!isalnum (*cp) && *cp != '-')
261 adios (NULLCP, "invalid component name %s", *ap);
273 static char ident[] = "@@(#)$Id: anno.c,v 2.4 1992/01/31 22:07:02 jromine Exp jromine $";
288 static char ident[] = "@@(#)$Id: anno.c,v 2.3 1990/04/05 15:35:14 sources Exp jromine $";
301 static char ident[] = "@@(#)$Id:$";
318 static char ident[] = "@@(#)$Id:";
333 @changes for SUN40 shared libraries and NNTP under bbc
342 @Added the code for fanno.
361 if (strcmp(invo_name,"fanno") == 0) fanno = 1;
364 (void) annotate (m_name (msgnum), comp, text, inplace);