#
-# "$Id: Makedefs.in 4836 2005-11-13 06:14:46Z mike $"
+# "$Id: Makedefs.in 4999 2006-01-26 23:36:22Z mike $"
#
# Common makefile definitions for the Common UNIX Printing System (CUPS).
#
LIBTIFF = @LIBTIFF@
LIBZ = @LIBZ@
+#
+# Install static libraries?
+#
+
+INSTALLSTATIC = @INSTALLSTATIC@
+
#
# Program options...
#
#
-# End of "$Id: Makedefs.in 4836 2005-11-13 06:14:46Z mike $"
+# End of "$Id: Makedefs.in 4999 2006-01-26 23:36:22Z mike $"
#
dnl
-dnl "$Id: cups-common.m4 4979 2006-01-25 17:47:43Z mike $"
+dnl "$Id: cups-common.m4 4999 2006-01-26 23:36:22Z mike $"
dnl
dnl Common configuration stuff for the Common UNIX Printing System (CUPS).
dnl
AC_MSG_ERROR([Unable to find required C++ compiler command.])
fi
-dnl Architecture checks...
-AC_C_BIGENDIAN
+dnl Static library option...
+INSTALLSTATIC=""
+AC_ARG_ENABLE(install_static, [ --enable-static install static libraries, default=no])
+
+if test x$enable_install_static = xyes; then
+ INSTALLSTATIC="installstatic"
+fi
+
+AC_SUBST(INSTALLSTATIC)
dnl Check for libraries...
AC_SEARCH_LIBS(crypt, crypt)
AC_DEFINE_UNQUOTED(CUPS_DEFAULT_IPP_PORT,$DEFAULT_IPP_PORT)
dnl
-dnl End of "$Id: cups-common.m4 4979 2006-01-25 17:47:43Z mike $".
+dnl End of "$Id: cups-common.m4 4999 2006-01-26 23:36:22Z mike $".
dnl
#
-# "$Id: Makefile 4961 2006-01-20 22:19:13Z mike $"
+# "$Id: Makefile 5000 2006-01-26 23:38:43Z mike $"
#
# API library Makefile for the Common UNIX Printing System (CUPS).
#
# Install object and target files...
#
-install: all installhdrs
+install: all installhdrs $(INSTALLSTATIC)
$(INSTALL_DIR) $(LIBDIR)
$(INSTALL_LIB) $(LIBCUPS) $(LIBDIR)
if test $(LIBCUPS) = "libcups.so.2" -o $(LIBCUPS) = "libcups.sl.2"; then \
$(RM) $(LIBDIR)/libcups.dylib; \
$(LN) $(LIBCUPS) $(LIBDIR)/libcups.dylib; \
fi
+
+installstatic:
+ $(INSTALL_DIR) -m 755 $(LIBDIR)
if test $(LIBCUPS) != "libcups.a"; then \
$(INSTALL_LIB) libcups.a $(LIBDIR); \
$(RANLIB) $(LIBDIR)/libcups.a; \
#
-# End of "$Id: Makefile 4961 2006-01-20 22:19:13Z mike $".
+# End of "$Id: Makefile 5000 2006-01-26 23:38:43Z mike $".
#
#
-# "$Id: Makefile 4950 2006-01-19 16:07:57Z mike $"
+# "$Id: Makefile 5000 2006-01-26 23:38:43Z mike $"
#
# Filter makefile for the Common UNIX Printing System (CUPS).
#
# Install all targets...
#
-install: all installhdrs
+install: all installhdrs $(INSTALLSTATIC)
$(INSTALL_DIR) $(SERVERBIN)/filter
for file in $(FILTERS); do \
$(INSTALL_BIN) $$file $(SERVERBIN)/filter; \
done
$(RM) $(SERVERBIN)/filter/rastertodymo
$(LN) rastertolabel $(SERVERBIN)/filter/rastertodymo
- $(INSTALL_DIR) $(LIBDIR)
+ $(INSTALL_DIR) -m 755 $(LIBDIR)
$(INSTALL_LIB) $(LIBCUPSIMAGE) $(LIBDIR)
-if test $(LIBCUPSIMAGE) = "libcupsimage.so.2" -o $(LIBCUPSIMAGE) = "libcupsimage.sl.2"; then \
$(RM) $(LIBDIR)/`basename $(LIBCUPSIMAGE) .2`; \
$(RM) $(LIBDIR)/libcupsimage.dylib; \
$(LN) $(LIBCUPSIMAGE) $(LIBDIR)/libcupsimage.dylib; \
fi
+
+installstatic:
+ $(INSTALL_DIR) -m 755 $(LIBDIR)
-if test $(LIBCUPSIMAGE) != "libcupsimage.a"; then \
$(INSTALL_LIB) libcupsimage.a $(LIBDIR); \
$(RANLIB) $(LIBDIR)/libcupsimage.a; \
#
-# End of "$Id: Makefile 4950 2006-01-19 16:07:57Z mike $".
+# End of "$Id: Makefile 5000 2006-01-26 23:38:43Z mike $".
#
/*
- * "$Id: interpret.c 4982 2006-01-25 21:44:44Z mike $"
+ * "$Id: interpret.c 4998 2006-01-26 21:59:54Z mike $"
*
* PPD command interpreter for the Common UNIX Printing System (CUPS).
*
* Include necessary headers...
*/
-#include <cups/ppd.h>
#include <cups/string.h>
#include "raster.h"
#include <stdlib.h>
/*
* 'cupsRasterInterpretPPD()' - Interpret PPD commands to create a page header.
*
+ * This function does not mark the options in the PPD using the "num_options"
+ * and "options" arguments. Instead, mark the options prior to calling
+ * cupsRasterInterpretPPD() - this allows you to do per-page options
+ * without manipulating the options array.
+ *
* @since CUPS 1.2@
*/
int /* O - 0 on success, -1 on failure */
cupsRasterInterpretPPD(
cups_page_header2_t *h, /* O - Page header */
- ppd_file_t *ppd) /* I - PPD file */
+ ppd_file_t *ppd, /* I - PPD file */
+ int num_options, /* I - Number of options */
+ cups_option_t *options) /* I - Options */
{
int i; /* Looping var */
int status; /* Cummulative status */
int count; /* Number of marked choices */
+ const char *val; /* Option value */
ppd_choice_t **choices; /* List of marked choices */
ppd_size_t *size; /* Current size */
float left, /* Left position */
memset(h, 0, sizeof(cups_page_header2_t));
- h->NumCopies = 1;
- h->PageSize[0] = 612;
- h->PageSize[1] = 792;
- h->HWResolution[0] = 100;
- h->HWResolution[1] = 100;
- h->cupsBitsPerColor = 1;
- h->cupsColorOrder = CUPS_ORDER_CHUNKED;
- h->cupsColorSpace = CUPS_CSPACE_K;
- h->cupsPageScaling = 1.0f;
- h->cupsPageSize[0] = 612.0f;
- h->cupsPageSize[1] = 792.0f;
- h->cupsImagingBBox[0] = 0.0f;
- h->cupsImagingBBox[1] = 0.0f;
- h->cupsImagingBBox[2] = 612.0f;
- h->cupsImagingBBox[3] = 792.0f;
+ h->NumCopies = 1;
+ h->PageSize[0] = 612;
+ h->PageSize[1] = 792;
+ h->HWResolution[0] = 100;
+ h->HWResolution[1] = 100;
+ h->cupsBitsPerColor = 1;
+ h->cupsColorOrder = CUPS_ORDER_CHUNKED;
+ h->cupsColorSpace = CUPS_CSPACE_K;
+ h->cupsBorderlessScalingFactor = 1.0f;
+ h->cupsPageSize[0] = 612.0f;
+ h->cupsPageSize[1] = 792.0f;
+ h->cupsImagingBBox[0] = 0.0f;
+ h->cupsImagingBBox[1] = 0.0f;
+ h->cupsImagingBBox[2] = 612.0f;
+ h->cupsImagingBBox[3] = 792.0f;
strcpy(h->cupsPageSizeName, "Letter");
if (!h->HWResolution[0] || !h->HWResolution[1] ||
!h->PageSize[0] || !h->PageSize[1] ||
(h->cupsBitsPerColor != 1 && h->cupsBitsPerColor != 2 &&
- h->cupsBitsPerColor != 4 && h->cupsBitsPerColor != 8))
+ h->cupsBitsPerColor != 4 && h->cupsBitsPerColor != 8) ||
+ h->cupsBorderlessScalingFactor < 0.9 ||
+ h->cupsBorderlessScalingFactor > 1.1)
return (-1);
+ /*
+ * Allow option override for page scaling...
+ */
+
+ if ((val = cupsGetOption("cupsBorderlessScalingFactor", num_options,
+ options)) != NULL)
+ {
+ float sc = atof(val);
+
+ if (sc >= 0.9 && sc <= 1.1)
+ h->cupsBorderlessScalingFactor = sc;
+ }
+
/*
* Get the margins for the current size...
*/
top = 792.0f;
}
- h->Margins[0] = left;
- h->Margins[1] = bottom;
- h->ImagingBoundingBox[0] = left;
- h->ImagingBoundingBox[1] = bottom;
- h->ImagingBoundingBox[2] = right;
- h->ImagingBoundingBox[3] = top;
+ h->PageSize[0] = h->cupsPageSize[0] *
+ h->cupsBorderlessScalingFactor;
+ h->PageSize[1] = h->cupsPageSize[1] *
+ h->cupsBorderlessScalingFactor;
+ h->Margins[0] = left * h->cupsBorderlessScalingFactor;
+ h->Margins[1] = bottom * h->cupsBorderlessScalingFactor;
+ h->ImagingBoundingBox[0] = left * h->cupsBorderlessScalingFactor;
+ h->ImagingBoundingBox[1] = bottom * h->cupsBorderlessScalingFactor;
+ h->ImagingBoundingBox[2] = right * h->cupsBorderlessScalingFactor;
+ h->ImagingBoundingBox[3] = top * h->cupsBorderlessScalingFactor;
h->cupsImagingBBox[0] = left;
h->cupsImagingBBox[1] = bottom;
h->cupsImagingBBox[2] = right;
* Compute the bitmap parameters...
*/
- h->cupsWidth = (int)((right - left) * h->cupsPageScaling *
+ h->cupsWidth = (int)((right - left) * h->cupsBorderlessScalingFactor *
h->HWResolution[0] / 72.0f + 0.5f);
- h->cupsHeight = (int)((top - bottom) * h->cupsPageScaling *
+ h->cupsHeight = (int)((top - bottom) * h->cupsBorderlessScalingFactor *
h->HWResolution[1] / 72.0f + 0.5f);
switch (h->cupsColorSpace)
h->OutputFaceUp = !strcmp(value, "true");
else if (!strcmp(name, "PageSize") && type == CUPS_TYPE_ARRAY)
{
- if (sscanf(value, "[%d%d]", h->PageSize + 0, h->PageSize + 1) != 2)
- return (-1);
-
if (sscanf(value, "[%f%f]", h->cupsPageSize + 0, h->cupsPageSize + 1) != 2)
return (-1);
}
h->cupsRowFeed = atoi(value);
else if (!strcmp(name, "cupsRowStep") && type == CUPS_TYPE_NUMBER)
h->cupsRowStep = atoi(value);
- else if (!strcmp(name, "cupsPageScaling") && type == CUPS_TYPE_NUMBER)
- {
- h->cupsPageScaling = atof(value);
- }
+ else if (!strcmp(name, "cupsBorderlessScalingFactor") &&
+ type == CUPS_TYPE_NUMBER)
+ h->cupsBorderlessScalingFactor = atof(value);
else if (!strncmp(name, "cupsInteger", 11) && type == CUPS_TYPE_NUMBER)
{
if ((i = atoi(name + 11)) >= 0 || i > 15)
/*
- * End of "$Id: interpret.c 4982 2006-01-25 21:44:44Z mike $".
+ * End of "$Id: interpret.c 4998 2006-01-26 21:59:54Z mike $".
*/
/*
- * "$Id: raster.h 4981 2006-01-25 21:34:00Z mike $"
+ * "$Id: raster.h 4998 2006-01-26 21:59:54Z mike $"
*
* Raster file definitions for the Common UNIX Printing System (CUPS).
*
* Include necessary headers...
*/
-# include <cups/ppd.h>
+# include <cups/cups.h>
# ifdef __cplusplus
extern "C" {
/**** Version 2 Dictionary Values ****/
unsigned cupsNumColors; /* Number of colors @since CUPS 1.2@ */
- float cupsPageScaling; /* Scaling that was applied to page data */
- float cupsPageSize[2]; /* Floating point PageSize @since CUPS 1.2@ */
- float cupsImagingBBox[4]; /* Floating point ImagingBoundingBox @since CUPS 1.2@ */
+ float cupsBorderlessScalingFactor;
+ /* Scaling that was applied to page data */
+ float cupsPageSize[2]; /* Floating point PageSize (scaling *
+ * factor not applied) @since CUPS 1.2@ */
+ float cupsImagingBBox[4]; /* Floating point ImagingBoundingBox *
+ * (scaling factor not applied) @since CUPS 1.2@ */
unsigned cupsInteger[16]; /* User-defined integer values @since CUPS 1.2@ */
float cupsReal[16]; /* User-defined floating-point values @since CUPS 1.2@ */
char cupsString[16][64]; /* User-defined string values @since CUPS 1.2@ */
/**** New in CUPS 1.2 ****/
extern int cupsRasterInterpretPPD(cups_page_header2_t *h,
- ppd_file_t *ppd);
+ ppd_file_t *ppd,
+ int num_options,
+ cups_option_t *options);
extern unsigned cupsRasterReadHeader2(cups_raster_t *r,
cups_page_header2_t *h);
extern unsigned cupsRasterWriteHeader2(cups_raster_t *r,
#endif /* !_CUPS_RASTER_H_ */
/*
- * End of "$Id: raster.h 4981 2006-01-25 21:34:00Z mike $".
+ * End of "$Id: raster.h 4998 2006-01-26 21:59:54Z mike $".
*/
#
-# "$Id: Makefile 4970 2006-01-24 14:05:45Z mike $"
+# "$Id: Makefile 5000 2006-01-26 23:38:43Z mike $"
#
# Scheduler Makefile for the Common UNIX Printing System (CUPS).
#
install: all
echo Creating $(SBINDIR)...
- $(INSTALL_DIR) $(SBINDIR)
+ $(INSTALL_DIR) -m 755 $(SBINDIR)
echo Installing cupsd in $(SBINDIR)...
$(INSTALL_BIN) cupsd $(SBINDIR)
echo Creating $(SERVERBIN)...
- $(INSTALL_DIR) $(SERVERBIN)
+ $(INSTALL_DIR) -m 755 $(SERVERBIN)
echo Creating $(SERVERBIN)/daemon...
- $(INSTALL_DIR) $(SERVERBIN)/daemon
+ $(INSTALL_DIR) -m 755 $(SERVERBIN)/daemon
echo Installing cups-deviced, cups-driverd, cups-lpd, and cups-polld in $(SERVERBIN)/daemon...
$(INSTALL_BIN) cups-deviced $(SERVERBIN)/daemon
$(INSTALL_BIN) cups-driverd $(SERVERBIN)/daemon
$(INSTALL_BIN) cups-lpd $(SERVERBIN)/daemon
$(INSTALL_BIN) cups-polld $(SERVERBIN)/daemon
echo Creating $(SERVERBIN)/driver...
- $(INSTALL_DIR) $(SERVERBIN)/driver
+ $(INSTALL_DIR) -m 755 $(SERVERBIN)/driver
echo Creating $(SERVERROOT)...
- $(INSTALL_DIR) $(SERVERROOT)
+ $(INSTALL_DIR) -m 755 $(SERVERROOT)
echo Creating $(SERVERROOT)/interfaces...
- $(INSTALL_DIR) -g $(CUPS_GROUP) $(SERVERROOT)/interfaces
+ $(INSTALL_DIR) -m 755 -g $(CUPS_GROUP) $(SERVERROOT)/interfaces
echo Creating $(SERVERROOT)/ppd...
- $(INSTALL_DIR) -g $(CUPS_GROUP) $(SERVERROOT)/ppd
+ $(INSTALL_DIR) -m 755 -g $(CUPS_GROUP) $(SERVERROOT)/ppd
echo Creating $(STATEDIR)...
- $(INSTALL_DIR) $(STATEDIR)
+ $(INSTALL_DIR) -m 755 $(STATEDIR)
echo Creating $(STATEDIR)/certs...
- $(INSTALL_DIR) $(STATEDIR)/certs
+ $(INSTALL_DIR) -m 711 $(STATEDIR)/certs
echo Creating $(LOGDIR)...
- $(INSTALL_DIR) $(LOGDIR)
+ $(INSTALL_DIR) -m 755 $(LOGDIR)
echo Creating $(REQUESTS)...
- $(INSTALL_DIR) -g $(CUPS_GROUP) $(REQUESTS)
- echo Creating -g $(CUPS_GROUP) $(REQUESTS)/tmp...
- $(INSTALL_DIR) $(REQUESTS)/tmp
+ $(INSTALL_DIR) -m 710 -g $(CUPS_GROUP) $(REQUESTS)
+ echo Creating $(REQUESTS)/tmp...
+ $(INSTALL_DIR) -m 1770 -g $(CUPS_GROUP) $(REQUESTS)/tmp
echo Creating $(CACHEDIR)...
- $(INSTALL_DIR) $(CACHEDIR)
- echo Creating $(CACHEDIR)/ppd...
- $(INSTALL_DIR) $(CACHEDIR)/ppd
+ $(INSTALL_DIR) -m 775 -g $(CUPS_GROUP) $(CACHEDIR)
+# echo Creating $(CACHEDIR)/ppd...
+# $(INSTALL_DIR) -m 755 $(CACHEDIR)/ppd
#
#
-# End of "$Id: Makefile 4970 2006-01-24 14:05:45Z mike $".
+# End of "$Id: Makefile 5000 2006-01-26 23:38:43Z mike $".
#
/*
- * "$Id: conf.c 4993 2006-01-26 19:27:40Z mike $"
+ * "$Id: conf.c 5001 2006-01-26 23:39:23Z mike $"
*
* Configuration routines for the Common UNIX Printing System (CUPS).
*
check_permissions(CacheDir, NULL, 0775, RunUser, Group, 1, 1);
check_permissions(CacheDir, "ppd", 0755, RunUser, Group, 1, 1);
- check_permissions(StateDir, NULL, 0775, RunUser, Group, 1, 1);
+ check_permissions(StateDir, NULL, 0755, RunUser, Group, 1, 1);
check_permissions(StateDir, "certs", RunUser ? 0711 : 0511, User,
SystemGroupIDs[0], 1, 1);
/*
- * End of "$Id: conf.c 4993 2006-01-26 19:27:40Z mike $".
+ * End of "$Id: conf.c 5001 2006-01-26 23:39:23Z mike $".
*/
/*
- * "$Id: main.c 4993 2006-01-26 19:27:40Z mike $"
+ * "$Id: main.c 4997 2006-01-26 21:43:54Z mike $"
*
* Scheduler main loop for the Common UNIX Printing System (CUPS).
*
timeout.tv_sec = select_timeout(fds);
timeout.tv_usec = 0;
- if ((fds = select(MaxFDs, input, output, NULL, &timeout)) < 0)
+ if (timeout.tv_sec < 86400) /* Only use timeout for < 1 day */
+ fds = select(MaxFDs, input, output, NULL, &timeout);
+ else
+ fds = select(MaxFDs, input, output, NULL, NULL);
+
+ if (fds < 0)
{
char s[16384], /* String buffer */
*sptr; /* Pointer into buffer */
cupsdLogMessage(CUPSD_LOG_EMERG, "BrowseSocket = %d", BrowseSocket);
+ cupsdLogMessage(CUPSD_LOG_EMERG, "CGIPipes[0] = %d", CGIPipes[0]);
+
for (job = (cupsd_job_t *)cupsArrayFirst(ActiveJobs);
job;
job = (cupsd_job_t *)cupsArrayNext(ActiveJobs))
{
cupsdLogMessage(CUPSD_LOG_DEBUG2,
"main: Removing fd %d from InputSet...", con->file);
+ FD_CLR(con->file, input);
FD_CLR(con->file, InputSet);
}
}
}
#endif /* HAVE_MALLINFO */
- /*
- * Update the root certificate when needed...
- */
-
- if (!RunUser && RootCertDuration &&
- (RootCertTime + RootCertDuration) < timeout)
- {
- timeout = RootCertTime + RootCertDuration;
- why = "update root certificate";
- }
-
/*
* Expire subscriptions as needed...
*/
/*
- * End of "$Id: main.c 4993 2006-01-26 19:27:40Z mike $".
+ * End of "$Id: main.c 4997 2006-01-26 21:43:54Z mike $".
*/
#
-# "$Id: Makefile 4791 2005-10-14 01:39:44Z mike $"
+# "$Id: Makefile 4999 2006-01-26 23:36:22Z mike $"
#
# System V commands makefile for the Common UNIX Printing System (CUPS).
#
$(INSTALL_DIR) $(BINDIR)
$(INSTALL_BIN) cancel $(BINDIR)
$(INSTALL_BIN) cupstestppd $(BINDIR)
- $(RM) $(SBINDIR)/disable
- $(LN) accept $(SBINDIR)/disable
- $(RM) $(SBINDIR)/enable
- $(LN) accept $(SBINDIR)/enable
+ $(RM) $(SBINDIR)/cupsdisable
+ $(LN) accept $(SBINDIR)/cupsdisable
+ $(RM) $(SBINDIR)/cupsenable
+ $(LN) accept $(SBINDIR)/cupsenable
$(INSTALL_BIN) lp $(BINDIR)
$(INSTALL_BIN) lpoptions $(BINDIR)
$(INSTALL_BIN) lpstat $(BINDIR)
#
-# End of "$Id: Makefile 4791 2005-10-14 01:39:44Z mike $".
+# End of "$Id: Makefile 4999 2006-01-26 23:36:22Z mike $".
#