2 Unix SMB/Netbios implementation.
5 Copyright (C) Andrew Tridgell 1992-2000
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25 /***************************************************************************
26 auto-load printer services
27 ***************************************************************************/
28 void add_all_printers(void)
30 int printers
= lp_servicenumber(PRINTERS_NAME
);
32 if (printers
< 0) return;
34 pcap_printer_fn(lp_add_one_printer
);
37 /***************************************************************************
38 auto-load some homes and printer services
39 ***************************************************************************/
40 static void add_auto_printers(void)
44 char *str
= strdup(lp_auto_services());
48 printers
= lp_servicenumber(PRINTERS_NAME
);
55 for (p
=strtok(str
,LIST_SEP
);p
;p
=strtok(NULL
,LIST_SEP
)) {
56 if (lp_servicenumber(p
) >= 0) continue;
58 if (pcap_printername_ok(p
,NULL
)) {
59 lp_add_printer(p
,printers
);
66 /***************************************************************************
67 load automatic printer services
68 ***************************************************************************/
69 void load_printers(void)
72 if (lp_load_printers())