home *** CD-ROM | disk | FTP | other *** search
- /*
- ** m a s s . c
- **
- ** functions for performing tagged/untagged
- ** operations en masse
- **
- ** Arthur W. Neilson III
- ** art@bohtsg.pegasus.com
- ** Feb 7, 1991
- **
- */
-
- #include "main.h"
- #include "node.h"
-
- /*
- ** m a s s d e l
- **
- ** unlink tagged/untagged files en masse
- **
- */
- Node *
- massdel(c)
- int c;
- {
- Node *this, *node, *del();
- int hflag;
-
- node = head; /* point to head of list */
- do {
- hflag = 0;
- this = node; /* save pointer to this node */
- node = node->next; /* point to next node */
- if ((c == 't') ? (this->flags & TAG) : !(this->flags & TAG)) {
- hflag = (this == head);
- wprintw(jobscr, "\n\tDeleting %s, %8lu bytes freed",
- this->name, this->st->st_size);
- (VOID) del(this); /* delete this node */
- }
- if (c == 'u' && (this->flags & TAG)) { /* is tag on? */
- this->flags &= ~TAG; /* turn tag off */
- this->flags |= WAS; /* turn was tag on */
- }
- } while (node != head || hflag);
-
- newline(jobscr);
- return (head);
- }
-
- /*
- ** m a s s p r i n t
- **
- ** spool files to printer en masse
- **
- */
- Node *
- massprint(c)
- int c;
- {
- Node *node;
- VOID print();
-
- node = head; /* point to head of list */
- do {
- if ((c == 't') ? (node->flags & TAG) : !(node->flags & TAG)) {
- wprintw(jobscr, "\n\tSpooled %s to printer", node->name);
- lp(node->name); /* print file */
- }
- if (node->flags & TAG) { /* is tag on? */
- node->flags &= ~TAG; /* turn tag off */
- node->flags |= WAS; /* turn was tag on */
- } else if (node->flags & WAS)
- node->flags &= ~WAS; /* turn was tag off */
- node = node->next; /* point to next node */
- } while (node != head);
-
- newline(jobscr);
- return (head);
- }
-