#include "includes.h"
#include "printing/pcap.h"
+#include "printing/printer_list.h"
#include "printing/load.h"
#include "lib/param/loadparm.h"
***************************************************************************/
void load_printers(void)
{
+ NTSTATUS status;
+
if (!pcap_cache_loaded(NULL)) {
return;
}
add_auto_printers();
- /* load all printcap printers */
- if (lp_load_printers() && lp_servicenumber(PRINTERS_NAME) >= 0)
- pcap_printer_read_fn(lp_add_one_printer, NULL);
+ if (!lp_load_printers()) {
+ return;
+ }
+
+ if (lp_servicenumber(PRINTERS_NAME) >= 0) {
+ return;
+ }
+
+ status = printer_list_read_run_fn(lp_add_one_printer, NULL);
+ if (!NT_STATUS_IS_OK(status)) {
+ DBG_NOTICE("printer_list_read_run_fn failed: %s\n",
+ nt_errstr(status));
+ }
}
return;
}
-
-void pcap_printer_read_fn(void (*fn)(const char *, const char *, const char *, void *), void *pdata)
-{
- NTSTATUS status;
-
- status = printer_list_read_run_fn(fn, pdata);
- if (!NT_STATUS_IS_OK(status)) {
- DEBUG(3, ("Failed to run fn for all printers!\n"));
- }
- return;
-}
bool pcap_cache_loaded(time_t *_last_change);
bool pcap_cache_replace(const struct pcap_cache *cache);
void pcap_printer_fn_specific(const struct pcap_cache *, void (*fn)(const char *, const char *, const char *, void *), void *);
-void pcap_printer_read_fn(void (*fn)(const char *, const char *, const char *, void *), void *);
void pcap_cache_reload(struct tevent_context *ev,
struct messaging_context *msg_ctx,