/*
- * $Id: main.c,v 1.18.6.2.2.5 2009-01-19 02:25:57 didg Exp $
+ * $Id: main.c,v 1.18.6.2.2.6 2009-01-21 04:07:05 didg Exp $
*
* Copyright (c) 1990,1995 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
#include "uam_auth.h"
#include "print_cups.h"
-#define _PATH_PAPDPPDFILE ".ppd"
#define PIPED_STATUS "status: print spooler processing job"
defprinter.p_type = "LaserWriter";
defprinter.p_zone = "*";
memset(&defprinter.p_addr, 0, sizeof(defprinter.p_addr));
- defprinter.p_ppdfile = _PATH_PAPDPPDFILE;
#ifdef __svr4__
defprinter.p_flags = P_PIPED;
defprinter.p_printer = "/usr/bin/lp -T PS";
/*
* Get PPD file.
*/
- if (( p = pgetstr( "pd", &a )) == NULL ) {
- pr->p_ppdfile = defprinter.p_ppdfile;
- } else {
+ if (( p = pgetstr( "pd", &a ) )) {
if (( pr->p_ppdfile = (char *)malloc( strlen( p ) + 1 )) == NULL ) {
perror( "malloc" );
exit( 1 );
* Check for ppd file, moved here because of cups_autoadd we cannot check at the usual location
*/
- if ( pr->p_ppdfile == defprinter.p_ppdfile ) {
+ if ( pr->p_ppdfile == NULL ) {
if ( (p = (char *) cups_get_printer_ppd ( pr->p_printer )) != NULL ) {
if (( pr->p_ppdfile = (char *)malloc( strlen( p ) + 1 )) == NULL ) {
LOG(log_error, logtype_papd, "malloc: %s", strerror(errno) );
}
strcpy( pr->p_ppdfile, p );
pr->p_flags |= P_CUPS_PPD;
- /*LOG(log_info, logtype_papd, "PPD File for %s set to %s", pr->p_printer, pr->p_ppdfile );*/
+ LOG(log_info, logtype_papd, "PPD File for %s set to %s", pr->p_printer, pr->p_ppdfile );
}
}
/*
- * $Id: ppd.c,v 1.9.8.1.2.5 2009-01-21 02:32:16 didg Exp $
+ * $Id: ppd.c,v 1.9.8.1.2.6 2009-01-21 04:07:05 didg Exp $
*
* Copyright (c) 1995 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
};
#ifndef SHOWPPD
-int ppd_inited = 0;
+static int ppd_inited;
-int ppd_init()
+static void ppd_init()
{
- if ( ppd_inited ) {
- return( -1 );
- }
+ if (ppd_inited)
+ return;
+
ppd_inited++;
- return read_ppd( printer->p_ppdfile, 0 );
+ if (printer->p_ppdfile)
+ read_ppd( printer->p_ppdfile, 0 );
}
#endif /* SHOWPPD */
/*
- * $Id: ppd.h,v 1.4 2001-06-25 20:13:45 rufustfirefly Exp $
+ * $Id: ppd.h,v 1.4.16.1 2009-01-21 04:07:05 didg Exp $
*
* Copyright (c) 1995 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
struct ppd_feature *ppd_feature __P((const char *, int));
struct ppd_font *ppd_font __P((char *));
int read_ppd __P((char *, int));
-int ppd_init __P(( void ));
#endif /* PAPD_PPD_H */