From 18820242e374421ebd6d504a20d11f310b2ac023 Mon Sep 17 00:00:00 2001 From: Agney Lopes Roth Ferraz Date: Fri, 9 Jun 2006 08:51:12 -0300 Subject: Import Debian changes 0.4-3 hardinfo (0.4-3) unstable; urgency=low * Updated project's homepage, old is unreachable. (Closes: #370797) * upated printers.h (Closes: #370363) --- arch/common/printers.h | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) (limited to 'arch') diff --git a/arch/common/printers.h b/arch/common/printers.h index 8632ea18..01beb5dd 100644 --- a/arch/common/printers.h +++ b/arch/common/printers.h @@ -19,18 +19,30 @@ void scan_printers(void) { - GModule *cups; + static GModule *cups = NULL; static int (*cupsGetPrinters) (char ***printers) = NULL; static char *(*cupsGetDefault) (void) = NULL; + static char *libcups[] = { "libcups", + "libcups.so", + "libcups.so.1", + "libcups.so.2", + NULL }; if (printer_list) g_free(printer_list); if (!(cupsGetPrinters && cupsGetDefault)) { - cups = g_module_open("libcups", G_MODULE_BIND_LAZY); - if (!cups) { + int i; + + for (i = 0; libcups[i] != NULL; i++) { + cups = g_module_open(libcups[i], G_MODULE_BIND_LAZY); + if (cups) + break; + } + + if (!cups) { printer_list = g_strdup("[Printers]\n" - "CUPS libraries cannot be found="); + "CUPS libraries cannot be found="); return; } @@ -38,7 +50,8 @@ scan_printers(void) || !g_module_symbol(cups, "cupsGetDefault", (gpointer) & cupsGetDefault)) { printer_list = - g_strdup("[Printers]\n" "No suitable CUPS library found="); + g_strdup("[Printers]\n" + "No suitable CUPS library found="); g_module_close(cups); return; } @@ -62,6 +75,7 @@ scan_printers(void) g_free(printers[i]); } } else { - printer_list = g_strdup("[Printers]\n" "No printers found"); + printer_list = g_strdup("[Printers]\n" + "No printers found"); } } -- cgit v1.2.3