Deleted Added
full compact
33c33
< "$FreeBSD: head/usr.sbin/lpr/chkprintcap/chkprintcap.c 70520 2000-12-30 20:56:04Z phk $";
---
> "$FreeBSD: head/usr.sbin/lpr/chkprintcap/chkprintcap.c 88004 2001-12-15 23:35:55Z gad $";
50a51,52
> #include "pathnames.h"
> #include "skimprintcap.h"
67c69,71
< int c, error, makedirs, more;
---
> struct skiminfo *skres;
> char *pcap_fname;
> int c, error, makedirs, more, queuecnt, verbosity;
70a75,77
> queuecnt = 0;
> verbosity = 0;
> pcap_fname = NULL;
73c80
< while ((c = getopt(argc, argv, "df:")) != -1) {
---
> while ((c = getopt(argc, argv, "df:v")) != -1) {
80c87,88
< setprintcap(optarg);
---
> pcap_fname = strdup(optarg);
> setprintcap(pcap_fname);
82a91,94
> case 'v':
> verbosity++;
> break;
>
90a103,121
> if (pcap_fname == NULL)
> pcap_fname = strdup(_PATH_PRINTCAP);
>
> /*
> * Skim through the printcap file looking for simple user-mistakes
> * which will produce the wrong result for the user, but which may
> * be pretty hard for the user to notice. Such user-mistakes will
> * only generate warning messages. The (fatal-) problem count will
> * only be incremented if there is a system problem trying to read
> * the printcap file.
> */
> skres = skim_printcap(pcap_fname, verbosity);
> if (skres->fatalerr)
> return (skres->fatalerr);
>
> /*
> * Now use the standard capability-db routines to check the values
> * in each of the queues defined in the printcap file.
> */
97a129
> queuecnt++;
110c142
< /* Make other validity checks here... */
---
> /* Make other queue-specific validity checks here... */
116a149
>
118c151,158
< return problems;
---
>
> if (queuecnt != skres->entries) {
> warnx("WARNING: found %d entries when skimming %s,",
> skres->entries, pcap_fname);
> warnx("WARNING: but only found %d queues to process!",
> queuecnt);
> }
> return (problems);
275c315
< fprintf(stderr, "usage:\n\tchkprintcap [-d] [-f printcapfile]\n");
---
> fprintf(stderr, "usage:\n\tchkprintcap [-dv] [-f printcapfile]\n");