summaryrefslogtreecommitdiff
path: root/source3/utils
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2005-01-05 16:20:35 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:53:46 -0500
commitd097ea490525e7a35739dae6a295fd03ba52cfc0 (patch)
tree131dc7af2e2e944283c70d255d8ad5d6bbef0726 /source3/utils
parent846b8d4cfdee815cd22d7e00b7f120668f9758a9 (diff)
downloadsamba-d097ea490525e7a35739dae6a295fd03ba52cfc0.tar.gz
samba-d097ea490525e7a35739dae6a295fd03ba52cfc0.tar.bz2
samba-d097ea490525e7a35739dae6a295fd03ba52cfc0.zip
r4539: patch from Rob -- adding real printcap name cache function to speed up printcap reloads
(This used to be commit 1cad5250932b963c2eb9b775221b13db386d601b)
Diffstat (limited to 'source3/utils')
-rw-r--r--source3/utils/testprns.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/source3/utils/testprns.c b/source3/utils/testprns.c
index 7e52b86afb..1525ab11d0 100644
--- a/source3/utils/testprns.c
+++ b/source3/utils/testprns.c
@@ -32,14 +32,17 @@
#include "includes.h"
+/*
+ * NOTE: this code is likely to be removed, and no longer supports
+ * checking against non-configured printcap files. -Rob
+ */
+
int main(int argc, char *argv[])
{
- const char *pszTemp;
-
setup_logging(argv[0],True);
- if (argc < 2 || argc > 3)
- printf("Usage: testprns printername [printcapfile]\n");
+ if (argc != 2)
+ printf("Usage: testprns printername\n");
else
{
dbf = x_fopen("test.log", O_WRONLY|O_CREAT|O_TRUNC, 0644);
@@ -47,10 +50,9 @@ int main(int argc, char *argv[])
printf("Unable to open logfile.\n");
} else {
DEBUGLEVEL = 3;
- pszTemp = (argc < 3) ? PRINTCAP_NAME : argv[2];
- printf("Looking for printer %s in printcap file %s\n",
- argv[1], pszTemp);
- if (!pcap_printername_ok(argv[1], pszTemp))
+ printf("Looking for printer %s\n", argv[1]);
+ load_printers();
+ if (!pcap_printername_ok(argv[1]))
printf("Printer name %s is not valid.\n", argv[1]);
else
printf("Printer name %s is valid.\n", argv[1]);