1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-25 14:50:24 +03:00

r10371: Adding iPrint printing backend written by Joel J. Smith @ Novell.

Jeremy.
(This used to be commit 155dc2d52a971bfb8d7565c06f3efc637e130b11)
This commit is contained in:
Jeremy Allison 2005-09-20 23:28:22 +00:00 committed by Gerald (Jerry) Carter
parent 1970294ab3
commit c762908074
8 changed files with 1281 additions and 2 deletions

View File

@ -410,7 +410,8 @@ SMBD_OBJ_BASE = $(PARAM_OBJ) $(SMBD_OBJ_SRV) $(LIBSMB_OBJ) \
PRINTING_OBJ = printing/pcap.o printing/print_svid.o printing/print_aix.o \
printing/print_cups.o printing/print_generic.o \
printing/lpq_parse.o printing/load.o
printing/lpq_parse.o printing/load.o \
printing/print_iprint.o
PRINTBASE_OBJ = printing/notify.o printing/printing_db.o

View File

@ -862,6 +862,17 @@ if test x$enable_cups != xno; then
fi
fi
AC_ARG_ENABLE(iprint,
[ --enable-iprint Turn on iPrint support (default=yes if cups is yes)])
if test x$enable_iprint != xno; then
if test "x$CUPS_CONFIG" != x; then
AC_DEFINE(HAVE_IPRINT,1,[Whether we have iPrint])
elif test x"$enable_iprint" = x"yes"; then
AC_MSG_ERROR(iPrint support required but cups not enabled. Make sure cups-devel related files are installed and that cups is enabled.)
fi
fi
############################################
# we need dlopen/dlclose/dlsym/dlerror for PAM, the password database plugins and the plugin loading code
AC_SEARCH_LIBS(dlopen, [dl])

View File

@ -69,6 +69,10 @@ extern struct printif generic_printif;
extern struct printif cups_printif;
#endif /* HAVE_CUPS */
#ifdef HAVE_IPRINT
extern struct printif iprint_printif;
#endif /* HAVE_IPRINT */
/* PRINT_MAX_JOBID is now defined in local.h */
#define UNIX_JOB_START PRINT_MAX_JOBID
#define NEXT_JOBID(j) ((j+1) % PRINT_MAX_JOBID > 0 ? (j+1) % PRINT_MAX_JOBID : 1)

View File

@ -1390,7 +1390,7 @@ enum server_types
/* printing types */
enum printing_types {PRINT_BSD,PRINT_SYSV,PRINT_AIX,PRINT_HPUX,
PRINT_QNX,PRINT_PLP,PRINT_LPRNG,PRINT_SOFTQ,
PRINT_CUPS,PRINT_LPRNT,PRINT_LPROS2
PRINT_CUPS,PRINT_LPRNT,PRINT_LPROS2,PRINT_IPRINT
#ifdef DEVELOPER
,PRINT_TEST,PRINT_VLP
#endif /* DEVELOPER */

View File

@ -241,6 +241,7 @@ typedef struct
char *szLdapAdminDn;
char *szAclCompat;
char *szCupsServer;
char *szIPrintServer;
int ldap_passwd_sync;
int ldap_replication_sleep;
int ldap_timeout; /* This is initialised in init_globals */
@ -641,6 +642,7 @@ static const struct enum_list enum_printing[] = {
{PRINT_PLP, "plp"},
{PRINT_LPRNG, "lprng"},
{PRINT_CUPS, "cups"},
{PRINT_IPRINT, "iprint"},
{PRINT_LPRNT, "nt"},
{PRINT_LPROS2, "os2"},
#ifdef DEVELOPER
@ -1007,6 +1009,7 @@ static struct parm_struct parm_table[] = {
{"printing", P_ENUM, P_LOCAL, &sDefault.iPrinting, handle_printing, enum_printing, FLAG_ADVANCED | FLAG_PRINT | FLAG_GLOBAL},
{"cups options", P_STRING, P_LOCAL, &sDefault.szCupsOptions, NULL, NULL, FLAG_ADVANCED | FLAG_PRINT | FLAG_GLOBAL},
{"cups server", P_STRING, P_GLOBAL, &Globals.szCupsServer, NULL, NULL, FLAG_ADVANCED | FLAG_PRINT | FLAG_GLOBAL},
{"iprint server", P_STRING, P_GLOBAL, &Globals.szIPrintServer, NULL, NULL, FLAG_ADVANCED | FLAG_PRINT | FLAG_GLOBAL},
{"print command", P_STRING, P_LOCAL, &sDefault.szPrintcommand, NULL, NULL, FLAG_ADVANCED | FLAG_PRINT | FLAG_GLOBAL},
{"disable spoolss", P_BOOL, P_GLOBAL, &Globals.bDisableSpoolss, NULL, NULL, FLAG_ADVANCED | FLAG_PRINT | FLAG_GLOBAL},
{"enable spoolss", P_BOOLREV, P_GLOBAL, &Globals.bDisableSpoolss, NULL, NULL, FLAG_HIDE},
@ -1273,6 +1276,7 @@ static void init_printer_values(service *pService)
break;
case PRINT_CUPS:
case PRINT_IPRINT:
#ifdef HAVE_CUPS
/* set the lpq command to contain the destination printer
name only. This is used by cups_queue_get() */
@ -1570,6 +1574,7 @@ static void init_globals(void)
string_set(&Globals.szWinbindSeparator, "\\");
string_set(&Globals.szAclCompat, "");
string_set(&Globals.szCupsServer, "");
string_set(&Globals.szIPrintServer, "");
string_set(&Globals.szEventLogOpenCommand, "");
string_set(&Globals.szEventLogReadCommand, "");
@ -1902,6 +1907,7 @@ FN_LOCAL_LIST(lp_admin_users, szAdminUsers)
FN_GLOBAL_LIST(lp_enable_svcctl, &Globals.szServicesList)
FN_LOCAL_STRING(lp_cups_options, szCupsOptions)
FN_GLOBAL_STRING(lp_cups_server, &Globals.szCupsServer)
FN_GLOBAL_STRING(lp_iprint_server, &Globals.szIPrintServer)
FN_LOCAL_STRING(lp_printcommand, szPrintcommand)
FN_LOCAL_STRING(lp_lpqcommand, szLpqcommand)
FN_LOCAL_STRING(lp_lprmcommand, szLprmcommand)

View File

@ -56,6 +56,9 @@
*
* Modified to call CUPS support if printcap name is set to "cups"
* in smb.conf.
*
* Modified to call iPrint support if printcap name is set to "iprint"
* in smb.conf.
*/
#include "includes.h"
@ -129,6 +132,13 @@ void pcap_cache_reload(void)
}
#endif
#ifdef HAVE_IPRINT
if (strequal(pcap_name, "iprint")) {
pcap_reloaded = iprint_cache_reload();
goto done;
}
#endif
#if defined(SYSV) || defined(HPUX)
if (strequal(pcap_name, "lpstat")) {
pcap_reloaded = sysv_cache_reload();

File diff suppressed because it is too large Load Diff

View File

@ -244,6 +244,12 @@ static struct printif *get_printer_fns_from_type( int type )
}
#endif /* HAVE_CUPS */
#ifdef HAVE_IPRINT
if ( type == PRINT_IPRINT ) {
printer_fns = &iprint_printif;
}
#endif /* HAVE_IPRINT */
printer_fns->type = type;
return printer_fns;