9 date 92.12.15.00.20.22; author jromine; state Exp;
14 date 92.11.04.00.48.24; author jromine; state Exp;
19 date 92.01.31.22.13.42; author jromine; state Exp;
24 date 92.01.31.22.12.57; author jromine; state Exp;
38 @/* mhpath.c - print full pathnames */
40 static char ident[] = "@@(#)$Id: mhpath.c,v 1.3 1992/11/04 00:48:24 jromine Exp jromine $";
51 static struct swit switches[] = {
79 setlocale(LC_ALL, "");
81 invo_name = r1bindex (argv[0], '/');
82 if ((cp = m_find (invo_name)) != NULL) {
83 ap = brkstring (cp = getcpy (cp), " ", "\n");
84 ap = copyip (ap, arguments);
88 (void) copyip (argv + 1, ap);
93 while (cp = *argp++) {
95 switch (smatch (++cp, switches)) {
97 ambigsw (cp, switches);
100 adios (NULLCP, "-%s unknown", cp);
102 (void) sprintf (buf, "%s [+folder] [msgs] [switches]",
104 help (buf, switches);
107 if (*cp == '+' || *cp == '@@') {
109 adios (NULLCP, "only one folder at a time!");
111 folder = path (cp + 1, *cp == '+' ? TFOLDER : TSUBCWF);
119 if (!m_find ("path"))
120 free (path ("./", TFOLDER));
123 folder = m_getfolder ();
124 maildir = m_maildir (folder);
126 printf ("%s\n", maildir);
130 if (chdir (maildir) == NOTOK)
131 adios (maildir, "unable to change directory to");
132 if (!(mp = m_gmsg (folder)))
133 adios (NULLCP, "unable to read folder %s", folder);
135 if ((mp = m_remsg (mp, 0, MAXFOLDER)) == NULL)
136 adios (NULLCP, "unable to allocate folder storage");
137 mp -> msgflags |= MHPATH;
139 for (msgnum = 0; msgnum < msgp; msgnum++)
140 if (!m_convert (mp, msgs[msgnum]))
146 if (mp -> numsel > MAXARGS - 2)
147 adios (NULLCP, "more than %d messages", MAXARGS - 2);
149 for (msgnum = mp -> lowsel; msgnum <= mp -> hghsel; msgnum++)
150 if (mp -> msgstats[msgnum] & SELECTED)
151 printf ("%s/%s\n", mp -> foldpath, m_name (msgnum));
168 static char ident[] = "@@(#)$Id: mhpath.c,v 1.2 1992/01/31 22:13:42 jromine Exp jromine $";
180 static char ident[] = "@@(#)$Id$";