Merge changes from CUPS 1.4svn-r8033.

git-svn-id: svn+ssh://src.apple.com/svn/cups/easysw/current@1003 a1ca3aef-8c08-0410-bb20-df032aa958be
Esse commit está contido em:
msweet
2008-10-08 22:50:16 +00:00
commit 58dc193312
97 arquivos alterados com 2157 adições e 3778 exclusões
+6 -1
Ver Arquivo
@@ -1,9 +1,14 @@
CHANGES.txt - 2008-10-01
CHANGES.txt - 2008-10-08
------------------------
CHANGES IN CUPS V1.4b1
- Documentation updates (STR #2567)
- CUPS-Get-Driver now provides much better driver matching based
on the IEEE-1284 device ID and make/model strings (STR #2707)
- Now support the cupsSNMPSupplies keyword to control whether
the network backends query the SNMP Printer MIB for supply
levels.
- Now support and use a new banner file format for better text
support and easier customization (STR #2490)
- The scheduler now sets the PRINTER_INFO and PRINTER_LOCATION
+2 -1
Ver Arquivo
@@ -137,7 +137,8 @@ FONTS = @FONTS@
IMGLIBS = @IMGLIBS@
IMGFILTERS = @IMGFILTERS@
LAUNCHDLIBS = @LAUNCHDLIBS@
LDFLAGS = -L../cups -L../filter @LDARCHFLAGS@ \
LDFLAGS = -L../cgi-bin -L../cups -L../filter -L../ppdc \
-L../scheduler @LDARCHFLAGS@ \
@LDFLAGS@ @RELROFLAGS@ @PIEFLAGS@ $(OPTIM)
LEGACY_BACKENDS = @LEGACY_BACKENDS@
LIBCUPSORDER = @LIBCUPSORDER@
+2 -1
Ver Arquivo
@@ -117,12 +117,13 @@ distclean: clean
$(RM) man/cups-lpd.man man/cupsaddsmb.man man/cupsd.man
$(RM) man/cupsd.conf.man man/drv.man man/lpoptions.man
$(RM) packaging/cups.list
$(RM) packaging/cups-desc.plist packaging/cups-info.plist
$(RM) templates/header.tmpl
$(RM) desktop/cups.desktop
$(RM) init/cups.xml
-$(RM) doc/*/index.html
-$(RM) templates/*/header.tmpl
-$(RM) -r autom4te*.cache
-$(RM) -r autom4te*.cache clang cups/charmaps cups/locale driver/test
#
+1 -1
Ver Arquivo
@@ -264,7 +264,7 @@ socket: socket.o ../cups/$(LIBCUPS) libbackend.a
usb: usb.o ../cups/$(LIBCUPS) libbackend.a
echo Linking $@...
$(CC) $(ARCHFLAGS) $(LDFLAGS) -o usb usb.o libbackend.a $(LIBUSB) \
$(CC) $(LDFLAGS) -o usb usb.o libbackend.a $(LIBUSB) \
$(BACKLIBS) $(LIBS)
usb.o: usb.c usb-darwin.c usb-libusb.c usb-unix.c
+16 -9
Ver Arquivo
@@ -242,6 +242,7 @@ main(int argc, /* I - Number of command-line args */
* Announce any devices we've found...
*/
DNSServiceErrorType status; /* DNS query status */
cups_device_t *best; /* Best matching device */
char device_uri[1024]; /* Device URI */
int count; /* Number of queries */
@@ -266,13 +267,19 @@ main(int argc, /* I - Number of command-line args */
fprintf(stderr, "DEBUG: Querying \"%s\"...\n", device->fullName);
if (DNSServiceQueryRecord(&(device->ref),
kDNSServiceFlagsShareConnection,
0, device->fullName, kDNSServiceType_TXT,
kDNSServiceClass_IN, query_callback,
devices) != kDNSServiceErr_NoError)
status = DNSServiceQueryRecord(&(device->ref),
kDNSServiceFlagsShareConnection,
0, device->fullName,
kDNSServiceType_TXT,
kDNSServiceClass_IN, query_callback,
devices);
if (status != kDNSServiceErr_NoError)
{
fputs("ERROR: Unable to query for TXT records!\n", stderr);
else
fprintf(stderr, "DEBUG: DNSServiceQueryRecord returned %d\n",
status);
}
else
count ++;
}
}
@@ -501,7 +508,8 @@ get_device(cups_array_t *devices, /* I - Device array */
{
cups_device_t key, /* Search key */
*device; /* Device */
char fullName[1024]; /* Full name for query */
char fullName[kDNSServiceMaxDomainName];
/* Full name for query */
/*
@@ -551,8 +559,7 @@ get_device(cups_array_t *devices, /* I - Device array */
* Set the "full name" of this service, which is used for queries...
*/
snprintf(fullName, sizeof(fullName), "%s.%s%s", serviceName, regtype,
replyDomain);
DNSServiceConstructFullName(fullName, serviceName, regtype, replyDomain);
device->fullName = strdup(fullName);
return (device);
+16
Ver Arquivo
@@ -323,6 +323,8 @@ backend_init_supplies(
*ptr, /* Pointer into value string */
*name_ptr; /* Pointer into name string */
cups_snmp_t packet; /* SNMP response packet */
ppd_file_t *ppd; /* PPD file for this queue */
ppd_attr_t *ppdattr; /* cupsSNMPSupplies attribute */
static const char * const types[] = /* Supply types */
{
"other",
@@ -371,6 +373,20 @@ backend_init_supplies(
memset(supplies, 0, sizeof(supplies));
/*
* See if we should be getting supply levels via SNMP...
*/
if ((ppd = ppdOpenFile(getenv("PPD"))) != NULL &&
(ppdattr = ppdFindAttr(ppd, "cupsSNMPSupplies", NULL)) != NULL &&
ppdattr->value && strcasecmp(ppdattr->value, "true"))
{
ppdClose(ppd);
return;
}
ppdClose(ppd);
/*
* Get the device description...
*/
+12 -9
Ver Arquivo
@@ -648,14 +648,12 @@ print_device(const char *uri, /* I - Device URI */
status = (*g.classdriver)->WritePipe(g.classdriver, (UInt8*)print_ptr, &bytes, 0);
/*
* Ignore timeout errors...
* Ignore timeout errors, but retain the number of bytes written to
* avoid sending duplicate data (<rdar://problem/6254911>)...
*/
if (status == kIOUSBTransactionTimeout)
{
status = 0;
bytes = 0;
}
if (status || bytes < 0)
{
@@ -1287,11 +1285,9 @@ static kern_return_t load_classdriver(CFStringRef driverPath,
}
}
#ifdef DEBUG
char bundlestr[1024];
CFStringGetCString(bundle, bundlestr, sizeof(bundlestr), kCFStringEncodingUTF8);
fprintf(stderr, "DEBUG: load_classdriver(%s) (kr:0x%08x)\n", bundlestr, (int)kr);
#endif /* DEBUG */
return kr;
}
@@ -1771,6 +1767,9 @@ static void run_legacy_backend(int argc,
struct sigaction action; /* POSIX signal action */
sigset_t newmask, /* New signal mask */
oldmask; /* Old signal mask */
char usbpath[1024]; /* Path to USB backend */
const char *cups_serverbin;/* Path to CUPS binaries */
memset(&action, 0, sizeof(action));
sigaddset(&action.sa_mask, SIGTERM);
@@ -1822,15 +1821,19 @@ static void run_legacy_backend(int argc,
* Set up the arguments and call posix_spawn...
*/
if ((cups_serverbin = getenv("CUPS_SERVERBIN")) == NULL)
cups_serverbin = CUPS_SERVERBIN;
snprintf(usbpath, sizeof(usbpath), "%s/backend/usb", cups_serverbin);
for (i = 0; i < argc && i < (sizeof(my_argv) / sizeof(my_argv[0])) - 1; i ++)
my_argv[i] = argv[i];
my_argv[i] = NULL;
if (posix_spawn(&child_pid, "/usr/libexec/cups/backend/usb", NULL, &attrs,
my_argv, environ))
if (posix_spawn(&child_pid, usbpath, NULL, &attrs, my_argv, environ))
{
perror("DEBUG: Unable to exec /usr/libexec/cups/backend/usb");
fprintf(stderr, "DEBUG: Unable to exec %s: %s\n", usbpath,
strerror(errno));
_cupsLangPrintf(stderr, _("Unable to use legacy USB class driver!\n"));
exit(CUPS_BACKEND_STOP);
}
+4 -4
Ver Arquivo
@@ -328,7 +328,7 @@ libcupscgi.a: $(LIBOBJS)
admin.cgi: admin.o ../Makedefs ../cups/$(LIBCUPS) $(LIBCUPSCGI)
echo Linking $@...
$(CC) $(LDFLAGS) -o $@ admin.o -L. -lcupscgi $(LIBS)
$(CC) $(LDFLAGS) -o $@ admin.o -lcupscgi $(LIBS)
#
@@ -337,7 +337,7 @@ admin.cgi: admin.o ../Makedefs ../cups/$(LIBCUPS) $(LIBCUPSCGI)
classes.cgi: classes.o ../Makedefs ../cups/$(LIBCUPS) $(LIBCUPSCGI)
echo Linking $@...
$(CC) $(LDFLAGS) -o $@ classes.o -L. -lcupscgi $(LIBS)
$(CC) $(LDFLAGS) -o $@ classes.o -lcupscgi $(LIBS)
#
@@ -346,7 +346,7 @@ classes.cgi: classes.o ../Makedefs ../cups/$(LIBCUPS) $(LIBCUPSCGI)
help.cgi: help.o ../Makedefs ../cups/$(LIBCUPS) $(LIBCUPSCGI)
echo Linking $@...
$(CC) $(LDFLAGS) -o $@ help.o -L. -lcupscgi $(LIBS)
$(CC) $(LDFLAGS) -o $@ help.o -lcupscgi $(LIBS)
#
@@ -355,7 +355,7 @@ help.cgi: help.o ../Makedefs ../cups/$(LIBCUPS) $(LIBCUPSCGI)
jobs.cgi: jobs.o ../Makedefs ../cups/$(LIBCUPS) $(LIBCUPSCGI)
echo Linking $@...
$(CC) $(LDFLAGS) -o $@ jobs.o -L. -lcupscgi $(LIBS)
$(CC) $(LDFLAGS) -o $@ jobs.o -lcupscgi $(LIBS)
#
+434 -468
Ver Arquivo
Diferenças do arquivo suprimidas por serem muito extensas Carregar Diff
+5 -1
Ver Arquivo
@@ -3,7 +3,7 @@
*
* CGI support library definitions.
*
* Copyright 2007 by Apple Inc.
* Copyright 2007-2008 by Apple Inc.
* Copyright 1997-2006 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
@@ -59,6 +59,7 @@ extern void cgiCopyTemplateFile(FILE *out, const char *tmpl);
extern void cgiCopyTemplateLang(const char *tmpl);
extern int cgiDoSearch(void *search, const char *text);
extern void cgiEndHTML(void);
extern void cgiEndMultipart(void);
extern char *cgiFormEncode(char *dst, const char *src, size_t dstsize);
extern void cgiFreeSearch(void *search);
extern const char *cgiGetArray(const char *name, int element);
@@ -72,6 +73,8 @@ extern const char *cgiGetVariable(const char *name);
extern int cgiInitialize(void);
extern int cgiIsPOST(void);
extern void cgiMoveJobs(http_t *http, const char *dest, int job_id);
extern void cgiPrintCommand(http_t *http, const char *dest,
const char *command, const char *title);
extern void cgiPrintTestPage(http_t *http, const char *dest);
extern char *cgiRewriteURL(const char *uri, char *url, int urlsize,
const char *newresource);
@@ -91,6 +94,7 @@ extern void cgiSetVariable(const char *name, const char *value);
extern void cgiShowIPPError(const char *message);
extern void cgiShowJobs(http_t *http, const char *dest);
extern void cgiStartHTML(const char *title);
extern void cgiStartMultipart(void);
extern const char *cgiText(const char *message);
#endif /* !_CUPS_CGI_H_ */
+120 -17
Ver Arquivo
@@ -14,9 +14,6 @@
*
* Contents:
*
* main() - Main entry for CGI.
* show_all_classes() - Show all classes...
* show_class() - Show a single class.
*/
/*
@@ -30,8 +27,10 @@
* Local functions...
*/
void show_all_classes(http_t *http, const char *username);
void show_class(http_t *http, const char *printer);
static void do_class_op(http_t *http, const char *printer, ipp_op_t op,
const char *title);
static void show_all_classes(http_t *http, const char *username);
static void show_class(http_t *http, const char *printer);
/*
@@ -80,6 +79,9 @@ main(int argc, /* I - Number of command-line arguments */
if (!*pclass)
pclass = NULL;
if (pclass)
cgiSetVariable("PRINTER_NAME", pclass);
}
/*
@@ -138,21 +140,40 @@ main(int argc, /* I - Number of command-line arguments */
else
show_class(http, pclass);
}
else if (!strcasecmp(op, "print-test-page") && pclass)
cgiPrintTestPage(http, pclass);
else if (!strcasecmp(op, "move-jobs") && pclass)
cgiMoveJobs(http, pclass, 0);
else if (pclass)
{
if (!strcmp(op, "start-class"))
do_class_op(http, pclass, IPP_RESUME_PRINTER, cgiText(_("Resume Class")));
else if (!strcmp(op, "stop-class"))
do_class_op(http, pclass, IPP_PAUSE_PRINTER, cgiText(_("Pause Class")));
else if (!strcmp(op, "accept-jobs"))
do_class_op(http, pclass, CUPS_ACCEPT_JOBS, cgiText(_("Accept Jobs")));
else if (!strcmp(op, "reject-jobs"))
do_class_op(http, pclass, CUPS_REJECT_JOBS, cgiText(_("Reject Jobs")));
else if (!strcmp(op, "purge-jobs"))
do_class_op(http, pclass, IPP_PURGE_JOBS, cgiText(_("Purge Jobs")));
else if (!strcasecmp(op, "print-test-page"))
cgiPrintTestPage(http, pclass);
else if (!strcasecmp(op, "move-jobs"))
cgiMoveJobs(http, pclass, 0);
else
{
/*
* Unknown/bad operation...
*/
cgiStartHTML(pclass);
cgiCopyTemplateLang("error-op.tmpl");
cgiEndHTML();
}
}
else
{
/*
* Unknown/bad operation...
*/
if (pclass)
cgiStartHTML(pclass);
else
cgiStartHTML(cgiText(_("Classes")));
cgiStartHTML(cgiText(_("Classes")));
cgiCopyTemplateLang("error-op.tmpl");
cgiEndHTML();
}
@@ -171,11 +192,94 @@ main(int argc, /* I - Number of command-line arguments */
}
/*
* 'do_class_op()' - Do a class operation.
*/
static void
do_class_op(http_t *http, /* I - HTTP connection */
const char *printer, /* I - Printer name */
ipp_op_t op, /* I - Operation to perform */
const char *title) /* I - Title of page */
{
ipp_t *request; /* IPP request */
char uri[HTTP_MAX_URI], /* Printer URI */
resource[HTTP_MAX_URI]; /* Path for request */
/*
* Build a printer request, which requires the following
* attributes:
*
* attributes-charset
* attributes-natural-language
* printer-uri
*/
request = ippNewRequest(op);
httpAssembleURIf(HTTP_URI_CODING_ALL, uri, sizeof(uri), "ipp", NULL,
"localhost", 0, "/classes/%s", printer);
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri",
NULL, uri);
/*
* Do the request and get back a response...
*/
snprintf(resource, sizeof(resource), "/classes/%s", printer);
ippDelete(cupsDoRequest(http, request, resource));
if (cupsLastError() == IPP_NOT_AUTHORIZED)
{
puts("Status: 401\n");
exit(0);
}
else if (cupsLastError() > IPP_OK_CONFLICT)
{
cgiStartHTML(title);
cgiShowIPPError(_("Unable to do maintenance command:"));
}
else
{
/*
* Redirect successful updates back to the printer page...
*/
char url[1024], /* Printer/class URL */
refresh[1024]; /* Refresh URL */
cgiRewriteURL(uri, url, sizeof(url), NULL);
cgiFormEncode(uri, url, sizeof(uri));
snprintf(refresh, sizeof(refresh), "5;URL=%s", uri);
cgiSetVariable("refresh_page", refresh);
cgiStartHTML(title);
cgiSetVariable("IS_CLASS", "YES");
if (op == IPP_PAUSE_PRINTER)
cgiCopyTemplateLang("printer-stop.tmpl");
else if (op == IPP_RESUME_PRINTER)
cgiCopyTemplateLang("printer-start.tmpl");
else if (op == CUPS_ACCEPT_JOBS)
cgiCopyTemplateLang("printer-accept.tmpl");
else if (op == CUPS_REJECT_JOBS)
cgiCopyTemplateLang("printer-reject.tmpl");
else if (op == IPP_PURGE_JOBS)
cgiCopyTemplateLang("printer-purge.tmpl");
}
cgiEndHTML();
}
/*
* 'show_all_classes()' - Show all classes...
*/
void
static void
show_all_classes(http_t *http, /* I - Connection to server */
const char *user) /* I - Username */
{
@@ -335,7 +439,7 @@ show_all_classes(http_t *http, /* I - Connection to server */
* 'show_class()' - Show a single class.
*/
void
static void
show_class(http_t *http, /* I - Connection to server */
const char *pclass) /* I - Name of class */
{
@@ -407,7 +511,6 @@ show_class(http_t *http, /* I - Connection to server */
* Show the class status...
*/
cgiSetVariable("_SINGLE_DEST", "1");
cgiCopyTemplateLang("class.tmpl");
/*
+43 -5
Ver Arquivo
@@ -3,7 +3,7 @@
*
* HTML support functions for the Common UNIX Printing System (CUPS).
*
* Copyright 2007 by Apple Inc.
* Copyright 2007-2008 by Apple Inc.
* Copyright 1997-2006 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
@@ -14,10 +14,12 @@
*
* Contents:
*
* cgiEndHTML() - End a HTML page.
* cgiFormEncode() - Encode a string as a form variable...
* cgiStartHTML() - Start a HTML page.
* cgi_null_passwd() - Return a NULL password for authentication.
* cgiEndHTML() - End a HTML page.
* cgiEndMultipart() - End the delivery of a multipart web page.
* cgiFormEncode() - Encode a string as a form variable...
* cgiStartHTML() - Start a HTML page.
* cgiStartMultipart() - Start a multipart delivery of a web page...
* cgi_null_passwd() - Return a NULL password for authentication.
*/
/*
@@ -27,6 +29,14 @@
#include "cgi-private.h"
/*
* Local globals...
*/
static const char *cgi_multipart = NULL;
/* Multipart separator, if any */
/*
* Local functions...
*/
@@ -49,6 +59,18 @@ cgiEndHTML(void)
}
/*
* 'cgiEndMultipart()' - End the delivery of a multipart web page.
*/
void
cgiEndMultipart(void)
{
if (cgi_multipart)
printf("\n%s--\n", cgi_multipart);
}
/*
* 'cgiFormEncode()' - Encode a string as a form variable...
*/
@@ -144,6 +166,9 @@ cgiStartHTML(const char *title) /* I - Title of page */
* Tell the client to expect UTF-8 encoded HTML...
*/
if (cgi_multipart)
puts(cgi_multipart);
puts("Content-Type: text/html;charset=utf-8\n");
/*
@@ -157,6 +182,19 @@ cgiStartHTML(const char *title) /* I - Title of page */
}
/*
* 'cgiStartMultipart()' - Start a multipart delivery of a web page...
*/
void
cgiStartMultipart(void)
{
puts("MIME-Version: 1.0");
puts("Content-Type: multipart/x-mixed-replace; boundary=\"CUPS-MULTIPART\"\n");
cgi_multipart = "--CUPS-MULTIPART";
}
/*
* 'cgi_null_passwd()' - Return a NULL password for authentication.
*/
+153 -7
Ver Arquivo
@@ -14,10 +14,11 @@
*
* Contents:
*
* cgiGetAttributes() - Get the list of attributes that are needed
* by the template file.
* cgiGetAttributes() - Get the list of attributes that are needed by the
* template file.
* cgiGetIPPObjects() - Get the objects in an IPP response.
* cgiMoveJobs() - Move one or more jobs.
* cgiPrintCommand() - Print a CUPS command job.
* cgiPrintTestPage() - Print a test page.
* cgiRewriteURL() - Rewrite a printer URI into a web browser URL...
* cgiSetIPPObjectVars() - Set CGI variables from an IPP object.
@@ -113,7 +114,7 @@ cgiGetAttributes(ipp_t *request, /* I - IPP request */
*/
for (nameptr = name; (ch = getc(in)) != EOF;)
if (strchr("}]<>=! \t\n", ch))
if (strchr("}]<>=!~ \t\n", ch))
break;
else if (nameptr > name && ch == '?')
break;
@@ -509,6 +510,155 @@ cgiMoveJobs(http_t *http, /* I - Connection to server */
}
/*
* 'cgiPrintCommand()' - Print a CUPS command job.
*/
void
cgiPrintCommand(http_t *http, /* I - Connection to server */
const char *dest, /* I - Destination printer */
const char *command, /* I - Command to send */
const char *title) /* I - Page/job title */
{
int job_id; /* Command file job */
char uri[HTTP_MAX_URI], /* Job URI */
resource[1024], /* Printer resource path */
refresh[1024], /* Refresh URL */
command_file[1024]; /* Command "file" */
http_status_t status; /* Document status */
cups_option_t hold_option; /* job-hold-until option */
const char *user; /* User name */
ipp_t *request, /* Get-Job-Attributes request */
*response; /* Get-Job-Attributes response */
ipp_attribute_t *attr; /* Current job attribute */
static const char const *job_attrs[] =/* Job attributes we want */
{
"job-state",
"job-printer-state-message"
};
/*
* Create the CUPS command file...
*/
snprintf(command_file, sizeof(command_file), "#CUPS-COMMAND\n%s\n", command);
/*
* Show status...
*/
cgiStartMultipart();
cgiStartHTML(title);
cgiCopyTemplateLang("command.tmpl");
cgiEndHTML();
fflush(stdout);
/*
* Send the command file job...
*/
hold_option.name = "job-hold-until";
hold_option.value = "no-hold";
if ((user = getenv("REMOTE_USER")) != NULL)
cupsSetUser(user);
else
cupsSetUser("anonymous");
if ((job_id = cupsCreateJob(http, dest, title,
1, &hold_option)) < 1)
{
cgiSetVariable("MESSAGE", cgiText(_("Unable to send command to printer driver!")));
cgiSetVariable("ERROR", cupsLastErrorString());
cgiStartHTML(title);
cgiCopyTemplateLang("error.tmpl");
cgiEndHTML();
cgiEndMultipart();
return;
}
status = cupsStartDocument(http, dest, job_id, NULL, CUPS_FORMAT_COMMAND, 1);
if (status == HTTP_CONTINUE)
status = cupsWriteRequestData(http, command_file,
strlen(command_file));
if (status == HTTP_CONTINUE)
cupsFinishDocument(http, dest);
if (cupsLastError() >= IPP_REDIRECTION_OTHER_SITE)
{
cgiSetVariable("MESSAGE", cgiText(_("Unable to send command to printer driver!")));
cgiSetVariable("ERROR", cupsLastErrorString());
cgiStartHTML(title);
cgiCopyTemplateLang("error.tmpl");
cgiEndHTML();
cgiEndMultipart();
cupsCancelJob(dest, job_id);
return;
}
/*
* Wait for the job to complete...
*/
for (;;)
{
/*
* Get the current job state...
*/
snprintf(uri, sizeof(uri), "ipp://localhost/jobs/%d", job_id);
request = ippNewRequest(IPP_GET_JOB_ATTRIBUTES);
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "job-uri",
NULL, uri);
if (user)
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME,
"requesting-user-name", NULL, user);
ippAddStrings(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD,
"requested-attributes", 2, NULL, job_attrs);
if ((response = cupsDoRequest(http, request, "/")) != NULL)
cgiSetIPPVars(response, NULL, NULL, NULL, 0);
attr = ippFindAttribute(response, "job-state", IPP_TAG_ENUM);
if (!attr || attr->values[0].integer >= IPP_JOB_STOPPED)
{
ippDelete(response);
break;
}
/*
* Job not complete, so update the status...
*/
ippDelete(response);
cgiStartHTML(title);
cgiCopyTemplateLang("command.tmpl");
cgiEndHTML();
fflush(stdout);
sleep(5);
}
/*
* Send the final page that reloads the printer's page...
*/
snprintf(resource, sizeof(resource), "/printers/%s", dest);
cgiFormEncode(uri, resource, sizeof(uri));
snprintf(refresh, sizeof(refresh), "5;URL=%s", uri);
cgiSetVariable("refresh_page", refresh);
cgiStartHTML(title);
cgiCopyTemplateLang("command.tmpl");
cgiEndHTML();
cgiEndMultipart();
}
/*
* 'cgiPrintTestPage()' - Print a test page.
*/
@@ -561,7 +711,6 @@ cgiPrintTestPage(http_t *http, /* I - Connection to server */
* attributes-natural-language
* printer-uri
* requesting-user-name
* document-format
*/
request = ippNewRequest(IPP_PRINT_JOB);
@@ -576,9 +725,6 @@ cgiPrintTestPage(http_t *http, /* I - Connection to server */
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "job-name",
NULL, "Test Page");
ippAddString(request, IPP_TAG_JOB, IPP_TAG_MIMETYPE, "document-format",
NULL, "application/postscript");
/*
* Do the request and get back a response...
*/
+3
Ver Arquivo
@@ -4,6 +4,7 @@ _cgiCopyTemplateFile
_cgiCopyTemplateLang
_cgiDoSearch
_cgiEndHTML
_cgiEndMultipart
_cgiFormEncode
_cgiFreeSearch
_cgiGetArray
@@ -16,6 +17,7 @@ _cgiGetVariable
_cgiInitialize
_cgiIsPOST
_cgiMoveJobs
_cgiPrintCommand
_cgiPrintTestPage
_cgiRewriteURL
_cgiSetArray
@@ -27,6 +29,7 @@ _cgiSetVariable
_cgiShowIPPError
_cgiShowJobs
_cgiStartHTML
_cgiStartMultipart
_cgiText
_helpDeleteIndex
_helpFindNode
+89 -145
Ver Arquivo
@@ -14,10 +14,6 @@
*
* Contents:
*
* main() - Main entry for CGI.
* print_command() - Send a print command to the printer.
* show_all_printers() - Show all printers...
* show_printer() - Show a single printer.
*/
/*
@@ -32,9 +28,10 @@
* Local functions...
*/
void print_command(http_t *http, const char *printer, const char *command);
void show_all_printers(http_t *http, const char *username);
void show_printer(http_t *http, const char *printer);
static void do_printer_op(http_t *http, const char *printer, ipp_op_t op,
const char *title);
static void show_all_printers(http_t *http, const char *username);
static void show_printer(http_t *http, const char *printer);
/*
@@ -83,6 +80,9 @@ main(int argc, /* I - Number of command-line arguments */
if (!*printer)
printer = NULL;
if (printer)
cgiSetVariable("PRINTER_NAME", printer);
}
/*
@@ -141,25 +141,48 @@ main(int argc, /* I - Number of command-line arguments */
else
show_printer(http, printer);
}
else if (!strcasecmp(op, "print-self-test-page") && printer)
print_command(http, printer, "PrintSelfTestPage");
else if (!strcasecmp(op, "clean-print-heads") && printer)
print_command(http, printer, "Clean all");
else if (!strcasecmp(op, "print-test-page") && printer)
cgiPrintTestPage(http, printer);
else if (!strcasecmp(op, "move-jobs") && printer)
cgiMoveJobs(http, printer, 0);
else if (printer)
{
if (!strcmp(op, "start-printer"))
do_printer_op(http, printer, IPP_RESUME_PRINTER,
cgiText(_("Resume Printer")));
else if (!strcmp(op, "stop-printer"))
do_printer_op(http, printer, IPP_PAUSE_PRINTER,
cgiText(_("Pause Printer")));
else if (!strcmp(op, "accept-jobs"))
do_printer_op(http, printer, CUPS_ACCEPT_JOBS, cgiText(_("Accept Jobs")));
else if (!strcmp(op, "reject-jobs"))
do_printer_op(http, printer, CUPS_REJECT_JOBS, cgiText(_("Reject Jobs")));
else if (!strcmp(op, "purge-jobs"))
do_printer_op(http, printer, IPP_PURGE_JOBS, cgiText(_("Purge Jobs")));
else if (!strcasecmp(op, "print-self-test-page"))
cgiPrintCommand(http, printer, "PrintSelfTestPage",
cgiText(_("Print Self-Test Page")));
else if (!strcasecmp(op, "clean-print-heads"))
cgiPrintCommand(http, printer, "Clean all",
cgiText(_("Clean Print Heads")));
else if (!strcasecmp(op, "print-test-page"))
cgiPrintTestPage(http, printer);
else if (!strcasecmp(op, "move-jobs"))
cgiMoveJobs(http, printer, 0);
else
{
/*
* Unknown/bad operation...
*/
cgiStartHTML(printer);
cgiCopyTemplateLang("error-op.tmpl");
cgiEndHTML();
}
}
else
{
/*
* Unknown/bad operation...
*/
if (printer)
cgiStartHTML(printer);
else
cgiStartHTML(cgiText(_("Printers")));
cgiStartHTML(cgiText(_("Printers")));
cgiCopyTemplateLang("error-op.tmpl");
cgiEndHTML();
}
@@ -179,122 +202,80 @@ main(int argc, /* I - Number of command-line arguments */
/*
* 'print_command()' - Send a print command to the printer.
* 'do_printer_op()' - Do a printer operation.
*/
void
print_command(http_t *http, /* I - Connection to server */
const char *printer, /* I - Printer */
const char *command) /* I - Command to send */
static void
do_printer_op(http_t *http, /* I - HTTP connection */
const char *printer, /* I - Printer name */
ipp_op_t op, /* I - Operation to perform */
const char *title) /* I - Title of page */
{
cups_file_t *fp; /* File pointer */
char filename[1024]; /* Temporary file */
ipp_t *request, /* IPP request */
*response; /* IPP response */
ipp_t *request; /* IPP request */
char uri[HTTP_MAX_URI], /* Printer URI */
resource[1024], /* POST resource path */
refresh[1024]; /* Refresh URL */
const char *user; /* Username */
resource[HTTP_MAX_URI]; /* Path for request */
/*
* See who is logged in...
*/
if ((user = getenv("REMOTE_USER")) == NULL)
user = "guest";
/*
* Create the CUPS command file to print...
*/
if ((fp = cupsTempFile2(filename, sizeof(filename))) == NULL)
{
cgiStartHTML(cgiText(_("Printer Maintenance")));
cgiSetVariable("MESSAGE", _("Unable to create temporary file:"));
cgiSetVariable("ERROR", strerror(errno));
cgiCopyTemplateLang("error.tmpl");
cgiEndHTML();
return;
}
cupsFilePuts(fp, "#CUPS-COMMAND\n");
cupsFilePrintf(fp, "%s\n", command);
cupsFileClose(fp);
/*
* Point to the printer...
*/
snprintf(resource, sizeof(resource), "/printers/%s", printer);
httpAssembleURIf(HTTP_URI_CODING_ALL, uri, sizeof(uri), "ipp", NULL,
"localhost", ippPort(), "/printers/%s", printer);
/*
* Build an IPP_PRINT_JOB request, which requires the following
* Build a printer request, which requires the following
* attributes:
*
* attributes-charset
* attributes-natural-language
* printer-uri
* requesting-user-name
* document-format
*/
request = ippNewRequest(IPP_PRINT_JOB);
request = ippNewRequest(op);
httpAssembleURIf(HTTP_URI_CODING_ALL, uri, sizeof(uri), "ipp", NULL,
"localhost", 0, "/printers/%s", printer);
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri",
NULL, uri);
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME,
"requesting-user-name", NULL, user);
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "job-name",
NULL, "Printer Maintenance");
ippAddString(request, IPP_TAG_JOB, IPP_TAG_MIMETYPE, "document-format",
NULL, "application/postscript");
/*
* Do the request and get back a response...
*/
if ((response = cupsDoFileRequest(http, request, resource,
filename)) != NULL)
{
cgiSetIPPVars(response, NULL, NULL, NULL, 0);
snprintf(resource, sizeof(resource), "/printers/%s", printer);
ippDelete(cupsDoRequest(http, request, resource));
ippDelete(response);
}
unlink(filename);
if (cupsLastError() <= IPP_OK_CONFLICT)
{
/*
* Automatically reload the printer status page...
*/
cgiFormEncode(uri, resource, sizeof(uri));
snprintf(refresh, sizeof(refresh), "2;URL=%s", uri);
cgiSetVariable("refresh_page", refresh);
}
else if (cupsLastError() == IPP_NOT_AUTHORIZED)
if (cupsLastError() == IPP_NOT_AUTHORIZED)
{
puts("Status: 401\n");
exit(0);
}
cgiStartHTML(cgiText(_("Printer Maintenance")));
if (cupsLastError() > IPP_OK_CONFLICT)
cgiShowIPPError(_("Unable to send maintenance job:"));
else if (cupsLastError() > IPP_OK_CONFLICT)
{
cgiStartHTML(title);
cgiShowIPPError(_("Unable to do maintenance command:"));
}
else
{
cgiSetVariable("PRINTER_NAME", printer);
/*
* Redirect successful updates back to the printer page...
*/
cgiCopyTemplateLang("maintenance.tmpl");
char url[1024], /* Printer/class URL */
refresh[1024]; /* Refresh URL */
cgiRewriteURL(uri, url, sizeof(url), NULL);
cgiFormEncode(uri, url, sizeof(uri));
snprintf(refresh, sizeof(refresh), "5;URL=q%s", uri);
cgiSetVariable("refresh_page", refresh);
cgiStartHTML(title);
if (op == IPP_PAUSE_PRINTER)
cgiCopyTemplateLang("printer-stop.tmpl");
else if (op == IPP_RESUME_PRINTER)
cgiCopyTemplateLang("printer-start.tmpl");
else if (op == CUPS_ACCEPT_JOBS)
cgiCopyTemplateLang("printer-accept.tmpl");
else if (op == CUPS_REJECT_JOBS)
cgiCopyTemplateLang("printer-reject.tmpl");
else if (op == IPP_PURGE_JOBS)
cgiCopyTemplateLang("printer-purge.tmpl");
}
cgiEndHTML();
@@ -305,7 +286,7 @@ print_command(http_t *http, /* I - Connection to server */
* 'show_all_printers()' - Show all printers...
*/
void
static void
show_all_printers(http_t *http, /* I - Connection to server */
const char *user) /* I - Username */
{
@@ -408,42 +389,14 @@ show_all_printers(http_t *http, /* I - Connection to server */
for (i = 0, printer = (ipp_attribute_t *)cupsArrayIndex(printers, first);
i < CUPS_PAGE_MAX && printer;
i ++, printer = (ipp_attribute_t *)cupsArrayNext(printers))
{
cgiSetIPPObjectVars(printer, NULL, i);
cgiSetArray("cupscommand", i, "0");
for (attr = printer; attr; attr = attr->next)
if (attr->group_tag != IPP_TAG_PRINTER || !attr->name)
break;
else if (!strcmp(attr->name, "printer-type"))
{
if (attr->values[0].integer & CUPS_PRINTER_COMMANDS)
cgiSetArray("cupscommand", i, "1");
break;
}
}
}
else
{
for (i = 0, printer = (ipp_attribute_t *)cupsArrayIndex(printers, count - first - 1);
i < CUPS_PAGE_MAX && printer;
i ++, printer = (ipp_attribute_t *)cupsArrayPrev(printers))
{
cgiSetIPPObjectVars(printer, NULL, i);
cgiSetArray("cupscommand", i, "0");
for (attr = printer; attr; attr = attr->next)
if (attr->group_tag == IPP_TAG_ZERO || !attr->name)
break;
else if (!strcmp(attr->name, "printer-type"))
{
if (attr->values[0].integer & CUPS_PRINTER_COMMANDS)
cgiSetArray("cupscommand", i, "1");
break;
}
}
}
/*
@@ -504,7 +457,7 @@ show_all_printers(http_t *http, /* I - Connection to server */
* 'show_printer()' - Show a single printer.
*/
void
static void
show_printer(http_t *http, /* I - Connection to server */
const char *printer) /* I - Name of printer */
{
@@ -549,14 +502,6 @@ show_printer(http_t *http, /* I - Connection to server */
cgiSetIPPVars(response, NULL, NULL, NULL, 0);
if ((attr = ippFindAttribute(response, "printer-type",
IPP_TAG_ENUM)) != NULL)
{
cgiSetVariable("cupscommand",
(attr->values[0].integer & CUPS_PRINTER_COMMANDS) ?
"1" : "0");
}
if (printer && (attr = ippFindAttribute(response, "printer-state",
IPP_TAG_ENUM)) != NULL &&
attr->values[0].integer == IPP_PRINTER_PROCESSING)
@@ -587,7 +532,6 @@ show_printer(http_t *http, /* I - Connection to server */
* Show the printer status...
*/
cgiSetVariable("_SINGLE_DEST", "1");
cgiCopyTemplateLang("printer.tmpl");
/*
+1 -1
Ver Arquivo
@@ -925,7 +925,7 @@ cgi_initialize_string(const char *data) /* I - Form data string */
if (s > value)
s --;
while (s >= value && *s == ' ')
while (s >= value && isspace(*s & 255))
*s-- = '\0';
/*
+1 -1
Ver Arquivo
@@ -62,7 +62,7 @@ image/x-xbitmap application/vnd.cups-postscript 66 imagetops
image/x-xpixmap application/vnd.cups-postscript 66 imagetops
#image/x-xwindowdump application/vnd.cups-postscript 66 imagetops
image/x-sun-raster application/vnd.cups-postscript 66 imagetops
application/vnd.cups-banner application/vnd.cups-postscript 33 bannertops
application/vnd.cups-banner application/postscript 33 bannertops
########################################################################
#
+1 -1
Ver Arquivo
@@ -286,7 +286,7 @@ LEGACY_BACKENDS="parallel scsi"
case $uname in
Darwin*)
FONTS=""
# FONTS=""
LEGACY_BACKENDS=""
BACKLIBS="$BACKLIBS -framework IOKit"
CUPSDLIBS="$CUPSDLIBS -sectorder __TEXT __text cupsd.order -e start -framework IOKit -framework SystemConfiguration -weak_framework ApplicationServices"
+1 -2
Ver Arquivo
@@ -1794,8 +1794,7 @@ _cupsAdminSetServerSettings(
else if ((((in_admin_location || in_conf_location || in_root_location) &&
remote_admin >= 0) ||
(in_root_location && share_printers >= 0)) &&
(((!strcasecmp(line, "Allow") || !strcasecmp(line, "Deny")) &&
!strcasecmp(value, "@LOCAL")) ||
(!strcasecmp(line, "Allow") || !strcasecmp(line, "Deny") ||
!strcasecmp(line, "Order")))
continue;
else if (in_cancel_job == 2)
+61
Ver Arquivo
@@ -1253,6 +1253,67 @@ cupsFilePutChar(cups_file_t *fp, /* I - CUPS file */
}
/*
* 'cupsFilePutConf()' - Write a configuration line.
*
* This function handles any comment escaping of the value.
*
* @since CUPS 1.4@
*/
ssize_t /* O - Number of bytes written or -1 on error */
cupsFilePutConf(cups_file_t *fp, /* I - CUPS file */
const char *directive, /* I - Directive */
const char *value) /* I - Value */
{
ssize_t bytes, /* Number of bytes written */
temp; /* Temporary byte count */
const char *ptr; /* Pointer into value */
if (!fp || !directive || !*directive)
return (-1);
if ((bytes = cupsFilePuts(fp, directive)) < 0)
return (-1);
if (cupsFilePutChar(fp, ' ') < 0)
return (-1);
bytes ++;
if (value && *value)
{
if ((ptr = strchr(value, '#')) != NULL)
{
/*
* Need to quote the first # in the info string...
*/
if ((temp = cupsFileWrite(fp, value, ptr - value)) < 0)
return (-1);
bytes += temp;
if (cupsFilePutChar(fp, '\\') < 0)
return (-1);
bytes ++;
if ((temp = cupsFilePuts(fp, ptr)) < 0)
return (-1);
bytes += temp;
}
else if ((temp = cupsFilePuts(fp, value)) < 0)
return (-1);
else
bytes += temp;
}
if (cupsFilePutChar(fp, '\n') < 0)
return (-1);
else
return (bytes + 1);
}
/*
* 'cupsFilePuts()' - Write a string.
*
+3 -1
Ver Arquivo
@@ -8,7 +8,7 @@
* our own file functions allows us to provide transparent support of
* gzip'd print files, PPD files, etc.
*
* Copyright 2007 by Apple Inc.
* Copyright 2007-2008 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
@@ -87,6 +87,8 @@ __attribute__ ((__format__ (__printf__, 2, 3)))
#endif /* __GNUC__ */
_CUPS_API_1_2;
extern int cupsFilePutChar(cups_file_t *fp, int c) _CUPS_API_1_2;
extern ssize_t cupsFilePutConf(cups_file_t *fp, const char *directive,
const char *value) _CUPS_API_1_4;
extern int cupsFilePuts(cups_file_t *fp, const char *s) _CUPS_API_1_2;
extern ssize_t cupsFileRead(cups_file_t *fp, char *buf, size_t bytes) _CUPS_API_1_2;
extern off_t cupsFileRewind(cups_file_t *fp) _CUPS_API_1_2;
+1
Ver Arquivo
@@ -120,6 +120,7 @@ _cupsFileOpenFd
_cupsFilePeekChar
_cupsFilePrintf
_cupsFilePutChar
_cupsFilePutConf
_cupsFilePuts
_cupsFileRead
_cupsFileRewind
+4
Ver Arquivo
@@ -323,6 +323,10 @@ main(int argc, /* I - Number of command-line arguments */
httpAddrFreeList(addrlist);
}
else if (isdigit(hostname[0] & 255))
{
puts("FAIL (ignored because hostname is numeric)");
}
else
{
failures ++;
+13 -3
Ver Arquivo
@@ -3,7 +3,7 @@
*
* Internationalization test for Common UNIX Printing System (CUPS).
*
* Copyright 2007 by Apple Inc.
* Copyright 2007-2008 by Apple Inc.
* Copyright 1997-2006 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
@@ -537,11 +537,21 @@ static void
print_utf8(const char *msg, /* I - Message String */
const cups_utf8_t *src) /* I - UTF-8 Source String */
{
const char *prefix; /* Prefix string */
if (msg)
printf("%s:", msg);
for (; *src; src ++)
printf(" %02x", *src);
for (prefix = " "; *src; src ++)
{
printf("%s%02x", prefix, *src);
if ((src[0] & 0x80) && (src[1] & 0x80))
prefix = "";
else
prefix = " ";
}
putchar('\n');
}
+2 -2
Ver Arquivo
@@ -953,7 +953,7 @@ conv_utf8_to_sbcs(
* Convert internal UCS-4 to SBCS legacy charset (and delete BOM)...
*/
for (workptr = work + 1, start = dest; *workptr && maxout > 1; maxout --)
for (workptr = work, start = dest; *workptr && maxout > 0; maxout --)
{
unichar = *workptr++;
if (!unichar)
@@ -1041,7 +1041,7 @@ conv_utf8_to_vbcs(
* Convert internal UCS-4 to VBCS legacy charset (and delete BOM)...
*/
for (start = dest, workptr = work + 1; *workptr && maxout > 1; maxout --)
for (start = dest, workptr = work; *workptr && maxout > 0; maxout --)
{
unichar = *workptr++;
+7 -4
Ver Arquivo
@@ -1577,7 +1577,8 @@ _cupsConnect(void)
/*
* 'cups_get_printer_uri()' - Get the printer-uri-supported attribute for the first printer in a class.
* 'cups_get_printer_uri()' - Get the printer-uri-supported attribute for the
* first printer in a class.
*/
static int /* O - 1 on success, 0 on failure */
@@ -1605,9 +1606,9 @@ cups_get_printer_uri(
/* Hostname associated with connection */
static const char * const requested_attrs[] =
{ /* Requested attributes */
"member-uris",
"printer-uri-supported",
"printer-type",
"member-uris"
"printer-type"
};
@@ -1742,7 +1743,9 @@ cups_get_printer_uri(
else if ((attr = ippFindAttribute(response, "printer-uri-supported",
IPP_TAG_URI)) != NULL)
{
httpSeparateURI(HTTP_URI_CODING_ALL, attr->values[0].string.text,
httpSeparateURI(HTTP_URI_CODING_ALL,
_httpResolveURI(attr->values[0].string.text, uri,
sizeof(uri), 0),
scheme, sizeof(scheme), username, sizeof(username),
host, hostsize, port, resource, resourcesize);
ippDelete(response);
-251
Ver Arquivo
@@ -1,251 +0,0 @@
charset 8bit
#
# This file defines the font and character mappings used for ISO-8859-10
# (Latin6/Nordic) text printing.
#
# The first line consists of:
#
# direction width normal bold italic bold-italic
#
# Direction is the string "ltor" or "rtol", indicating left-to-right or
# right-to-left text.
#
# Width is the string "single" or "double"; double means that the glyphs
# are twice as wide as ASCII characters in the Courier typeface.
#
# "Normal", "bold", "italic", and "bold-italic" are the typefaces to use
# for each presentation. If characters are only available in a single
# style then only one typeface should be listed (e.g. "Symbol")
#
# Each font that is listed will be used (and downloaded if needed) when
# printing.
#
00 ff ltor single Courier Courier-Bold Courier-Italic Courier-BoldItalic
#
# The following lines define the mapping from the 8-bit character set to
# the Unicode glyphs for each character:
#
# char glyph
#
# "Char" and "glyph" are hexadecimal values.
#
20 0020
21 0021
22 0022
23 0023
24 0024
25 0025
26 0026
27 0027
28 0028
29 0029
2A 002A
2B 002B
2C 002C
2D 002D
2E 002E
2F 002F
30 0030
31 0031
32 0032
33 0033
34 0034
35 0035
36 0036
37 0037
38 0038
39 0039
3A 003A
3B 003B
3C 003C
3D 003D
3E 003E
3F 003F
40 0040
41 0041
42 0042
43 0043
44 0044
45 0045
46 0046
47 0047
48 0048
49 0049
4A 004A
4B 004B
4C 004C
4D 004D
4E 004E
4F 004F
50 0050
51 0051
52 0052
53 0053
54 0054
55 0055
56 0056
57 0057
58 0058
59 0059
5A 005A
5B 005B
5C 005C
5D 005D
5E 005E
5F 005F
60 0060
61 0061
62 0062
63 0063
64 0064
65 0065
66 0066
67 0067
68 0068
69 0069
6A 006A
6B 006B
6C 006C
6D 006D
6E 006E
6F 006F
70 0070
71 0071
72 0072
73 0073
74 0074
75 0075
76 0076
77 0077
78 0078
79 0079
7A 007A
7B 007B
7C 007C
7D 007D
7E 007E
80 20AC
82 201A
83 0192
84 201E
85 2026
86 2020
87 2021
88 02C6
89 2030
8A 0160
8B 2039
8C 0152
91 2018
92 2019
93 201C
94 201D
95 2022
96 2013
97 2014
98 02DC
99 2122
9A 0161
9B 203A
9C 0153
9F 0178
A0 00A0
A1 0104
A2 0112
A3 0122
A4 012A
A5 0128
A6 0136
A7 00A7
A8 013B
A9 0110
AA 0160
AB 0166
AC 017D
AD 00AD
AE 016A
AF 014A
B0 00B0
B1 0105
B2 0113
B3 0123
B4 012B
B5 0129
B6 0137
B7 00B7
B8 013C
B9 0111
BA 0161
BB 0167
BC 017E
BD 2015
BE 016B
BF 014B
C0 0100
C1 00C1
C2 00C2
C3 00C3
C4 00C4
C5 00C5
C6 00C6
C7 012E
C8 010C
C9 00C9
CA 0118
CB 00CB
CC 0116
CD 00CD
CE 00CE
CF 00CF
D0 0110
D1 0145
D2 014C
D3 00D3
D4 00D4
D5 00D5
D6 00D6
D7 0168
D8 00D8
D9 0172
DA 00DA
DB 00DB
DC 00DC
DD 00DD
DE 00DE
DF 00DF
E0 0101
E1 00E1
E2 00E2
E3 00E3
E4 00E4
E5 00E5
E6 00E6
E7 012F
E8 010D
E9 00E9
EA 0119
EB 00EB
EC 0117
ED 00ED
EE 00EE
EF 00EF
F0 00F0
F1 0146
F2 014D
F3 00F3
F4 00F4
F5 00F5
F6 00F6
F7 0169
F8 00F8
F9 0173
FA 00FA
FB 00FB
FC 00FC
FD 00FD
FE 00FD
FF 0138
-251
Ver Arquivo
@@ -1,251 +0,0 @@
charset 8bit
#
# This file defines the font and character mappings used for ISO-8859-13
# (Latin7/Baltic Rim) text printing.
#
# The first line consists of:
#
# direction width normal bold italic bold-italic
#
# Direction is the string "ltor" or "rtol", indicating left-to-right or
# right-to-left text.
#
# Width is the string "single" or "double"; double means that the glyphs
# are twice as wide as ASCII characters in the Courier typeface.
#
# "Normal", "bold", "italic", and "bold-italic" are the typefaces to use
# for each presentation. If characters are only available in a single
# style then only one typeface should be listed (e.g. "Symbol")
#
# Each font that is listed will be used (and downloaded if needed) when
# printing.
#
00 ff ltor single Courier Courier-Bold Courier-Italic Courier-BoldItalic
#
# The following lines define the mapping from the 8-bit character set to
# the Unicode glyphs for each character:
#
# char glyph
#
# "Char" and "glyph" are hexadecimal values.
#
20 0020
21 0021
22 0022
23 0023
24 0024
25 0025
26 0026
27 0027
28 0028
29 0029
2A 002A
2B 002B
2C 002C
2D 002D
2E 002E
2F 002F
30 0030
31 0031
32 0032
33 0033
34 0034
35 0035
36 0036
37 0037
38 0038
39 0039
3A 003A
3B 003B
3C 003C
3D 003D
3E 003E
3F 003F
40 0040
41 0041
42 0042
43 0043
44 0044
45 0045
46 0046
47 0047
48 0048
49 0049
4A 004A
4B 004B
4C 004C
4D 004D
4E 004E
4F 004F
50 0050
51 0051
52 0052
53 0053
54 0054
55 0055
56 0056
57 0057
58 0058
59 0059
5A 005A
5B 005B
5C 005C
5D 005D
5E 005E
5F 005F
60 0060
61 0061
62 0062
63 0063
64 0064
65 0065
66 0066
67 0067
68 0068
69 0069
6A 006A
6B 006B
6C 006C
6D 006D
6E 006E
6F 006F
70 0070
71 0071
72 0072
73 0073
74 0074
75 0075
76 0076
77 0077
78 0078
79 0079
7A 007A
7B 007B
7C 007C
7D 007D
7E 007E
80 20AC
82 201A
83 0192
84 201E
85 2026
86 2020
87 2021
88 02C6
89 2030
8A 0160
8B 2039
8C 0152
91 2018
92 2019
93 201C
94 201D
95 2022
96 2013
97 2014
98 02DC
99 2122
9A 0161
9B 203A
9C 0153
9F 0178
A0 00A0
A1 201D
A2 00A2
A3 00A3
A4 00A4
A5 201E
A6 00A6
A7 00A7
A8 00D8
A9 00A9
AA 0156
AB 00AB
AC 00AC
AD 00AD
AE 00AE
AF 00C6
B0 00B0
B1 00B1
B2 00B2
B3 00B3
B4 201C
B5 00B5
B6 00B6
B7 00B7
B8 00F8
B9 00B9
BA 0157
BB 00BB
BC 00BC
BD 00BD
BE 00BE
BF 00E6
C0 0104
C1 012E
C2 0100
C3 0106
C4 00C4
C5 00C5
C6 0118
C7 0112
C8 010C
C9 00C9
CA 0179
CB 0116
CC 0122
CD 0136
CE 012A
CF 013B
D0 0160
D1 0143
D2 0145
D3 00D3
D4 014C
D5 00D5
D6 00D6
D7 00D7
D8 0172
D9 0141
DA 015A
DB 016A
DC 00DC
DD 017B
DE 017D
DF 00DF
E0 0105
E1 012F
E2 0101
E3 0107
E4 00E4
E5 00E5
E6 0119
E7 0113
E8 010D
E9 00E9
EA 017A
EB 0117
EC 0123
ED 0137
EE 012B
EF 013C
F0 0161
F1 0144
F2 0146
F3 00F3
F4 014D
F5 00F5
F6 00F6
F7 00F7
F8 0173
F9 0142
FA 015B
FB 016B
FC 00FC
FD 017C
FE 017E
FF 2019
-251
Ver Arquivo
@@ -1,251 +0,0 @@
charset 8bit
#
# This file defines the font and character mappings used for ISO-8859-14
# (Latin8/Celtic) text printing.
#
# The first line consists of:
#
# direction width normal bold italic bold-italic
#
# Direction is the string "ltor" or "rtol", indicating left-to-right or
# right-to-left text.
#
# Width is the string "single" or "double"; double means that the glyphs
# are twice as wide as ASCII characters in the Courier typeface.
#
# "Normal", "bold", "italic", and "bold-italic" are the typefaces to use
# for each presentation. If characters are only available in a single
# style then only one typeface should be listed (e.g. "Symbol")
#
# Each font that is listed will be used (and downloaded if needed) when
# printing.
#
00 ff ltor single Courier Courier-Bold Courier-Italic Courier-BoldItalic
#
# The following lines define the mapping from the 8-bit character set to
# the Unicode glyphs for each character:
#
# char glyph
#
# "Char" and "glyph" are hexadecimal values.
#
20 0020
21 0021
22 0022
23 0023
24 0024
25 0025
26 0026
27 0027
28 0028
29 0029
2A 002A
2B 002B
2C 002C
2D 002D
2E 002E
2F 002F
30 0030
31 0031
32 0032
33 0033
34 0034
35 0035
36 0036
37 0037
38 0038
39 0039
3A 003A
3B 003B
3C 003C
3D 003D
3E 003E
3F 003F
40 0040
41 0041
42 0042
43 0043
44 0044
45 0045
46 0046
47 0047
48 0048
49 0049
4A 004A
4B 004B
4C 004C
4D 004D
4E 004E
4F 004F
50 0050
51 0051
52 0052
53 0053
54 0054
55 0055
56 0056
57 0057
58 0058
59 0059
5A 005A
5B 005B
5C 005C
5D 005D
5E 005E
5F 005F
60 0060
61 0061
62 0062
63 0063
64 0064
65 0065
66 0066
67 0067
68 0068
69 0069
6A 006A
6B 006B
6C 006C
6D 006D
6E 006E
6F 006F
70 0070
71 0071
72 0072
73 0073
74 0074
75 0075
76 0076
77 0077
78 0078
79 0079
7A 007A
7B 007B
7C 007C
7D 007D
7E 007E
80 20AC
82 201A
83 0192
84 201E
85 2026
86 2020
87 2021
88 02C6
89 2030
8A 0160
8B 2039
8C 0152
91 2018
92 2019
93 201C
94 201D
95 2022
96 2013
97 2014
98 02DC
99 2122
9A 0161
9B 203A
9C 0153
9F 0178
A0 00A0
A1 1E02
A2 1E03
A3 00A3
A4 010A
A5 010B
A6 1E0A
A7 00A7
A8 1E80
A9 00A9
AA 1E82
AB 1E0B
AC 1EF2
AD 00AD
AE 00AE
AF 0178
B0 1E1E
B1 1E1F
B2 0120
B3 0121
B4 1E40
B5 1E41
B6 00B6
B7 1E56
B8 1E81
B9 1E57
BA 1E83
BB 1E60
BC 1EF3
BD 1E84
BE 1E85
BF 1E61
C0 00C0
C1 00C1
C2 00C2
C3 00C3
C4 00C4
C5 00C5
C6 00C6
C7 00C7
C8 00C8
C9 00C9
CA 00CA
CB 00CB
CC 00CC
CD 00CD
CE 00CE
CF 00CF
D0 0174
D1 00D1
D2 00D2
D3 00D3
D4 00D4
D5 00D5
D6 00D6
D7 1E6A
D8 00D8
D9 00D9
DA 00DA
DB 00DB
DC 00DC
DD 00DD
DE 0176
DF 00DF
E0 00E0
E1 00E1
E2 00E2
E3 00E3
E4 00E4
E5 00E5
E6 00E6
E7 00E7
E8 00E8
E9 00E9
EA 00EA
EB 00EB
EC 00EC
ED 00ED
EE 00EE
EF 00EF
F0 0175
F1 00F1
F2 00F2
F3 00F3
F4 00F4
F5 00F5
F6 00F6
F7 1E6B
F8 00F8
F9 00F9
FA 00FA
FB 00FB
FC 00FC
FD 00FD
FE 0177
FF 00FF
-251
Ver Arquivo
@@ -1,251 +0,0 @@
charset 8bit
#
# This file defines the font and character mappings used for ISO-8859-15
# (Latin9/West Europe + Euro) text printing.
#
# The first line consists of:
#
# direction width normal bold italic bold-italic
#
# Direction is the string "ltor" or "rtol", indicating left-to-right or
# right-to-left text.
#
# Width is the string "single" or "double"; double means that the glyphs
# are twice as wide as ASCII characters in the Courier typeface.
#
# "Normal", "bold", "italic", and "bold-italic" are the typefaces to use
# for each presentation. If characters are only available in a single
# style then only one typeface should be listed (e.g. "Symbol")
#
# Each font that is listed will be used (and downloaded if needed) when
# printing.
#
00 ff ltor single Courier Courier-Bold Courier-Italic Courier-BoldItalic
#
# The following lines define the mapping from the 8-bit character set to
# the Unicode glyphs for each character:
#
# char glyph
#
# "Char" and "glyph" are hexadecimal values.
#
20 0020
21 0021
22 0022
23 0023
24 0024
25 0025
26 0026
27 0027
28 0028
29 0029
2A 002A
2B 002B
2C 002C
2D 002D
2E 002E
2F 002F
30 0030
31 0031
32 0032
33 0033
34 0034
35 0035
36 0036
37 0037
38 0038
39 0039
3A 003A
3B 003B
3C 003C
3D 003D
3E 003E
3F 003F
40 0040
41 0041
42 0042
43 0043
44 0044
45 0045
46 0046
47 0047
48 0048
49 0049
4A 004A
4B 004B
4C 004C
4D 004D
4E 004E
4F 004F
50 0050
51 0051
52 0052
53 0053
54 0054
55 0055
56 0056
57 0057
58 0058
59 0059
5A 005A
5B 005B
5C 005C
5D 005D
5E 005E
5F 005F
60 0060
61 0061
62 0062
63 0063
64 0064
65 0065
66 0066
67 0067
68 0068
69 0069
6A 006A
6B 006B
6C 006C
6D 006D
6E 006E
6F 006F
70 0070
71 0071
72 0072
73 0073
74 0074
75 0075
76 0076
77 0077
78 0078
79 0079
7A 007A
7B 007B
7C 007C
7D 007D
7E 007E
80 20AC
82 201A
83 0192
84 201E
85 2026
86 2020
87 2021
88 02C6
89 2030
8A 0160
8B 2039
8C 0152
91 2018
92 2019
93 201C
94 201D
95 2022
96 2013
97 2014
98 02DC
99 2122
9A 0161
9B 203A
9C 0153
9F 0178
A0 00A0
A1 00A1
A2 00A2
A3 00A3
A4 20AC
A5 00A5
A6 0160
A7 00A7
A8 0161
A9 00A9
AA 00AA
AB 00AB
AC 00AC
AD 00AD
AE 00AE
AF 00AF
B0 00B0
B1 00B1
B2 00B2
B3 00B3
B4 017D
B5 00B5
B6 00B6
B7 00B7
B8 017E
B9 00B9
BA 00BA
BB 00BB
BC 0152
BD 0153
BE 0178
BF 00BF
C0 00C0
C1 00C1
C2 00C2
C3 00C3
C4 00C4
C5 00C5
C6 00C6
C7 00C7
C8 00C8
C9 00C9
CA 00CA
CB 00CB
CC 00CC
CD 00CD
CE 00CE
CF 00CF
D0 00D0
D1 00D1
D2 00D2
D3 00D3
D4 00D4
D5 00D5
D6 00D6
D7 00D7
D8 00D8
D9 00D9
DA 00DA
DB 00DB
DC 00DC
DD 00DD
DE 00DE
DF 00DF
E0 00E0
E1 00E1
E2 00E2
E3 00E3
E4 00E4
E5 00E5
E6 00E6
E7 00E7
E8 00E8
E9 00E9
EA 00EA
EB 00EB
EC 00EC
ED 00ED
EE 00EE
EF 00EF
F0 00F0
F1 00F1
F2 00F2
F3 00F3
F4 00F4
F5 00F5
F6 00F6
F7 00F7
F8 00F8
F9 00F9
FA 00FA
FB 00FB
FC 00FC
FD 00FD
FE 00FE
FF 00FF
+1 -6
Ver Arquivo
@@ -36,12 +36,7 @@ WEBIMAGES = \
images/sel.gif \
images/smiley.jpg \
images/unsel.gif \
images/web-add-this-printer.gif \
images/web-password.gif \
images/web-printer-driver.gif \
images/web-printer-status.gif \
images/web-set-printer-options.gif \
images/web-test-page.gif
images/wait.gif
HELPFILES = \
help/accounting.html \
help/api-array.html \
+28 -1
Ver Arquivo
@@ -260,19 +260,34 @@ TABLE.list {
}
TABLE.list TH {
border-bottom: solid 1pt #999999;
background: white;
border-bottom: solid thin #cccccc;
color: #444444;
padding-top: 10pt;
padding-left: 5pt;
text-align: left;
vertical-align: bottom;
white-space: nowrap;
}
TABLE.list TH A {
color: #4444cc;
}
TABLE.list TD {
border-bottom: solid thin #eeeeee;
padding-top: 5pt;
padding-left: 5pt;
}
TABLE.list TR:nth-child(even) {
background: #f8f8f8;
}
TABLE.list TR:nth-child(odd) {
background: #f4f4f4;
}
DIV.sidebar {
float: right;
min-width: 25%;
@@ -368,6 +383,18 @@ DIV.summary TABLE THEAD TH {
background: #f0f0f0;
}
DIV.tabs {
height: 480px;
overflow: hidden;
}
DIV.tab {
float: left;
height: 100%;
overflow-y: auto;
width: 100%;
}
/* API documentation styles... */
div.body h1 {
margin: 0;
+44 -85
Ver Arquivo
@@ -5,104 +5,63 @@
</HEAD>
<BODY>
<P>The Common UNIX Printing System<sup>TM</sup>, or CUPS, is the
software you use to print from applications like the web browser
you are using to read this page. It converts the <em>page
descriptions</em> produced by your application (put a paragraph
here, draw a line there, and so forth) into something your
printer can understand and then sends the information to the
printer for printing.</P>
<P>The Common UNIX Printing System<sup>TM</sup>, or CUPS, is the software you
use to print from applications like the web browser you are using to read this
page. It converts the <em>page descriptions</em> produced by your application
(put a paragraph here, draw a line there, and so forth) into something your
printer can understand and then sends the information to the printer for
printing.</P>
<P>Now, since every printer manufacturer does things differently,
printing can be very complicated. CUPS does its best to hide this
from you and your application so that you can concentrate on
printing and less on <em>how</em> to print. Generally, the only
time you need to know anything about your printer is when you use
it for the first time, and even then CUPS can often figure things
<P>Now, since every printer manufacturer does things differently, printing can
be very complicated. CUPS does its best to hide this from you and your
application so that you can concentrate on printing and less on <em>how</em> to
print. Generally, the only time you need to know anything about your printer is
when you use it for the first time, and even then CUPS can often figure things
out on its own.</P>
<H2 CLASS="title"><A NAME="WORK">How Does It Work?</A></H2>
<P>The first time you print to a printer, CUPS creates a
<em>queue</em> to keep track of the current status of the printer
(everything OK, out of paper, etc.) and any pages you have
printed. Most of the time the queue points to a printer connected
directly to your computer via a USB or parallel port, however it
can also point to a printer on your network, a printer on the
Internet, or multiple printers depending on the configuration.
Regardless of <em>where</em> the queue points, it will look like
any other printer to you and your applications.</P>
<P>The first time you print to a printer, CUPS creates a <em>queue</em> to keep
track of the current status of the printer (everything OK, out of paper, etc.)
and any pages you have printed. Most of the time the queue points to a printer
connected directly to your computer via a USB or parallel port, however it can
also point to a printer on your network, a printer on the Internet, or multiple
printers depending on the configuration. Regardless of <em>where</em> the queue
points, it will look like any other printer to you and your applications.</P>
<P>Every time you print something, CUPS creates a <em>job</em>
which contains the queue you are sending the print to, the name
of the document you are printing, and the page descriptions. Job
are numbered (queue-1, queue-2, and so forth) so you can monitor
the job as it is printed or cancel it if you see a mistake. When
CUPS gets a job for printing, it determines the best programs
(<em>filters</em>, <em>printer drivers</em>, <em>port
monitors</em>, and <em>backends</em>) to convert the pages into a
printable format and then runs them to actually print the
job.</P>
<P>Every time you print something, CUPS creates a <em>job</em> which contains
the queue you are sending the print to, the name of the document you are
printing, and the page descriptions. Job are numbered (queue-1, queue-2, and so
forth) so you can monitor the job as it is printed or cancel it if you see a
mistake. When CUPS gets a job for printing, it determines the best programs
(<em>filters</em>, <em>printer drivers</em>, <em>port monitors</em>, and
<em>backends</em>) to convert the pages into a printable format and then runs
them to actually print the job.</P>
<P>When the print job is completely printed, CUPS removes the job
from the queue and moves on to any other jobs you have submitted.
You can also be notified when the job is finished, or if there
are any errors during printing, in several different ways.</P>
<P>When the print job is completely printed, CUPS removes the job from the queue
and moves on to any other jobs you have submitted. You can also be notified when
the job is finished, or if there are any errors during printing, in several
different ways.</P>
<H2 CLASS="title"><A NAME="BEGIN">Where Do I Begin?</A></H2>
<P>Click on the <A HREF="/admin">Administration</A> tab at the
top of this page. If you have a printer connected to a USB or
parallel port, you will see it listed as a new printer - click on
the <VAR>Add This Printer</VAR> button, verify the printer driver
CUPS has chosen for you, and click on the <VAR>Add Printer</VAR>
button. If you do not see your printer listed, or if you have a
network printer, click on the <VAR>Add Printer</VAR> button and
follow the prompts.</P>
<P>Click on the <A HREF="/admin">Administration</A> tab at the top of this page.
Click on the <VAR>Add Printer</VAR> button and follow the prompts.</P>
<BLOCKQUOTE>If you are asked for a username and password, enter
your login username and password or the "root" username and
password. On MacOS X, the login username (or "short name") is
typically your first name in lowercase.</BLOCKQUOTE>
<BLOCKQUOTE>When you are asked for a username and password, enter your login
username and password or the "root" username and password. On MacOS X, the login
username (or "short name") is typically your first and last name in
lowercase.</BLOCKQUOTE>
<P>After the printer is added, CUPS will ask you to set the
default printer options (paper size, output mode, etc.) for the
printer. Make any changes as needed and then click on the
<VAR>Set Printer Options</VAR> button to save them.</P>
<P>After the printer is added, CUPS will ask you to set the default printer
options (paper size, output mode, etc.) for the printer. Make any changes as
needed and then click on the <VAR>Set Default Options</VAR> button to save
them. Some printers also support auto-configuration - click on the <VAR>Query
Printer for Default Options</VAR> button to update the options automaticaly.</P>
<P>Finally, click on the <VAR>Print Test Page</VAR> button to
print a simple test page and verify that everything is working
properly.</P>
<P>Once you have added the printer, you can print to it from any
application.</P>
<TABLE ALIGN="CENTER" CELLPADDING="10" SUMMARY="Screenshots">
<TR VALIGN="TOP">
<TD ALIGN="CENTER"><IMG SRC="../images/web-add-this-printer.gif"
WIDTH="366" HEIGHT="300" ALT="CUPS Administration Web Page"><BR>
<I>Figure 1: The CUPS Administration Web Page</I></TD>
<TD ALIGN="CENTER"><IMG SRC="../images/web-printer-driver.gif"
WIDTH="366" HEIGHT="300" ALT="CUPS Driver Selection Web Page"><BR>
<I>Figure 2: The CUPS Driver Selection Web Page</I></TD>
</TR>
<TR VALIGN="TOP">
<TD ALIGN="CENTER"><IMG SRC="../images/web-password.gif"
WIDTH="366" HEIGHT="300" ALT="CUPS Password Dialog"><BR>
<I>Figure 3: The CUPS Password Dialog</I></TD>
<TD ALIGN="CENTER"><IMG SRC="../images/web-set-printer-options.gif"
WIDTH="366" HEIGHT="300" ALT="CUPS Set Printer Options Web Page"><BR>
<I>Figure 4: The CUPS Set Printer Options Web Page</I></TD>
</TR>
<TR VALIGN="TOP">
<TD ALIGN="CENTER"><IMG SRC="../images/web-printer-status.gif"
WIDTH="366" HEIGHT="300" ALT="CUPS Printer Status Page"><BR>
<I>Figure 5: The CUPS Printer Status Page</I></TD>
<TD ALIGN="CENTER"><IMG SRC="../images/web-test-page.gif"
WIDTH="234" HEIGHT="300" ALT="CUPS Printer Test Page"><BR>
<I>Figure 6: The CUPS Printer Test Page</I></TD>
</TR>
</TABLE>
<P>Once you have added the printer, you can print to it from any application.
You can also choose <VAR>Print Test Page</VAR> from the maintenance menu to print
a simple test page and verify that everything is working properly.</P>
</BODY>
</HTML>
+67 -4
Ver Arquivo
@@ -37,12 +37,12 @@ active.</P>
<P>The <CODE>Accepting</CODE> directive defines the initial state
of the <VAR>printer-is-accepting-jobs</VAR> attribute. This state
is also set by the <CODE>accept(8)</CODE> and
<CODE>reject(8)</CODE> commands:</P>
is also set by the <CODE>cupsaccept(8)</CODE> and
<CODE>cupsreject(8)</CODE> commands:</P>
<PRE CLASS="command">
<KBD>/usr/sbin/accept printername
/usr/sbin/reject printername</KBD>
<KBD>/usr/sbin/cupsaccept printername
/usr/sbin/cupsreject printername</KBD>
</PRE>
<P>This directive must appear inside a <A
@@ -211,6 +211,27 @@ HREF="#DefaultPrinter"><CODE>DefaultPrinter</CODE></A>
section.</P>
<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.4</SPAN><A NAME="Filter">Filter</A></H2>
<H3>Examples</H3>
<PRE CLASS="command">
&lt;Printer name&gt;
...
Filter mime/type 100 program
&lt;/Printer&gt;
</PRE>
<H3>Description</H3>
<P>The <CODE>Filter</CODE> directive lists a single filter program as defined
in the printer's PPD file.</P>
<P>This directive must appear inside a
<A HREF="#Printer"><CODE>Printer</CODE></A> or
<A HREF="#DefaultPrinter"><CODE>DefaultPrinter</CODE></A> section.</P>
<H2 CLASS="title"><A NAME="Info">Info</A></H2>
<H3>Examples</H3>
@@ -482,6 +503,27 @@ HREF="#DefaultPrinter"><CODE>DefaultPrinter</CODE></A>
section.</P>
<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.4</SPAN><A NAME="PreFilter">PreFilter</A></H2>
<H3>Examples</H3>
<PRE CLASS="command">
&lt;Printer name&gt;
...
PreFilter mime/type 100 program
&lt;/Printer&gt;
</PRE>
<H3>Description</H3>
<P>The <CODE>PreFilter</CODE> directive lists a single pre-filter program as
defined in the printer's PPD file.</P>
<P>This directive must appear inside a
<A HREF="#Printer"><CODE>Printer</CODE></A> or
<A HREF="#DefaultPrinter"><CODE>DefaultPrinter</CODE></A> section.</P>
<H2 CLASS="title"><A NAME="Printer">Printer</A></H2>
<H3>Examples</H3>
@@ -503,6 +545,27 @@ command:
</PRE>
<H2 CLASS="title"><SPAN CLASS="info">CUPS 1.4</SPAN><A NAME="Product">Product</A></H2>
<H3>Examples</H3>
<PRE CLASS="command">
&lt;Printer name&gt;
...
Product Acme PaperWriter
&lt;/Printer&gt;
</PRE>
<H3>Description</H3>
<P>The <CODE>Product</CODE> directive defines the main product string from the
printer's PPD file and is used when advertising the queue via DNS-SD.</P>
<P>This directive must appear inside a
<A HREF="#Printer"><CODE>Printer</CODE></A> or
<A HREF="#DefaultPrinter"><CODE>DefaultPrinter</CODE></A> section.</P>
<H2 CLASS="title"><A NAME="QuotaPeriod">QuotaPeriod</A></H2>
<H3>Examples</H3>
+1 -1
Ver Arquivo
@@ -2130,7 +2130,7 @@ release.</p>
</blockquote>
<h4><a name="columns">columns (integer(1:4))</a></h4>
<h4><a name="columns">columns (integer(1:4))</a> <span class='info'>Deprecated</span></h4>
<p>The columns attribute specifies the number of columns to generate when
printing text files. The default value is 1.
+18
Ver Arquivo
@@ -1527,6 +1527,21 @@ before the filter that accepts the given MIME type.</p>
*cupsPreFilter: "image/png 0 mypngprefilter"
</pre>
<h3><span class='info'>CUPS 1.4</span><a name='cupsSNMPSupplies'>cupsSNMPSupplies</a></h3>
<p class='summary'>*cupsSNMPSupplies: boolean</p>
<p>This attribute tells the standard network backends whether they should query
the standard SNMP Printer MIB OIDs for supply levels. The default value is
<code>True</code>.
<p>Example:</p>
<pre class='command'>
<em>*% Do not use SNMP queries to report supply levels</em>
*cupsSNMPSupplies: False
</pre>
<h3><a name='cupsVersion'>cupsVersion</a></h3>
<p class='summary'>*cupsVersion: major.minor</p>
@@ -1831,6 +1846,9 @@ the device.</p>
<li>Added <a href='#cupsPJLDisplay'><tt>cupsPJLDisplay</tt></a>
attribute.</li>
<li>Added <a href='#cupsSNMPSupplies'><tt>cupsSNMPSupplies</tt></a>
attribute.</li>
<li>Added <a href='#cupsUIResolver'><tt>cupsUIResolver</tt></a> and
<a href='#cupsUIConstraints'><tt>cupsUIConstraints</tt></a>
attributes.</li>
+83 -100
Ver Arquivo
@@ -5,205 +5,188 @@
</HEAD>
<BODY>
<P>CUPS 1.4 adds over ?? changes and new features to CUPS 1.3.x. This page provides a high-level outline of these changes. If you have never used CUPS before, read the <A HREF="overview.html">"Overview of CUPS"</A> document instead.</P>
<P>CUPS 1.4 adds over 64 changes and new features to CUPS 1.3.x. This page provides a high-level outline of these changes. If you have never used CUPS before, read the <A HREF="overview.html">"Overview of CUPS"</A> document instead.</P>
<H2 CLASS="title"><A NAME="COMMANDS">Commands</A></H2>
<OL START="1">
<LI><EM>accept and reject;</EM> the accept and reject commands have been officially renamed to cupsaccess and cupsreject. The old names are still supported via symlinks.</LI>
<LI><EM>cupsfilter;</EM> the cupsfilter program now supports filtering of already-queued print job files and can also run printer-specific filters specified in the PPD file.</LI>
<LI><EM>cupstestdsc;</EM> the cupstestdsc utility has been improved to better detect problems with PostScript print files.</LI>
<LI><EM>cupstestppd;</EM> the cupstestppd utility has been improved to test new PPD keywords and better detect impossible contraints.</LI>
<LI><EM>lpadmin;</EM> the lpadmin command now supports options to hold and release new jobs on a printer or all printers.</LI>
<LI><EM>lpoptions;</EM> the lpoptions command now describes custom options and their parameters.</LI>
<LI><EM>lppasswd;</EM> the lppasswd program is no longer installed setuid by default.</LI>
<LI><EM>cupsfilter;</EM> the cupsfilter program now supports filtering of already-queued print job files.</LI>
<LI><EM>;</EM> </LI>
<LI><EM>;</EM> </LI>
<LI><EM>;</EM> </LI>
<LI><EM>lpstat;</EM> the lpstat command now supports a -H option to show the current default server and no longer slows down when a printer is specified.</LI>
</OL>
<H2 CLASS="title"><A NAME="WEBIF">Web Interface</A></H2>
<OL START="1">
<OL START="9">
<LI><EM>Look-n-feel;</EM> the web interface has been given a new look with a new CUPS logo.</LI>
<LI><EM>Look-n-feel;</EM> the web interface has been given a new look.</LI>
<LI><EM>Security;</EM> the web interface has been updated to require authentication for printing of test pages and RSS subscription operations.</LI>
<LI><EM>Printer sharing;</EM> the "share printer" and "unshare printer" buttons are now only shown when printer sharing is enabled in the scheduler.</LI>
<LI><EM>PHP support;</EM> the "php-cgi" program is used, when available, to process PHP pages in the CUPS web interface.</LI>
<LI><EM>Printer configuration;</EM> improvements have been made to the add and modify printer pages.</LI>
<LI><EM>;</EM> </LI>
<LI><EM>Printer options;</EM> the Set Default Options page now provides a "query" button that queries the default and installed options from the printer.</LI>
<LI><EM>;</EM> </LI>
<LI><EM>Printer sharing;</EM> the "share printer" and "unshare printer" buttons are now only shown when printer sharing is enabled in the scheduler.</LI>
<LI><EM>;</EM> </LI>
<LI><EM>Security;</EM> the web interface has been updated to support authentication for printing of test pages and RSS subscription operations.</LI>
<LI><EM>;</EM> </LI>
<LI><EM>Server settings;</EM> the Administration page now provides access to common "advanced" server settings.</LI>
</OL>
<H2 CLASS="title"><A NAME="NETWORKING">Networking</A></H2>
<OL START="1">
<OL START="16">
<LI><EM>Bonjour (DNS-SD) printing support;</EM> a new mdns backend provides Bonjour-based printer discovery and the ipp, lpd, and socket backends now support Bonjour address resolution.</LI>
<LI><EM>Bonjour (DNS-SD) perforance tuning;</EM> the scheduler now only uses a single file descriptor for printer sharing. It previously used one per printer.</LI>
<LI><EM>Bonjour (DNS-SD) web interface registry;</EM> when remote access is enabled, the scheduler registers the web interface for easier access</LI>
<LI><EM>Bonjour (DNS-SD) web interface registry;</EM> when remote access is enabled, the scheduler can register the web interface for easier access.</LI>
<LI><EM>LPD client support;</EM> the cups-lpd mini-daemon now provides the document-name for print jobs and supports specification of a CUPS server.</LI>
<LI><EM>PWG Port Monitor MIB;</EM> the snmp backend now supports the PWG Port Monitor MIB to better choose the device URI to use.</LI>
<LI><EM>SNMP-based monitoring;</EM> the ipp, lpd, and socket backends now report supply levels and printer status using SNMP queries.</LI>
<LI><EM>SNMP port monitor MIB;</EM> the ipp, lpd, snmp, and socket now support the PWG port monitor MIB</LI>
<LI><EM>;</EM> </LI>
<LI><EM>;</EM> </LI>
</OL>
<H2 CLASS="title"><A NAME="IPP">IPP Support</A></H2>
<OL START="1"></EM></LI>
<OL START="22">
<LI><EM>CUPS-Add-Modify-Printer operation;</EM> the scheduler now supports setting the printer-state-reasons attribute using this operation.</LI>
<LI><EM>CUPS-Get-Document operation;</EM> the scheduler now supports a "get document" operation to download files from a print job.</LI>
<LI><EM>;</EM> </LI>
<LI><EM>Device location;</EM> the scheduler and backend discovery interface now support a device-location attribute.</LI>
<LI><EM>;</EM> </LI>
<LI><EM>;</EM> </LI>
<LI><EM>;</EM> </LI>
<LI><EM>;</EM> </LI>
<LI><EM>Hold-New-Jobs and Release-Held-New-Jobs operations;</EM> the scheduler now supports the Hold-New-Jobs and Release-Held-New-Jobs operations.</LI>
</OL>
<H2 CLASS="title"><A NAME="SCHEDULER">Scheduler</A></H2>
<OL START="1">
<OL START="26">
<LI><EM>Performance tuning;</EM> the scheduler now coalesces configuration and state file changes to reduce the amount of disk activity.</LI>
<LI><EM>Access control;</EM> the scheduler now supports multiple addresses in Allow and Deny lines. It also now returns a HTTP 403 (forbidden) status when a user authenticates successfully but is not allowed to perform an operation.</LI>
<LI><EM>Access logging;</EM> the scheduler now supports an AccessLogLevel directive to control what is logged in the access_log file.</LI>
<LI><EM>Configuration files;</EM> the default cupsd.conf file now provides an "authenticated" policy for easy authenticated sharing of printers.</LI>
<LI><EM>Seatbelt support;</EM> the scheduler now runs child processes using restrictive policies on Mac OS X for improved security and job isolation.</LI>
<LI><EM>Default LogLevel;</EM> the default LogLevel is now "warn" instead of "info".</LI>
<LI><EM>PAM support;</EM> the scheduler now sets more PAM attributes to better support third-party authentication schemes.</LI>
<LI><EM>Default paper size;</EM> the scheduler now supports a DefaultPaperSize directive to override the default paper size defined by the locale or libpaper configuration.</LI>
<LI><EM>Test option;</EM> the scheduler now supports a test mode via the "-t" option.</LI>
<LI><EM>Encryption support;</EM> the scheduler now supports a SSLOptions directive to optionally support Windows clients in "FIPS" mode. It also now loads both the server and CA certificates (if present) from the ServerCertificate file.</LI>
<LI><EM>Error logging;</EM> the scheduler now logs unsuccessful operations as errors in the error_log file.</LI>
<LI><EM>Error policies;</EM> the scheduler now supports a retry-current-job error policy that retries the current job immediately.</LI>
<LI><EM>Fatal error handling;</EM> the scheduler now supports a FatalErrors directive to control which startup errors should be considered fatal.</LI>
<LI><EM>Filter command-line;</EM> the scheduer now passes the job-originating-host-name attribute as a CUPS option to filters and backends.</LI>
<LI><EM>Filter environment;</EM> the scheduler now includes CUPS_JOBTYPE, PRINTER_INFO, and PRINTER_LOCATION variables in the environment passed to filters and backends.</LI>
<LI><EM>Job progress;</EM> the scheduler now supports a job-media-progress attribute to track the printing progress of each page.</LI>
<LI><EM>MIME database;</EM> MIME types now support a priority attribute to override the default (alphabetical) rules of precedence.</LI>
<LI><EM>Page logging;</EM> the scheduler now supports a <code>PageLogFormat</code> directive to control the format of the page_log file.</LI>
<LI><EM>;</EM> </LI>
<LI><EM>PAM support;</EM> the scheduler now sets more PAM attributes to better support third-party authentication schemes.</LI>
<LI><EM>;</EM> </LI>
<LI><EM>PDF job ticket support;</EM> the scheduler now supports cupsJobTicket comments at the beginning of PDF print jobs.</LI>
<LI><EM>;</EM> </LI>
<LI><EM>Performance tuning;</EM> the scheduler now coalesces configuration and state file changes to reduce the amount of disk activity and caches printer attributes to further reduce startup time.</LI>
<LI><EM>;</EM> </LI>
<LI><EM>Printcap support;</EM> the scheduler no longer clears the printcap file when shutting down, and can now create XML "plist" printcap files as well.</LI>
<LI><EM>;</EM> </LI>
<LI><EM>RSS subscriptions;</EM> the scheduler now starts the notifier for RSS subscriptions after creation so the feed is available immediately.</LI>
<LI><EM>Sandbox support;</EM> the scheduler now runs child processes using restrictive policies on Mac OS X for improved security and job isolation.</LI>
<LI><EM>Test option;</EM> the scheduler now supports a test mode via the "-t" option.</LI>
</OL>
<H2 CLASS="title"><A NAME="DRIVERS">Printer Drivers</A></H2>
<OL START="1">
<OL START="47">
<LI><EM>Dynamic PPD support;</EM> drivers can now set PPD keywords
dynamically using <code>PPD:</code> messages.</LI>
<LI><EM>Device discovery;</EM> the cups-deviced helper now runs backends in parallel for faster discovery and streams the results of discovery as the backends provide them.</LI>
<LI><EM>Driver development kit;</EM> the CUPS DDK is now a standard part of CUPS.</LI>
<LI><EM>Driver information file support;</EM> the cups-driverd helper program now directly supports PPD compiler driver information files.</LI>
<LI><EM>Dynamic PPD support;</EM> drivers can now set PPD keywords dynamically using <code>PPD:</code> messages.</LI>
<LI><EM>Generic PostScript command filter;</EM> a new CUPS command file filter for PostScript printers provides auto-configuration, self-test page, and status and supply level reporting functions.</LI>
<LI><EM>New printer drivers;</EM> new generic PostScript and PCL drivers provide improved support for laser printers, the CUPS DDK drivers offer support for many HP DesignJet printers, and new label drivers offer support for Seiko and Tharo label printers.</LI>
<LI><EM>PJL support;</EM> the cupsPJLDisplay PPD attribute controls the PJL commands used to display the current user and job on the printer.</LI>
<LI><EM>Driver development kit;</EM> the CUPS DDK is now a standard part of CUPS</LI>
<LI><EM>PPD compiler improvements;</EM> the PPD compiler now supports Mac OS X .strings files, OID query strings, conditional directives, long file names, and a test mode. It also fixes many other bugs from the CUPS DDK 1.2.3 release.</LI>
<LI><EM>PPD compiler improvements;</EM> the PPD compiler now supports Mac OS X .strings files for localization and ... </LI>
<LI><EM>Generic PostScript and PCL drivers;</EM> new generic PostScript and PCL drivers provide improved support for laser printers.</LI>
<LI><EM>;</EM> </LI>
<LI><EM>;</EM> </LI>
<LI><EM>;</EM> </LI>
<LI><EM>;</EM> </LI>
<LI><EM>;</EM> </LI>
<LI><EM>;</EM> </LI>
<LI><EM>;</EM> </LI>
<LI><EM>;</EM> </LI>
<LI><EM>;</EM> </LI>
<LI><EM>;</EM> </LI>
<LI><EM>;</EM> </LI>
<LI><EM>;</EM> </LI>
<LI><EM>USB printer support;</EM> the usb backend now uses libusb when available to allow it to better work with third-party scanning and printing solutions.</LI>
</OL>
<H2 CLASS="title"><A NAME="FILTERS">Print Filters</A></H2>
<OL START="1">
<OL START="56">
<LI><EM>Banner filter;</EM> the bundled banner ("job-sheets") pages are now generated using a new banner filter provides easier customization and better support for UTF-8 text.</LI>
<LI><EM>Image filters;</EM> the standard image filters now support image files larger than 2GB.</LI>
<LI><EM>Device discovery;</EM> the cups-deviced helper now runs backends in parallel for faster discovery and streams the results of discovery as the backends provide them.</LI>
<LI><EM>PDF filter;</EM> the pdftops filter has been replaced with a wrapper program that runs the Xpdf, poppler, or Ghostscript PDF to PostScript utilities.</LI>
<LI><EM>;</EM> </LI>
<LI><EM>;</EM> </LI>
<LI><EM>;</EM> </LI>
<LI><EM>;</EM> </LI>
</OL>
<H2 CLASS="title"><A NAME="CUPSAPI">CUPS API</A></H2>
<OL START="1">
<OL START="59">
<LI><EM>Streaming API;</EM> a new streaming request API provides asynchronous job creation and request submission.</LI>
<LI><EM>Backend API;</EM> a new cupsBackendReport function is provided to report a device from a backend and handles any needed quoting of the make-and-model, info, device-id, and location strings.</LI>
<LI><EM>Device discovery;</EM> the new <code>cupsGetDevices</code> function streams discovered devices to an application-provided callback function.</LI>
<LI><EM>PPD support;</EM> two new functions are provided, cupsGetPPD3 and ppdLocalizeMarkerName, to update the local copy of a printers's PPD file and get a localized marker (supply) name, respectively.</LI>
<LI><EM>IPP API;</EM> the IPP read and write functions no longer use a large stack-based buffer when reading and writing IPP attributes.</LI>
<LI><EM>;</EM> </LI>
<LI><EM>PPD support;</EM> several new functions are provided: cupsGetPPD3, cupsResolveConflicts, ppdInstallableConflict, ppdLocalizeAttr, ppdLocalizeMarkerName and ppdPageSizeLimits.</LI>
<LI><EM>;</EM> </LI>
<LI><EM>Side-Channel API;</EM> new cupsSideChannelSNMPGet and cupsSideChannelSNMPWalk functions allow printer drivers to do SNMP queries via the standard network backends.</LI>
<LI><EM>;</EM> </LI>
<LI><EM>;</EM> </LI>
<LI><EM>;</EM> </LI>
<LI><EM>;</EM> </LI>
<LI><EM>;</EM> </LI>
<LI><EM>Streaming API;</EM> a new streaming request API provides asynchronous job creation and request submission.</LI>
</OL>
Arquivo binário não exibido.

Antes

Largura:  |  Altura:  |  Tamanho: 23 KiB

Arquivo binário não exibido.

Antes

Largura:  |  Altura:  |  Tamanho: 20 KiB

Arquivo binário não exibido.

Antes

Largura:  |  Altura:  |  Tamanho: 20 KiB

Arquivo binário não exibido.

Antes

Largura:  |  Altura:  |  Tamanho: 24 KiB

Arquivo binário não exibido.

Antes

Largura:  |  Altura:  |  Tamanho: 20 KiB

Arquivo binário não exibido.

Antes

Largura:  |  Altura:  |  Tamanho: 19 KiB

+9 -2
Ver Arquivo
@@ -15,6 +15,12 @@
*
* Contents:
*
* main() - Generate PostScript cover pages.
* load_banner() - Load the banner file.
* ps_ascii85() - Print binary data as a series of base-85 numbers.
* write_banner() - Write a banner page...
* write_epilogue() - Write the PostScript file epilogue.
* write_prolog() - Write the PostScript file prolog with options.
*/
/*
@@ -556,6 +562,7 @@ write_banner(banner_file_t *banner, /* I - Banner file */
{
images = NULL;
images_height = 0;
images_width = 0;
}
total_height = info_height + notices_height + images_height;
@@ -601,11 +608,11 @@ write_banner(banner_file_t *banner, /* I - Banner file */
y -= line_height;
psTextUTF8(fonts, fontsize, PS_BOLD, PS_RIGHT,
_cupsLangString(language, _("Printer Name: ")));
psTextUTF8(fonts, fontsize, PS_NORMAL, PS_LEFT, getenv("PRINTER_NAME"));
psTextUTF8(fonts, fontsize, PS_NORMAL, PS_LEFT, getenv("PRINTER"));
}
if (banner->show & SHOW_JOB_ID)
{
snprintf(text, sizeof(text), "%s-%d", getenv("PRINTER_NAME"), job_id);
snprintf(text, sizeof(text), "%s-%d", getenv("PRINTER"), job_id);
printf("%.1f %.1f moveto", x, y);
y -= line_height;
psTextUTF8(fonts, fontsize, PS_BOLD, PS_RIGHT,
Diferenças do arquivo suprimidas por serem muito extensas Carregar Diff
+37 -5
Ver Arquivo
@@ -3,7 +3,7 @@
.\"
.\" lpinfo man page for the Common UNIX Printing System (CUPS).
.\"
.\" Copyright 2007 by Apple Inc.
.\" Copyright 2007-2008 by Apple Inc.
.\" Copyright 1997-2006 by Easy Software Products.
.\"
.\" These coded instructions, statements, and computer programs are the
@@ -12,7 +12,7 @@
.\" which should have been included with this file. If this file is
.\" file is missing or damaged, see the license at "http://www.cups.org/".
.\"
.TH lpinfo 8 "Common UNIX Printing System" "12 February 2006" "Apple Inc."
.TH lpinfo 8 "Common UNIX Printing System" "8 October 2008" "Apple Inc."
.SH NAME
lpinfo \- show available devices or drivers
.SH SYNOPSIS
@@ -21,14 +21,24 @@ lpinfo \- show available devices or drivers
.I username
] [ -h
.I server[:port]
] [ -l ] -m
] [ -l ] [ --device-id
.I device-id-string
] [ --language
.I locale
] [ --make-and-model
.I name
] [ --product
.I name
] -m
.br
.B lpinfo
[ -E ] [ -U
.I username
] [ -h
.I server[:port]
] [ -l ] -v
] [ -l ] [ --timeout
.I seconds
] -v
.SH DESCRIPTION
\fIlpinfo\fR lists the available devices or drivers known to the
CUPS server. The first form (\fI-m\fR) lists the available
@@ -52,6 +62,28 @@ Selects an alternate server.
-l
.br
Shows a "long" listing of devices or drivers.
.TP 5
--device-id device-id-string
.br
Specifies the IEEE-1284 device ID to match when listing drivers with the
\fI-m\fR option.
.TP 5
--language locale
.br
Specifies the language to match when listing drivers with the \fI-m\fR option.
.TP 5
--make-and-model name
.br
Specifies the make and model to match when listing drivers with the \fI-m\fR
option.
.TP 5
--product name
.br
Specifies the product to match when listing drivers with the \fI-m\fR option.
.TP 5
--timeout seconds
.br
Specifies the timeout when listing devices with the \fI-v\fR option.
.SH COMPATIBILITY
The \fIlpinfo\fR command is unique to CUPS.
.SH SEE ALSO
@@ -59,7 +91,7 @@ The \fIlpinfo\fR command is unique to CUPS.
.br
http://localhost:631/help
.SH COPYRIGHT
Copyright 2007 by Apple Inc.
Copyright 2007-2008 by Apple Inc.
.\"
.\" End of "$Id: lpinfo.man 7600 2008-05-20 21:06:23Z mike $".
.\"
+39 -70
Ver Arquivo
@@ -674,14 +674,14 @@ void
cupsdSaveAllClasses(void)
{
cups_file_t *fp; /* classes.conf file */
char temp[1024]; /* Temporary string */
char backup[1024]; /* classes.conf.O file */
char temp[1024], /* Temporary string */
backup[1024], /* printers.conf.O file */
value[2048]; /* Value string */
cupsd_printer_t *pclass; /* Current printer class */
int i; /* Looping var */
time_t curtime; /* Current time */
struct tm *curdate; /* Current date */
cups_option_t *option; /* Current option */
const char *ptr; /* Pointer into info/location */
/*
@@ -757,53 +757,38 @@ cupsdSaveAllClasses(void)
if (pclass->num_auth_info_required > 0)
{
cupsFilePrintf(fp, "AuthInfoRequired %s", pclass->auth_info_required[0]);
for (i = 1; i < pclass->num_auth_info_required; i ++)
cupsFilePrintf(fp, ",%s", pclass->auth_info_required[i]);
cupsFilePutChar(fp, '\n');
switch (pclass->num_auth_info_required)
{
case 1 :
strlcpy(value, pclass->auth_info_required[0], sizeof(value));
break;
case 2 :
snprintf(value, sizeof(value), "%s,%s",
pclass->auth_info_required[0],
pclass->auth_info_required[1]);
break;
case 3 :
default :
snprintf(value, sizeof(value), "%s,%s,%s",
pclass->auth_info_required[0],
pclass->auth_info_required[1],
pclass->auth_info_required[2]);
break;
}
cupsFilePutConf(fp, "AuthInfoRequired", value);
}
if (pclass->info)
{
if ((ptr = strchr(pclass->info, '#')) != NULL)
{
/*
* Need to quote the first # in the info string...
*/
cupsFilePuts(fp, "Info ");
cupsFileWrite(fp, pclass->info, ptr - pclass->info);
cupsFilePutChar(fp, '\\');
cupsFilePuts(fp, ptr);
cupsFilePutChar(fp, '\n');
}
else
cupsFilePrintf(fp, "Info %s\n", pclass->info);
}
cupsFilePutConf(fp, "Info", pclass->info);
if (pclass->location)
{
if ((ptr = strchr(pclass->info, '#')) != NULL)
{
/*
* Need to quote the first # in the location string...
*/
cupsFilePuts(fp, "Location ");
cupsFileWrite(fp, pclass->location, ptr - pclass->location);
cupsFilePutChar(fp, '\\');
cupsFilePuts(fp, ptr);
cupsFilePutChar(fp, '\n');
}
else
cupsFilePrintf(fp, "Location %s\n", pclass->location);
}
cupsFilePutConf(fp, "Location", pclass->location);
if (pclass->state == IPP_PRINTER_STOPPED)
{
cupsFilePuts(fp, "State Stopped\n");
cupsFilePrintf(fp, "StateMessage %s\n", pclass->state_message);
}
else
cupsFilePuts(fp, "State Idle\n");
@@ -819,46 +804,30 @@ cupsdSaveAllClasses(void)
else
cupsFilePuts(fp, "Shared No\n");
cupsFilePrintf(fp, "JobSheets %s %s\n", pclass->job_sheets[0],
pclass->job_sheets[1]);
for (i = 0; i < pclass->num_users; i ++)
{
if ((ptr = strchr(pclass->users[i], '#')) != NULL)
{
/*
* Need to quote the first # in the user string...
*/
cupsFilePrintf(fp, "%sUser ", pclass->deny_users ? "Deny" : "Allow");
cupsFileWrite(fp, pclass->users[i], ptr - pclass->users[i]);
cupsFilePutChar(fp, '\\');
cupsFilePuts(fp, ptr);
cupsFilePutChar(fp, '\n');
}
else
cupsFilePrintf(fp, "%sUser %s\n",
pclass->deny_users ? "Deny" : "Allow",
pclass->users[i]);
}
snprintf(value, sizeof(value), "%s %s", pclass->job_sheets[0],
pclass->job_sheets[1]);
cupsFilePutConf(fp, "JobSheets", value);
cupsFilePrintf(fp, "QuotaPeriod %d\n", pclass->quota_period);
cupsFilePrintf(fp, "PageLimit %d\n", pclass->page_limit);
cupsFilePrintf(fp, "KLimit %d\n", pclass->k_limit);
for (i = 0; i < pclass->num_users; i ++)
cupsFilePrintf(fp, "%sUser %s\n", pclass->deny_users ? "Deny" : "Allow",
pclass->users[i]);
cupsFilePutConf(fp, pclass->deny_users ? "DenyUser" : "AllowUser",
pclass->users[i]);
if (pclass->op_policy)
cupsFilePrintf(fp, "OpPolicy %s\n", pclass->op_policy);
if (pclass->op_policy)
cupsFilePutConf(fp, "OpPolicy", pclass->op_policy);
if (pclass->error_policy)
cupsFilePrintf(fp, "ErrorPolicy %s\n", pclass->error_policy);
cupsFilePutConf(fp, "ErrorPolicy", pclass->error_policy);
for (i = pclass->num_options, option = pclass->options;
i > 0;
i --, option ++)
cupsFilePrintf(fp, "Option %s %s\n", option->name, option->value);
{
snprintf(value, sizeof(value), "%s %s", option->name, option->value);
cupsFilePutConf(fp, "Option", value);
}
cupsFilePuts(fp, "</Class>\n");
}
+2 -3
Ver Arquivo
@@ -3093,10 +3093,9 @@ encrypt_client(cupsd_client_t *con) /* I - Client to encrypt */
SSL_CTX_set_options(context, SSL_OP_NO_SSLv2); /* Only use SSLv3 or TLS */
if (SSLOptions & CUPSD_SSL_NOEMPTY)
SSL_CTX_set_options(context, SSL_OP_DONTS_INSERT_EMPTY_FRAGMENTS);
SSL_CTX_set_options(context, SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS);
SSL_CTX_use_PrivateKey_file(context, ServerKey, SSL_FILETYPE_PEM);
SSL_CTX_use_certificate_chain_file(context, ServerCertificate,
SSL_FILETYPE_PEM);
SSL_CTX_use_certificate_chain_file(context, ServerCertificate);
bio = BIO_new(_httpBIOMethods());
BIO_ctrl(bio, BIO_C_SET_FILE_PTR, 0, (char *)HTTP(con));
+2
Ver Arquivo
@@ -3247,6 +3247,7 @@ read_configuration(cups_file_t *fp) /* I - File to read from */
"Missing value for SetEnv directive on line %d.",
linenum);
}
#ifdef HAVE_SSL
else if (!strcasecmp(line, "SSLOptions"))
{
/*
@@ -3262,6 +3263,7 @@ read_configuration(cups_file_t *fp) /* I - File to read from */
"Unknown value \"%s\" for SSLOptions directive on "
"line %d.", value, linenum);
}
#endif /* HAVE_SSL */
else
{
/*
+323 -78
Ver Arquivo
@@ -18,18 +18,23 @@
*
* Contents:
*
* main() - Scan for drivers and return an IPP response.
* add_ppd() - Add a PPD file.
* cat_drv() - Generate a PPD from a driver info file.
* cat_ppd() - Copy a PPD file to stdout.
* copy_static() - Copy a static PPD file to stdout.
* compare_names() - Compare PPD filenames for sorting.
* compare_ppds() - Compare PPD file make and model names for sorting.
* free_array() - Free an array of strings.
* list_ppds() - List PPD files.
* load_ppds() - Load PPD files recursively.
* load_drv() - Load the PPDs from a driver information file.
* load_drivers() - Load driver-generated PPD files.
* main() - Scan for drivers and return an IPP response.
* add_ppd() - Add a PPD file.
* cat_drv() - Generate a PPD from a driver info file.
* cat_ppd() - Copy a PPD file to stdout.
* copy_static() - Copy a static PPD file to stdout.
* compare_matches() - Compare PPD match scores for sorting.
* compare_names() - Compare PPD filenames for sorting.
* compare_ppds() - Compare PPD file make and model names for sorting.
* free_array() - Free an array of strings.
* list_ppds() - List PPD files.
* load_ppds() - Load PPD files recursively.
* load_drv() - Load the PPDs from a driver information file.
* load_drivers() - Load driver-generated PPD files.
* regex_device_id() - Compile a regular expression based on the 1284 device
* ID.
* regex_string() - Construct a regular expression to compare a simple
* string.
*/
/*
@@ -41,6 +46,7 @@
#include <cups/transcode.h>
#include <cups/ppd-private.h>
#include <ppdc/ppdc.h>
#include <regex.h>
/*
@@ -95,6 +101,7 @@ typedef struct /**** PPD record ****/
typedef struct /**** In-memory record ****/
{
int found; /* 1 if PPD is found */
int matches; /* Match count */
ppd_rec_t record; /* PPDs.dat record */
} ppd_info_t;
@@ -121,6 +128,8 @@ static ppd_info_t *add_ppd(const char *filename, const char *name,
static int cat_drv(const char *name, int request_id);
static int cat_ppd(const char *name, int request_id);
static int cat_static(const char *name, int request_id);
static int compare_matches(const ppd_info_t *p0,
const ppd_info_t *p1);
static int compare_names(const ppd_info_t *p0,
const ppd_info_t *p1);
static int compare_ppds(const ppd_info_t *p0,
@@ -131,6 +140,8 @@ static int load_drivers(void);
static int load_drv(const char *filename, const char *name,
cups_file_t *fp, time_t mtime, off_t size);
static int load_ppds(const char *d, const char *p, int descend);
static regex_t *regex_device_id(const char *device_id);
static regex_t *regex_string(const char *s);
/*
@@ -325,7 +336,7 @@ cat_drv(const char *name, /* I - PPD name */
ppdcCatalog *catalog; // Message catalog in .drv file
fprintf(stderr, "DEBUG: %d locales defined in \"%s\"...\n",
fprintf(stderr, "DEBUG: [cups-driverd] %d locales defined in \"%s\"...\n",
src->po_files->count, filename);
locales = new ppdcArray();
@@ -333,7 +344,7 @@ cat_drv(const char *name, /* I - PPD name */
catalog;
catalog = (ppdcCatalog *)src->po_files->next())
{
fprintf(stderr, "DEBUG: Adding locale \"%s\"...\n",
fprintf(stderr, "DEBUG: [cups-driverd] Adding locale \"%s\"...\n",
catalog->locale->value);
locales->add(catalog->locale);
}
@@ -635,6 +646,22 @@ cat_static(const char *name, /* I - PPD name */
}
/*
* 'compare_matches()' - Compare PPD match scores for sorting.
*/
static int
compare_matches(const ppd_info_t *p0, /* I - First PPD */
const ppd_info_t *p1) /* I - Second PPD */
{
if (p1->matches != p0->matches)
return (p1->matches - p0->matches);
else
return (cupsdCompareNames(p1->record.make_and_model,
p0->record.make_and_model));
}
/*
* 'compare_names()' - Compare PPD filenames for sorting.
*/
@@ -729,8 +756,8 @@ list_ppds(int request_id, /* I - Request ID */
*type_str; /* ppd-type option */
int model_number, /* ppd-model-number value */
type, /* ppd-type value */
mam_len, /* Length of ppd-make-and-model */
device_id_len, /* Length of ppd-device-id */
make_and_model_len, /* Length of ppd-make-and-model */
product_len, /* Length of ppd-product */
send_device_id, /* Send ppd-device-id? */
send_make, /* Send ppd-make? */
send_make_and_model, /* Send ppd-make-and-model? */
@@ -741,6 +768,10 @@ list_ppds(int request_id, /* I - Request ID */
send_psversion, /* Send ppd-psversion? */
send_type, /* Send ppd-type? */
sent_header; /* Sent the IPP header? */
regex_t *device_id_re, /* Regular expression for matching device ID */
*make_and_model_re; /* Regular expression for matching make and model */
regmatch_t re_matches[6]; /* Regular expression matches */
cups_array_t *matches; /* Matching PPDs */
fprintf(stderr,
@@ -926,14 +957,14 @@ list_ppds(int request_id, /* I - Request ID */
type_str = cupsGetOption("ppd-type", num_options, options);
if (make_and_model)
mam_len = strlen(make_and_model);
make_and_model_len = strlen(make_and_model);
else
mam_len = 0;
make_and_model_len = 0;
if (device_id)
device_id_len = strlen(device_id);
if (product)
product_len = strlen(product);
else
device_id_len = 0;
product_len = 0;
if (model_number_str)
model_number = atoi(model_number_str);
@@ -1021,68 +1052,137 @@ list_ppds(int request_id, /* I - Request ID */
else
count = limit;
for (ppd = (ppd_info_t *)cupsArrayFirst(PPDsByMakeModel);
if (device_id || language || make || make_and_model || model_number_str ||
product)
{
matches = cupsArrayNew((cups_array_func_t)compare_matches, NULL);
if (device_id)
device_id_re = regex_device_id(device_id);
else
device_id_re = NULL;
if (make_and_model)
make_and_model_re = regex_string(make_and_model);
else
make_and_model_re = NULL;
for (ppd = (ppd_info_t *)cupsArrayFirst(PPDsByMakeModel);
ppd;
ppd = (ppd_info_t *)cupsArrayNext(PPDsByMakeModel))
{
/*
* Filter PPDs based on make, model, product, language, model number,
* and/or device ID using the "matches" score value. An exact match
* for product, make-and-model, or device-id adds 3 to the score.
* Partial matches for make-and-model yield 1 or 2 points, and matches
* for the make and language add a single point. Results are then sorted
* by score, highest score first.
*/
if (ppd->record.type < PPD_TYPE_POSTSCRIPT ||
ppd->record.type >= PPD_TYPE_DRV)
continue;
ppd->matches = 0;
if (device_id_re &&
!regexec(device_id_re, ppd->record.device_id,
(int)(sizeof(re_matches) / sizeof(re_matches[0])),
re_matches, 0))
{
/*
* Add the number of matching values from the device ID - it will be
* at least 2 (manufacturer and model), and as much as 3 (command set).
*/
for (i = 1; i < (int)(sizeof(re_matches) / sizeof(re_matches[0])); i ++)
if (re_matches[i].rm_so >= 0)
ppd->matches ++;
}
if (language)
{
for (i = 0; i < PPD_MAX_LANG; i ++)
if (!ppd->record.languages[i][0] ||
!strcasecmp(ppd->record.languages[i], language))
{
ppd->matches ++;
break;
}
}
if (make && !strcasecmp(ppd->record.make, make))
ppd->matches ++;
if (make_and_model_re &&
!regexec(make_and_model_re, ppd->record.make_and_model,
(int)(sizeof(re_matches) / sizeof(re_matches[0])),
re_matches, 0))
{
// See how much of the make-and-model string we matched...
if (re_matches[0].rm_so == 0)
{
if (re_matches[0].rm_eo == make_and_model_len)
ppd->matches += 3; // Exact match
else
ppd->matches += 2; // Prefix match
}
else
ppd->matches ++; // Infix match
}
if (model_number_str && ppd->record.model_number == model_number)
ppd->matches ++;
if (product)
{
for (i = 0; i < PPD_MAX_PROD; i ++)
if (!ppd->record.products[i][0] ||
!strcasecmp(ppd->record.products[i], product))
{
ppd->matches += 3;
break;
}
}
if (psversion)
{
for (i = 0; i < PPD_MAX_VERS; i ++)
if (!ppd->record.psversions[i][0] ||
!strcasecmp(ppd->record.psversions[i], psversion))
{
ppd->matches ++;
break;
}
}
if (type_str && ppd->record.type == type)
ppd->matches ++;
if (ppd->matches)
{
fprintf(stderr, "DEBUG: [cups-driverd] %s matches with score %d!\n",
ppd->record.name, ppd->matches);
cupsArrayAdd(matches, ppd);
}
}
}
else
matches = PPDsByMakeModel;
for (ppd = (ppd_info_t *)cupsArrayFirst(matches);
count > 0 && ppd;
ppd = (ppd_info_t *)cupsArrayNext(PPDsByMakeModel))
ppd = (ppd_info_t *)cupsArrayNext(matches))
{
/*
* Filter PPDs based on make, model, or device ID...
* Skip invalid PPDs...
*/
if (ppd->record.type < PPD_TYPE_POSTSCRIPT ||
ppd->record.type >= PPD_TYPE_DRV)
continue;
if (device_id && strncasecmp(ppd->record.device_id, device_id,
device_id_len))
continue; /* TODO: implement smart compare */
if (language)
{
for (i = 0; i < PPD_MAX_LANG; i ++)
if (!ppd->record.languages[i][0] ||
!strcasecmp(ppd->record.languages[i], language))
break;
if (i >= PPD_MAX_LANG || !ppd->record.languages[i][0])
continue;
}
if (make && strcasecmp(ppd->record.make, make))
continue;
if (make_and_model && strncasecmp(ppd->record.make_and_model,
make_and_model, mam_len))
continue;
if (model_number_str && ppd->record.model_number != model_number)
continue;
if (product)
{
for (i = 0; i < PPD_MAX_PROD; i ++)
if (!ppd->record.products[i][0] ||
!strcasecmp(ppd->record.products[i], product))
break;
if (i >= PPD_MAX_PROD || !ppd->record.products[i][0])
continue;
}
if (psversion)
{
for (i = 0; i < PPD_MAX_VERS; i ++)
if (!ppd->record.psversions[i][0] ||
!strcasecmp(ppd->record.psversions[i], psversion))
break;
if (i >= PPD_MAX_VERS || !ppd->record.psversions[i][0])
continue;
}
if (type_str && ppd->record.type != type)
continue;
/*
* Send this PPD...
*/
@@ -1094,7 +1194,8 @@ list_ppds(int request_id, /* I - Request ID */
cupsdSendIPPHeader(IPP_OK, request_id);
cupsdSendIPPGroup(IPP_TAG_OPERATION);
cupsdSendIPPString(IPP_TAG_CHARSET, "attributes-charset", "utf-8");
cupsdSendIPPString(IPP_TAG_LANGUAGE, "attributes-natural-language", "en-US");
cupsdSendIPPString(IPP_TAG_LANGUAGE, "attributes-natural-language",
"en-US");
}
fprintf(stderr, "DEBUG: [cups-driverd] Sending %s (%s)...\n",
@@ -1164,13 +1265,13 @@ list_ppds(int request_id, /* I - Request ID */
for (this_make = ppd->record.make,
ppd = (ppd_info_t *)cupsArrayNext(PPDsByMakeModel);
ppd = (ppd_info_t *)cupsArrayNext(matches);
ppd;
ppd = (ppd_info_t *)cupsArrayNext(PPDsByMakeModel))
ppd = (ppd_info_t *)cupsArrayNext(matches))
if (strcasecmp(this_make, ppd->record.make))
break;
cupsArrayPrev(PPDsByMakeModel);
cupsArrayPrev(matches);
}
}
@@ -1382,7 +1483,13 @@ load_ppds(const char *d, /* I - Actual directory */
else if (!strncmp(line, "*NickName:", 10))
sscanf(line, "%*[^\"]\"%255[^\"]", nick_name);
else if (!strncasecmp(line, "*1284DeviceID:", 14))
{
sscanf(line, "%*[^\"]\"%255[^\"]", device_id);
// Make sure device ID ends with a semicolon...
if (device_id[0] && device_id[strlen(device_id) - 1] != ';')
strlcat(device_id, ";", sizeof(device_id));
}
else if (!strncmp(line, "*Product:", 9))
{
if (sscanf(line, "%*[^\"]\"(%255[^)]", product) == 1)
@@ -1980,6 +2087,144 @@ load_drivers(void)
}
/*
* 'regex_device_id()' - Compile a regular expression based on the 1284 device
* ID.
*/
static regex_t * /* O - Regular expression */
regex_device_id(const char *device_id) /* I - IEEE-1284 device ID */
{
char res[2048], /* Regular expression string */
*ptr; /* Pointer into string */
regex_t *re; /* Regular expression */
int cmd; /* Command set string? */
fprintf(stderr, "DEBUG: [cups-driverd] regex_device_id(\"%s\")\n", device_id);
/*
* Scan the device ID string and insert class, command set, manufacturer, and
* model attributes to match. We assume that the device ID in the PPD and the
* device ID reported by the device itself use the same attribute names and
* order of attributes.
*/
ptr = res;
while (*device_id && ptr < (res + sizeof(res) - 6))
{
cmd = !strncasecmp(device_id, "COMMAND SET:", 12) ||
!strncasecmp(device_id, "CMD:", 4);
if (cmd || !strncasecmp(device_id, "MANUFACTURER:", 13) ||
!strncasecmp(device_id, "MFG:", 4) ||
!strncasecmp(device_id, "MFR:", 4) ||
!strncasecmp(device_id, "MODEL:", 6) ||
!strncasecmp(device_id, "MDL:", 4))
{
if (ptr > res)
{
*ptr++ = '.';
*ptr++ = '*';
}
*ptr++ = '(';
while (*device_id && *device_id != ';' && ptr < (res + sizeof(res) - 4))
{
if (strchr("[]{}().*\\|", *device_id))
*ptr++ = '\\';
*ptr++ = *device_id++;
}
if (*device_id == ';' || !*device_id)
*ptr++ = ';';
*ptr++ = ')';
if (cmd)
*ptr++ = '?';
}
else if ((device_id = strchr(device_id, ';')) == NULL)
break;
else
device_id ++;
}
*ptr = '\0';
fprintf(stderr, "DEBUG: [cups-driverd] regex_device_id: \"%s\"\n", res);
/*
* Compile the regular expression and return...
*/
if (res[0] && (re = (regex_t *)calloc(1, sizeof(regex_t))) != NULL)
{
if (!regcomp(re, res, REG_EXTENDED | REG_ICASE))
{
fputs("DEBUG: [cups-driverd] regex_device_id: OK\n", stderr);
return (re);
}
free(re);
}
return (NULL);
}
/*
* 'regex_string()' - Construct a regular expression to compare a simple string.
*/
static regex_t * /* O - Regular expression */
regex_string(const char *s) /* I - String to compare */
{
char res[2048], /* Regular expression string */
*ptr; /* Pointer into string */
regex_t *re; /* Regular expression */
fprintf(stderr, "DEBUG: [cups-driverd] regex_string(\"%s\")\n", s);
/*
* Convert the string to a regular expression, escaping special characters
* as needed.
*/
ptr = res;
while (*s && ptr < (res + sizeof(res) - 2))
{
if (strchr("[]{}().*\\", *s))
*ptr++ = '\\';
*ptr++ = *s++;
}
*ptr = '\0';
fprintf(stderr, "DEBUG: [cups-driverd] regex_string: \"%s\"\n", res);
/*
* Create a case-insensitive regular expression...
*/
if (res[0] && (re = (regex_t *)calloc(1, sizeof(regex_t))) != NULL)
{
if (!regcomp(re, res, REG_ICASE))
{
fputs("DEBUG: [cups-driverd] regex_string: OK\n", stderr);
return (re);
}
free(re);
}
return (NULL);
}
/*
* End of "$Id$".
*/
+2 -1
Ver Arquivo
@@ -3,7 +3,7 @@
*
* Main header file for the Common UNIX Printing System (CUPS) scheduler.
*
* Copyright 2007 by Apple Inc.
* Copyright 2007-2008 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
@@ -235,6 +235,7 @@ extern void cupsdStopSelect(void);
extern int cupsdRemoveFile(const char *filename);
/*
* End of "$Id: cupsd.h 7928 2008-09-10 22:14:22Z mike $".
*/
+20 -18
Ver Arquivo
@@ -696,7 +696,8 @@ cupsdSaveRemoteCache(void)
{
int i; /* Looping var */
cups_file_t *fp; /* printers.conf file */
char temp[1024]; /* Temporary string */
char temp[1024], /* Temporary string */
value[2048]; /* Value string */
cupsd_printer_t *printer; /* Current printer class */
time_t curtime; /* Current time */
struct tm *curdate; /* Current date */
@@ -765,48 +766,49 @@ cupsdSaveRemoteCache(void)
else
cupsFilePrintf(fp, "Printer %s>\n", printer->name);
cupsFilePrintf(fp, "Type %d\n", printer->type);
cupsFilePrintf(fp, "BrowseTime %d\n", (int)printer->browse_expire);
if (printer->info)
cupsFilePrintf(fp, "Info %s\n", printer->info);
if (printer->make_model)
cupsFilePrintf(fp, "MakeModel %s\n", printer->make_model);
cupsFilePutConf(fp, "Info", printer->info);
if (printer->location)
cupsFilePrintf(fp, "Location %s\n", printer->location);
cupsFilePutConf(fp, "Location", printer->location);
cupsFilePrintf(fp, "DeviceURI %s\n", printer->device_uri);
if (printer->make_model)
cupsFilePutConf(fp, "MakeModel", printer->make_model);
cupsFilePutConf(fp, "DeviceURI", printer->device_uri);
if (printer->state == IPP_PRINTER_STOPPED)
{
cupsFilePuts(fp, "State Stopped\n");
cupsFilePrintf(fp, "StateMessage %s\n", printer->state_message);
}
else
cupsFilePuts(fp, "State Idle\n");
for (i = 0; i < printer->num_reasons; i ++)
cupsFilePrintf(fp, "Reason %s\n", printer->reasons[i]);
cupsFilePutConf(fp, "Reason", printer->reasons[i]);
cupsFilePrintf(fp, "Type %d\n", printer->type);
if (printer->accepting)
cupsFilePuts(fp, "Accepting Yes\n");
else
cupsFilePuts(fp, "Accepting No\n");
cupsFilePrintf(fp, "JobSheets %s %s\n", printer->job_sheets[0],
printer->job_sheets[1]);
snprintf(value, sizeof(value), "%s %s", printer->job_sheets[0],
printer->job_sheets[1]);
cupsFilePutConf(fp, "JobSheets", value);
for (i = 0; i < printer->num_users; i ++)
cupsFilePrintf(fp, "%sUser %s\n", printer->deny_users ? "Deny" : "Allow",
printer->users[i]);
cupsFilePutConf(fp, printer->deny_users ? "DenyUser" : "AllowUser",
printer->users[i]);
for (i = printer->num_options, option = printer->options;
i > 0;
i --, option ++)
cupsFilePrintf(fp, "Option %s %s\n", option->name, option->value);
{
snprintf(value, sizeof(value), "%s %s", option->name, option->value);
cupsFilePutConf(fp, "Option", value);
}
if (printer->type & CUPS_PRINTER_CLASS)
cupsFilePuts(fp, "</Class>\n");
+12 -2
Ver Arquivo
@@ -5449,6 +5449,17 @@ copy_printer_attrs(
ippAddBoolean(con->response, IPP_TAG_PRINTER, "printer-is-shared",
printer->shared);
if ((!ra || cupsArrayFind(ra, "printer-more-info")) &&
!(printer->type & CUPS_PRINTER_DISCOVERED))
{
httpAssembleURIf(HTTP_URI_CODING_ALL, printer_uri, sizeof(printer_uri),
"http", NULL, con->servername, con->serverport,
(printer->type & CUPS_PRINTER_CLASS) ?
"/classes/%s" : "/printers/%s", printer->name);
ippAddString(con->response, IPP_TAG_PRINTER, IPP_TAG_URI,
"printer-more-info", NULL, printer_uri);
}
if (!ra || cupsArrayFind(ra, "printer-op-policy"))
ippAddString(con->response, IPP_TAG_PRINTER, IPP_TAG_NAME,
"printer-op-policy", NULL, printer->op_policy);
@@ -5514,8 +5525,7 @@ copy_printer_attrs(
"printer-up-time", curtime);
if ((!ra || cupsArrayFind(ra, "printer-uri-supported")) &&
!ippFindAttribute(printer->attrs, "printer-uri-supported",
IPP_TAG_URI))
!(printer->type & CUPS_PRINTER_DISCOVERED))
{
httpAssembleURIf(HTTP_URI_CODING_ALL, printer_uri, sizeof(printer_uri),
"ipp", NULL, con->servername, con->serverport,
+154 -132
Ver Arquivo
@@ -1005,6 +1005,11 @@ cupsdLoadAllPrinters(void)
if (value)
cupsdSetString(&p->info, value);
}
else if (!strcasecmp(line, "MakeModel"))
{
if (value)
cupsdSetString(&p->make_model, value);
}
else if (!strcasecmp(line, "Location"))
{
if (value)
@@ -1111,6 +1116,52 @@ cupsdLoadAllPrinters(void)
cupsdLogMessage(CUPSD_LOG_ERROR,
"Syntax error on line %d of printers.conf.", linenum);
}
else if (!strcasecmp(line, "Type"))
{
if (value)
p->type = atoi(value);
else
cupsdLogMessage(CUPSD_LOG_ERROR,
"Syntax error on line %d of printers.conf.", linenum);
}
else if (!strcasecmp(line, "Product"))
{
if (value)
{
#ifdef HAVE_DNSSD
p->product = _cupsStrAlloc(value);
#endif /* HAVE_DNSSD */
}
else
cupsdLogMessage(CUPSD_LOG_ERROR,
"Syntax error on line %d of printers.conf.", linenum);
}
else if (!strcasecmp(line, "Filter"))
{
if (value)
{
if (!p->filters)
p->filters = cupsArrayNew(NULL, NULL);
cupsArrayAdd(p->filters, _cupsStrAlloc(value));
}
else
cupsdLogMessage(CUPSD_LOG_ERROR,
"Syntax error on line %d of printers.conf.", linenum);
}
else if (!strcasecmp(line, "PreFilter"))
{
if (value)
{
if (!p->pre_filters)
p->pre_filters = cupsArrayNew(NULL, NULL);
cupsArrayAdd(p->pre_filters, _cupsStrAlloc(value));
}
else
cupsdLogMessage(CUPSD_LOG_ERROR,
"Syntax error on line %d of printers.conf.", linenum);
}
else if (!strcasecmp(line, "Shared"))
{
/*
@@ -1349,13 +1400,14 @@ cupsdSaveAllPrinters(void)
{
int i; /* Looping var */
cups_file_t *fp; /* printers.conf file */
char temp[1024]; /* Temporary string */
char backup[1024]; /* printers.conf.O file */
char temp[1024], /* Temporary string */
backup[1024], /* printers.conf.O file */
value[2048], /* Value string */
*ptr; /* Pointer into value */
cupsd_printer_t *printer; /* Current printer class */
time_t curtime; /* Current time */
struct tm *curdate; /* Current date */
cups_option_t *option; /* Current option */
const char *ptr; /* Pointer into info/location */
ipp_attribute_t *marker; /* Current marker attribute */
@@ -1432,56 +1484,50 @@ cupsdSaveAllPrinters(void)
if (printer->num_auth_info_required > 0)
{
cupsFilePrintf(fp, "AuthInfoRequired %s", printer->auth_info_required[0]);
for (i = 1; i < printer->num_auth_info_required; i ++)
cupsFilePrintf(fp, ",%s", printer->auth_info_required[i]);
cupsFilePutChar(fp, '\n');
switch (printer->num_auth_info_required)
{
case 1 :
strlcpy(value, printer->auth_info_required[0], sizeof(value));
break;
case 2 :
snprintf(value, sizeof(value), "%s,%s",
printer->auth_info_required[0],
printer->auth_info_required[1]);
break;
case 3 :
default :
snprintf(value, sizeof(value), "%s,%s,%s",
printer->auth_info_required[0],
printer->auth_info_required[1],
printer->auth_info_required[2]);
break;
}
cupsFilePutConf(fp, "AuthInfoRequired", value);
}
if (printer->info)
{
if ((ptr = strchr(printer->info, '#')) != NULL)
{
/*
* Need to quote the first # in the info string...
*/
cupsFilePuts(fp, "Info ");
cupsFileWrite(fp, printer->info, ptr - printer->info);
cupsFilePutChar(fp, '\\');
cupsFilePuts(fp, ptr);
cupsFilePutChar(fp, '\n');
}
else
cupsFilePrintf(fp, "Info %s\n", printer->info);
}
cupsFilePutConf(fp, "Info", printer->info);
if (printer->location)
{
if ((ptr = strchr(printer->info, '#')) != NULL)
{
/*
* Need to quote the first # in the location string...
*/
cupsFilePutConf(fp, "Location", printer->location);
cupsFilePuts(fp, "Location ");
cupsFileWrite(fp, printer->location, ptr - printer->location);
cupsFilePutChar(fp, '\\');
cupsFilePuts(fp, ptr);
cupsFilePutChar(fp, '\n');
}
else
cupsFilePrintf(fp, "Location %s\n", printer->location);
}
cupsFilePrintf(fp, "DeviceURI %s\n", printer->device_uri);
if (printer->make_model)
cupsFilePutConf(fp, "MakeModel", printer->make_model);
cupsFilePutConf(fp, "DeviceURI", printer->device_uri);
if (printer->port_monitor)
cupsFilePrintf(fp, "PortMonitor %s\n", printer->port_monitor);
cupsFilePutConf(fp, "PortMonitor", printer->port_monitor);
if (printer->state == IPP_PRINTER_STOPPED)
{
cupsFilePuts(fp, "State Stopped\n");
cupsFilePrintf(fp, "StateMessage %s\n", printer->state_message);
if (printer->state_message)
cupsFilePutConf(fp, "StateMessage", printer->state_message);
}
else
cupsFilePuts(fp, "State Idle\n");
@@ -1489,7 +1535,24 @@ cupsdSaveAllPrinters(void)
cupsFilePrintf(fp, "StateTime %d\n", (int)printer->state_time);
for (i = 0; i < printer->num_reasons; i ++)
cupsFilePrintf(fp, "Reason %s\n", printer->reasons[i]);
cupsFilePutConf(fp, "Reason", printer->reasons[i]);
cupsFilePrintf(fp, "Type %d", printer->type);
#ifdef HAVE_DNSSD
if (printer->product)
cupsFilePutConf(fp, "Product", printer->product);
#endif /* HAVE_DNSSD */
for (ptr = (char *)cupsArrayFirst(printer->filters);
ptr;
ptr = (char *)cupsArrayNext(printer->filters))
cupsFilePutConf(fp, "Filter", ptr);
for (ptr = (char *)cupsArrayFirst(printer->pre_filters);
ptr;
ptr = (char *)cupsArrayNext(printer->pre_filters))
cupsFilePutConf(fp, "PreFilter", ptr);
if (printer->accepting)
cupsFilePuts(fp, "Accepting Yes\n");
@@ -1501,80 +1564,50 @@ cupsdSaveAllPrinters(void)
else
cupsFilePuts(fp, "Shared No\n");
cupsFilePrintf(fp, "JobSheets %s %s\n", printer->job_sheets[0],
printer->job_sheets[1]);
snprintf(value, sizeof(value), "%s %s", printer->job_sheets[0],
printer->job_sheets[1]);
cupsFilePutConf(fp, "JobSheets", value);
cupsFilePrintf(fp, "QuotaPeriod %d\n", printer->quota_period);
cupsFilePrintf(fp, "PageLimit %d\n", printer->page_limit);
cupsFilePrintf(fp, "KLimit %d\n", printer->k_limit);
for (i = 0; i < printer->num_users; i ++)
{
if ((ptr = strchr(printer->users[i], '#')) != NULL)
{
/*
* Need to quote the first # in the user string...
*/
cupsFilePrintf(fp, "%sUser ", printer->deny_users ? "Deny" : "Allow");
cupsFileWrite(fp, printer->users[i], ptr - printer->users[i]);
cupsFilePutChar(fp, '\\');
cupsFilePuts(fp, ptr);
cupsFilePutChar(fp, '\n');
}
else
cupsFilePrintf(fp, "%sUser %s\n",
printer->deny_users ? "Deny" : "Allow",
printer->users[i]);
}
cupsFilePutConf(fp, printer->deny_users ? "DenyUser" : "AllowUser",
printer->users[i]);
if (printer->op_policy)
cupsFilePrintf(fp, "OpPolicy %s\n", printer->op_policy);
cupsFilePutConf(fp, "OpPolicy", printer->op_policy);
if (printer->error_policy)
cupsFilePrintf(fp, "ErrorPolicy %s\n", printer->error_policy);
cupsFilePutConf(fp, "ErrorPolicy", printer->error_policy);
for (i = printer->num_options, option = printer->options;
i > 0;
i --, option ++)
{
if ((ptr = strchr(option->value, '#')) != NULL)
{
/*
* Need to quote the first # in the option string...
*/
cupsFilePrintf(fp, "Option %s ", option->name);
cupsFileWrite(fp, option->value, ptr - option->value);
cupsFilePutChar(fp, '\\');
cupsFilePuts(fp, ptr);
cupsFilePutChar(fp, '\n');
}
else
cupsFilePrintf(fp, "Option %s %s\n", option->name, option->value);
snprintf(value, sizeof(value), "%s %s", option->name, option->value);
cupsFilePutConf(fp, "Option", value);
}
if ((marker = ippFindAttribute(printer->attrs, "marker-colors",
IPP_TAG_NAME)) != NULL)
{
cupsFilePrintf(fp, "Attribute %s ", marker->name);
snprintf(value, sizeof(value), "%s ", marker->name);
for (i = 0, ptr = NULL; i < marker->num_values; i ++)
for (i = 0, ptr = value + strlen(value);
i < marker->num_values && ptr < (value + sizeof(value) - 1);
i ++)
{
if (i)
cupsFilePutChar(fp, ',');
*ptr++ = ',';
if (!ptr && (ptr = strchr(marker->values[i].string.text, '#')) != NULL)
{
cupsFileWrite(fp, marker->values[i].string.text,
ptr - marker->values[i].string.text);
cupsFilePutChar(fp, '\\');
cupsFilePuts(fp, ptr);
}
else
cupsFilePuts(fp, marker->values[i].string.text);
strlcpy(ptr, marker->values[i].string.text,
value + sizeof(value) - ptr);
ptr += strlen(ptr);
}
cupsFilePuts(fp, "\n");
*ptr = '\0';
cupsFilePutConf(fp, "Attribute", value);
}
if ((marker = ippFindAttribute(printer->attrs, "marker-levels",
@@ -1590,67 +1623,52 @@ cupsdSaveAllPrinters(void)
if ((marker = ippFindAttribute(printer->attrs, "marker-message",
IPP_TAG_TEXT)) != NULL)
{
cupsFilePrintf(fp, "Attribute %s ", marker->name);
snprintf(value, sizeof(value), "%s %s", marker->name,
marker->values[0].string.text);
if ((ptr = strchr(marker->values[0].string.text, '#')) != NULL)
{
cupsFileWrite(fp, marker->values[0].string.text,
ptr - marker->values[0].string.text);
cupsFilePutChar(fp, '\\');
cupsFilePuts(fp, ptr);
}
else
cupsFilePuts(fp, marker->values[0].string.text);
cupsFilePuts(fp, "\n");
cupsFilePutConf(fp, "Attribute", value);
}
if ((marker = ippFindAttribute(printer->attrs, "marker-names",
IPP_TAG_NAME)) != NULL)
{
cupsFilePrintf(fp, "Attribute %s ", marker->name);
snprintf(value, sizeof(value), "%s ", marker->name);
for (i = 0, ptr = NULL; i < marker->num_values; i ++)
for (i = 0, ptr = value + strlen(value);
i < marker->num_values && ptr < (value + sizeof(value) - 1);
i ++)
{
if (i)
cupsFilePutChar(fp, ',');
*ptr++ = ',';
if (!ptr && (ptr = strchr(marker->values[i].string.text, '#')) != NULL)
{
cupsFileWrite(fp, marker->values[i].string.text,
ptr - marker->values[i].string.text);
cupsFilePutChar(fp, '\\');
cupsFilePuts(fp, ptr);
}
else
cupsFilePuts(fp, marker->values[i].string.text);
strlcpy(ptr, marker->values[i].string.text,
value + sizeof(value) - ptr);
ptr += strlen(ptr);
}
cupsFilePuts(fp, "\n");
*ptr = '\0';
cupsFilePutConf(fp, "Attribute", value);
}
if ((marker = ippFindAttribute(printer->attrs, "marker-types",
IPP_TAG_KEYWORD)) != NULL)
{
cupsFilePrintf(fp, "Attribute %s ", marker->name);
snprintf(value, sizeof(value), "%s ", marker->name);
for (i = 0, ptr = NULL; i < marker->num_values; i ++)
for (i = 0, ptr = value + strlen(value);
i < marker->num_values && ptr < (value + sizeof(value) - 1);
i ++)
{
if (i)
cupsFilePutChar(fp, ',');
*ptr++ = ',';
if (!ptr && (ptr = strchr(marker->values[i].string.text, '#')) != NULL)
{
cupsFileWrite(fp, marker->values[i].string.text,
ptr - marker->values[i].string.text);
cupsFilePutChar(fp, '\\');
cupsFilePuts(fp, ptr);
}
else
cupsFilePuts(fp, marker->values[i].string.text);
strlcpy(ptr, marker->values[i].string.text,
value + sizeof(value) - ptr);
ptr += strlen(ptr);
}
cupsFilePuts(fp, "\n");
*ptr = '\0';
cupsFilePutConf(fp, "Attribute", value);
}
cupsFilePuts(fp, "</Printer>\n");
@@ -2176,8 +2194,6 @@ cupsdSetPrinterAttrs(cupsd_printer_t *p)/* I - Printer to setup */
NULL, p->location ? p->location : "");
ippAddString(p->attrs, IPP_TAG_PRINTER, IPP_TAG_TEXT, "printer-info",
NULL, p->info ? p->info : "");
ippAddString(p->attrs, IPP_TAG_PRINTER, IPP_TAG_URI, "printer-more-info",
NULL, p->uri);
if (p->num_users)
{
@@ -2230,6 +2246,9 @@ cupsdSetPrinterAttrs(cupsd_printer_t *p)/* I - Printer to setup */
ippAddString(p->attrs, IPP_TAG_PRINTER, IPP_TAG_URI,
"printer-uri-supported", NULL, p->uri);
ippAddString(p->attrs, IPP_TAG_PRINTER, IPP_TAG_URI, "printer-more-info",
NULL, p->uri);
if (p->make_model)
ippAddString(p->attrs, IPP_TAG_PRINTER, IPP_TAG_TEXT,
"printer-make-and-model", NULL, p->make_model);
@@ -2750,7 +2769,10 @@ cupsdSetPrinterAttrs(cupsd_printer_t *p)/* I - Printer to setup */
}
else if (!strncmp(p->device_uri, "ipp://", 6) &&
(strstr(p->device_uri, "/printers/") != NULL ||
strstr(p->device_uri, "/classes/") != NULL))
strstr(p->device_uri, "/classes/") != NULL ||
(strstr(p->device_uri, "._ipp.") != NULL &&
!strcmp(p->device_uri + strlen(p->device_uri) - 5,
"/cups"))))
{
/*
* Tell the client this is really a hard-wired remote printer.
+2
Ver Arquivo
@@ -88,6 +88,8 @@ typedef struct cupsd_printer_s
char *alert, /* PSX printer-alert value */
*alert_description; /* PSX printer-alert-description value */
time_t marker_time; /* Last time marker attributes were updated */
cups_array_t *filters, /* Filters for queue */
*pre_filters; /* Pre-filters for queue */
#ifdef __APPLE__
char *recoverable; /* com.apple.print.recoverable-message */
+183 -62
Ver Arquivo
@@ -42,8 +42,10 @@ static void device_cb(const char *device_clas, const char *device_id,
const char *device_make_and_model,
const char *device_uri, const char *device_location,
void *user_data);
static int show_devices(http_t *, int);
static int show_models(http_t *, int);
static int show_devices(http_t *http, int long_status, int timeout);
static int show_models(http_t *http, int long_status,
const char *device_id, const char *language,
const char *make_model, const char *product);
/*
@@ -57,12 +59,22 @@ main(int argc, /* I - Number of command-line arguments */
int i; /* Looping var */
http_t *http; /* Connection to server */
int long_status; /* Long listing? */
const char *device_id, /* 1284 device ID */
*language, /* Language */
*make_model, /* Make and model */
*product; /* Product */
int timeout; /* Device timeout */
_cupsSetLocale(argv);
http = NULL;
long_status = 0;
device_id = NULL;
language = NULL;
make_model = NULL;
product = NULL;
timeout = CUPS_TIMEOUT_DEFAULT;
for (i = 1; i < argc; i ++)
if (argv[i][0] == '-')
@@ -81,48 +93,6 @@ main(int argc, /* I - Number of command-line arguments */
#endif /* HAVE_SSL */
break;
case 'l' : /* Show long listing */
long_status = 1;
break;
case 'm' : /* Show models */
if (!http)
{
http = httpConnectEncrypt(cupsServer(), ippPort(),
cupsEncryption());
if (http == NULL)
{
_cupsLangPrintf(stderr,
_("lpinfo: Unable to connect to server: %s\n"),
strerror(errno));
return (1);
}
}
if (show_models(http, long_status))
return (1);
break;
case 'v' : /* Show available devices */
if (!http)
{
http = httpConnectEncrypt(cupsServer(), ippPort(),
cupsEncryption());
if (http == NULL)
{
_cupsLangPrintf(stderr,
_("lpinfo: Unable to connect to server: %s\n"),
strerror(errno));
return (1);
}
}
if (show_devices(http, long_status))
return (1);
break;
case 'h' : /* Connect to host */
if (http)
{
@@ -147,6 +117,143 @@ main(int argc, /* I - Number of command-line arguments */
}
break;
case 'l' : /* Show long listing */
long_status = 1;
break;
case 'm' : /* Show models */
if (!http)
{
http = httpConnectEncrypt(cupsServer(), ippPort(),
cupsEncryption());
if (http == NULL)
{
_cupsLangPrintf(stderr,
_("lpinfo: Unable to connect to server: %s\n"),
strerror(errno));
return (1);
}
}
if (show_models(http, long_status, device_id, language, make_model,
product))
return (1);
break;
case 'v' : /* Show available devices */
if (!http)
{
http = httpConnectEncrypt(cupsServer(), ippPort(),
cupsEncryption());
if (http == NULL)
{
_cupsLangPrintf(stderr,
_("lpinfo: Unable to connect to server: %s\n"),
strerror(errno));
return (1);
}
}
if (show_devices(http, long_status, timeout))
return (1);
break;
case '-' : /* --something */
if (!strcmp(argv[i], "--device-id"))
{
i ++;
if (i < argc)
device_id = argv[i];
else
{
_cupsLangPuts(stderr,
_("lpinfo: Expected 1284 device ID string "
"after --device-id!\n"));
return (1);
}
}
else if (!strncmp(argv[i], "--device-id=", 12) && argv[i][12])
{
device_id = argv[i] + 12;
}
else if (!strcmp(argv[i], "--language"))
{
i ++;
if (i < argc)
language = argv[i];
else
{
_cupsLangPuts(stderr,
_("lpinfo: Expected language after "
"--language!\n"));
return (1);
}
}
else if (!strncmp(argv[i], "--language=", 11) && argv[i][11])
{
language = argv[i] + 11;
}
else if (!strcmp(argv[i], "--make-and-model"))
{
i ++;
if (i < argc)
make_model= argv[i];
else
{
_cupsLangPuts(stderr,
_("lpinfo: Expected make and model after "
"--make-and-model!\n"));
return (1);
}
}
else if (!strncmp(argv[i], "--make-and-model=", 17) && argv[i][17])
{
make_model = argv[i] + 17;
}
else if (!strcmp(argv[i], "--product"))
{
i ++;
if (i < argc)
product = argv[i];
else
{
_cupsLangPuts(stderr,
_("lpinfo: Expected product string after "
"--product!\n"));
return (1);
}
}
else if (!strncmp(argv[i], "--product=", 10) && argv[i][10])
{
product = argv[i] + 10;
}
else if (!strcmp(argv[i], "--timeout"))
{
i ++;
if (i < argc)
timeout = atoi(argv[i]);
else
{
_cupsLangPuts(stderr,
_("lpinfo: Expected timeout after --timeout!\n"));
return (1);
}
}
else if (!strncmp(argv[i], "--timeout=", 10) && argv[i][10])
{
timeout = atoi(argv[i] + 10);
}
else
{
_cupsLangPrintf(stderr, _("lpinfo: Unknown option \'%s\'!\n"),
argv[i]);
return (1);
}
break;
default :
_cupsLangPrintf(stderr, _("lpinfo: Unknown option \'%c\'!\n"),
argv[i][1]);
@@ -209,9 +316,10 @@ device_cb(
static int /* O - 0 on success, 1 on failure */
show_devices(http_t *http, /* I - HTTP connection to server */
int long_status) /* I - Long status report? */
int long_status, /* I - Long status report? */
int timeout) /* I - Timeout */
{
if (cupsGetDevices(http, CUPS_TIMEOUT_DEFAULT, CUPS_EXCLUDE_NONE, device_cb,
if (cupsGetDevices(http, timeout, CUPS_EXCLUDE_NONE, device_cb,
&long_status) != IPP_OK)
{
_cupsLangPrintf(stderr, "lpinfo: %s\n", cupsLastErrorString());
@@ -227,15 +335,19 @@ show_devices(http_t *http, /* I - HTTP connection to server */
*/
static int /* O - 0 on success, 1 on failure */
show_models(http_t *http, /* I - HTTP connection to server */
int long_status) /* I - Long status report? */
show_models(http_t *http, /* I - HTTP connection to server */
int long_status, /* I - Long status report? */
const char *device_id, /* I - 1284 device ID */
const char *language, /* I - Language */
const char *make_model, /* I - Make and model */
const char *product) /* I - Product */
{
ipp_t *request, /* IPP Request */
*response; /* IPP Response */
ipp_attribute_t *attr; /* Current attribute */
const char *ppd_device_id, /* Pointer to ppd-device-id */
*ppd_language, /* Pointer to ppd-natural-language */
*ppd_make, /* Pointer to ppd-make-and-model */
*ppd_make_model, /* Pointer to ppd-make-and-model */
*ppd_name; /* Pointer to ppd-name */
@@ -243,15 +355,24 @@ show_models(http_t *http, /* I - HTTP connection to server */
return (1);
/*
* Build a CUPS_GET_PPDS request, which requires the following
* attributes:
*
* attributes-charset
* attributes-natural-language
* Build a CUPS_GET_PPDS request...
*/
request = ippNewRequest(CUPS_GET_PPDS);
if (device_id)
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_TEXT, "ppd-device-id",
NULL, device_id);
if (language)
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE, "ppd-language",
NULL, language);
if (make_model)
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_TEXT, "ppd-make-and-model",
NULL, make_model);
if (product)
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_TEXT, "ppd-product",
NULL, product);
/*
* Do the request and get back a response...
*/
@@ -285,10 +406,10 @@ show_models(http_t *http, /* I - HTTP connection to server */
* Pull the needed attributes from this PPD...
*/
ppd_device_id = "NONE";
ppd_language = NULL;
ppd_make = NULL;
ppd_name = NULL;
ppd_device_id = "NONE";
ppd_language = NULL;
ppd_make_model = NULL;
ppd_name = NULL;
while (attr != NULL && attr->group_tag == IPP_TAG_PRINTER)
{
@@ -300,7 +421,7 @@ show_models(http_t *http, /* I - HTTP connection to server */
ppd_language = attr->values[0].string.text;
else if (!strcmp(attr->name, "ppd-make-and-model") &&
attr->value_tag == IPP_TAG_TEXT)
ppd_make = attr->values[0].string.text;
ppd_make_model = attr->values[0].string.text;
else if (!strcmp(attr->name, "ppd-name") &&
attr->value_tag == IPP_TAG_NAME)
ppd_name = attr->values[0].string.text;
@@ -312,7 +433,7 @@ show_models(http_t *http, /* I - HTTP connection to server */
* See if we have everything needed...
*/
if (ppd_language == NULL || ppd_make == NULL || ppd_name == NULL)
if (ppd_language == NULL || ppd_make_model == NULL || ppd_name == NULL)
{
if (attr == NULL)
break;
@@ -331,10 +452,10 @@ show_models(http_t *http, /* I - HTTP connection to server */
" natural_language = %s\n"
" make-and-model = %s\n"
" device-id = %s\n"),
ppd_name, ppd_language, ppd_make, ppd_device_id);
ppd_name, ppd_language, ppd_make_model, ppd_device_id);
}
else
_cupsLangPrintf(stdout, "%s %s\n", ppd_name, ppd_make);
_cupsLangPrintf(stdout, "%s %s\n", ppd_name, ppd_make_model);
if (attr == NULL)
break;
+1 -1
Ver Arquivo
@@ -37,6 +37,7 @@ FILES = \
class-modified.tmpl \
classes.tmpl \
classes-header.tmpl \
command.tmpl \
edit-config.tmpl \
error.tmpl \
error-op.tmpl \
@@ -53,7 +54,6 @@ FILES = \
jobs.tmpl \
jobs-header.tmpl \
list-available-printers.tmpl \
maintenance.tmpl \
modify-class.tmpl \
modify-printer.tmpl \
norestart.tmpl \
+4 -1
Ver Arquivo
@@ -2,6 +2,9 @@
<H2 CLASS="title">{op=modify-printer?Modify {printer_name}:Add Printer}</H2>
{CUPS_GET_DEVICES_DONE?:<P><IMG SRC="/images/wait.gif" WIDTH="16" HEIGHT="16" ALIGN="ABSMIDDLE"
ALT="Busy Indicator"> Looking for printers...</P>}
<FORM METHOD="POST" ACTION="/admin">
<INPUT TYPE="HIDDEN" NAME="OP" VALUE="{op}">
{printer_name?<INPUT TYPE="HIDDEN" NAME="printer_name" VALUE="{printer_name}">:}
@@ -11,7 +14,7 @@
<TH CLASS="label">Current Connection:</TH>
<TD><INPUT TYPE="RADIO" NAME="DEVICE_URI" VALUE="{current_device_uri}" CHECKED>
{current_device_uri}</TD>
</TR>:}
</TR>}
<TR>
<TH CLASS="label">Local Printers:</TH>
<TD>
+2
Ver Arquivo
@@ -1,5 +1,7 @@
<DIV CLASS="indent">
<H2 CLASS="title">Add Class</H2>
<P>Class <A HREF="/classes/{printer_name}">{printer_name}</A> has been added
successfully.
+2
Ver Arquivo
@@ -1,5 +1,7 @@
<DIV CLASS="indent">
<H2 CLASS="title">Delete Class {printer_name}</H2>
<P><B>Warning:</B> Are you sure you want to delete class
{printer_name}?</P>
+2
Ver Arquivo
@@ -1,5 +1,7 @@
<DIV CLASS="indent">
<H2 CLASS="title">Delete Class {printer_name}</H2>
<P>Class {printer_name} has been deleted successfully.
</DIV>
+2
Ver Arquivo
@@ -1,5 +1,7 @@
<DIV CLASS="indent">
<H2 CLASS="title">Modify Class {printer_name}</H2>
<P>Class <A HREF="/classes/{printer_name}">{printer_name}</A> has been
modified successfully.
+2 -2
Ver Arquivo
@@ -8,7 +8,7 @@
<SELECT NAME="OP" ONCHANGE="document.maintenance.submit();">
<OPTION VALUE="">Maintenance</OPTION>
<OPTION VALUE="print-test-page">Print Test Page</OPTION>
{printer_state=5?<OPTION VALUE="start-printer">Resume Class</OPTION>:<OPTION VALUE="stop-printer">Pause Class</OPTION>}
{printer_state=5?<OPTION VALUE="start-class">Resume Class</OPTION>:<OPTION VALUE="stop-class">Pause Class</OPTION>}
{printer_is_accepting_jobs=0?<OPTION VALUE="accept-jobs">Accept Jobs</OPTION>:<OPTION VALUE="reject-jobs">Reject Jobs</OPTION>}
<OPTION VALUE="move-jobs">Move All Jobs</OPTION>
<OPTION VALUE="purge-jobs">Cancel All Jobs</OPTION>
@@ -17,7 +17,7 @@
</FORM>
<FORM METHOD="POST" ACTION="{admin_uri}" NAME="administration">
<INPUT TYPE="HIDDEN" NAME="printer_name" VALUE="{%printer_name}">
<INPUT TYPE="HIDDEN" NAME="printer_name" VALUE="{printer_name}">
<SELECT NAME="OP" ONCHANGE="document.administration.submit();">
<OPTION VALUE="">Administration</OPTION>
<OPTION VALUE="modify-class">Modify Class</OPTION>
+2
Ver Arquivo
@@ -1,5 +1,7 @@
<DIV CLASS="indent">
<H2 CLASS="title">{?title} {?printer_name} Error</H2>
<P>Error:</P>
<BLOCKQUOTE>Unknown operation "{op}"!</BLOCKQUOTE>
+2
Ver Arquivo
@@ -1,5 +1,7 @@
<DIV CLASS="indent">
<H2 CLASS="title">{?title} {?printer_name} Error</H2>
<P>{?message?{message}:Error:}</P>
<BLOCKQUOTE>{error}</BLOCKQUOTE>
+1 -1
Ver Arquivo
@@ -4,7 +4,7 @@
<P ALIGN="CENTER"><B>Search in
{HELPTITLE?{HELPTITLE}:{TOPIC?{TOPIC}:All Documents}}:</B> <INPUT
TYPE="SEARCH" NAME="QUERY" VALUE="{?QUERY}" SIZE="60" PLACEHOLDER=""
TYPE="SEARCH" NAME="QUERY" VALUE="{?QUERY}" SIZE="40" PLACEHOLDER=""
AUTOSAVE="org.cups.help" RESULTS="20">
<INPUT TYPE="SUBMIT" NAME="SEARCH" VALUE="Search">
<INPUT TYPE="SUBMIT" NAME="CLEAR" VALUE="Clear"></P>
+6
Ver Arquivo
@@ -1 +1,7 @@
<DIV CLASS="indent">
<H2 CLASS="title">Cancel Job {job_id}</H2>
<P><A HREF="{job_printer_uri}">Job {job_id}</A> has been canceled.
</DIV>
+6
Ver Arquivo
@@ -1 +1,7 @@
<DIV CLASS="indent">
<H2 CLASS="title">Hold Job {job_id}</H2>
<P><A HREF="{job_printer_uri}">Job {job_id}</A> has been held from printing.
</DIV>
+5 -1
Ver Arquivo
@@ -1,3 +1,5 @@
<DIV CLASS="indent">
<FORM METHOD="POST" ACTION="/{SECTION}/{job_id?:{printer_name}}">
<INPUT TYPE="HIDDEN" NAME="OP" VALUE="{op}">
{job_id?<INPUT TYPE="HIDDEN" NAME="JOB_ID" VALUE="{job_id}">:}
@@ -15,8 +17,10 @@
</TR>
<TR>
<TD></TD>
<TD><INPUT TYPE="SUBMIT" VALUE="Move Job{job_id?:s}"></TD>
<TD><INPUT TYPE="SUBMIT" VALUE="{job_id?Move Job:Move Jobs}"></TD>
</TR>
</TABLE>
</FORM>
</DIV>
+6
Ver Arquivo
@@ -1,2 +1,8 @@
<DIV CLASS="indent">
<H2 CLASS="title">{job_id?Move Job {job_id}:Move All Jobs}</H2>
<P>{job_id?<A HREF="/jobs/{job_id}">Job {job_id}</A>:All jobs} moved to
<A HREF="{job_printer_uri}">{job_printer_name}</A>.</P>
</DIV>
+6
Ver Arquivo
@@ -1 +1,7 @@
<DIV CLASS="indent">
<H2 CLASS="title">Release Job {job_id}</H2>
<P><A HREF="{job_printer_uri}">Job {job_id}</A> has been released for printing.
</DIV>
+6
Ver Arquivo
@@ -1 +1,7 @@
<DIV CLASS="indent">
<H2 CLASS="title">Reprint Job {job_id}</H2>
<P><A HREF="{job_printer_uri}">Job {job_id}</A> has been restarted.
</DIV>
+2 -2
Ver Arquivo
@@ -16,9 +16,9 @@
{job_state=7?canceled at<BR>{time_at_completed}:{job_state=8?aborted:completed at<BR>{time_at_completed}}}}}}}&nbsp;{job_printer_state_message?<BR>
<EM>"{job_printer_state_message}"</EM>:}</TD>
<TD>
{job_preserved>0?
{job_preserved>0?{job_state>5?
<FORM ACTION="/jobs/" METHOD="POST"><INPUT TYPE="HIDDEN" NAME="OP" VALUE="restart-job"><INPUT TYPE="HIDDEN" NAME="job_id" VALUE="{job_id}"><INPUT TYPE="HIDDEN" NAME="job_printer_uri" VALUE="{job_printer_uri}">
<INPUT TYPE="SUBMIT" VALUE="Reprint Job"></FORM>:}
<INPUT TYPE="SUBMIT" VALUE="Reprint Job"></FORM>:}:}
{job_state=4?
<FORM ACTION="/jobs/" METHOD="POST"><INPUT TYPE="HIDDEN" NAME="OP" VALUE="release-job"><INPUT TYPE="HIDDEN" NAME="job_id" VALUE="{job_id}"><INPUT TYPE="HIDDEN" NAME="job_printer_uri" VALUE="{job_printer_uri}">
<INPUT TYPE="SUBMIT" VALUE="Release Job"></FORM>:}
-6
Ver Arquivo
@@ -1,6 +0,0 @@
<DIV CLASS="indent">
<P>Maintenance commands sent; job ID is <A HREF="/printers/{printer_name}">
{printer_name}-{job_id}</A>.</P>
</DIV>
+8 -2
Ver Arquivo
@@ -1,2 +1,8 @@
<p>The server was not restarted because no changes were made to
the configuration...</p>
<DIV CLASS="indent">
<H2 CLASS="title">Change Settings</H2>
<P>The server was not restarted because no changes were made to
the configuration...</P>
</DIV>
+1 -1
Ver Arquivo
@@ -1,5 +1,5 @@
<TR>
<TH CLASS="label"{conflicted=1? CLASS="conflict":}><A NAME="{keyword}">{keytext}</A>:</TH>
<TH {conflicted=1?CLASS="conflict":CLASS="label"} WIDTH="50%"><A NAME="{keyword}">{keytext}</A>:</TH>
<TD>
{[choices]<INPUT TYPE="RADIO" NAME="{keyword}" {choices={defchoice}?CHECKED:} VALUE="{choices}">{text}}
</TD>
+4 -2
Ver Arquivo
@@ -1,3 +1,5 @@
<H2 CLASS="title">{printer_name}: {group}</H2>
<DIV CLASS="tab" ID="{group_id}">
<TABLE>
<H3 ALIGN="CENTER">{group}</H3>
<TABLE WIDTH="100%">
+1 -1
Ver Arquivo
@@ -1,5 +1,5 @@
<TR>
<TH CLASS="label"{conflicted=1? CLASS="conflict":}><A NAME="{keyword}">{keytext}</A>:</TH>
<TH {conflicted=1?CLASS="conflict":CLASS="label"} WIDTH="50%"><A NAME="{keyword}">{keytext}</A>:</TH>
<TD><SELECT NAME="{keyword}" MULTIPLE SIZE="10">
{[choices]<OPTION {choices={defchoice}?SELECTED:} VALUE="{choices}">{text}}
</SELECT></TD>
+1 -1
Ver Arquivo
@@ -1,5 +1,5 @@
<TR>
<TH CLASS="label"{conflicted=1? CLASS="conflict":}><A NAME="{keyword}">{keytext}</A>:</TH>
<TH {conflicted=1?CLASS="conflict":CLASS="label"} WIDTH="50%"><A NAME="{keyword}">{keytext}</A>:</TH>
<TD><SELECT NAME="{keyword}" ID="select-{keyword}" ONCHANGE="update_paramtable('{keyword}')">
{[choices]<OPTION {choices={defchoice}?SELECTED:} VALUE="{choices}">{text}}
</SELECT>
+4 -4
Ver Arquivo
@@ -1,5 +1,5 @@
<TR>
<TD></TD>
<TD><INPUT TYPE="SUBMIT" VALUE="Set Printer Options"></TD>
</TR>
</TABLE>
<P ALIGN="CENTER"><INPUT TYPE="SUBMIT" VALUE="Set Default Options"></P>
</DIV>
+2
Ver Arquivo
@@ -1,5 +1,7 @@
<DIV CLASS="indent">
<H2 CLASS="title">Accept Jobs On {is_class?Class:Printer} {printer_name}</H2>
<P>{is_class?Class:Printer} <A
HREF="/{is_class?classes:printers}/{printer_name}">{printer_name}</A>
is now accepting jobs.</P>
+2
Ver Arquivo
@@ -1,5 +1,7 @@
<DIV CLASS="indent">
<H2 CLASS="title">Add Printer</H2>
<P>Printer <A HREF="/printers/{printer_name}">{printer_name}</A> has been added
successfully.
+4 -2
Ver Arquivo
@@ -1,6 +1,8 @@
<DIV CLASS="indent">
<P>{OP=set-class-options?Class <A HREF="/classes/{printer_name}">:Printer <A HREF="/printers/{printer_name}">}{printer_name}</A> has
been configured successfully.
<H2 CLASS="title">Set Default Options for {printer_name}</H2>
<P>{OP=set-class-options?Class <A HREF="/classes/{printer_name}">:Printer <A HREF="/printers/{printer_name}">}{printer_name}</A>
default options have been set successfully.
</DIV>
+2
Ver Arquivo
@@ -1,5 +1,7 @@
<DIV CLASS="indent">
<H2 CLASS="title">Delete Printer {printer_name}</H2>
<P><B>Warning:</B> Are you sure you want to delete printer
{printer_name}?</P>
+2
Ver Arquivo
@@ -1,5 +1,7 @@
<DIV CLASS="indent">
<H2 CLASS="title">Set {is_class?Class:Printer} {printer_name} As Default</H2>
<P>{is_class?Class:Printer} <A
HREF="/{is_class?classes:printers}/{printer_name}">{printer_name}</A>
has been made the default printer on the server.</P>
+2
Ver Arquivo
@@ -1,5 +1,7 @@
<DIV CLASS="indent">
<H2 CLASS="title">Delete Printer {printer_name}</H2>
<P>Printer {printer_name} has been deleted successfully.
</DIV>
+2
Ver Arquivo
@@ -1,5 +1,7 @@
<DIV CLASS="indent">
<H2 CLASS="title">Modify Printer {printer_name}</H2>
<P>Printer <A HREF="/printers/{printer_name}">{printer_name}</A> has been
modified successfully.
+2
Ver Arquivo
@@ -1,5 +1,7 @@
<DIV CLASS="indent">
<H2 CLASS="title">Purge Jobs On {is_class?Class:Printer} {printer_name}</H2>
<P>{is_class?Class:Printer} <A
HREF="/{is_class?classes:printers}/{printer_name}">{printer_name}</A>
has been purged of all jobs.</P>
+2
Ver Arquivo
@@ -1,5 +1,7 @@
<DIV CLASS="indent">
<H2 CLASS="title">Reject Jobs On {is_class?Class:Printer} {printer_name}</H2>
<P>{is_class?Class:Printer} <A
HREF="/{is_class?classes:printers}/{printer_name}">{printer_name}</A>
is no longer accepting jobs.</P>
+3 -1
Ver Arquivo
@@ -1,7 +1,9 @@
<DIV CLASS="indent">
<H2 CLASS="title">Resume {is_class?Class:Printer} {printer_name}</H2>
<P>{is_class?Class:Printer} <A
HREF="/{is_class?classes:printers}/{printer_name}">{printer_name}</A>
has been started.</P>
has been resumed.</P>
</DIV>
+3 -1
Ver Arquivo
@@ -1,7 +1,9 @@
<DIV CLASS="indent">
<H2 CLASS="title">Pause {is_class?Class:Printer} {printer_name}</H2>
<P>{is_class?Class:Printer} <A
HREF="/{is_class?classes:printers}/{printer_name}">{printer_name}</A>
has been stopped.</P>
has been paused.</P>
</DIV>
+4 -3
Ver Arquivo
@@ -1,4 +1,5 @@
<DIV CLASS="indent">
<H2 CLASS="title"><A HREF="{printer_uri_supported}">{printer_name}</A>
({printer_state=3?Idle:{printer_state=4?Processing:Paused}},
{printer_is_accepting_jobs=0?Rejecting Jobs:Accepting Jobs},
@@ -8,8 +9,8 @@
<SELECT NAME="OP" ONCHANGE="document.maintenance.submit();">
<OPTION VALUE="">Maintenance</OPTION>
<OPTION VALUE="print-test-page">Print Test Page</OPTION>
{?cupscommand=1?<OPTION VALUE="clean-print-heads">Clean Print Heads</OPTION>
<OPTION VALUE="print-self-test-page">Print Self Test Page</OPTION>:}
{printer_commands~.*Clean.*?<OPTION VALUE="clean-print-heads">Clean Print Heads</OPTION>:}
{printer_commands~.*PrintSelfTestPage.*?<OPTION VALUE="print-self-test-page">Print Self Test Page</OPTION>:}
{printer_state=5?<OPTION VALUE="start-printer">Resume Printer</OPTION>:<OPTION VALUE="stop-printer">Pause Printer</OPTION>}
{printer_is_accepting_jobs=0?<OPTION VALUE="accept-jobs">Accept Jobs</OPTION>:<OPTION VALUE="reject-jobs">Reject Jobs</OPTION>}
<OPTION VALUE="move-jobs">Move All Jobs</OPTION>
@@ -19,7 +20,7 @@
</FORM>
<FORM METHOD="POST" ACTION="{admin_uri}" NAME="administration">
<INPUT TYPE="HIDDEN" NAME="printer_name" VALUE="{%printer_name}">
<INPUT TYPE="HIDDEN" NAME="printer_name" VALUE="{printer_name}">
<SELECT NAME="OP" ONCHANGE="document.administration.submit();">
<OPTION VALUE="">Administration</OPTION>
<OPTION VALUE="modify-printer">Modify Printer</OPTION>
+8 -1
Ver Arquivo
@@ -1 +1,8 @@
<p>Please stand by while the server restarts...</p>
<DIV CLASS="indent">
<H2 CLASS="title">Change Settings</H2>
<P><IMG SRC="/images/wait.gif" WIDTH="16" HEIGHT="16" ALIGN="ABSMIDDLE"
ALT="Busy Indicator"> Please stand by while the server restarts...</P>
</DIV>
+7 -1
Ver Arquivo
@@ -1,9 +1,11 @@
<DIV CLASS="indent">
<H2 CLASS="title">Set Default Options for {printer_name}</H2>
<FORM METHOD="POST" ACTION="/admin">
<INPUT TYPE="HIDDEN" NAME="PRINTER_NAME" VALUE="{printer_name}">
<INPUT TYPE="HIDDEN" NAME="OP" VALUE="{op}">
{HAVE_AUTOCONFIGURE?<INPUT TYPE="SUBMIT" NAME="AUTOCONFIGURE" VALUE="Auto-Configure Options">:}
{HAVE_AUTOCONFIGURE?<INPUT TYPE="SUBMIT" NAME="AUTOCONFIGURE" VALUE="Query Printer for Default Options">:}
<SCRIPT TYPE="text/javascript"><!--
function update_paramtable(option)
@@ -17,3 +19,7 @@ function update_paramtable(option)
}
--></SCRIPT>
<H3 CLASS="title">{[group_id]
<A HREF="#{group_id}">{group}</A>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</H3>
<DIV CLASS="tabs">
+2
Ver Arquivo
@@ -1,3 +1,5 @@
</DIV>
<SCRIPT TYPE="text/javascript"><!--
// Hide custom options parameters for browsers that understand Javascript
var paramtables = document.getElementsByName("paramtable");
+6
Ver Arquivo
@@ -1,2 +1,8 @@
<DIV CLASS="indent">
<H2 CLASS="title">Print Test Page On {printer_name}</H2>
<P>Test page sent; job ID is <A HREF="/{SECTION}/{printer_name}">
{printer_name}-{job_id}</A>.</P>
</DIV>
-22
Ver Arquivo
@@ -1,22 +0,0 @@
#!/bin/sh
#
# Check .po files to see if there are untranslated or fuzzy strings.
#
# Usage: checkpo filename.po [ ... filenameN.po]
#
if test $# = 1; then
echo Usage: checkpo filename.po ... filenameN.po
exit 1
fi
echo "Catalog Untrans Fuzzy"
echo "-------------------- ------- -------"
for file in $*; do
untranslated=`msgattrib --untranslated $file | grep 'msgid "..*"' | wc -l`
fuzzy=`grep fuzzy $file | wc -l`
printf "%-20.20s %7d %7d\n" $file $untranslated $fuzzy
done