Clean up a comment noticed by Jonathan Shao@Panasas.com and remove an
[Samba/gebeck_regimport.git] / source3 / utils / testprns.c
blob7e52b86afb6979bd731ebc177d98fbca1e9767c0
1 /*
2 Unix SMB/CIFS implementation.
3 test printer setup
4 Copyright (C) Karl Auer 1993, 1994-1998
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 * Testbed for pcap.c
24 * This module simply checks a given printer name against the compiled-in
25 * printcap file.
27 * The operation is performed with DEBUGLEVEL at 3.
29 * Useful for a quick check of a printcap file.
33 #include "includes.h"
35 int main(int argc, char *argv[])
37 const char *pszTemp;
39 setup_logging(argv[0],True);
41 if (argc < 2 || argc > 3)
42 printf("Usage: testprns printername [printcapfile]\n");
43 else
45 dbf = x_fopen("test.log", O_WRONLY|O_CREAT|O_TRUNC, 0644);
46 if (dbf == NULL) {
47 printf("Unable to open logfile.\n");
48 } else {
49 DEBUGLEVEL = 3;
50 pszTemp = (argc < 3) ? PRINTCAP_NAME : argv[2];
51 printf("Looking for printer %s in printcap file %s\n",
52 argv[1], pszTemp);
53 if (!pcap_printername_ok(argv[1], pszTemp))
54 printf("Printer name %s is not valid.\n", argv[1]);
55 else
56 printf("Printer name %s is valid.\n", argv[1]);
57 x_fclose(dbf);
60 return (0);