]> diplodocus.org Git - nmh/blob - docs/historical/mh-6.8.5/uip/RCS/folder.c,v
Always check that mktemp()/mktemp2() succeeds before trying to
[nmh] / docs / historical / mh-6.8.5 / uip / RCS / folder.c,v
1 head 2.11;
2 access;
3 symbols;
4 locks; strict;
5 comment @ * @;
6
7
8 2.11
9 date 93.08.27.23.23.06; author jromine; state Exp;
10 branches;
11 next 2.10;
12
13 2.10
14 date 93.08.26.22.30.09; author jromine; state Exp;
15 branches;
16 next 2.9;
17
18 2.9
19 date 92.12.15.00.20.22; author jromine; state Exp;
20 branches;
21 next 2.8;
22
23 2.8
24 date 92.11.04.00.43.01; author jromine; state Exp;
25 branches;
26 next 2.7;
27
28 2.7
29 date 92.05.19.18.01.13; author jromine; state Exp;
30 branches;
31 next 2.6;
32
33 2.6
34 date 92.02.07.20.16.40; author jromine; state Exp;
35 branches;
36 next 2.5;
37
38 2.5
39 date 92.02.06.21.38.18; author jromine; state Exp;
40 branches;
41 next 2.4;
42
43 2.4
44 date 90.04.05.14.56.54; author sources; state Exp;
45 branches;
46 next 2.3;
47
48 2.3
49 date 90.02.09.09.48.38; author sources; state Exp;
50 branches;
51 next 2.2;
52
53 2.2
54 date 90.02.06.13.18.44; author sources; state Exp;
55 branches;
56 next 2.1;
57
58 2.1
59 date 90.02.05.14.41.04; author sources; state Exp;
60 branches;
61 next 2.0;
62
63 2.0
64 date 89.11.17.15.57.53; author sources; state Exp;
65 branches;
66 next 1.1;
67
68 1.1
69 date 89.06.26.14.36.39; author sources; state Exp;
70 branches;
71 next ;
72
73
74 desc
75 @@
76
77
78 2.11
79 log
80 @add -[no]create instead of -create policy
81 @
82 text
83 @/* folder(s).c - report on folders */
84 #ifndef lint
85 static char ident[] = "@@(#)$Id: folder.c,v 2.10 1993/08/26 22:30:09 jromine Exp jromine $";
86 #endif /* lint */
87
88 #include "../h/mh.h"
89 #include "../h/local.h"
90 #include <errno.h>
91 #include <stdio.h>
92 #ifdef LOCALE
93 #include <locale.h>
94 #endif
95
96 static dodir(), addir(), addfold(), dother();
97 static int pfold(), sfold(), compare();
98 /* \f */
99
100 static struct swit switches[] = {
101 #define ALLSW 0
102 "all", 0,
103
104 #define CREATSW 1
105 "create", 0,
106 #define NCREATSW 2
107 "nocreate", 0,
108
109 #define FASTSW 3
110 "fast", 0,
111 #define NFASTSW 4
112 "nofast", 0,
113
114 #define HDRSW 5
115 "header", 0,
116 #define NHDRSW 6
117 "noheader", 0,
118
119 #define PACKSW 7
120 "pack", 0,
121 #define NPACKSW 8
122 "nopack", 0,
123 #define VERBSW 9
124 "verbose", 0,
125 #define NVERBSW 10
126 "noverbose", 0,
127
128 #define RECURSW 11
129 "recurse", 0,
130 #define NRECRSW 12
131 "norecurse", 0,
132
133 #define TOTALSW 13
134 "total", 0,
135 #define NTOTLSW 14
136 "nototal", 0,
137
138 #define PRNTSW 15
139 "print", 0,
140 #define NPRNTSW 16
141 "noprint", -4,
142 #define LISTSW 17
143 "list", 0,
144 #define NLISTSW 18
145 "nolist", 0,
146 #define PUSHSW 19
147 "push", 0,
148 #define POPSW 20
149 "pop", 0,
150
151 #define HELPSW 21
152 "help", 4,
153
154 NULL, 0
155 };
156
157 /* \f */
158
159 extern int errno;
160
161 static int fshort = 0;
162 static int fcreat = 0;
163 static int fpack = 0;
164 static int fverb = 0;
165 static int fheader = 0;
166 static int frecurse = 0;
167 static int ftotonly = 0;
168 static int msgtot = 0;
169 static int foldtot = 0;
170 static int start = 0;
171 static int foldp = 0;
172
173 static char *mhdir;
174 static char *stack = "Folder-Stack";
175 static char folder[BUFSIZ];
176 static char *folds[NFOLDERS + 1];
177
178 struct msgs *tfold ();
179
180 /* \f */
181
182 /* ARGSUSED */
183
184 main (argc, argv)
185 char *argv[];
186 {
187 int all = 0,
188 printsw = 0,
189 listsw = 0,
190 pushsw = 0,
191 popsw = 0;
192 char *cp,
193 *dp,
194 *msg = NULL,
195 *argfolder = NULL,
196 **ap,
197 **argp,
198 buf[100],
199 *arguments[MAXARGS];
200 struct stat st;
201
202 #ifdef LOCALE
203 setlocale(LC_ALL, "");
204 #endif
205 invo_name = r1bindex (argv[0], '/');
206 if (argv[0][strlen (argv[0]) - 1] == 's')
207 all++;
208 if ((cp = m_find (invo_name)) != NULL) {
209 ap = brkstring (cp = getcpy (cp), " ", "\n");
210 ap = copyip (ap, arguments);
211 }
212 else
213 ap = arguments;
214 (void) copyip (argv + 1, ap);
215 argp = arguments;
216
217 /* \f */
218
219 while (cp = *argp++) {
220 if (*cp == '-')
221 switch (smatch (++cp, switches)) {
222 case AMBIGSW:
223 ambigsw (cp, switches);
224 done (1);
225 case UNKWNSW:
226 adios (NULLCP, "-%s unknown", cp);
227 case HELPSW:
228 (void) sprintf (buf, "%s [+folder] [msg] [switches]",
229 invo_name);
230 help (buf, switches);
231 done (1);
232
233 case ALLSW:
234 all++;
235 continue;
236
237 case CREATSW:
238 fcreat = 1;
239 continue;
240 case NCREATSW:
241 fcreat = -1;
242 continue;
243
244 case FASTSW:
245 fshort++;
246 continue;
247 case NFASTSW:
248 fshort = 0;
249 continue;
250
251 case HDRSW:
252 fheader = -1;
253 continue;
254 case NHDRSW:
255 fheader++;
256 continue;
257
258 case PACKSW:
259 fpack++;
260 continue;
261 case NPACKSW:
262 fpack = 0;
263 continue;
264
265 case VERBSW:
266 fverb++;
267 continue;
268 case NVERBSW:
269 fverb = 0;
270 continue;
271
272 case RECURSW:
273 frecurse++;
274 continue;
275 case NRECRSW:
276 frecurse = 0;
277 continue;
278
279 case TOTALSW:
280 all++;
281 ftotonly++;
282 continue;
283 case NTOTLSW:
284 if (ftotonly)
285 all = 0;
286 ftotonly = 0;
287 continue;
288
289 case PRNTSW:
290 printsw++;
291 continue;
292 case NPRNTSW:
293 printsw = 0;
294 continue;
295
296 case LISTSW:
297 listsw++;
298 continue;
299 case NLISTSW:
300 listsw = 0;
301 continue;
302
303 case PUSHSW:
304 pushsw++;
305 listsw++;
306 popsw = 0;
307 continue;
308 case POPSW:
309 popsw++;
310 listsw++;
311 pushsw = 0;
312 continue;
313 }
314 if (*cp == '+' || *cp == '@@')
315 if (argfolder)
316 adios (NULLCP, "only one folder at a time!");
317 else
318 argfolder = path (cp + 1, *cp == '+' ? TFOLDER : TSUBCWF);
319 else
320 if (msg)
321 adios (NULLCP, "only one (current) message at a time!");
322 else
323 msg = cp;
324 }
325
326 /* \f */
327
328 if (!m_find ("path"))
329 free (path ("./", TFOLDER));
330 mhdir = concat (m_maildir (""), "/", NULLCP);
331
332 if (pushsw == 0 && popsw == 0 && listsw == 0)
333 printsw++;
334 if (pushsw) {
335 if (!argfolder) {
336 if ((cp = m_find (stack)) == NULL
337 || (ap = brkstring (dp = getcpy (cp), " ", "\n")) == NULL
338 || (argfolder = *ap++) == NULL)
339 adios (NULLCP, "no other folder");
340 for (cp = getcpy (m_getfolder ()); *ap; ap++)
341 cp = add (*ap, add (" ", cp));
342 free (dp);
343 m_replace (stack, cp);
344 }
345 else
346 m_replace (stack,
347 (cp = m_find (stack))
348 ? concat (m_getfolder (), " ", cp, NULLCP)
349 : getcpy (m_getfolder ()));
350 }
351 if (popsw) {
352 if (argfolder)
353 adios (NULLCP, "sorry, no folders allowed with -pop");
354 if ((cp = m_find (stack)) == NULL
355 || (ap = brkstring (dp = getcpy (cp), " ", "\n")) == NULL
356 || (argfolder = *ap++) == NULL)
357 adios (NULLCP, "folder stack empty");
358 for (cp = NULL; *ap; ap++)
359 cp = cp ? add (*ap, add (" ", cp)) : getcpy (*ap);
360 free (dp);
361 if (cp)
362 m_replace (stack, cp);
363 else
364 (void) m_delete (stack);
365 }
366 if (pushsw || popsw) {
367 if (access (cp = m_maildir (argfolder), 0) == NOTOK)
368 adios (cp, "unable to find folder");
369 m_replace (pfolder, argfolder);
370 m_update ();
371 argfolder = NULL;
372 }
373 if (listsw) {
374 printf ("%s", argfolder ? argfolder : m_getfolder ());
375 if (cp = m_find (stack)) {
376 for (ap = brkstring (dp = getcpy (cp), " ", "\n"); *ap; ap++)
377 printf (" %s", *ap);
378 free (dp);
379 }
380 printf ("\n");
381
382 if (!printsw)
383 done (0);
384 }
385
386 /* \f */
387
388 if (all) {
389 fheader = 0;
390 if (argfolder) {
391 (void) strcpy (folder, argfolder);
392 if (pfold (argfolder, msg)) {
393 m_replace (pfolder, argfolder);
394 m_update ();
395 }
396 if (!frecurse) /* recurse not done in pfold(), */
397 dodir (folder); /* so just list all level-1 sub-folders */
398 }
399 else {
400 if (msg)
401 admonish (NULLCP, "no folder given for message %s", msg);
402 dother ();
403
404 (void) strcpy (folder, (cp = m_find (pfolder)) ? cp : "");
405 dodir (".");
406 }
407
408 if (!fshort) {
409 if (!ftotonly)
410 printf ("\n\t\t ");
411 printf ("TOTAL= %*d message%c in %d folder%s.\n",
412 DMAXFOLDER, msgtot, msgtot != 1 ? 's' : ' ',
413 foldtot, foldtot != 1 ? "s" : "");
414 }
415 }
416 else {
417 fheader++;
418
419 (void) strcpy (folder, argfolder ? argfolder : m_getfolder ());
420 if (stat (strcpy (buf, m_maildir (folder)), &st) == NOTOK) {
421 if (errno != ENOENT)
422 adios (buf, "error on folder");
423 switch (fcreat) {
424 case 0: /* ask before create */
425 cp = concat ("Create folder \"", buf, "\"? ", NULLCP);
426 if (!getanswer (cp))
427 done (1);
428 free (cp);
429 break;
430 case -1: /* do not create */
431 done (1);
432 break;
433 }
434 if (!makedir (buf))
435 adios (NULLCP, "unable to create folder %s", buf);
436 }
437
438 if (pfold (folder, msg) && argfolder)
439 m_replace (pfolder, argfolder);
440 }
441
442 m_update ();
443
444 done (0);
445 }
446
447 /* \f */
448
449 static dodir (dir)
450 register char *dir;
451 {
452 int i;
453 int os = start;
454 int of = foldp;
455 char buffer[BUFSIZ];
456
457 start = foldp;
458 if (chdir (mhdir) == NOTOK)
459 adios (mhdir, "unable to change directory to");
460
461 addir (strcpy (buffer, dir));
462 for (i = start; i < foldp; i++)
463 (void) pfold (folds[i], NULLCP), (void) fflush (stdout);
464
465 start = os;
466 foldp = of;
467 }
468
469 /* \f */
470
471 static int pfold (fold, msg)
472 register char *fold,
473 *msg;
474 {
475 int hack,
476 others,
477 retval = 1;
478 register char *mailfile;
479 register struct msgs *mp = NULL;
480
481 mailfile = m_maildir (fold);
482 if (chdir (mailfile) == NOTOK) {
483 if (errno != EACCES)
484 admonish (mailfile, "unable to change directory to");
485 else
486 printf ("%22s%c unreadable\n",
487 fold, strcmp (folder, fold) ? ' ' : '+');
488 return 0;
489 }
490
491 if (fshort) {
492 printf ("%s\n", fold);
493
494 if (!msg && !fpack) {
495 if (frecurse)
496 dodir (fold);
497 return retval;
498 }
499 }
500
501 if (!(mp = m_gmsg (fold))) {
502 admonish (NULLCP, "unable to read folder %s", fold);
503 return 0;
504 }
505
506 if (msg && !sfold (mp, msg))
507 retval = 0;
508 if (fpack)
509 mp = tfold (mp);
510
511 if (fshort)
512 goto out;
513 foldtot++;
514 msgtot += mp -> nummsg;
515
516 if (ftotonly)
517 goto out;
518
519 if (!fheader++)
520 printf ("\t\tFolder %*s# of messages (%*srange%*s); cur%*smsg (other files)\n",
521 DMAXFOLDER, "", DMAXFOLDER - 2, "", DMAXFOLDER - 2, "",
522 DMAXFOLDER - 2, "");
523
524 printf ("%22s%c ", fold, strcmp (folder, fold) ? ' ' : '+');
525
526 hack = 0;
527 if (mp -> hghmsg == 0)
528 printf ("has no messages%*s",
529 mp -> msgflags & OTHERS ? DMAXFOLDER * 2 + 4 : 0, "");
530 else {
531 printf ("has %*d message%s (%*d-%*d)",
532 DMAXFOLDER, mp -> nummsg, (mp -> nummsg == 1) ? " " : "s",
533 DMAXFOLDER, mp -> lowmsg, DMAXFOLDER, mp -> hghmsg);
534 if (mp -> curmsg >= mp -> lowmsg && mp -> curmsg <= mp -> hghmsg)
535 printf ("; cur=%*d", DMAXFOLDER, hack = mp -> curmsg);
536 }
537
538 if (mp -> msgflags & OTHERS)
539 printf (";%*s (others)", hack ? 0 : DMAXFOLDER + 6, "");
540 printf (".\n");
541
542 out: ;
543 others = mp -> msgflags & OTHERS;
544 m_fmsg (mp);
545
546 if (frecurse && others)
547 dodir (fold);
548
549 return retval;
550 }
551
552 /* \f */
553
554 static int sfold (mp, msg)
555 register struct msgs *mp;
556 char *msg;
557 {
558 if (!m_convert (mp, msg))
559 return 0;
560
561 if (mp -> numsel > 1) {
562 admonish (NULLCP, "only one message at a time!");
563 return 0;
564 }
565 m_setseq (mp);
566 m_setcur (mp, mp -> lowsel);
567 m_sync (mp);
568 m_update ();
569
570 return 1;
571 }
572
573
574 struct msgs *tfold (mp)
575 register struct msgs *mp;
576 {
577 register int hole,
578 msgnum;
579 char newmsg[BUFSIZ],
580 oldmsg[BUFSIZ];
581
582 if (mp -> lowmsg > 1 && (mp = m_remsg (mp, 1, mp -> hghmsg)) == NULL)
583 adios (NULLCP, "unable to allocate folder storage");
584
585 for (msgnum = mp -> lowmsg, hole = 1; msgnum <= mp -> hghmsg; msgnum++)
586 if (mp -> msgstats[msgnum] & EXISTS) {
587 if (msgnum != hole) {
588 (void) strcpy (newmsg, m_name (hole));
589 (void) strcpy (oldmsg, m_name (msgnum));
590 if (fverb)
591 printf ("message %s becomes %s\n", oldmsg, newmsg);
592 if (rename (oldmsg, newmsg) == NOTOK)
593 adios (newmsg, "unable to rename %s to", oldmsg);
594 if (msgnum == mp -> curmsg)
595 m_setcur (mp, mp -> curmsg = hole);
596 mp -> msgstats[hole] = mp -> msgstats[msgnum];
597 mp -> msgflags |= SEQMOD;
598 if (msgnum == mp -> lowsel)
599 mp -> lowsel = hole;
600 if (msgnum == mp -> hghsel)
601 mp -> hghsel = hole;
602 }
603 hole++;
604 }
605 if (mp -> nummsg > 0) {
606 mp -> lowmsg = 1;
607 mp -> hghmsg = hole - 1;
608 }
609 m_sync (mp);
610 m_update ();
611
612 return mp;
613 }
614
615 /* \f */
616
617 static addir (name)
618 register char *name;
619 {
620 register char *base,
621 *cp;
622 struct stat st;
623 #ifdef SYS5DIR
624 register struct dirent *dp;
625 #else /* SYS5DIR */
626 register struct direct *dp;
627 #endif /* SYS5DIR */
628 register DIR * dd;
629
630 cp = name + strlen (name);
631 *cp++ = '/';
632 *cp = '\0';
633
634 base = strcmp (name, "./") ? name : name + 2;/* hack */
635
636 if ((dd = opendir (name)) == NULL) {
637 admonish (name, "unable to read directory ");
638 return;
639 }
640 while (dp = readdir (dd))
641 if (strcmp (dp -> d_name, ".") && strcmp (dp -> d_name, "..")) {
642 #ifdef SYS5DIR
643 if (cp + dp -> d_reclen + 2 >= name + BUFSIZ)
644 #else /* SYS5DIR */
645 if (cp + strlen (dp -> d_name) + 2 >= name + BUFSIZ)
646 #endif /* SYS5DIR */
647 continue;
648 (void) strcpy (cp, dp -> d_name);
649 if (stat (name, &st) != NOTOK && (st.st_mode & S_IFMT) == S_IFDIR)
650 addfold (base);
651 }
652 closedir (dd);
653
654 *--cp = '\0';
655 }
656
657 /* \f */
658
659 static addfold (fold)
660 register char *fold;
661 {
662 register int i,
663 j;
664 register char *cp;
665
666 if (foldp > NFOLDERS)
667 adios (NULLCP, "more than %d folders to report on", NFOLDERS);
668
669 cp = getcpy (fold);
670 for (i = start; i < foldp; i++)
671 if (compare (cp, folds[i]) < 0) {
672 for (j = foldp - 1; j >= i; j--)
673 folds[j + 1] = folds[j];
674 foldp++;
675 folds[i] = cp;
676 return;
677 }
678
679 folds[foldp++] = cp;
680 }
681
682 /* \f */
683
684 static int compare (s1, s2)
685 register char *s1,
686 *s2;
687 {
688 register int i;
689
690 while (*s1 || *s2)
691 if (i = *s1++ - *s2++)
692 return i;
693
694 return 0;
695 }
696
697 /* \f */
698
699 static dother () {
700 int atrlen;
701 char atrcur[BUFSIZ];
702 register struct node *np;
703
704 (void) sprintf (atrcur, "atr-%s-", current);
705 atrlen = strlen (atrcur);
706
707 m_getdefs ();
708 for (np = m_defs; np; np = np -> n_next)
709 if (ssequal (atrcur, np -> n_name)
710 && !ssequal (mhdir, np -> n_name + atrlen))
711 (void) pfold (np -> n_name + atrlen, NULLCP);
712 }
713 @
714
715
716 2.10
717 log
718 @add -create policy
719 @
720 text
721 @d3 1
722 a3 1
723 static char ident[] = "@@(#)$Id: folder.c,v 2.9 1992/12/15 00:20:22 jromine Exp jromine $";
724 d23 3
725 a25 1
726 "create policy", 0,
727 d27 1
728 a27 1
729 #define FASTSW 2
730 d29 1
731 a29 1
732 #define NFASTSW 3
733 d32 1
734 a32 1
735 #define HDRSW 4
736 d34 1
737 a34 1
738 #define NHDRSW 5
739 d37 1
740 a37 1
741 #define PACKSW 6
742 d39 1
743 a39 1
744 #define NPACKSW 7
745 d41 1
746 a41 1
747 #define VERBSW 8
748 d43 1
749 a43 1
750 #define NVERBSW 9
751 d46 1
752 a46 1
753 #define RECURSW 10
754 d48 1
755 a48 1
756 #define NRECRSW 11
757 d51 1
758 a51 1
759 #define TOTALSW 12
760 d53 1
761 a53 1
762 #define NTOTLSW 13
763 d56 1
764 a56 1
765 #define PRNTSW 14
766 d58 1
767 a58 1
768 #define NPRNTSW 15
769 d60 1
770 a60 1
771 #define LISTSW 16
772 d62 1
773 a62 1
774 #define NLISTSW 17
775 d64 1
776 a64 1
777 #define PUSHSW 18
778 d66 1
779 a66 1
780 #define POPSW 19
781 d69 1
782 a69 1
783 #define HELPSW 20
784 a74 11
785 static struct swit creats[] = {
786 #define CREAT_ALWAYS 0
787 "always", 0,
788 #define CREAT_ASK 1
789 "ask", 0,
790 #define CREAT_NEVER 2
791 "never", 0,
792
793 NULL, 0
794 };
795
796 d80 1
797 a80 1
798 static int fcreat = CREAT_ASK;
799 d155 2
800 a156 12
801 case CREATSW:
802 if (!(cp = *argp++) || *cp == '-')
803 adios (NULLCP, "missing argument to %s", argp[-2]);
804 switch (fcreat = smatch (cp, creats)) {
805 case AMBIGSW:
806 ambigsw (cp, creats);
807 done (1);
808 case UNKWNSW:
809 adios (NULLCP, "%s unknown", cp);
810 default:
811 break;
812 }
813 d158 3
814 a161 1
815
816 d342 1
817 a342 1
818 case CREAT_ASK:
819 d348 1
820 a348 1
821 case CREAT_NEVER:
822 @
823
824
825 2.9
826 log
827 @endif sugar
828 @
829 text
830 @d3 1
831 a3 1
832 static char ident[] = "@@(#)$Id: folder.c,v 2.8 1992/11/04 00:43:01 jromine Exp jromine $";
833 d22 4
834 a25 1
835 #define FASTSW 1
836 d27 1
837 a27 1
838 #define NFASTSW 2
839 d30 1
840 a30 1
841 #define HDRSW 3
842 d32 1
843 a32 1
844 #define NHDRSW 4
845 d35 1
846 a35 1
847 #define PACKSW 5
848 d37 1
849 a37 1
850 #define NPACKSW 6
851 d39 1
852 a39 1
853 #define VERBSW 7
854 d41 1
855 a41 1
856 #define NVERBSW 8
857 d44 1
858 a44 1
859 #define RECURSW 9
860 d46 1
861 a46 1
862 #define NRECRSW 10
863 d49 1
864 a49 1
865 #define TOTALSW 11
866 d51 1
867 a51 1
868 #define NTOTLSW 12
869 d54 1
870 a54 1
871 #define PRNTSW 13
872 d56 1
873 a56 1
874 #define NPRNTSW 14
875 d58 1
876 a58 1
877 #define LISTSW 15
878 d60 1
879 a60 1
880 #define NLISTSW 16
881 d62 1
882 a62 1
883 #define PUSHSW 17
884 d64 1
885 a64 1
886 #define POPSW 18
887 d67 1
888 a67 1
889 #define HELPSW 19
890 d73 11
891 d89 1
892 d164 15
893 d358 11
894 a368 4
895 cp = concat ("Create folder \"", buf, "\"? ", NULLCP);
896 if (!getanswer (cp))
897 done (1);
898 free (cp);
899 @
900
901
902 2.8
903 log
904 @LOCALE
905 @
906 text
907 @d3 2
908 a4 2
909 static char ident[] = "@@(#)$Id: folder.c,v 2.7 1992/05/19 18:01:13 jromine Exp jromine $";
910 #endif lint
911 @
912
913
914 2.7
915 log
916 @compiler sugar
917 @
918 text
919 @d3 1
920 a3 1
921 static char ident[] = "@@(#)$Id: folder.c,v 2.6 1992/02/07 20:16:40 jromine Exp jromine $";
922 d10 3
923 d114 3
924 @
925
926
927 2.6
928 log
929 @undocument noprint
930 let -nolist turn -list off if -push/-pop
931 @
932 text
933 @d3 1
934 a3 1
935 static char ident[] = "@@(#)$Id: folder.c,v 2.5 1992/02/06 21:38:18 jromine Exp jromine $";
936 d64 1
937 a64 1
938 NULL, NULL
939 d517 1
940 a517 1
941 #else SYS5DIR
942 d519 1
943 a519 1
944 #endif SYS5DIR
945 d524 1
946 a524 1
947 *cp = NULL;
948 d536 1
949 a536 1
950 #else SYS5DIR
951 d538 1
952 a538 1
953 #endif SYS5DIR
954 d546 1
955 a546 1
956 *--cp = NULL;
957 @
958
959
960 2.5
961 log
962 @complain if -all w/o +folder w/ msg
963 allow -[push|pop] -nolist
964 @
965 text
966 @d3 1
967 a3 1
968 static char ident[] = "@@(#)$Id: folder.c,v 2.4 1990/04/05 14:56:54 sources Exp jromine $";
969 d51 1
970 a51 1
971 "noprint", 0,
972 d199 1
973 a199 1
974 listsw = -1;
975 d272 1
976 a272 1
977 if (listsw > 0) {
978 @
979
980
981 2.4
982 log
983 @add ID
984 @
985 text
986 @d3 1
987 a3 1
988 static char ident[] = "@@(#)$Id:$";
989 d199 1
990 a199 1
991 listsw = 0;
992 d204 1
993 d209 1
994 d272 1
995 a272 1
996 if (pushsw || popsw || listsw) {
997 d289 3
998 a291 4
999 if (argfolder || msg) {
1000 (void) strcpy (folder, argfolder ? argfolder : m_getfolder ());
1001
1002 if (pfold (argfolder, msg) && argfolder) {
1003 d295 2
1004 a296 2
1005 if (!frecurse) /* counter-intuitive */
1006 dodir (folder);
1007 d299 2
1008 @
1009
1010
1011 2.3
1012 log
1013 @Fixes from Van Jacobson
1014 @
1015 text
1016 @d2 3
1017 @
1018
1019
1020 2.2
1021 log
1022 @ANSI Compilance
1023 @
1024 text
1025 @d30 4
1026 d35 1
1027 a35 1
1028 #define RECURSW 7
1029 d37 1
1030 a37 1
1031 #define NRECRSW 8
1032 d40 1
1033 a40 1
1034 #define TOTALSW 9
1035 d42 1
1036 a42 1
1037 #define NTOTLSW 10
1038 d45 1
1039 a45 1
1040 #define PRNTSW 11
1041 d47 1
1042 a47 1
1043 #define NPRNTSW 12
1044 d49 1
1045 a49 1
1046 #define LISTSW 13
1047 d51 1
1048 a51 1
1049 #define NLISTSW 14
1050 d53 1
1051 a53 1
1052 #define PUSHSW 15
1053 d55 1
1054 a55 1
1055 #define POPSW 16
1056 d58 1
1057 a58 1
1058 #define HELPSW 17
1059 d70 1
1060 d161 7
1061 d476 2
1062 @
1063
1064
1065 2.1
1066 log
1067 @change SYS5DIR fix
1068 @
1069 text
1070 @d8 2
1071 @
1072
1073
1074 2.0
1075 log
1076 @changes for SUN40 shared libraries and NNTP under bbc
1077 @
1078 text
1079 @d515 1
1080 a515 1
1081 if (cp + dp -> d_namlen + 2 >= name + BUFSIZ)
1082 @
1083
1084
1085 1.1
1086 log
1087 @Initial revision
1088 @
1089 text
1090 @d493 3
1091 d497 1
1092 d512 3
1093 d516 1
1094 @