diff options
author | jlovell <jlovell@a1ca3aef-8c08-0410-bb20-df032aa958be> | 2006-01-26 21:39:43 +0000 |
---|---|---|
committer | jlovell <jlovell@a1ca3aef-8c08-0410-bb20-df032aa958be> | 2006-01-26 21:39:43 +0000 |
commit | fa73b22906f71080fa5056485d8204612717adac (patch) | |
tree | f2f23b68c20d1fc9a85301527690aca5efa382df | |
parent | 4a09f02d10d679af0b04d36c25f0dcb518e432a4 (diff) |
Load cups into easysw/current.
git-svn-id: svn+ssh://src.apple.com/svn/cups/easysw/current@13 a1ca3aef-8c08-0410-bb20-df032aa958be
202 files changed, 26541 insertions, 22523 deletions
diff --git a/CHANGES.txt b/CHANGES.txt index b2e1670fc..2e9f452f2 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,8 +1,15 @@ -CHANGES.txt - 01/12/2006 +CHANGES.txt - 01/18/2006 ------------------------ CHANGES IN CUPS V1.2.0b1 + - All of the Berkeley (except for lpc) and System V + commands now support specification of user, host, and + port (STR #1028, STR #1029, STR #1087) + - The lpmove command now allows you to move all jobs for + a given queue (STR #56) + - The web interface now supports moving of a job or jobs + to another queue (STR #56) - The web interface now provides searching, paging, and changing of the sort/display order of classes, jobs, and printers. @@ -13,9 +20,9 @@ CHANGES IN CUPS V1.2.0b1 UI text (STR #1101) - Printer names can now (reliably) contain Unicode characters (STR #896) - - The "lpstat -p" command now shows the time and date of - the last printer state change instead of the hardcoded - "Jan 01 00:00" (STR #659) + - The lpstat command now shows the time and date of the + last printer state change instead of the hardcoded "Jan + 01 00:00" (STR #659) - The scheduler now adds a job-actual-printer-uri attribute to job objects when printing to a class (STR #116) @@ -1,9 +1,9 @@ # -# "$Id: Makefile 4835 2005-11-12 22:00:16Z mike $" +# "$Id: Makefile 4971 2006-01-24 14:33:18Z mike $" # # Top-level Makefile for the Common UNIX Printing System (CUPS). # -# Copyright 1997-2004 by Easy Software Products, all rights reserved. +# Copyright 1997-2006 by Easy Software Products, all rights reserved. # # These coded instructions, statements, and computer programs are the # property of Easy Software Products and are protected by Federal @@ -92,25 +92,25 @@ install: installhdrs echo Installing startup script... if test "x$(INITDIR)" != "x"; then \ $(INSTALL_DIR) $(BUILDROOT)$(INITDIR)/init.d; \ - $(INSTALL_SCRIPT) cups.sh $(BUILDROOT)$(INITDIR)/init.d/cups; \ + $(INSTALL_SCRIPT) init/cups.sh $(BUILDROOT)$(INITDIR)/init.d/cups; \ $(INSTALL_DIR) $(BUILDROOT)$(INITDIR)/rc0.d; \ - $(INSTALL_SCRIPT) cups.sh $(BUILDROOT)$(INITDIR)/rc0.d/K00cups; \ + $(INSTALL_SCRIPT) init/cups.sh $(BUILDROOT)$(INITDIR)/rc0.d/K00cups; \ $(INSTALL_DIR) $(BUILDROOT)$(INITDIR)/rc2.d; \ - $(INSTALL_SCRIPT) cups.sh $(BUILDROOT)$(INITDIR)/rc2.d/S99cups; \ + $(INSTALL_SCRIPT) init/cups.sh $(BUILDROOT)$(INITDIR)/rc2.d/S99cups; \ $(INSTALL_DIR) $(BUILDROOT)$(INITDIR)/rc3.d; \ - $(INSTALL_SCRIPT) cups.sh $(BUILDROOT)$(INITDIR)/rc3.d/S99cups; \ + $(INSTALL_SCRIPT) init/cups.sh $(BUILDROOT)$(INITDIR)/rc3.d/S99cups; \ $(INSTALL_DIR) $(BUILDROOT)$(INITDIR)/rc5.d; \ - $(INSTALL_SCRIPT) cups.sh $(BUILDROOT)$(INITDIR)/rc5.d/S99cups; \ + $(INSTALL_SCRIPT) init/cups.sh $(BUILDROOT)$(INITDIR)/rc5.d/S99cups; \ fi if test "x$(INITDIR)" = "x" -a "x$(INITDDIR)" != "x"; then \ $(INSTALL_DIR) $(BUILDROOT)$(INITDDIR); \ if test "$(INITDDIR)" = "/System/Library/StartupItems/PrintingServices"; then \ - $(INSTALL_SCRIPT) cups.osx $(BUILDROOT)$(INITDDIR)/PrintingServices; \ - $(INSTALL_DATA) cups.plist $(BUILDROOT)$(INITDDIR)/StartupParameters.plist; \ + $(INSTALL_SCRIPT) init/cups.osx $(BUILDROOT)$(INITDDIR)/PrintingServices; \ + $(INSTALL_DATA) init/cups.plist $(BUILDROOT)$(INITDDIR)/StartupParameters.plist; \ $(INSTALL_DIR) $(BUILDROOT)$(INITDDIR)/Resources/English.lproj; \ - $(INSTALL_DATA) cups.strings $(BUILDROOT)$(INITDDIR)/Resources/English.lproj/Localizable.strings; \ + $(INSTALL_DATA) init/cups.strings $(BUILDROOT)$(INITDDIR)/Resources/English.lproj/Localizable.strings; \ else \ - $(INSTALL_SCRIPT) cups.sh $(BUILDROOT)$(INITDDIR)/cups; \ + $(INSTALL_SCRIPT) init/cups.sh $(BUILDROOT)$(INITDDIR)/cups; \ fi \ fi @@ -167,5 +167,5 @@ tardist: epm $(EPMFLAGS) -f tardist cups packaging/cups.list # -# End of "$Id: Makefile 4835 2005-11-12 22:00:16Z mike $". +# End of "$Id: Makefile 4971 2006-01-24 14:33:18Z mike $". # diff --git a/backend/ipp.c b/backend/ipp.c index 47cee2b91..468f69dd2 100644 --- a/backend/ipp.c +++ b/backend/ipp.c @@ -1,5 +1,5 @@ /* - * "$Id: ipp.c 4906 2006-01-10 20:53:28Z mike $" + * "$Id: ipp.c 4926 2006-01-13 03:12:13Z mike $" * * IPP backend for the Common UNIX Printing System (CUPS). * @@ -68,8 +68,7 @@ static char tmpfilename[1024] = ""; /* Temporary spool file name */ * Local functions... */ -void check_printer_state(http_t *http, cups_lang_t *language, - const char *charset, const char *uri, /* I - Printer URI */ +void check_printer_state(http_t *http, const char *uri, const char *resource, const char *user, int version); const char *password_cb(const char *); @@ -119,12 +118,9 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */ ipp_attribute_t *job_sheets; /* job-media-sheets-completed attribute */ ipp_attribute_t *job_state; /* job-state attribute */ ipp_attribute_t *copies_sup; /* copies-supported attribute */ - ipp_attribute_t *charset_sup; /* charset-supported attribute */ ipp_attribute_t *format_sup; /* document-format-supported attribute */ ipp_attribute_t *printer_state; /* printer-state attribute */ ipp_attribute_t *printer_accepting; /* printer-is-accepting-jobs attribute */ - const char *charset; /* Character set to use */ - cups_lang_t *language; /* Default language */ int copies; /* Number of copies remaining */ const char *content_type; /* CONTENT_TYPE environment variable */ #if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET) @@ -135,7 +131,6 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */ static const char * const pattrs[] = { /* Printer attributes we want */ "copies-supported", - "charset-supported", "document-format-supported", "printer-is-accepting-jobs", "printer-state", @@ -539,11 +534,9 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */ * don't support the copies attribute... */ - language = cupsLangDefault(); - charset_sup = NULL; - copies_sup = NULL; - format_sup = NULL; - supported = NULL; + copies_sup = NULL; + format_sup = NULL; + supported = NULL; do { @@ -551,17 +544,8 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */ * Build the IPP request... */ - request = ippNew(); - request->request.op.version[1] = version; - request->request.op.operation_id = IPP_GET_PRINTER_ATTRIBUTES; - request->request.op.request_id = 1; - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET, - "attributes-charset", NULL, "utf-8"); - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE, - "attributes-natural-language", NULL, - language != NULL ? language->language : "en"); + request = ippNewRequest(IPP_GET_PRINTER_ATTRIBUTES); + request->request.op.version[1] = version; ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, uri); @@ -634,10 +618,8 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */ copies_sup = NULL; /* No */ } - charset_sup = ippFindAttribute(supported, "charset-supported", - IPP_TAG_CHARSET); - format_sup = ippFindAttribute(supported, "document-format-supported", - IPP_TAG_MIMETYPE); + format_sup = ippFindAttribute(supported, "document-format-supported", + IPP_TAG_MIMETYPE); if (format_sup) { @@ -705,43 +687,6 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */ copies = atoi(argv[4]); /* - * Figure out the character set to use... - */ - - charset = language ? cupsLangEncoding(language) : "us-ascii"; - - if (charset_sup) - { - /* - * See if IPP server supports the requested character set... - */ - - for (i = 0; i < charset_sup->num_values; i ++) - if (strcasecmp(charset, charset_sup->values[i].string.text) == 0) - break; - - /* - * If not, choose us-ascii or utf-8... - */ - - if (i >= charset_sup->num_values) - { - /* - * See if us-ascii is supported... - */ - - for (i = 0; i < charset_sup->num_values; i ++) - if (strcasecmp("us-ascii", charset_sup->values[i].string.text) == 0) - break; - - if (i < charset_sup->num_values) - charset = "us-ascii"; - else - charset = "utf-8"; - } - } - - /* * Then issue the print-job request... */ @@ -753,17 +698,8 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */ * Build the IPP request... */ - request = ippNew(); - request->request.op.version[1] = version; - request->request.op.operation_id = IPP_PRINT_JOB; - request->request.op.request_id = 1; - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET, - "attributes-charset", NULL, charset); - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE, - "attributes-natural-language", NULL, - language != NULL ? language->language : "en"); + request = ippNewRequest(IPP_PRINT_JOB); + request->request.op.version[1] = version; ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, uri); @@ -923,17 +859,8 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */ * Build an IPP_GET_JOB_ATTRIBUTES request... */ - request = ippNew(); - request->request.op.version[1] = version; - request->request.op.operation_id = IPP_GET_JOB_ATTRIBUTES; - request->request.op.request_id = 1; - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET, - "attributes-charset", NULL, charset); - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE, - "attributes-natural-language", NULL, - language != NULL ? language->language : "en"); + request = ippNewRequest(IPP_GET_JOB_ATTRIBUTES); + request->request.op.version[1] = version; ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, uri); @@ -999,8 +926,9 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */ if (job_state->values[0].integer > IPP_JOB_PROCESSING || job_state->values[0].integer == IPP_JOB_HELD) { - if ((job_sheets = ippFindAttribute(response, "job-media-sheets-completed", - IPP_TAG_INTEGER)) != NULL) + if ((job_sheets = ippFindAttribute(response, + "job-media-sheets-completed", + IPP_TAG_INTEGER)) != NULL) fprintf(stderr, "PAGE: total %d\n", job_sheets->values[0].integer); ippDelete(response); @@ -1016,11 +944,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */ * Check the printer state and report it if necessary... */ -/* if (!copies_sup) - httpReconnect(http);*/ - - check_printer_state(http, language, charset, uri, resource, argv[2], - version); + check_printer_state(http, uri, resource, argv[2], version); /* * Wait 10 seconds before polling again... @@ -1037,7 +961,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */ /* if (!copies_sup) httpReconnect(http);*/ - check_printer_state(http, language, charset, uri, resource, argv[2], version); + check_printer_state(http, uri, resource, argv[2], version); /* * Free memory... @@ -1073,16 +997,12 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */ */ void -check_printer_state(http_t *http, /* I - HTTP connection */ - cups_lang_t *language, - /* I - Language */ - const char *charset, - /* I - Charset */ - const char *uri, /* I - Printer URI */ - const char *resource, - /* I - Resource path */ - const char *user, /* I - Username, if any */ - int version)/* I - IPP version */ +check_printer_state( + http_t *http, /* I - HTTP connection */ + const char *uri, /* I - Printer URI */ + const char *resource, /* I - Resource path */ + const char *user, /* I - Username, if any */ + int version) /* I - IPP version */ { ipp_t *request, /* IPP request */ *response; /* IPP response */ @@ -1092,17 +1012,8 @@ check_printer_state(http_t *http, /* I - HTTP connection */ * Check on the printer state... */ - request = ippNew(); - request->request.op.version[1] = version; - request->request.op.operation_id = IPP_GET_PRINTER_ATTRIBUTES; - request->request.op.request_id = 1; - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET, - "attributes-charset", NULL, charset); - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE, - "attributes-natural-language", NULL, - language != NULL ? language->language : "en"); + request = ippNewRequest(IPP_GET_PRINTER_ATTRIBUTES); + request->request.op.version[1] = version; ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, uri); @@ -1130,8 +1041,8 @@ check_printer_state(http_t *http, /* I - HTTP connection */ * 'password_cb()' - Disable the password prompt for cupsDoFileRequest(). */ -const char * /* O - Password */ -password_cb(const char *prompt) /* I - Prompt (not used) */ +const char * /* O - Password */ +password_cb(const char *prompt) /* I - Prompt (not used) */ { (void)prompt; @@ -1279,17 +1190,17 @@ report_printer_state(ipp_t *ipp) /* I - IPP response */ * PostScript file for printing... */ -int /* O - Exit status of filter */ -run_pictwps_filter(char **argv, /* I - Command-line arguments */ - const char *filename) /* I - Filename */ +int /* O - Exit status of filter */ +run_pictwps_filter(char **argv, /* I - Command-line arguments */ + const char *filename)/* I - Filename */ { - struct stat fileinfo; /* Print file information */ - const char *ppdfile; /* PPD file for destination printer */ - int pid; /* Child process ID */ - int fd; /* Temporary file descriptor */ - int status; /* Exit status of filter */ - const char *printer; /* PRINTER env var */ - static char ppdenv[1024]; /* PPD environment variable */ + struct stat fileinfo; /* Print file information */ + const char *ppdfile; /* PPD file for destination printer */ + int pid; /* Child process ID */ + int fd; /* Temporary file descriptor */ + int status; /* Exit status of filter */ + const char *printer; /* PRINTER env var */ + static char ppdenv[1024]; /* PPD environment variable */ /* @@ -1464,5 +1375,5 @@ sigterm_handler(int sig) /* I - Signal */ /* - * End of "$Id: ipp.c 4906 2006-01-10 20:53:28Z mike $". + * End of "$Id: ipp.c 4926 2006-01-13 03:12:13Z mike $". */ diff --git a/backend/lpd.c b/backend/lpd.c index ee6d3deaa..9407fe6cf 100644 --- a/backend/lpd.c +++ b/backend/lpd.c @@ -1,5 +1,5 @@ /* - * "$Id: lpd.c 4906 2006-01-10 20:53:28Z mike $" + * "$Id: lpd.c 4991 2006-01-26 15:01:46Z mike $" * * Line Printer Daemon backend for the Common UNIX Printing System (CUPS). * @@ -59,6 +59,10 @@ # include <arpa/inet.h> # include <netdb.h> #endif /* WIN32 */ +#ifdef __APPLE__ +# include <CoreFoundation/CFNumber.h> +# include <CoreFoundation/CFPreferences.h> +#endif /* __APPLE__ */ /* @@ -95,7 +99,7 @@ static int lpd_queue(const char *hostname, int port, const char *printer, const char *filename, const char *user, const char *title, int copies, int banner, int format, int order, int reserve, - int manual_copies, int timeout); + int manual_copies, int timeout, int contimeout); static void lpd_timeout(int sig); static int lpd_write(int lpd_fd, char *buffer, int length); #ifndef HAVE_RRESVPORT_AF @@ -135,6 +139,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */ int sanitize_title; /* Sanitize title string? */ int manual_copies, /* Do manual copies? */ timeout, /* Timeout */ + contimeout, /* Connection timeout */ copies; /* Number of copies */ #if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET) struct sigaction action; /* Actions for POSIX signals */ @@ -243,18 +248,41 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */ * See if there are any options... */ - banner = 0; - format = 'l'; - order = ORDER_CONTROL_DATA; - reserve = RESERVE_ANY; - manual_copies = 1; - timeout = 300; - sanitize_title = 1; + banner = 0; + format = 'l'; + order = ORDER_CONTROL_DATA; + reserve = RESERVE_ANY; + manual_copies = 1; + timeout = 300; + contimeout = 7 * 24 * 60 * 60; -#if defined(__APPLE__) +#ifdef __APPLE__ /* We want to pass utf-8 characters, not re-map them (3071945) */ - sanitize_title= 0; -#endif + sanitize_title = 0; + + { + CFPropertyListRef pvalue; /* Preference value */ + SInt32 toval; /* Timeout value */ + + + pvalue = CFPreferencesCopyValue(CFSTR("timeout"), + CFSTR("com.apple.print.backends"), + kCFPreferencesAnyUser, + kCFPreferencesCurrentHost); + if (pvalue) + { + if (CFGetTypeID(pvalue) == CFNumberGetTypeID()) + { + CFNumberGetValue(pvalue, kCFNumberSInt32Type, &toval); + contimeout = (int)toval; + } + + CFRelease(pvalue); + } + } +#else + sanitize_title = 1; +#endif /* __APPLE__ */ if ((options = strchr(resource, '?')) != NULL) { @@ -293,7 +321,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */ *ptr++ = *options++; *ptr = '\0'; - if (*options == '+') + if (*options == '+' || *options == '&') options ++; } else @@ -303,51 +331,47 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */ * Process the option... */ - if (strcasecmp(name, "banner") == 0) + if (!strcasecmp(name, "banner")) { /* * Set the banner... */ - banner = !value[0] || - strcasecmp(value, "on") == 0 || - strcasecmp(value, "yes") == 0 || - strcasecmp(value, "true") == 0; + banner = !value[0] || !strcasecmp(value, "on") || + !strcasecmp(value, "yes") || !strcasecmp(value, "true"); } - else if (strcasecmp(name, "format") == 0 && value[0]) + else if (!strcasecmp(name, "format") && value[0]) { /* * Set output format... */ - if (strchr("cdfglnoprtv", value[0]) != NULL) + if (strchr("cdfglnoprtv", value[0])) format = value[0]; else fprintf(stderr, "ERROR: Unknown format character \"%c\"\n", value[0]); } - else if (strcasecmp(name, "order") == 0 && value[0]) + else if (!strcasecmp(name, "order") && value[0]) { /* * Set control/data order... */ - if (strcasecmp(value, "control,data") == 0) + if (!strcasecmp(value, "control,data")) order = ORDER_CONTROL_DATA; - else if (strcasecmp(value, "data,control") == 0) + else if (!strcasecmp(value, "data,control")) order = ORDER_DATA_CONTROL; else fprintf(stderr, "ERROR: Unknown file order \"%s\"\n", value); } - else if (strcasecmp(name, "reserve") == 0) + else if (!strcasecmp(name, "reserve")) { /* * Set port reservation mode... */ - if (!value[0] || - !strcasecmp(value, "on") || - !strcasecmp(value, "yes") || - !strcasecmp(value, "true") || + if (!value[0] || !strcasecmp(value, "on") || + !strcasecmp(value, "yes") || !strcasecmp(value, "true") || !strcasecmp(value, "rfc1179")) reserve = RESERVE_RFC1179; else if (!strcasecmp(value, "any")) @@ -355,29 +379,25 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */ else reserve = RESERVE_NONE; } - else if (strcasecmp(name, "manual_copies") == 0) + else if (!strcasecmp(name, "manual_copies")) { /* * Set manual copies... */ - manual_copies = !value[0] || - strcasecmp(value, "on") == 0 || - strcasecmp(value, "yes") == 0 || - strcasecmp(value, "true") == 0; + manual_copies = !value[0] || !strcasecmp(value, "on") || + !strcasecmp(value, "yes") || !strcasecmp(value, "true"); } - else if (strcasecmp(name, "sanitize_title") == 0) + else if (!strcasecmp(name, "sanitize_title")) { /* * Set sanitize title... */ - sanitize_title = !value[0] || - strcasecmp(value, "on") == 0 || - strcasecmp(value, "yes") == 0 || - strcasecmp(value, "true") == 0; + sanitize_title = !value[0] || !strcasecmp(value, "on") || + !strcasecmp(value, "yes") || !strcasecmp(value, "true"); } - else if (strcasecmp(name, "timeout") == 0) + else if (!strcasecmp(name, "timeout")) { /* * Set the timeout... @@ -386,6 +406,15 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */ if (atoi(value) > 0) timeout = atoi(value); } + else if (!strcasecmp(name, "contimeout")) + { + /* + * Set the timeout... + */ + + if (atoi(value) > 0) + contimeout = atoi(value); + } } } @@ -426,7 +455,8 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */ status = lpd_queue(hostname, port, resource + 1, filename, username, title, copies, - banner, format, order, reserve, manual_copies, timeout); + banner, format, order, reserve, manual_copies, + timeout, contimeout); if (!status) fprintf(stderr, "PAGE: 1 %d\n", atoi(argv[4])); @@ -434,7 +464,8 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */ else status = lpd_queue(hostname, port, resource + 1, filename, username, title, 1, - banner, format, order, reserve, 1, timeout); + banner, format, order, reserve, 1, + timeout, contimeout); /* * Remove the temporary file if necessary... @@ -536,7 +567,8 @@ lpd_queue(const char *hostname, /* I - Host to connect to */ int order, /* I - Order of data/control files */ int reserve, /* I - Reserve ports? */ int manual_copies, /* I - Do copies by hand... */ - int timeout) /* I - Timeout... */ + int timeout, /* I - Timeout... */ + int contimeout) /* I - Connection timeout */ { FILE *fp; /* Job file */ char localhost[255]; /* Local host name */ @@ -551,6 +583,10 @@ lpd_queue(const char *hostname, /* I - Host to connect to */ http_addrlist_t *addrlist, /* Address list */ *addr; /* Socket address */ int copy; /* Copies written */ + time_t start_time; /* Time of first connect */ +#ifdef __APPLE__ + int recoverable; /* Recoverable error shown? */ +#endif /* __APPLE__ */ size_t nbytes; /* Number of bytes written */ off_t tbytes; /* Total bytes written */ char buffer[65536]; /* Output buffer */ @@ -589,6 +625,15 @@ lpd_queue(const char *hostname, /* I - Host to connect to */ } /* + * Remember when we starting trying to connect to the printer... + */ + +#ifdef __APPLE__ + recoverable = 0; +#endif /* __APPLE__ */ + start_time = time(NULL); + + /* * Loop forever trying to print the file... */ @@ -714,7 +759,20 @@ lpd_queue(const char *hostname, /* I - Host to connect to */ if (error == ECONNREFUSED || error == EHOSTDOWN || error == EHOSTUNREACH) { - fprintf(stderr, "WARNING: Network host \'%s\' is busy, down, or unreachable; will retry in 30 seconds...\n", + if (contimeout && (time(NULL) - start_time) > contimeout) + { + fputs("ERROR: Printer not responding!\n", stderr); + return (CUPS_BACKEND_FAILED); + } + +#ifdef __APPLE__ + recoverable = 1; + fprintf(stderr, "WARNING: recoverable: " +#else + fprintf(stderr, "WARNING: " +#endif /* __APPLE__ */ + "Network host \'%s\' is busy, down, or " + "unreachable; will retry in 30 seconds...\n", hostname); sleep(30); } @@ -728,11 +786,31 @@ lpd_queue(const char *hostname, /* I - Host to connect to */ } else { - perror("ERROR: Unable to connect to printer; will retry in 30 seconds..."); +#ifdef __APPLE__ + recoverable = 1; + perror("ERROR: recoverable: " +#else + perror("ERROR: " +#endif /* __APPLE__ */ + "Unable to connect to printer; will retry in 30 seconds..."); sleep(30); } } +#ifdef __APPLE__ + if (recoverable) + { + /* + * If we've shown a recoverable error make sure the printer proxies + * have a chance to see the recovered message. Not pretty but + * necessary for now... + */ + + fputs("INFO: recovered: \n", stderr); + sleep(5); + } +#endif /* __APPLE__ */ + fprintf(stderr, "INFO: Connected to %s...\n", hostname); fprintf(stderr, "DEBUG: Connected on ports %d (local %d)...\n", port, lport); @@ -1145,5 +1223,5 @@ sigterm_handler(int sig) /* I - Signal */ /* - * End of "$Id: lpd.c 4906 2006-01-10 20:53:28Z mike $". + * End of "$Id: lpd.c 4991 2006-01-26 15:01:46Z mike $". */ diff --git a/backend/socket.c b/backend/socket.c index 54b6a7796..240adca1f 100644 --- a/backend/socket.c +++ b/backend/socket.c @@ -1,5 +1,5 @@ /* - * "$Id: socket.c 4906 2006-01-10 20:53:28Z mike $" + * "$Id: socket.c 4974 2006-01-25 07:04:33Z mike $" * * AppSocket backend for the Common UNIX Printing System (CUPS). * @@ -71,9 +71,14 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */ char method[255], /* Method in URI */ hostname[1024], /* Hostname */ username[255], /* Username info (not used) */ - resource[1024]; /* Resource info (not used) */ + resource[1024], /* Resource info (not used) */ + *options, /* Pointer to options */ + name[255], /* Name of option */ + value[255], /* Value of option */ + *ptr; /* Pointer into name or value */ int fp; /* Print file */ int copies; /* Number of copies to print */ + int waiteof; /* Wait for end-of-file? */ int port; /* Port number */ char portname[255]; /* Port name */ int delay; /* Delay for retries... */ @@ -167,6 +172,71 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */ port = 9100; /* Default to HP JetDirect/Tektronix PhaserShare */ /* + * Get options, if any... + */ + + waiteof = 1; + + if ((options = strchr(resource, '?')) != NULL) + { + /* + * Yup, terminate the device name string and move to the first + * character of the options... + */ + + *options++ = '\0'; + + /* + * Parse options... + */ + + while (*options) + { + /* + * Get the name... + */ + + for (ptr = name; *options && *options != '=';) + if (ptr < (name + sizeof(name) - 1)) + *ptr++ = *options++; + *ptr = '\0'; + + if (*options == '=') + { + /* + * Get the value... + */ + + options ++; + + for (ptr = value; *options && *options != '+' && *options != '&';) + if (ptr < (value + sizeof(value) - 1)) + *ptr++ = *options++; + *ptr = '\0'; + + if (*options == '+' || *options == '&') + options ++; + } + else + value[0] = '\0'; + + /* + * Process the option... + */ + + if (!strcasecmp(name, "waiteof")) + { + /* + * Set the wait-for-eof value... + */ + + waiteof = !value[0] || !strcasecmp(value, "on") || + !strcasecmp(value, "yes") || !strcasecmp(value, "true"); + } + } + } + + /* * Then try to connect to the remote host... */ @@ -346,48 +416,51 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */ (unsigned long)tbytes); } - /* - * Shutdown the socket and wait for the other end to finish... - */ - - fputs("INFO: Print file sent, waiting for printer to finish...\n", stderr); - - shutdown(fd, 1); - - for (;;) + if (waiteof) { /* - * Wait a maximum of 90 seconds for backchannel data or a closed - * connection... + * Shutdown the socket and wait for the other end to finish... */ - timeout.tv_sec = 90; - timeout.tv_usec = 0; + fputs("INFO: Print file sent, waiting for printer to finish...\n", stderr); - FD_ZERO(&input); - FD_SET(fd, &input); + shutdown(fd, 1); -#ifdef __hpux - if (select(fd + 1, (int *)&input, NULL, NULL, &timeout) > 0) -#else - if (select(fd + 1, &input, NULL, NULL, &timeout) > 0) -#endif /* __hpux */ + for (;;) { /* - * Grab the data coming back and spit it out to stderr... + * Wait a maximum of 90 seconds for backchannel data or a closed + * connection... */ - if ((rbytes = recv(fd, resource, sizeof(resource), 0)) > 0) + timeout.tv_sec = 90; + timeout.tv_usec = 0; + + FD_ZERO(&input); + FD_SET(fd, &input); + + #ifdef __hpux + if (select(fd + 1, (int *)&input, NULL, NULL, &timeout) > 0) + #else + if (select(fd + 1, &input, NULL, NULL, &timeout) > 0) + #endif /* __hpux */ { - fprintf(stderr, "DEBUG: Received %d bytes of back-channel data!\n", - rbytes); - cupsBackchannelWrite(resource, rbytes, 1.0); - } + /* + * Grab the data coming back and spit it out to stderr... + */ + + if ((rbytes = recv(fd, resource, sizeof(resource), 0)) > 0) + { + fprintf(stderr, "DEBUG: Received %d bytes of back-channel data!\n", + rbytes); + cupsBackchannelWrite(resource, rbytes, 1.0); + } + else + break; + } else break; } - else - break; } /* @@ -414,5 +487,5 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */ /* - * End of "$Id: socket.c 4906 2006-01-10 20:53:28Z mike $". + * End of "$Id: socket.c 4974 2006-01-25 07:04:33Z mike $". */ diff --git a/berkeley/lpc.c b/berkeley/lpc.c index 4b80a618d..5edbeafb7 100644 --- a/berkeley/lpc.c +++ b/berkeley/lpc.c @@ -1,5 +1,5 @@ /* - * "$Id: lpc.c 4906 2006-01-10 20:53:28Z mike $" + * "$Id: lpc.c 4948 2006-01-19 03:23:41Z mike $" * * "lpc" command for the Common UNIX Printing System (CUPS). * @@ -85,7 +85,7 @@ main(int argc, /* I - Number of command-line arguments */ * Do the command prompt thing... */ - printf("lpc> "); + _cupsLangPuts(stdout, _("lpc> ")); while (fgets(line, sizeof(line), stdin) != NULL) { /* @@ -113,7 +113,7 @@ main(int argc, /* I - Number of command-line arguments */ * Nothing left, just show a prompt... */ - printf("lpc> "); + _cupsLangPuts(stdout, _("lpc> ")); continue; } @@ -149,7 +149,7 @@ main(int argc, /* I - Number of command-line arguments */ * Put another prompt out to the user... */ - printf("lpc> "); + _cupsLangPuts(stdout, _("lpc> ")); } } @@ -197,7 +197,7 @@ do_command(http_t *http, /* I - HTTP connection to server */ else if (!compare_strings(command, "help", 1) || !strcmp(command, "?")) show_help(params); else - _cupsLangPrintf(stdout, cupsLangDefault(), + _cupsLangPrintf(stdout, _("%s is not implemented by the CUPS version of lpc.\n"), command); } @@ -212,20 +212,17 @@ show_help(const char *command) /* I - Command to describe or NULL */ { if (!command) { - _cupsLangPrintf(stdout, cupsLangDefault(), + _cupsLangPrintf(stdout, _("Commands may be abbreviated. Commands are:\n" "\n" "exit help quit status ?\n")); } else if (!compare_strings(command, "help", 1) || !strcmp(command, "?")) - _cupsLangPrintf(stdout, cupsLangDefault(), - _("help\t\tget help on commands\n")); + _cupsLangPrintf(stdout, _("help\t\tget help on commands\n")); else if (!compare_strings(command, "status", 4)) - _cupsLangPrintf(stdout, cupsLangDefault(), - _("status\t\tshow status of daemon and queue\n")); + _cupsLangPrintf(stdout, _("status\t\tshow status of daemon and queue\n")); else - _cupsLangPrintf(stdout, cupsLangDefault(), - _("?Invalid help command unknown\n")); + _cupsLangPrintf(stdout, _("?Invalid help command unknown\n")); } @@ -474,7 +471,7 @@ show_status(http_t *http, /* I - HTTP connection to server */ printf("%s:\n", printer); if (!strncmp(device, "file:", 5)) - _cupsLangPrintf(stdout, language, + _cupsLangPrintf(stdout, _("\tprinter is on device \'%s\' speed -1\n"), device + 5); else @@ -486,28 +483,28 @@ show_status(http_t *http, /* I - HTTP connection to server */ if ((delimiter = strchr(device, ':')) != NULL ) { *delimiter = '\0'; - _cupsLangPrintf(stdout, language, + _cupsLangPrintf(stdout, _("\tprinter is on device \'%s\' speed -1\n"), device); } } if (accepting) - _cupsLangPuts(stdout, language, _("\tqueuing is enabled\n")); + _cupsLangPuts(stdout, _("\tqueuing is enabled\n")); else - _cupsLangPuts(stdout, language, _("\tqueuing is disabled\n")); + _cupsLangPuts(stdout, _("\tqueuing is disabled\n")); if (pstate != IPP_PRINTER_STOPPED) - _cupsLangPuts(stdout, language, _("\tprinting is enabled\n")); + _cupsLangPuts(stdout, _("\tprinting is enabled\n")); else - _cupsLangPuts(stdout, language, _("\tprinting is disabled\n")); + _cupsLangPuts(stdout, _("\tprinting is disabled\n")); if (jobcount == 0) - _cupsLangPuts(stdout, language, _("\tno entries\n")); + _cupsLangPuts(stdout, _("\tno entries\n")); else - _cupsLangPrintf(stdout, language, _("\t%d entries\n"), jobcount); + _cupsLangPrintf(stdout, _("\t%d entries\n"), jobcount); - _cupsLangPuts(stdout, language, _("\tdaemon present\n")); + _cupsLangPuts(stdout, _("\tdaemon present\n")); } if (attr == NULL) @@ -520,5 +517,5 @@ show_status(http_t *http, /* I - HTTP connection to server */ /* - * End of "$Id: lpc.c 4906 2006-01-10 20:53:28Z mike $". + * End of "$Id: lpc.c 4948 2006-01-19 03:23:41Z mike $". */ diff --git a/berkeley/lpq.c b/berkeley/lpq.c index a5e009171..6fd1dfc91 100644 --- a/berkeley/lpq.c +++ b/berkeley/lpq.c @@ -1,5 +1,5 @@ /* - * "$Id: lpq.c 4906 2006-01-10 20:53:28Z mike $" + * "$Id: lpq.c 4948 2006-01-19 03:23:41Z mike $" * * "lpq" command for the Common UNIX Printing System (CUPS). * @@ -49,9 +49,9 @@ * Local functions... */ -static int show_jobs(http_t *, const char *, const char *, const int, - const int); -static void show_printer(http_t *, const char *); +static int show_jobs(const char *, http_t *, const char *, + const char *, const int, const int); +static void show_printer(const char *, http_t *, const char *); static void usage(void); @@ -60,24 +60,24 @@ static void usage(void); */ int -main(int argc, /* I - Number of command-line arguments */ - char *argv[]) /* I - Command-line arguments */ +main(int argc, /* I - Number of command-line arguments */ + char *argv[]) /* I - Command-line arguments */ { - int i; /* Looping var */ - http_t *http; /* Connection to server */ - const char *dest, /* Desired printer */ - *user, /* Desired user */ - *val; /* Environment variable name */ - char *instance; /* Printer instance */ - int id, /* Desired job ID */ - all, /* All printers */ - interval, /* Reporting interval */ - longstatus; /* Show file details */ - int num_dests; /* Number of destinations */ - cups_dest_t *dests; /* Destinations */ - cups_lang_t *language; /* Language */ + int i; /* Looping var */ + http_t *http; /* Connection to server */ + const char *dest, /* Desired printer */ + *user, /* Desired user */ + *val; /* Environment variable name */ + char *instance; /* Printer instance */ + int id, /* Desired job ID */ + all, /* All printers */ + interval, /* Reporting interval */ + longstatus; /* Show file details */ + int num_dests; /* Number of destinations */ + cups_dest_t *dests; /* Destinations */ + cups_lang_t *language; /* Language */ #ifdef HAVE_SSL - http_encryption_t encryption; /* Encryption? */ + http_encryption_t encryption; /* Encryption? */ #endif /* HAVE_SSL */ @@ -90,8 +90,7 @@ main(int argc, /* I - Number of command-line arguments */ if ((http = httpConnectEncrypt(cupsServer(), ippPort(), cupsEncryption())) == NULL) { - _cupsLangPuts(stderr, language, - _("lpq: Unable to contact server!\n")); + _cupsLangPrintf(stderr, _("%s: Unable to contact server!\n"), argv[0]); return (1); } @@ -121,12 +120,31 @@ main(int argc, /* I - Number of command-line arguments */ if (http) httpEncryption(http, encryption); #else - _cupsLangPrintf(stderr, language, + _cupsLangPrintf(stderr, _("%s: Sorry, no encryption support compiled in!\n"), argv[0]); #endif /* HAVE_SSL */ break; + case 'U' : /* Username */ + if (argv[i][2] != '\0') + cupsSetUser(argv[i] + 2); + else + { + i ++; + if (i >= argc) + { + _cupsLangPrintf(stderr, + _("%s: Error - expected username after " + "\'-U\' option!\n"), + argv[0]); + return (1); + } + + cupsSetUser(argv[i]); + } + break; + case 'P' : /* Printer */ if (argv[i][2]) dest = argv[i] + 2; @@ -151,12 +169,13 @@ main(int argc, /* I - Number of command-line arguments */ if (cupsGetDest(dest, instance, num_dests, dests) == NULL) { if (instance) - _cupsLangPrintf(stderr, language, - _("lpq: Unknown destination \"%s/%s\"!\n"), - dest, instance); + _cupsLangPrintf(stderr, + _("%s: Error - unknown destination \"%s/%s\"!\n"), + argv[0], dest, instance); else - _cupsLangPrintf(stderr, language, - _("lpq: Unknown destination \"%s\"!\n"), dest); + _cupsLangPrintf(stderr, + _("%s: Unknown destination \"%s\"!\n"), + argv[0], dest); return (1); } @@ -166,6 +185,29 @@ main(int argc, /* I - Number of command-line arguments */ all = 1; break; + case 'h' : /* Connect to host */ + if (http != NULL) + httpClose(http); + + if (argv[i][2] != '\0') + cupsSetServer(argv[i] + 2); + else + { + i ++; + + if (i >= argc) + { + _cupsLangPrintf(stderr, + _("%s: Error - expected hostname after " + "\'-h\' option!\n"), + argv[0]); + return (1); + } + else + cupsSetServer(argv[i]); + } + break; + case 'l' : /* Long status */ longstatus = 1; break; @@ -207,13 +249,14 @@ main(int argc, /* I - Number of command-line arguments */ val = "LPDEST"; if (dest && !cupsGetDest(dest, NULL, num_dests, dests)) - _cupsLangPrintf(stderr, language, - _("lp: error - %s environment variable names " + _cupsLangPrintf(stderr, + _("%s: error - %s environment variable names " "non-existent destination \"%s\"!\n"), - val, dest); + argv[0], val, dest); else - _cupsLangPuts(stderr, language, - _("lpq: error - no default destination available.\n")); + _cupsLangPrintf(stderr, + _("%s: error - no default destination available.\n"), + argv[0]); httpClose(http); cupsFreeDests(num_dests, dests); return (1); @@ -227,9 +270,9 @@ main(int argc, /* I - Number of command-line arguments */ for (;;) { if (dest) - show_printer(http, dest); + show_printer(argv[0], http, dest); - i = show_jobs(http, dest, user, id, longstatus); + i = show_jobs(argv[0], http, dest, user, id, longstatus); if (i && interval) { @@ -255,33 +298,33 @@ main(int argc, /* I - Number of command-line arguments */ * 'show_jobs()' - Show jobs. */ -static int /* O - Number of jobs in queue */ -show_jobs(http_t *http, /* I - HTTP connection to server */ - const char *dest, /* I - Destination */ - const char *user, /* I - User */ - const int id, /* I - Job ID */ - const int longstatus)/* I - 1 if long report desired */ +static int /* O - Number of jobs in queue */ +show_jobs(const char *command, /* I - Command name */ + http_t *http, /* I - HTTP connection to server */ + const char *dest, /* I - Destination */ + const char *user, /* I - User */ + const int id, /* I - Job ID */ + const int longstatus) /* I - 1 if long report desired */ { - ipp_t *request, /* IPP Request */ - *response; /* IPP Response */ - ipp_attribute_t *attr; /* Current attribute */ - cups_lang_t *language; /* Default language */ - const char *jobdest, /* Pointer into job-printer-uri */ - *jobuser, /* Pointer to job-originating-user-name */ - *jobname; /* Pointer to job-name */ - ipp_jstate_t jobstate; /* job-state */ - int jobid, /* job-id */ - jobsize, /* job-k-octets */ + ipp_t *request, /* IPP Request */ + *response; /* IPP Response */ + ipp_attribute_t *attr; /* Current attribute */ + const char *jobdest, /* Pointer into job-printer-uri */ + *jobuser, /* Pointer to job-originating-user-name */ + *jobname; /* Pointer to job-name */ + ipp_jstate_t jobstate; /* job-state */ + int jobid, /* job-id */ + jobsize, /* job-k-octets */ #ifdef __osf__ - jobpriority, /* job-priority */ + jobpriority, /* job-priority */ #endif /* __osf__ */ - jobcount, /* Number of jobs */ - jobcopies, /* Number of copies */ - rank; /* Rank of job */ - char resource[1024]; /* Resource string */ - char rankstr[255]; /* Rank string */ - char namestr[1024]; /* Job name string */ - static const char *ranks[10] =/* Ranking strings */ + jobcount, /* Number of jobs */ + jobcopies, /* Number of copies */ + rank; /* Rank of job */ + char resource[1024]; /* Resource string */ + char rankstr[255]; /* Rank string */ + char namestr[1024]; /* Job name string */ + static const char *ranks[10] = /* Ranking strings */ { "th", "st", @@ -311,18 +354,7 @@ show_jobs(http_t *http, /* I - HTTP connection to server */ * job-uri or printer-uri */ - request = ippNew(); - - request->request.op.operation_id = id ? IPP_GET_JOB_ATTRIBUTES : IPP_GET_JOBS; - request->request.op.request_id = 1; - - language = cupsLangDefault(); - - attr = ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET, - "attributes-charset", NULL, cupsLangEncoding(language)); - - attr = ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE, - "attributes-natural-language", NULL, language->language); + request = ippNewRequest(id ? IPP_GET_JOB_ATTRIBUTES : IPP_GET_JOBS); if (dest == NULL) { @@ -360,8 +392,7 @@ show_jobs(http_t *http, /* I - HTTP connection to server */ { if (response->request.status.status_code > IPP_OK_CONFLICT) { - _cupsLangPrintf(stderr, language, _("lpq: get-jobs failed: %s\n"), - ippErrorString(response->request.status.status_code)); + _cupsLangPrintf(stderr, "%s: %s\n", command, cupsLastErrorString()); ippDelete(response); return (0); } @@ -401,38 +432,38 @@ show_jobs(http_t *http, /* I - HTTP connection to server */ while (attr != NULL && attr->group_tag == IPP_TAG_JOB) { - if (strcmp(attr->name, "job-id") == 0 && + if (!strcmp(attr->name, "job-id") && attr->value_tag == IPP_TAG_INTEGER) jobid = attr->values[0].integer; - if (strcmp(attr->name, "job-k-octets") == 0 && + if (!strcmp(attr->name, "job-k-octets") && attr->value_tag == IPP_TAG_INTEGER) jobsize = attr->values[0].integer; #ifdef __osf__ - if (strcmp(attr->name, "job-priority") == 0 && + if (!strcmp(attr->name, "job-priority") && attr->value_tag == IPP_TAG_INTEGER) jobpriority = attr->values[0].integer; #endif /* __osf__ */ - if (strcmp(attr->name, "job-state") == 0 && + if (!strcmp(attr->name, "job-state") && attr->value_tag == IPP_TAG_ENUM) jobstate = (ipp_jstate_t)attr->values[0].integer; - if (strcmp(attr->name, "job-printer-uri") == 0 && + if (!strcmp(attr->name, "job-printer-uri") && attr->value_tag == IPP_TAG_URI) if ((jobdest = strrchr(attr->values[0].string.text, '/')) != NULL) jobdest ++; - if (strcmp(attr->name, "job-originating-user-name") == 0 && + if (!strcmp(attr->name, "job-originating-user-name") && attr->value_tag == IPP_TAG_NAME) jobuser = attr->values[0].string.text; - if (strcmp(attr->name, "job-name") == 0 && + if (!strcmp(attr->name, "job-name") && attr->value_tag == IPP_TAG_NAME) jobname = attr->values[0].string.text; - if (strcmp(attr->name, "copies") == 0 && + if (!strcmp(attr->name, "copies") && attr->value_tag == IPP_TAG_INTEGER) jobcopies = attr->values[0].integer; @@ -453,11 +484,11 @@ show_jobs(http_t *http, /* I - HTTP connection to server */ if (!longstatus && jobcount == 0) #ifdef __osf__ - _cupsLangPuts(stdout, language, + _cupsLangPuts(stdout, _("Rank Owner Pri Job Files" " Total Size\n")); #else - _cupsLangPuts(stdout, language, + _cupsLangPuts(stdout, _("Rank Owner Job File(s)" " Total Size\n")); #endif /* __osf__ */ @@ -487,7 +518,7 @@ show_jobs(http_t *http, /* I - HTTP connection to server */ if (longstatus) { - _cupsLangPuts(stdout, language, ""); + _cupsLangPuts(stdout, "\n"); if (jobcopies > 1) snprintf(namestr, sizeof(namestr), "%d copies of %s", jobcopies, @@ -495,19 +526,19 @@ show_jobs(http_t *http, /* I - HTTP connection to server */ else strlcpy(namestr, jobname, sizeof(namestr)); - _cupsLangPrintf(stdout, language, _("%s: %-33.33s [job %d localhost]\n"), + _cupsLangPrintf(stdout, _("%s: %-33.33s [job %d localhost]\n"), jobuser, rankstr, jobid); - _cupsLangPrintf(stdout, language, _(" %-39.39s %.0f bytes\n"), + _cupsLangPrintf(stdout, _(" %-39.39s %.0f bytes\n"), namestr, 1024.0 * jobsize); } else #ifdef __osf__ - _cupsLangPrintf(stdout, language, + _cupsLangPrintf(stdout, _("%-6s %-10.10s %-4d %-10d %-27.27s %.0f bytes\n"), rankstr, jobuser, jobpriority, jobid, jobname, 1024.0 * jobsize); #else - _cupsLangPrintf(stdout, language, + _cupsLangPrintf(stdout, _("%-7s %-7.7s %-7d %-31.31s %.0f bytes\n"), rankstr, jobuser, jobid, jobname, 1024.0 * jobsize); #endif /* __osf */ @@ -520,13 +551,12 @@ show_jobs(http_t *http, /* I - HTTP connection to server */ } else { - _cupsLangPrintf(stderr, language, _("lpq: get-jobs failed: %s\n"), - ippErrorString(cupsLastError())); + _cupsLangPrintf(stderr, "%s: %s\n", command, cupsLastErrorString()); return (0); } if (jobcount == 0) - _cupsLangPuts(stdout, language, _("no entries\n")); + _cupsLangPuts(stdout, _("no entries\n")); return (jobcount); } @@ -537,16 +567,15 @@ show_jobs(http_t *http, /* I - HTTP connection to server */ */ static void -show_printer(http_t *http, /* I - HTTP connection to server */ - const char *dest) /* I - Destination */ +show_printer(const char *command, /* I - Command name */ + http_t *http, /* I - HTTP connection to server */ + const char *dest) /* I - Destination */ { - ipp_t *request, /* IPP Request */ - *response; /* IPP Response */ - ipp_attribute_t *attr; /* Current attribute */ - cups_lang_t *language; /* Default language */ - ipp_pstate_t state; /* Printer state */ - char uri[HTTP_MAX_URI]; - /* Printer URI */ + ipp_t *request, /* IPP Request */ + *response; /* IPP Response */ + ipp_attribute_t *attr; /* Current attribute */ + ipp_pstate_t state; /* Printer state */ + char uri[HTTP_MAX_URI]; /* Printer URI */ if (http == NULL) @@ -561,18 +590,7 @@ show_printer(http_t *http, /* I - HTTP connection to server */ * printer-uri */ - request = ippNew(); - - request->request.op.operation_id = IPP_GET_PRINTER_ATTRIBUTES; - request->request.op.request_id = 1; - - language = cupsLangDefault(); - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET, - "attributes-charset", NULL, cupsLangEncoding(language)); - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE, - "attributes-natural-language", NULL, language->language); + request = ippNewRequest(IPP_GET_PRINTER_ATTRIBUTES); httpAssembleURIf(uri, sizeof(uri), "ipp", NULL, "localhost", 0, "/printers/%s", dest); @@ -587,9 +605,7 @@ show_printer(http_t *http, /* I - HTTP connection to server */ { if (response->request.status.status_code > IPP_OK_CONFLICT) { - _cupsLangPrintf(stderr, language, - _("lpq: get-printer-attributes failed: %s\n"), - ippErrorString(response->request.status.status_code)); + _cupsLangPrintf(stderr, "%s: %s\n", command, cupsLastErrorString()); ippDelete(response); return; } @@ -602,23 +618,21 @@ show_printer(http_t *http, /* I - HTTP connection to server */ switch (state) { case IPP_PRINTER_IDLE : - _cupsLangPrintf(stdout, language, _("%s is ready\n"), dest); + _cupsLangPrintf(stdout, _("%s is ready\n"), dest); break; case IPP_PRINTER_PROCESSING : - _cupsLangPrintf(stdout, language, _("%s is ready and printing\n"), + _cupsLangPrintf(stdout, _("%s is ready and printing\n"), dest); break; case IPP_PRINTER_STOPPED : - _cupsLangPrintf(stdout, language, _("%s is not ready\n"), dest); + _cupsLangPrintf(stdout, _("%s is not ready\n"), dest); break; } ippDelete(response); } else - _cupsLangPrintf(stderr, language, - _("lpq: get-printer-attributes failed: %s\n"), - ippErrorString(cupsLastError())); + _cupsLangPrintf(stderr, "%s: %s\n", command, cupsLastErrorString()); } @@ -629,12 +643,13 @@ show_printer(http_t *http, /* I - HTTP connection to server */ static void usage(void) { - _cupsLangPuts(stderr, cupsLangDefault(), - _("Usage: lpq [-P dest] [-l] [+interval]\n")); + _cupsLangPuts(stderr, + _("Usage: lpq [-P dest] [-U username] [-h hostname[:port]] " + "[-l] [+interval]\n")); exit(1); } /* - * End of "$Id: lpq.c 4906 2006-01-10 20:53:28Z mike $". + * End of "$Id: lpq.c 4948 2006-01-19 03:23:41Z mike $". */ diff --git a/berkeley/lpr.c b/berkeley/lpr.c index 58c9202f4..c909892e3 100644 --- a/berkeley/lpr.c +++ b/berkeley/lpr.c @@ -1,5 +1,5 @@ /* - * "$Id: lpr.c 4906 2006-01-10 20:53:28Z mike $" + * "$Id: lpr.c 4974 2006-01-25 07:04:33Z mike $" * * "lpr" command for the Common UNIX Printing System (CUPS). * @@ -64,31 +64,33 @@ char tempfile[1024]; /* Temporary file for printing from stdin */ */ int -main(int argc, /* I - Number of command-line arguments */ - char *argv[]) /* I - Command-line arguments */ +main(int argc, /* I - Number of command-line arguments */ + char *argv[]) /* I - Command-line arguments */ { - int i, j; /* Looping var */ - int job_id; /* Job ID */ - char ch; /* Option character */ - char *printer, /* Destination printer or class */ - *instance; /* Instance */ - const char *title, /* Job title */ - *val; /* Environment variable name */ - int num_copies; /* Number of copies per file */ - int num_files; /* Number of files to print */ - const char *files[1000]; /* Files to print */ - int num_dests; /* Number of destinations */ - cups_dest_t *dests, /* Destinations */ - *dest; /* Selected destination */ - int num_options; /* Number of options */ - cups_option_t *options; /* Options */ - int deletefile; /* Delete file after print? */ - char buffer[8192]; /* Copy buffer */ - int temp; /* Temporary file descriptor */ - cups_lang_t *language; /* Language information */ + int i, j; /* Looping var */ + int job_id; /* Job ID */ + char ch; /* Option character */ + char *printer, /* Destination printer or class */ + *instance; /* Instance */ + const char *title, /* Job title */ + *val; /* Environment variable name */ + int num_copies; /* Number of copies per file */ + int num_files; /* Number of files to print */ + const char *files[1000]; /* Files to print */ + int num_dests; /* Number of destinations */ + cups_dest_t *dests, /* Destinations */ + *dest; /* Selected destination */ + int num_options; /* Number of options */ + cups_option_t *options; /* Options */ + int deletefile; /* Delete file after print? */ + char buffer[8192]; /* Copy buffer */ + ssize_t bytes; /* Bytes copied */ + off_t filesize; /* Size of temp file */ + int temp; /* Temporary file descriptor */ + cups_lang_t *language; /* Language information */ #if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET) - struct sigaction action; /* Signal action */ - struct sigaction oldaction; /* Old signal action */ + struct sigaction action; /* Signal action */ + struct sigaction oldaction; /* Old signal action */ #endif /* HAVE_SIGACTION && !HAVE_SIGSET */ @@ -110,12 +112,51 @@ main(int argc, /* I - Number of command-line arguments */ #ifdef HAVE_SSL cupsSetEncryption(HTTP_ENCRYPT_REQUIRED); #else - _cupsLangPrintf(stderr, language, + _cupsLangPrintf(stderr, _("%s: Sorry, no encryption support compiled in!\n"), argv[0]); #endif /* HAVE_SSL */ break; + case 'U' : /* Username */ + if (argv[i][2] != '\0') + cupsSetUser(argv[i] + 2); + else + { + i ++; + if (i >= argc) + { + _cupsLangPrintf(stderr, + _("%s: Error - expected username after " + "\'-U\' option!\n"), + argv[0]); + return (1); + } + + cupsSetUser(argv[i]); + } + break; + + case 'H' : /* Connect to host */ + if (argv[i][2] != '\0') + cupsSetServer(argv[i] + 2); + else + { + i ++; + + if (i >= argc) + { + _cupsLangPrintf(stderr, + _("%s: Error - expected hostname after " + "\'-H\' option!\n"), + argv[0]); + return (1); + } + else + cupsSetServer(argv[i]); + } + break; + case '1' : /* TROFF font set 1 */ case '2' : /* TROFF font set 2 */ case '3' : /* TROFF font set 3 */ @@ -128,9 +169,9 @@ main(int argc, /* I - Number of command-line arguments */ if (i >= argc) { - _cupsLangPrintf(stderr, language, - _("lpr: error - expected value after -%c " - "option!\n"), ch); + _cupsLangPrintf(stderr, + _("%s: Error - expected value after \'-%c\' " + "option!\n"), argv[0], ch); return (1); } } @@ -142,9 +183,10 @@ main(int argc, /* I - Number of command-line arguments */ case 'n' : /* Ditroff */ case 't' : /* Troff */ case 'v' : /* Raster image */ - _cupsLangPrintf(stderr, language, - _("lpr: warning - \'%c\' format modifier not " - "supported - output may not be correct!\n"), ch); + _cupsLangPrintf(stderr, + _("%s: Warning - \'%c\' format modifier not " + "supported - output may not be correct!\n"), + argv[0], ch); break; case 'o' : /* Option */ @@ -155,9 +197,10 @@ main(int argc, /* I - Number of command-line arguments */ i ++; if (i >= argc) { - _cupsLangPuts(stderr, language, - _("lpr: error - expected option=value after " - "-o option!\n")); + _cupsLangPrintf(stderr, + _("%s: error - expected option=value after " + "\'-o\' option!\n"), + argv[0]); return (1); } @@ -170,20 +213,28 @@ main(int argc, /* I - Number of command-line arguments */ break; case 'p' : /* Prettyprint */ - num_options = cupsAddOption("prettyprint", "", num_options, &options); + num_options = cupsAddOption("prettyprint", "", num_options, + &options); break; case 'h' : /* Suppress burst page */ - num_options = cupsAddOption("job-sheets", "none", num_options, &options); + num_options = cupsAddOption("job-sheets", "none", num_options, + &options); break; case 's' : /* Don't use symlinks */ break; case 'm' : /* Mail on completion */ - _cupsLangPuts(stderr, language, - _("lpr: warning - email notification is not " - "currently supported!\n")); + { + char email[1024]; /* EMail address */ + + + snprintf(email, sizeof(email), "mailto:%s@%s", cupsUser(), + httpGetHostname(buffer, sizeof(buffer))); + num_options = cupsAddOption("notify-recipient", email, + num_options, &options); + } break; case 'q' : /* Queue file but don't print */ @@ -203,9 +254,10 @@ main(int argc, /* I - Number of command-line arguments */ i ++; if (i >= argc) { - _cupsLangPuts(stderr, language, - _("lpr: error - expected destination after -P " - "option!\n")); + _cupsLangPrintf(stderr, + _("%s: Error - expected destination after " + "\'-P\' option!\n"), + argv[0]); return (1); } @@ -221,7 +273,8 @@ main(int argc, /* I - Number of command-line arguments */ if ((dest = cupsGetDest(printer, instance, num_dests, dests)) != NULL) { for (j = 0; j < dest->num_options; j ++) - if (cupsGetOption(dest->options[j].name, num_options, options) == NULL) + if (cupsGetOption(dest->options[j].name, num_options, + options) == NULL) num_options = cupsAddOption(dest->options[j].name, dest->options[j].value, num_options, &options); @@ -236,9 +289,10 @@ main(int argc, /* I - Number of command-line arguments */ i ++; if (i >= argc) { - _cupsLangPuts(stderr, language, - _("lpr: error - expected copy count after -# " - "option!\n")); + _cupsLangPrintf(stderr, + _("%s: Error - expected copy count after " + "\'-#\' option!\n"), + argv[0]); return (1); } @@ -259,9 +313,9 @@ main(int argc, /* I - Number of command-line arguments */ i ++; if (i >= argc) { - _cupsLangPrintf(stderr, language, - _("lpr: error - expected name after -%c " - "option!\n"), ch); + _cupsLangPrintf(stderr, + _("%s: Error - expected name after \'-%c\' " + "option!\n"), argv[0], ch); return (1); } @@ -269,28 +323,10 @@ main(int argc, /* I - Number of command-line arguments */ } break; - case 'U' : /* User */ - if (argv[i][2] != '\0') - cupsSetUser(argv[i] + 2); - else - { - i ++; - if (i >= argc) - { - _cupsLangPuts(stderr, language, - _("lpr: error - expected username after -U " - "option!\n")); - return (1); - } - - cupsSetUser(argv[i]); - } - break; - default : - _cupsLangPrintf(stderr, language, - _("lpr: error - unknown option \'%c\'!\n"), - argv[i][1]); + _cupsLangPrintf(stderr, + _("%s: Error - unknown option \'%c\'!\n"), + argv[0], argv[i][1]); return (1); } else if (num_files < 1000) @@ -301,9 +337,9 @@ main(int argc, /* I - Number of command-line arguments */ if (access(argv[i], R_OK) != 0) { - _cupsLangPrintf(stderr, language, - _("lpr: error - unable to access \"%s\" - %s\n"), - argv[i], strerror(errno)); + _cupsLangPrintf(stderr, + _("%s: Error - unable to access \"%s\" - %s\n"), + argv[0], argv[i], strerror(errno)); return (1); } @@ -319,8 +355,9 @@ main(int argc, /* I - Number of command-line arguments */ } } else - _cupsLangPrintf(stderr, language, - _("lpr: error - too many files - \"%s\"\n"), argv[i]); + _cupsLangPrintf(stderr, + _("%s: Error - too many files - \"%s\"\n"), + argv[0], argv[i]); /* * See if we have any files to print; if not, print from stdin... */ @@ -360,16 +397,18 @@ main(int argc, /* I - Number of command-line arguments */ val = "LPDEST"; if (printer && !cupsGetDest(printer, NULL, num_dests, dests)) - _cupsLangPrintf(stderr, language, - _("lpr: error - %s environment variable names " + _cupsLangPrintf(stderr, + _("%s: Error - %s environment variable names " "non-existent destination \"%s\"!\n"), - val, printer); + argv[0], val, printer); else if (cupsLastError() == IPP_NOT_FOUND) - _cupsLangPuts(stderr, language, - _("lpr: error - no default destination available.\n")); + _cupsLangPrintf(stderr, + _("%s: Error - no default destination available.\n"), + argv[0]); else - _cupsLangPuts(stderr, language, - _("lpr: error - scheduler not responding!\n")); + _cupsLangPrintf(stderr, + _("%s: Error - scheduler not responding!\n"), + argv[0]); return (1); } @@ -417,32 +456,33 @@ main(int argc, /* I - Number of command-line arguments */ if ((temp = cupsTempFd(tempfile, sizeof(tempfile))) < 0) { - _cupsLangPrintf(stderr, language, - _("lpr: error - unable to create temporary file " + _cupsLangPrintf(stderr, + _("%s: Error - unable to create temporary file " "\"%s\" - %s\n"), - tempfile, strerror(errno)); + argv[0], tempfile, strerror(errno)); return (1); } - while ((i = read(0, buffer, sizeof(buffer))) > 0) - if (write(temp, buffer, i) < 0) + while ((bytes = read(0, buffer, sizeof(buffer))) > 0) + if (write(temp, buffer, bytes) < 0) { - _cupsLangPrintf(stderr, language, - _("lpr: error - unable to write to temporary file " + _cupsLangPrintf(stderr, + _("%s: Error - unable to write to temporary file " "\"%s\" - %s\n"), - tempfile, strerror(errno)); + argv[0], tempfile, strerror(errno)); close(temp); unlink(tempfile); return (1); } - i = lseek(temp, 0, SEEK_CUR); + filesize = lseek(temp, 0, SEEK_CUR); close(temp); - if (i == 0) + if (filesize <= 0) { - _cupsLangPuts(stderr, language, - _("lpr: error - stdin is empty, so no job has been sent.\n")); + _cupsLangPrintf(stderr, + _("%s: Error - stdin is empty, so no job has been sent.\n"), + argv[0]); unlink(tempfile); return (1); } @@ -457,9 +497,7 @@ main(int argc, /* I - Number of command-line arguments */ if (job_id < 1) { - _cupsLangPrintf(stderr, language, - _("lpr: error - unable to print file: %s\n"), - ippErrorString(cupsLastError())); + _cupsLangPrintf(stderr, "%s: %s\n", argv[0], cupsLastErrorString()); return (1); } @@ -473,7 +511,7 @@ main(int argc, /* I - Number of command-line arguments */ */ void -sighandler(int s) /* I - Signal number */ +sighandler(int s) /* I - Signal number */ { /* * Remove the temporary file we're using to print from stdin... @@ -491,5 +529,5 @@ sighandler(int s) /* I - Signal number */ /* - * End of "$Id: lpr.c 4906 2006-01-10 20:53:28Z mike $". + * End of "$Id: lpr.c 4974 2006-01-25 07:04:33Z mike $". */ diff --git a/berkeley/lprm.c b/berkeley/lprm.c index f6fe9fc6b..8497ff532 100644 --- a/berkeley/lprm.c +++ b/berkeley/lprm.c @@ -1,5 +1,5 @@ /* - * "$Id: lprm.c 4906 2006-01-10 20:53:28Z mike $" + * "$Id: lprm.c 4948 2006-01-19 03:23:41Z mike $" * * "lprm" command for the Common UNIX Printing System (CUPS). * @@ -84,7 +84,7 @@ main(int argc, /* I - Number of command-line arguments */ if ((http = httpConnectEncrypt(cupsServer(), ippPort(), encryption)) == NULL) { - _cupsLangPuts(stderr, language, _("lprm: Unable to contact server!\n")); + _cupsLangPuts(stderr, _("lprm: Unable to contact server!\n")); cupsFreeDests(num_dests, dests); return (1); } @@ -103,7 +103,7 @@ main(int argc, /* I - Number of command-line arguments */ httpEncryption(http, encryption); #else - _cupsLangPrintf(stderr, language, + _cupsLangPrintf(stderr, _("%s: Sorry, no encryption support compiled in!\n"), argv[0]); #endif /* HAVE_SSL */ @@ -123,17 +123,61 @@ main(int argc, /* I - Number of command-line arguments */ if (cupsGetDest(dest, NULL, num_dests, dests) == NULL) { - _cupsLangPrintf(stderr, language, - _("lprm: Unknown destination \"%s\"!\n"), dest); + _cupsLangPrintf(stderr, + _("%s: Error - unknown destination \"%s\"!\n"), + argv[0], dest); cupsFreeDests(num_dests, dests); httpClose(http); return(1); } break; + case 'U' : /* Username */ + if (argv[i][2] != '\0') + cupsSetUser(argv[i] + 2); + else + { + i ++; + if (i >= argc) + { + _cupsLangPrintf(stderr, + _("%s: Error - expected username after " + "\'-U\' option!\n"), + argv[0]); + return (1); + } + + cupsSetUser(argv[i]); + } + break; + + case 'h' : /* Connect to host */ + if (http != NULL) + httpClose(http); + + if (argv[i][2] != '\0') + cupsSetServer(argv[i] + 2); + else + { + i ++; + + if (i >= argc) + { + _cupsLangPrintf(stderr, + _("%s: Error - expected hostname after " + "\'-h\' option!\n"), + argv[0]); + return (1); + } + else + cupsSetServer(argv[i]); + } + break; + default : - _cupsLangPrintf(stderr, language, - _("lprm: Unknown option \'%c\'!\n"), argv[i][1]); + _cupsLangPrintf(stderr, + _("%s: Error - unknown option \'%c\'!\n"), + argv[0], argv[i][1]); cupsFreeDests(num_dests, dests); httpClose(http); return (1); @@ -151,7 +195,7 @@ main(int argc, /* I - Number of command-line arguments */ op = IPP_CANCEL_JOB; job_id = atoi(argv[i]); } - else if (strcmp(argv[i], "-") == 0) + else if (!strcmp(argv[i], "-")) { /* * Cancel all jobs @@ -175,16 +219,7 @@ main(int argc, /* I - Number of command-line arguments */ * [requesting-user-name] */ - request = ippNew(); - - request->request.op.operation_id = op; - request->request.op.request_id = 1; - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET, - "attributes-charset", NULL, cupsLangEncoding(language)); - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE, - "attributes-natural-language", NULL, language->language); + request = ippNewRequest(op); if (dest) { @@ -214,43 +249,12 @@ main(int argc, /* I - Number of command-line arguments */ else response = cupsDoRequest(http, request, "/jobs/"); - if (response != NULL) - { - switch (response->request.status.status_code) - { - case IPP_NOT_FOUND : - _cupsLangPuts(stderr, language, - _("lprm: Job or printer not found!\n")); - break; - case IPP_NOT_AUTHORIZED : - _cupsLangPuts(stderr, language, - _("lprm: Not authorized to lprm job(s)!\n")); - break; - case IPP_FORBIDDEN : - _cupsLangPrintf(stderr, language, - _("lprm: You don't own job ID %d!\n"), job_id); - break; - default : - if (response->request.status.status_code > IPP_OK_CONFLICT) - _cupsLangPuts(stderr, language, - _("lprm: Unable to lprm job(s)!\n")); - break; - } - - if (response->request.status.status_code > IPP_OK_CONFLICT) - { - ippDelete(response); - cupsFreeDests(num_dests, dests); - httpClose(http); - return (1); - } - - ippDelete(response); - } - else + ippDelete(response); + + if (cupsLastError() > IPP_OK_CONFLICT) { - _cupsLangPuts(stderr, language, - _("lprm: Unable to cancel job(s)!\n")); + _cupsLangPrintf(stderr, "%s: %s\n", argv[0], cupsLastErrorString()); + cupsFreeDests(num_dests, dests); httpClose(http); return (1); @@ -265,8 +269,7 @@ main(int argc, /* I - Number of command-line arguments */ if (response == NULL) if (!cupsCancelJob(dest, 0)) { - _cupsLangPuts(stderr, language, - _("lprm: Unable to cancel job(s)!\n")); + _cupsLangPrintf(stderr, "%s: %s\n", argv[0], cupsLastErrorString()); cupsFreeDests(num_dests, dests); httpClose(http); return (1); @@ -280,5 +283,5 @@ main(int argc, /* I - Number of command-line arguments */ /* - * End of "$Id: lprm.c 4906 2006-01-10 20:53:28Z mike $". + * End of "$Id: lprm.c 4948 2006-01-19 03:23:41Z mike $". */ diff --git a/cgi-bin/Dependencies b/cgi-bin/Dependencies index fbcdc3d50..1bfd5141f 100644 --- a/cgi-bin/Dependencies +++ b/cgi-bin/Dependencies @@ -1,50 +1,50 @@ # DO NOT DELETE help-index.o: cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h -help-index.o: ../cups/md5.h ../cups/ppd.h ../cups/file.h help-index.h -help-index.o: ../cups/debug.h ../cups/i18n.h ../cups/language.h +help-index.o: ../cups/md5.h ../cups/ppd.h ../cups/file.h ../cups/array.h +help-index.o: help-index.h ../cups/debug.h ../cups/i18n.h ../cups/language.h help-index.o: ../cups/array.h ../cups/string.h ../config.h ../cups/dir.h html.o: cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h -html.o: ../cups/md5.h ../cups/ppd.h ../cups/file.h help-index.h -html.o: ../cups/debug.h ../cups/i18n.h ../cups/language.h ../cups/array.h -html.o: ../cups/string.h ../config.h +html.o: ../cups/md5.h ../cups/ppd.h ../cups/file.h ../cups/array.h +html.o: help-index.h ../cups/debug.h ../cups/i18n.h ../cups/language.h +html.o: ../cups/array.h ../cups/string.h ../config.h ipp-var.o: cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h -ipp-var.o: ../cups/md5.h ../cups/ppd.h ../cups/file.h help-index.h -ipp-var.o: ../cups/debug.h ../cups/i18n.h ../cups/language.h ../cups/array.h -ipp-var.o: ../cups/string.h ../config.h +ipp-var.o: ../cups/md5.h ../cups/ppd.h ../cups/file.h ../cups/array.h +ipp-var.o: help-index.h ../cups/debug.h ../cups/i18n.h ../cups/language.h +ipp-var.o: ../cups/array.h ../cups/string.h ../config.h search.o: cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h -search.o: ../cups/md5.h ../cups/ppd.h ../cups/file.h help-index.h -search.o: ../cups/debug.h ../cups/i18n.h ../cups/language.h ../cups/array.h -search.o: ../cups/string.h ../config.h +search.o: ../cups/md5.h ../cups/ppd.h ../cups/file.h ../cups/array.h +search.o: help-index.h ../cups/debug.h ../cups/i18n.h ../cups/language.h +search.o: ../cups/array.h ../cups/string.h ../config.h template.o: cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h -template.o: ../cups/md5.h ../cups/ppd.h ../cups/file.h help-index.h -template.o: ../cups/debug.h ../cups/i18n.h ../cups/language.h ../cups/array.h -template.o: ../cups/string.h ../config.h +template.o: ../cups/md5.h ../cups/ppd.h ../cups/file.h ../cups/array.h +template.o: help-index.h ../cups/debug.h ../cups/i18n.h ../cups/language.h +template.o: ../cups/array.h ../cups/string.h ../config.h var.o: cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h -var.o: ../cups/md5.h ../cups/ppd.h ../cups/file.h help-index.h -var.o: ../cups/debug.h ../cups/i18n.h ../cups/language.h ../cups/array.h -var.o: ../cups/string.h ../config.h +var.o: ../cups/md5.h ../cups/ppd.h ../cups/file.h ../cups/array.h +var.o: help-index.h ../cups/debug.h ../cups/i18n.h ../cups/language.h +var.o: ../cups/array.h ../cups/string.h ../config.h admin.o: cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h -admin.o: ../cups/md5.h ../cups/ppd.h ../cups/file.h help-index.h -admin.o: ../cups/debug.h ../cups/i18n.h ../cups/language.h ../cups/array.h -admin.o: ../cups/string.h ../config.h ../cups/file.h +admin.o: ../cups/md5.h ../cups/ppd.h ../cups/file.h ../cups/array.h +admin.o: help-index.h ../cups/debug.h ../cups/i18n.h ../cups/language.h +admin.o: ../cups/array.h ../cups/string.h ../config.h ../cups/file.h classes.o: cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h -classes.o: ../cups/md5.h ../cups/ppd.h ../cups/file.h help-index.h -classes.o: ../cups/debug.h ../cups/i18n.h ../cups/language.h ../cups/array.h -classes.o: ../cups/string.h ../config.h +classes.o: ../cups/md5.h ../cups/ppd.h ../cups/file.h ../cups/array.h +classes.o: help-index.h ../cups/debug.h ../cups/i18n.h ../cups/language.h +classes.o: ../cups/array.h ../cups/string.h ../config.h help.o: cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h -help.o: ../cups/md5.h ../cups/ppd.h ../cups/file.h help-index.h -help.o: ../cups/debug.h ../cups/i18n.h ../cups/language.h ../cups/array.h -help.o: ../cups/string.h ../config.h +help.o: ../cups/md5.h ../cups/ppd.h ../cups/file.h ../cups/array.h +help.o: help-index.h ../cups/debug.h ../cups/i18n.h ../cups/language.h +help.o: ../cups/array.h ../cups/string.h ../config.h jobs.o: cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h -jobs.o: ../cups/md5.h ../cups/ppd.h ../cups/file.h help-index.h -jobs.o: ../cups/debug.h ../cups/i18n.h ../cups/language.h ../cups/array.h -jobs.o: ../cups/string.h ../config.h +jobs.o: ../cups/md5.h ../cups/ppd.h ../cups/file.h ../cups/array.h +jobs.o: help-index.h ../cups/debug.h ../cups/i18n.h ../cups/language.h +jobs.o: ../cups/array.h ../cups/string.h ../config.h printers.o: cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h -printers.o: ../cups/md5.h ../cups/ppd.h ../cups/file.h help-index.h -printers.o: ../cups/debug.h ../cups/i18n.h ../cups/language.h ../cups/array.h -printers.o: ../cups/string.h ../config.h +printers.o: ../cups/md5.h ../cups/ppd.h ../cups/file.h ../cups/array.h +printers.o: help-index.h ../cups/debug.h ../cups/i18n.h ../cups/language.h +printers.o: ../cups/array.h ../cups/string.h ../config.h testcgi.o: cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h ../cups/md5.h -testcgi.o: ../cups/ppd.h ../cups/file.h help-index.h +testcgi.o: ../cups/ppd.h ../cups/file.h ../cups/array.h help-index.h testhi.o: cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h ../cups/md5.h -testhi.o: ../cups/ppd.h ../cups/file.h help-index.h +testhi.o: ../cups/ppd.h ../cups/file.h ../cups/array.h help-index.h diff --git a/cgi-bin/admin.c b/cgi-bin/admin.c index 37be8beaa..01252ba5c 100644 --- a/cgi-bin/admin.c +++ b/cgi-bin/admin.c @@ -1,5 +1,5 @@ /* - * "$Id: admin.c 4921 2006-01-12 21:26:26Z mike $" + * "$Id: admin.c 4943 2006-01-18 20:30:42Z mike $" * * Administration CGI for the Common UNIX Printing System (CUPS). * @@ -24,13 +24,13 @@ * Contents: * * main() - Main entry for CGI. - * compare_printer_devices() - Compare two printer devices. * do_am_class() - Add or modify a class. * do_am_printer() - Add or modify a printer. * do_config_printer() - Configure the default options for a printer. * do_config_server() - Configure server settings. * do_delete_class() - Delete a class... * do_delete_printer() - Delete a printer... + * do_export() - Export printers to Samba... * do_menu() - Show the main menu... * do_printer_op() - Do a printer operation. * do_set_allowed_users() - Set the allowed/denied users for a queue. @@ -45,23 +45,27 @@ #include "cgi-private.h" #include <cups/file.h> #include <errno.h> +#include <unistd.h> +#include <fcntl.h> +#include <sys/wait.h> /* * Local functions... */ -static void do_am_class(http_t *http, cups_lang_t *language, int modify); -static void do_am_printer(http_t *http, cups_lang_t *language, int modify); -static void do_config_printer(http_t *http, cups_lang_t *language); -static void do_config_server(http_t *http, cups_lang_t *language); -static void do_delete_class(http_t *http, cups_lang_t *language); -static void do_delete_printer(http_t *http, cups_lang_t *language); -static void do_menu(http_t *http, cups_lang_t *language); -static void do_printer_op(http_t *http, cups_lang_t *language, +static void do_am_class(http_t *http, int modify); +static void do_am_printer(http_t *http, int modify); +static void do_config_printer(http_t *http); +static void do_config_server(http_t *http); +static void do_delete_class(http_t *http); +static void do_delete_printer(http_t *http); +static void do_export(http_t *http); +static void do_menu(http_t *http); +static void do_printer_op(http_t *http, ipp_op_t op, const char *title); -static void do_set_allowed_users(http_t *http, cups_lang_t *language); -static void do_set_sharing(http_t *http, cups_lang_t *language); +static void do_set_allowed_users(http_t *http); +static void do_set_sharing(http_t *http); static int match_string(const char *a, const char *b); @@ -73,18 +77,11 @@ int /* O - Exit status */ main(int argc, /* I - Number of command-line arguments */ char *argv[]) /* I - Command-line arguments */ { - cups_lang_t *language; /* Language information */ http_t *http; /* Connection to the server */ const char *op; /* Operation name */ /* - * Get the request language... - */ - - language = cupsLangDefault(); - - /* * Connect to the HTTP server... */ @@ -106,7 +103,7 @@ main(int argc, /* I - Number of command-line arguments */ * Nope, send the administration menu... */ - do_menu(http, language); + do_menu(http); } else if ((op = cgiGetVariable("OP")) != NULL) { @@ -125,57 +122,53 @@ main(int argc, /* I - Number of command-line arguments */ puts("Location: /admin\n"); } else if (!strcmp(op, "start-printer")) - do_printer_op(http, language, IPP_RESUME_PRINTER, "Start Printer"); + do_printer_op(http, IPP_RESUME_PRINTER, cgiText(_("Start Printer"))); else if (!strcmp(op, "stop-printer")) - do_printer_op(http, language, IPP_PAUSE_PRINTER, "Stop Printer"); + do_printer_op(http, IPP_PAUSE_PRINTER, cgiText(_("Stop Printer"))); else if (!strcmp(op, "start-class")) - do_printer_op(http, language, IPP_RESUME_PRINTER, "Start Class"); + do_printer_op(http, IPP_RESUME_PRINTER, cgiText(_("Start Class"))); else if (!strcmp(op, "stop-class")) - do_printer_op(http, language, IPP_PAUSE_PRINTER, "Stop Class"); + do_printer_op(http, IPP_PAUSE_PRINTER, cgiText(_("Stop Class"))); else if (!strcmp(op, "accept-jobs")) - do_printer_op(http, language, CUPS_ACCEPT_JOBS, "Accept Jobs"); + do_printer_op(http, CUPS_ACCEPT_JOBS, cgiText(_("Accept Jobs"))); else if (!strcmp(op, "reject-jobs")) - do_printer_op(http, language, CUPS_REJECT_JOBS, "Reject Jobs"); + do_printer_op(http, CUPS_REJECT_JOBS, cgiText(_("Reject Jobs"))); else if (!strcmp(op, "purge-jobs")) - do_printer_op(http, language, IPP_PURGE_JOBS, "Purge Jobs"); + do_printer_op(http, IPP_PURGE_JOBS, cgiText(_("Purge Jobs"))); else if (!strcmp(op, "set-allowed-users")) - do_set_allowed_users(http, language); + do_set_allowed_users(http); else if (!strcmp(op, "set-as-default")) - do_printer_op(http, language, CUPS_SET_DEFAULT, "Set As Default"); + do_printer_op(http, CUPS_SET_DEFAULT, cgiText(_("Set As Default"))); else if (!strcmp(op, "set-sharing")) - do_set_sharing(http, language); + do_set_sharing(http); else if (!strcmp(op, "add-class")) - do_am_class(http, language, 0); + do_am_class(http, 0); else if (!strcmp(op, "add-printer")) - do_am_printer(http, language, 0); + do_am_printer(http, 0); else if (!strcmp(op, "modify-class")) - do_am_class(http, language, 1); + do_am_class(http, 1); else if (!strcmp(op, "modify-printer")) - do_am_printer(http, language, 1); + do_am_printer(http, 1); else if (!strcmp(op, "delete-class")) - do_delete_class(http, language); + do_delete_class(http); else if (!strcmp(op, "delete-printer")) - do_delete_printer(http, language); + do_delete_printer(http); else if (!strcmp(op, "set-printer-options")) - do_config_printer(http, language); + do_config_printer(http); else if (!strcmp(op, "config-server")) - do_config_server(http, language); + do_config_server(http); + else if (!strcmp(op, "export-samba")) + do_export(http); else { /* * Bad operation code... Display an error... */ - cgiStartHTML("Error"); - cgiCopyTemplateLang("admin-op.tmpl"); + cgiStartHTML(cgiText(_("Administration"))); + cgiCopyTemplateLang("error-op.tmpl"); cgiEndHTML(); } - - /* - * Close the HTTP server connection... - */ - - httpClose(http); } else { @@ -183,16 +176,16 @@ main(int argc, /* I - Number of command-line arguments */ * Form data but no operation code... Display an error... */ - cgiStartHTML("Error"); - cgiCopyTemplateLang("admin-op.tmpl"); + cgiStartHTML(cgiText(_("Administration"))); + cgiCopyTemplateLang("error-op.tmpl"); cgiEndHTML(); } /* - * Free the request language... + * Close the HTTP server connection... */ - cupsLangFree(language); + httpClose(http); /* * Return with no errors... @@ -203,25 +196,12 @@ main(int argc, /* I - Number of command-line arguments */ /* - * 'compare_printer_devices()' - Compare two printer devices. - */ - -static int /* O - Result of comparison */ -compare_printer_devices(const void *a, /* I - First device */ - const void *b) /* I - Second device */ -{ - return (strcmp(*((char **)a), *((char **)b))); -} - - -/* * 'do_am_class()' - Add or modify a class. */ static void -do_am_class(http_t *http, /* I - HTTP connection */ - cups_lang_t *language, /* I - Client's language */ - int modify) /* I - Modify the printer? */ +do_am_class(http_t *http, /* I - HTTP connection */ + int modify) /* I - Modify the printer? */ { int i, j; /* Looping vars */ int element; /* Element number */ @@ -229,7 +209,6 @@ do_am_class(http_t *http, /* I - HTTP connection */ ipp_t *request, /* IPP request */ *response; /* IPP response */ ipp_attribute_t *attr; /* member-uris attribute */ - ipp_status_t status; /* Request status */ char uri[HTTP_MAX_URI]; /* Device or printer URI */ const char *name, /* Pointer to class name */ *ptr; /* Pointer to CGI variable */ @@ -242,7 +221,7 @@ do_am_class(http_t *http, /* I - HTTP connection */ }; - title = modify ? "Modify Class" : "Add Class"; + title = cgiText(modify ? _("Modify Class") : _("Add Class")); name = cgiGetVariable("PRINTER_NAME"); if (cgiGetVariable("PRINTER_LOCATION") == NULL) @@ -256,16 +235,7 @@ do_am_class(http_t *http, /* I - HTTP connection */ * printer-uri */ - request = ippNew(); - - request->request.op.operation_id = CUPS_GET_PRINTERS; - request->request.op.request_id = 1; - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET, - "attributes-charset", NULL, cupsLangEncoding(language)); - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE, - "attributes-natural-language", NULL, language->language); + request = ippNewRequest(CUPS_GET_PRINTERS); ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, "ipp://localhost/printers"); @@ -331,16 +301,7 @@ do_am_class(http_t *http, /* I - HTTP connection */ * printer-uri */ - request = ippNew(); - - request->request.op.operation_id = IPP_GET_PRINTER_ATTRIBUTES; - request->request.op.request_id = 1; - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET, - "attributes-charset", NULL, cupsLangEncoding(language)); - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE, - "attributes-natural-language", NULL, language->language); + request = ippNewRequest(IPP_GET_PRINTER_ATTRIBUTES); httpAssembleURIf(uri, sizeof(uri), "ipp", NULL, "localhost", 0, "/classes/%s", name); @@ -420,9 +381,11 @@ do_am_class(http_t *http, /* I - HTTP connection */ if (*ptr || ptr == name || strlen(name) > 127) { - cgiSetVariable("ERROR", "The class name may only contain up to 127 printable " - "characters and may not contain spaces, slashes (/), " - "or the pound sign (#)."); + cgiSetVariable("ERROR", + cgiText(_("The class name may only contain up to " + "127 printable characters and may not " + "contain spaces, slashes (/), or the " + "pound sign (#)."))); cgiStartHTML(title); cgiCopyTemplateLang("error.tmpl"); cgiEndHTML(); @@ -443,16 +406,7 @@ do_am_class(http_t *http, /* I - HTTP connection */ * member-uris */ - request = ippNew(); - - request->request.op.operation_id = CUPS_ADD_CLASS; - request->request.op.request_id = 1; - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET, - "attributes-charset", NULL, cupsLangEncoding(language)); - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE, - "attributes-natural-language", NULL, language->language); + request = ippNewRequest(CUPS_ADD_CLASS); httpAssembleURIf(uri, sizeof(uri), "ipp", NULL, "localhost", 0, "/classes/%s", cgiGetVariable("PRINTER_NAME")); @@ -482,19 +436,13 @@ do_am_class(http_t *http, /* I - HTTP connection */ * Do the request and get back a response... */ - if ((response = cupsDoRequest(http, request, "/admin/")) != NULL) - { - status = response->request.status.status_code; - ippDelete(response); - } - else - status = cupsLastError(); + ippDelete(cupsDoRequest(http, request, "/admin/")); - if (status > IPP_OK_CONFLICT) + if (cupsLastError() > IPP_OK_CONFLICT) { cgiStartHTML(title); - cgiSetVariable("ERROR", ippErrorString(status)); - cgiCopyTemplateLang("error.tmpl"); + cgiShowIPPError(modify ? _("Unable to modify class:") : + _("Unable to add class:")); } else { @@ -505,7 +453,7 @@ do_am_class(http_t *http, /* I - HTTP connection */ char refresh[1024]; /* Refresh URL */ cgiFormEncode(uri, name, sizeof(uri)); - snprintf(refresh, sizeof(refresh), "5;/admin?OP=redirect&URL=/classes/%s", + snprintf(refresh, sizeof(refresh), "5;/admin/?OP=redirect&URL=/classes/%s", uri); cgiSetVariable("refresh_page", refresh); @@ -526,9 +474,8 @@ do_am_class(http_t *http, /* I - HTTP connection */ */ static void -do_am_printer(http_t *http, /* I - HTTP connection */ - cups_lang_t *language, /* I - Client's language */ - int modify) /* I - Modify the printer? */ +do_am_printer(http_t *http, /* I - HTTP connection */ + int modify) /* I - Modify the printer? */ { int i; /* Looping var */ int element; /* Element number */ @@ -537,7 +484,6 @@ do_am_printer(http_t *http, /* I - HTTP connection */ ipp_t *request, /* IPP request */ *response, /* IPP response */ *oldinfo; /* Old printer information */ - ipp_status_t status; /* Request status */ const cgi_file_t *file; /* Uploaded file, if any */ const char *var; /* CGI variable */ char uri[HTTP_MAX_URI], /* Device or printer URI */ @@ -562,7 +508,10 @@ do_am_printer(http_t *http, /* I - HTTP connection */ }; - title = modify ? "Modify Printer" : "Add Printer"; + fprintf(stderr, "DEBUG: do_am_printer: DEVICE_URI=\"%s\"\n", + cgiGetVariable("DEVICE_URI")); + + title = cgiText(modify ? _("Modify Printer") : _("Add Printer")); if (modify) { @@ -575,16 +524,7 @@ do_am_printer(http_t *http, /* I - HTTP connection */ * printer-uri */ - request = ippNew(); - - request->request.op.operation_id = IPP_GET_PRINTER_ATTRIBUTES; - request->request.op.request_id = 1; - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET, - "attributes-charset", NULL, cupsLangEncoding(language)); - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE, - "attributes-natural-language", NULL, language->language); + request = ippNewRequest(IPP_GET_PRINTER_ATTRIBUTES); httpAssembleURIf(uri, sizeof(uri), "ipp", NULL, "localhost", 0, "/printers/%s", cgiGetVariable("PRINTER_NAME")); @@ -639,9 +579,11 @@ do_am_printer(http_t *http, /* I - HTTP connection */ if (*ptr || ptr == name || strlen(name) > 127) { - cgiSetVariable("ERROR", "The printer name may only contain up to 127 printable " - "characters and may not contain spaces, slashes (/), " - "or the pound sign (#)."); + cgiSetVariable("ERROR", + cgiText(_("The printer name may only contain up to " + "127 printable characters and may not " + "contain spaces, slashes (/), or the " + "pound sign (#)."))); cgiStartHTML(title); cgiCopyTemplateLang("error.tmpl"); cgiEndHTML(); @@ -669,16 +611,7 @@ do_am_printer(http_t *http, /* I - HTTP connection */ * printer-uri */ - request = ippNew(); - - request->request.op.operation_id = CUPS_GET_DEVICES; - request->request.op.request_id = 1; - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET, - "attributes-charset", NULL, cupsLangEncoding(language)); - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE, - "attributes-natural-language", NULL, language->language); + request = ippNewRequest(CUPS_GET_DEVICES); ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, "ipp://localhost/printers/"); @@ -860,21 +793,11 @@ do_am_printer(http_t *http, /* I - HTTP connection */ * printer-uri */ - request = ippNew(); - - request->request.op.operation_id = CUPS_GET_PPDS; - request->request.op.request_id = 1; - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET, - "attributes-charset", NULL, cupsLangEncoding(language)); - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE, - "attributes-natural-language", NULL, language->language); + request = ippNewRequest(CUPS_GET_PPDS); ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, "ipp://localhost/printers/"); - if ((var = cgiGetVariable("PPD_MAKE")) != NULL) ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_TEXT, "ppd-make", NULL, var); @@ -973,13 +896,8 @@ do_am_printer(http_t *http, /* I - HTTP connection */ } else { - char message[1024]; - - - snprintf(message, sizeof(message), "Unable to get list of printer drivers: %s", - ippErrorString(cupsLastError())); - cgiSetVariable("ERROR", message); cgiStartHTML(title); + cgiShowIPPError(_("Unable to get list of printer drivers:")); cgiCopyTemplateLang("error.tmpl"); cgiEndHTML(); } @@ -1001,16 +919,7 @@ do_am_printer(http_t *http, /* I - HTTP connection */ * printer-state */ - request = ippNew(); - - request->request.op.operation_id = CUPS_ADD_PRINTER; - request->request.op.request_id = 1; - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET, - "attributes-charset", NULL, cupsLangEncoding(language)); - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE, - "attributes-natural-language", NULL, language->language); + request = ippNewRequest(CUPS_ADD_PRINTER); httpAssembleURIf(uri, sizeof(uri), "ipp", NULL, "localhost", 0, "/printers/%s", cgiGetVariable("PRINTER_NAME")); @@ -1036,7 +945,7 @@ do_am_printer(http_t *http, /* I - HTTP connection */ if ((uriptr = strrchr(uri, '|')) != NULL) *uriptr = '\0'; - if (strncmp(uri, "serial:", 7) == 0) + if (!strncmp(uri, "serial:", 7)) { /* * Update serial port URI to include baud rate, etc. @@ -1064,23 +973,15 @@ do_am_printer(http_t *http, /* I - HTTP connection */ */ if (file) - response = cupsDoFileRequest(http, request, "/admin/", file->tempfile); + ippDelete(cupsDoFileRequest(http, request, "/admin/", file->tempfile)); else - response = cupsDoRequest(http, request, "/admin/"); + ippDelete(cupsDoRequest(http, request, "/admin/")); - if (response) - { - status = response->request.status.status_code; - ippDelete(response); - } - else - status = cupsLastError(); - - if (status > IPP_OK_CONFLICT) + if (cupsLastError() > IPP_OK_CONFLICT) { cgiStartHTML(title); - cgiSetVariable("ERROR", ippErrorString(status)); - cgiCopyTemplateLang("error.tmpl"); + cgiShowIPPError(modify ? _("Unable to modify printer:") : + _("Unable to add printer:")); } else { @@ -1095,10 +996,10 @@ do_am_printer(http_t *http, /* I - HTTP connection */ if (modify) snprintf(refresh, sizeof(refresh), - "5;/admin?OP=redirect&URL=/printers/%s", uri); + "5;/admin/?OP=redirect&URL=/printers/%s", uri); else snprintf(refresh, sizeof(refresh), - "5;/admin?OP=set-printer-options&PRINTER_NAME=%s", uri); + "5;/admin/?OP=set-printer-options&PRINTER_NAME=%s", uri); cgiSetVariable("refresh_page", refresh); @@ -1123,8 +1024,7 @@ do_am_printer(http_t *http, /* I - HTTP connection */ */ static void -do_config_printer(http_t *http, /* I - HTTP connection */ - cups_lang_t *language)/* I - Client's language */ +do_config_printer(http_t *http) /* I - HTTP connection */ { int i, j, k, m; /* Looping vars */ int have_options; /* Have options? */ @@ -1134,7 +1034,6 @@ do_config_printer(http_t *http, /* I - HTTP connection */ char uri[HTTP_MAX_URI]; /* Job URI */ const char *var; /* Variable value */ const char *printer; /* Printer printer name */ - ipp_status_t status; /* Operation status... */ const char *filename; /* PPD filename */ char tempfile[1024]; /* Temporary filename */ cups_file_t *in, /* Input file */ @@ -1146,8 +1045,11 @@ do_config_printer(http_t *http, /* I - HTTP connection */ ppd_group_t *group; /* Option group */ ppd_option_t *option; /* Option */ ppd_attr_t *protocol; /* cupsProtocol attribute */ + const char *title; /* Page title */ + title = cgiText(_("Set Printer Options")); + /* * Get the printer name... */ @@ -1157,8 +1059,8 @@ do_config_printer(http_t *http, /* I - HTTP connection */ "/printers/%s", printer); else { - cgiSetVariable("ERROR", ippErrorString(IPP_NOT_FOUND)); - cgiStartHTML("Set Printer Options"); + cgiSetVariable("ERROR", cgiText(_("Missing form variable!"))); + cgiStartHTML(title); cgiCopyTemplateLang("error.tmpl"); cgiEndHTML(); return; @@ -1170,35 +1072,17 @@ do_config_printer(http_t *http, /* I - HTTP connection */ if ((filename = cupsGetPPD(printer)) == NULL) { - if (cupsLastError() == IPP_NOT_FOUND) - { - /* - * No PPD file for this printer, so we can't configure it! - */ - - cgiSetVariable("ERROR", ippErrorString(IPP_NOT_POSSIBLE)); - cgiStartHTML("Set Printer Options"); - cgiCopyTemplateLang("error.tmpl"); - cgiEndHTML(); - } - else - { - /* - * Unable to access the PPD file for some reason... - */ - - cgiSetVariable("ERROR", ippErrorString(cupsLastError())); - cgiStartHTML("Set Printer Options"); - cgiCopyTemplateLang("error.tmpl"); - cgiEndHTML(); - } + cgiStartHTML(title); + cgiShowIPPError(_("Unable to get PPD file!")); + cgiEndHTML(); return; } if ((ppd = ppdOpenFile(filename)) == NULL) { - cgiSetVariable("ERROR", ippErrorString(IPP_DEVICE_ERROR)); - cgiStartHTML("Set Printer Options"); + cgiSetVariable("ERROR", ppdErrorString(ppdLastError(&i))); + cgiSetVariable("MESSAGE", cgiText(_("Unable to open PPD file:"))); + cgiStartHTML(title); cgiCopyTemplateLang("error.tmpl"); cgiEndHTML(); return; @@ -1243,6 +1127,8 @@ do_config_printer(http_t *http, /* I - HTTP connection */ * Show the options to the user... */ + ppdLocalize(ppd); + cgiStartHTML("Set Printer Options"); cgiCopyTemplateLang("set-printer-options-header.tmpl"); @@ -1265,8 +1151,7 @@ do_config_printer(http_t *http, /* I - HTTP connection */ i --, group ++) { if (!strcmp(group->name, "InstallableOptions")) - cgiSetVariable("GROUP", - _cupsLangString(language, _("Options Installed"))); + cgiSetVariable("GROUP", cgiText(_("Options Installed"))); else cgiSetVariable("GROUP", group->text); @@ -1333,16 +1218,7 @@ do_config_printer(http_t *http, /* I - HTTP connection */ * printer-uri */ - request = ippNew(); - - request->request.op.operation_id = IPP_GET_PRINTER_ATTRIBUTES; - request->request.op.request_id = 1; - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET, - "attributes-charset", NULL, cupsLangEncoding(language)); - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE, - "attributes-natural-language", NULL, language->language); + request = ippNewRequest(IPP_GET_PRINTER_ATTRIBUTES); httpAssembleURIf(uri, sizeof(uri), "ipp", NULL, "localhost", 0, "/printers/%s", printer); @@ -1355,13 +1231,14 @@ do_config_printer(http_t *http, /* I - HTTP connection */ if ((response = cupsDoRequest(http, request, "/")) != NULL) { - if ((attr = ippFindAttribute(response, "job-sheets-supported", IPP_TAG_ZERO)) != NULL) + if ((attr = ippFindAttribute(response, "job-sheets-supported", + IPP_TAG_ZERO)) != NULL) { /* * Add the job sheets options... */ - cgiSetVariable("GROUP", "Banners"); + cgiSetVariable("GROUP", cgiText(_("Banners"))); cgiCopyTemplateLang("option-header.tmpl"); cgiSetSize("CHOICES", attr->num_values); @@ -1375,14 +1252,14 @@ do_config_printer(http_t *http, /* I - HTTP connection */ attr = ippFindAttribute(response, "job-sheets-default", IPP_TAG_ZERO); cgiSetVariable("KEYWORD", "job_sheets_start"); - cgiSetVariable("KEYTEXT", "Starting Banner"); + cgiSetVariable("KEYTEXT", cgiText(_("Starting Banner"))); cgiSetVariable("DEFCHOICE", attr == NULL ? "" : attr->values[0].string.text); cgiCopyTemplateLang("option-pickone.tmpl"); cgiSetVariable("KEYWORD", "job_sheets_end"); - cgiSetVariable("KEYTEXT", "Ending Banner"); + cgiSetVariable("KEYTEXT", cgiText(_("Ending Banner"))); cgiSetVariable("DEFCHOICE", attr == NULL && attr->num_values > 1 ? "" : attr->values[1].string.text); @@ -1400,7 +1277,7 @@ do_config_printer(http_t *http, /* I - HTTP connection */ * Add the error and operation policy options... */ - cgiSetVariable("GROUP", "Policies"); + cgiSetVariable("GROUP", cgiText(_("Policies"))); cgiCopyTemplateLang("option-header.tmpl"); /* @@ -1424,7 +1301,7 @@ do_config_printer(http_t *http, /* I - HTTP connection */ IPP_TAG_ZERO); cgiSetVariable("KEYWORD", "printer_error_policy"); - cgiSetVariable("KEYTEXT", "Error Policy"); + cgiSetVariable("KEYTEXT", cgiText(_("Error Policy"))); cgiSetVariable("DEFCHOICE", attr == NULL ? "" : attr->values[0].string.text); } @@ -1451,7 +1328,7 @@ do_config_printer(http_t *http, /* I - HTTP connection */ attr = ippFindAttribute(response, "printer-op-policy", IPP_TAG_ZERO); cgiSetVariable("KEYWORD", "printer_op_policy"); - cgiSetVariable("KEYTEXT", "Operation Policy"); + cgiSetVariable("KEYTEXT", cgiText(_("Operation Policy"))); cgiSetVariable("DEFCHOICE", attr == NULL ? "" : attr->values[0].string.text); @@ -1472,13 +1349,13 @@ do_config_printer(http_t *http, /* I - HTTP connection */ { protocol = ppdFindAttr(ppd, "cupsProtocol", NULL); - cgiSetVariable("GROUP", "PS Binary Protocol"); + cgiSetVariable("GROUP", cgiText(_("PS Binary Protocol"))); cgiCopyTemplateLang("option-header.tmpl"); cgiSetSize("CHOICES", 2); cgiSetSize("TEXT", 2); cgiSetArray("CHOICES", 0, "None"); - cgiSetArray("TEXT", 0, "None"); + cgiSetArray("TEXT", 0, cgiText(_("None"))); if (strstr(ppd->protocols, "TBCP")) { @@ -1492,7 +1369,7 @@ do_config_printer(http_t *http, /* I - HTTP connection */ } cgiSetVariable("KEYWORD", "protocol"); - cgiSetVariable("KEYTEXT", "PS Binary Protocol"); + cgiSetVariable("KEYTEXT", cgiText(_("PS Binary Protocol"))); cgiSetVariable("DEFCHOICE", protocol ? protocol->value : "None"); cgiCopyTemplateLang("option-pickone.tmpl"); @@ -1581,16 +1458,7 @@ do_config_printer(http_t *http, /* I - HTTP connection */ * [ppd file] */ - request = ippNew(); - - request->request.op.operation_id = CUPS_ADD_PRINTER; - request->request.op.request_id = 1; - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET, - "attributes-charset", NULL, cupsLangEncoding(language)); - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE, - "attributes-natural-language", NULL, language->language); + request = ippNewRequest(CUPS_ADD_PRINTER); httpAssembleURIf(uri, sizeof(uri), "ipp", NULL, "localhost", 0, "/printers/%s", cgiGetVariable("PRINTER_NAME")); @@ -1614,19 +1482,12 @@ do_config_printer(http_t *http, /* I - HTTP connection */ * Do the request and get back a response... */ - if ((response = cupsDoFileRequest(http, request, "/admin/", tempfile)) != NULL) - { - status = response->request.status.status_code; - ippDelete(response); - } - else - status = cupsLastError(); + ippDelete(cupsDoFileRequest(http, request, "/admin/", tempfile)); - if (status > IPP_OK_CONFLICT) + if (cupsLastError() > IPP_OK_CONFLICT) { - cgiStartHTML("Set Printer Options"); - cgiSetVariable("ERROR", ippErrorString(status)); - cgiCopyTemplateLang("error.tmpl"); + cgiStartHTML(title); + cgiShowIPPError(_("Unable to set options:")); } else { @@ -1636,12 +1497,13 @@ do_config_printer(http_t *http, /* I - HTTP connection */ char refresh[1024]; /* Refresh URL */ + cgiFormEncode(uri, printer, sizeof(uri)); - snprintf(refresh, sizeof(refresh), "5;/admin?OP=redirect&URL=/printers/%s", + snprintf(refresh, sizeof(refresh), "5;/admin/?OP=redirect&URL=/printers/%s", uri); cgiSetVariable("refresh_page", refresh); - cgiStartHTML("Set Printer Options"); + cgiStartHTML(title); cgiCopyTemplateLang("printer-configured.tmpl"); } @@ -1660,8 +1522,7 @@ do_config_printer(http_t *http, /* I - HTTP connection */ */ static void -do_config_server(http_t *http, /* I - HTTP connection */ - cups_lang_t *language) /* I - Client's language */ +do_config_server(http_t *http) /* I - HTTP connection */ { if (cgiIsPOST() && !cgiGetVariable("CUPSDCONF")) { @@ -1727,7 +1588,8 @@ do_config_server(http_t *http, /* I - HTTP connection */ * Unable to open - log an error... */ - cgiStartHTML("Change Settings"); + cgiStartHTML(cgiText(_("Change Settings"))); + cgiSetVariable("MESSAGE", cgiText(_("Unable to change server settings:"))); cgiSetVariable("ERROR", strerror(errno)); cgiCopyTemplateLang("error.tmpl"); cgiEndHTML(); @@ -1742,7 +1604,8 @@ do_config_server(http_t *http, /* I - HTTP connection */ if ((tempfd = cupsTempFd(tempfile, sizeof(tempfile))) < 0) { - cgiStartHTML("Change Settings"); + cgiStartHTML(cgiText(_("Change Settings"))); + cgiSetVariable("MESSAGE", cgiText(_("Unable to change server settings:"))); cgiSetVariable("ERROR", strerror(errno)); cgiCopyTemplateLang("error.tmpl"); cgiEndHTML(); @@ -1754,7 +1617,8 @@ do_config_server(http_t *http, /* I - HTTP connection */ if ((temp = cupsFileOpenFd(tempfd, "w")) == NULL) { - cgiStartHTML("Change Settings"); + cgiStartHTML(cgiText(_("Change Settings"))); + cgiSetVariable("MESSAGE", cgiText(_("Unable to change server settings:"))); cgiSetVariable("ERROR", strerror(errno)); cgiCopyTemplateLang("error.tmpl"); cgiEndHTML(); @@ -2230,15 +2094,16 @@ do_config_server(http_t *http, /* I - HTTP connection */ if (status != HTTP_CREATED) { + cgiSetVariable("MESSAGE", cgiText(_("Unable to upload cupsd.conf file:"))); cgiSetVariable("ERROR", httpStatus(status)); - cgiStartHTML("Change Settings"); + cgiStartHTML(cgiText(_("Change Settings"))); cgiCopyTemplateLang("error.tmpl"); } else { - cgiSetVariable("refresh_page", "5;/admin?OP=redirect"); + cgiSetVariable("refresh_page", "5;/admin/?OP=redirect"); - cgiStartHTML("Change Settings"); + cgiStartHTML(cgiText(_("Change Settings"))); cgiCopyTemplateLang("restart.tmpl"); } @@ -2266,7 +2131,8 @@ do_config_server(http_t *http, /* I - HTTP connection */ if ((tempfd = cupsTempFd(tempfile, sizeof(tempfile))) < 0) { - cgiStartHTML("Edit Configuration File"); + cgiStartHTML(cgiText(_("Edit Configuration File"))); + cgiSetVariable("MESSAGE", cgiText(_("Unable to create temporary file:"))); cgiSetVariable("ERROR", strerror(errno)); cgiCopyTemplateLang("error.tmpl"); cgiEndHTML(); @@ -2277,7 +2143,8 @@ do_config_server(http_t *http, /* I - HTTP connection */ if ((temp = cupsFileOpenFd(tempfd, "w")) == NULL) { - cgiStartHTML("Edit Configuration File"); + cgiStartHTML(cgiText(_("Edit Configuration File"))); + cgiSetVariable("MESSAGE", cgiText(_("Unable to create temporary file:"))); cgiSetVariable("ERROR", strerror(errno)); cgiCopyTemplateLang("error.tmpl"); cgiEndHTML(); @@ -2320,15 +2187,17 @@ do_config_server(http_t *http, /* I - HTTP connection */ if (status != HTTP_CREATED) { + cgiSetVariable("MESSAGE", cgiText(_("Unable to upload cupsd.conf file:"))); cgiSetVariable("ERROR", httpStatus(status)); - cgiStartHTML("Edit Configuration File"); + + cgiStartHTML(cgiText(_("Edit Configuration File"))); cgiCopyTemplateLang("error.tmpl"); } else { - cgiSetVariable("refresh_page", "5;/admin?OP=redirect"); + cgiSetVariable("refresh_page", "5;/admin/?OP=redirect"); - cgiStartHTML("Edit Configuration File"); + cgiStartHTML(cgiText(_("Edit Configuration File"))); cgiCopyTemplateLang("restart.tmpl"); } @@ -2360,7 +2229,8 @@ do_config_server(http_t *http, /* I - HTTP connection */ if (stat(filename, &info)) { - cgiStartHTML("Edit Configuration File"); + cgiStartHTML(cgiText(_("Edit Configuration File"))); + cgiSetVariable("MESSAGE", cgiText(_("Unable to access cupsd.conf file:"))); cgiSetVariable("ERROR", strerror(errno)); cgiCopyTemplateLang("error.tmpl"); cgiEndHTML(); @@ -2371,8 +2241,11 @@ do_config_server(http_t *http, /* I - HTTP connection */ if (info.st_size > (1024 * 1024)) { - cgiStartHTML("Edit Configuration File"); - cgiSetVariable("ERROR", "Unable to edit cupsd.conf files larger than 1MB!"); + cgiStartHTML(cgiText(_("Edit Configuration File"))); + cgiSetVariable("MESSAGE", cgiText(_("Unable to access cupsd.conf file:"))); + cgiSetVariable("ERROR", + cgiText(_("Unable to edit cupsd.conf files larger than " + "1MB!"))); cgiCopyTemplateLang("error.tmpl"); cgiEndHTML(); @@ -2391,7 +2264,8 @@ do_config_server(http_t *http, /* I - HTTP connection */ * Unable to open - log an error... */ - cgiStartHTML("Edit Configuration File"); + cgiStartHTML(cgiText(_("Edit Configuration File"))); + cgiSetVariable("MESSAGE", cgiText(_("Unable to access cupsd.conf file:"))); cgiSetVariable("ERROR", strerror(errno)); cgiCopyTemplateLang("error.tmpl"); cgiEndHTML(); @@ -2432,19 +2306,17 @@ do_config_server(http_t *http, /* I - HTTP connection */ */ static void -do_delete_class(http_t *http, /* I - HTTP connection */ - cups_lang_t *language) /* I - Client's language */ +do_delete_class(http_t *http) /* I - HTTP connection */ { - ipp_t *request, /* IPP request */ - *response; /* IPP response */ + ipp_t *request; /* IPP request */ char uri[HTTP_MAX_URI]; /* Job URI */ const char *pclass; /* Printer class name */ - ipp_status_t status; /* Operation status... */ + cgiStartHTML(cgiText(_("Delete Class"))); + if (cgiGetVariable("CONFIRM") == NULL) { - cgiStartHTML("Delete Class"); cgiCopyTemplateLang("class-confirm.tmpl"); cgiEndHTML(); return; @@ -2455,8 +2327,7 @@ do_delete_class(http_t *http, /* I - HTTP connection */ "/classes/%s", pclass); else { - cgiSetVariable("ERROR", ippErrorString(IPP_NOT_FOUND)); - cgiStartHTML("Delete Class"); + cgiSetVariable("ERROR", cgiText(_("Missing form variable!"))); cgiCopyTemplateLang("error.tmpl"); cgiEndHTML(); return; @@ -2471,16 +2342,7 @@ do_delete_class(http_t *http, /* I - HTTP connection */ * printer-uri */ - request = ippNew(); - - request->request.op.operation_id = CUPS_DELETE_CLASS; - request->request.op.request_id = 1; - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET, - "attributes-charset", NULL, cupsLangEncoding(language)); - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE, - "attributes-natural-language", NULL, language->language); + request = ippNewRequest(CUPS_DELETE_CLASS); ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, uri); @@ -2489,22 +2351,10 @@ do_delete_class(http_t *http, /* I - HTTP connection */ * Do the request and get back a response... */ - if ((response = cupsDoRequest(http, request, "/admin/")) != NULL) - { - status = response->request.status.status_code; + ippDelete(cupsDoRequest(http, request, "/admin/")); - ippDelete(response); - } - else - status = cupsLastError(); - - cgiStartHTML("Delete Class"); - - if (status > IPP_OK_CONFLICT) - { - cgiSetVariable("ERROR", ippErrorString(status)); - cgiCopyTemplateLang("error.tmpl"); - } + if (cupsLastError() > IPP_OK_CONFLICT) + cgiShowIPPError(_("Unable to delete class:")); else cgiCopyTemplateLang("class-deleted.tmpl"); @@ -2517,19 +2367,17 @@ do_delete_class(http_t *http, /* I - HTTP connection */ */ static void -do_delete_printer(http_t *http, /* I - HTTP connection */ - cups_lang_t *language)/* I - Client's language */ +do_delete_printer(http_t *http) /* I - HTTP connection */ { - ipp_t *request, /* IPP request */ - *response; /* IPP response */ + ipp_t *request; /* IPP request */ char uri[HTTP_MAX_URI]; /* Job URI */ const char *printer; /* Printer printer name */ - ipp_status_t status; /* Operation status... */ + cgiStartHTML(cgiText(_("Delete Printer"))); + if (cgiGetVariable("CONFIRM") == NULL) { - cgiStartHTML("Delete Printer"); cgiCopyTemplateLang("printer-confirm.tmpl"); cgiEndHTML(); return; @@ -2540,8 +2388,7 @@ do_delete_printer(http_t *http, /* I - HTTP connection */ "/printers/%s", printer); else { - cgiSetVariable("ERROR", ippErrorString(IPP_NOT_FOUND)); - cgiStartHTML("Delete Printer"); + cgiSetVariable("ERROR", cgiText(_("Missing form variable!"))); cgiCopyTemplateLang("error.tmpl"); cgiEndHTML(); return; @@ -2556,16 +2403,7 @@ do_delete_printer(http_t *http, /* I - HTTP connection */ * printer-uri */ - request = ippNew(); - - request->request.op.operation_id = CUPS_DELETE_PRINTER; - request->request.op.request_id = 1; - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET, - "attributes-charset", NULL, cupsLangEncoding(language)); - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE, - "attributes-natural-language", NULL, language->language); + request = ippNewRequest(CUPS_DELETE_PRINTER); ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, uri); @@ -2574,25 +2412,251 @@ do_delete_printer(http_t *http, /* I - HTTP connection */ * Do the request and get back a response... */ - if ((response = cupsDoRequest(http, request, "/admin/")) != NULL) + ippDelete(cupsDoRequest(http, request, "/admin/")); + + if (cupsLastError() > IPP_OK_CONFLICT) + cgiShowIPPError(_("Unable to delete printer:")); + else + cgiCopyTemplateLang("printer-deleted.tmpl"); + + cgiEndHTML(); +} + + +/* + * 'do_export()' - Export printers to Samba... + */ + +static void +do_export(http_t *http) /* I - HTTP connection */ +{ + int i, j; /* Looping vars */ + ipp_t *request, /* IPP request */ + *response; /* IPP response */ + const char *username, /* Samba username */ + *password, /* Samba password */ + *export_all; /* Export all printers? */ + int export_count, /* Number of printers to export */ + printer_count; /* Number of available printers */ + + + /* + * Show header... + */ + + cgiStartHTML(cgiText(_("Export Printers to Samba"))); + + /* + * Get form data... + */ + + username = cgiGetVariable("USERNAME"); + password = cgiGetVariable("PASSWORD"); + export_all = cgiGetVariable("EXPORT_ALL"); + export_count = cgiGetSize("EXPORT_NAME"); + + if (username && *username && password && *password && export_count <= 1000) { - status = response->request.status.status_code; + /* + * Do export... + */ - ippDelete(response); + char userpass[1024], /* Username%password */ + *argv[1005]; /* Arguments */ + int argc; /* Number of arguments */ + int pid; /* Process ID of child */ + int status; /* Status of command */ + + + fputs("DEBUG: Export printers...\n", stderr); + + /* + * Create the command-line for cupsaddsmb... + */ + + snprintf(userpass, sizeof(userpass), "%s%%%s", username, password); + + argv[0] = "cupsaddsmb"; + argv[1] = "-v"; + argv[2] = "-U"; + argv[3] = userpass; + argc = 4; + + if (export_all) + argv[argc ++] = "-a"; + else + { + for (i = 0; i < export_count; i ++) + argv[argc ++] = (char *)cgiGetArray("EXPORT_NAME", i); + } + + argv[argc] = NULL; + + /* + * Run the command... + */ + + if ((pid = fork()) == 0) + { + /* + * Child goes here... + */ + + close(0); + open("/dev/null", O_RDONLY); + close(1); + dup(2); + + execvp("cupsaddsmb", argv); + perror("ERROR: Unable to execute cupsaddsmb"); + exit(20); + } + else if (pid < 0) + cgiSetVariable("ERROR", cgiText(_("Unable to fork process!"))); + else + { + /* + * Parent goes here, wait for child to finish... + */ + + while (wait(&status) < 0); + + if (status) + { + char message[1024]; /* Error message */ + + + if (WIFEXITED(status)) + { + switch (WEXITSTATUS(status)) + { + case 1 : + cgiSetVariable("ERROR", cgiText(_("Unable to connect to server!"))); + break; + + case 2 : + cgiSetVariable("ERROR", cgiText(_("Unable to get printer " + "attributes!"))); + break; + + case 3 : + cgiSetVariable("ERROR", cgiText(_("Unable to convert PPD file!"))); + break; + + case 4 : + cgiSetVariable("ERROR", cgiText(_("Unable to copy Windows 2000 " + "printer driver files!"))); + break; + + case 5 : + cgiSetVariable("ERROR", cgiText(_("Unable to install Windows " + "2000 printer driver files!"))); + break; + + case 6 : + cgiSetVariable("ERROR", cgiText(_("Unable to copy Windows 9x " + "printer driver files!"))); + break; + + case 7 : + cgiSetVariable("ERROR", cgiText(_("Unable to install Windows " + "9x printer driver files!"))); + break; + + case 8 : + cgiSetVariable("ERROR", cgiText(_("Unable to set Windows " + "printer driver!"))); + break; + + case 9 : + cgiSetVariable("ERROR", cgiText(_("No printer drivers found!"))); + break; + + case 20 : + cgiSetVariable("ERROR", cgiText(_("Unable to execute " + "cupsaddsmb command!"))); + break; + + default : + snprintf(message, sizeof(message), + cgiText(_("cupsaddsmb failed with status %d")), + WEXITSTATUS(status)); + + cgiSetVariable("ERROR", message); + break; + } + } + else + { + snprintf(message, sizeof(message), + cgiText(_("cupsaddsmb crashed on signal %d")), + WTERMSIG(status)); + + cgiSetVariable("ERROR", message); + } + } + else + { + cgiCopyTemplateLang("samba-exported"); + cgiEndHTML(); + return; + } + } } - else - status = cupsLastError(); + else if (username && !*username) + cgiSetVariable("ERROR", + cgiText(_("A Samba username is required to export " + "printer drivers!"))); + else if (username && (!password || !*password)) + cgiSetVariable("ERROR", + cgiText(_("A Samba password is required to export " + "printer drivers!"))); + + /* + * Get list of available printers... + */ - cgiStartHTML("Delete Printer"); + cgiSetSize("PRINTER_NAME", 0); + cgiSetSize("PRINTER_EXPORT", 0); - if (status > IPP_OK_CONFLICT) + request = ippNewRequest(CUPS_GET_PRINTERS); + + ippAddInteger(request, IPP_TAG_OPERATION, IPP_TAG_ENUM, + "printer-type", 0); + + ippAddInteger(request, IPP_TAG_OPERATION, IPP_TAG_ENUM, + "printer-type-mask", CUPS_PRINTER_CLASS | CUPS_PRINTER_REMOTE | + CUPS_PRINTER_IMPLICIT); + + ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD, + "requested-attributes", NULL, "printer-name"); + + if ((response = cupsDoRequest(http, request, "/")) != NULL) { - cgiSetVariable("ERROR", ippErrorString(status)); - cgiCopyTemplateLang("error.tmpl"); + cgiSetIPPVars(response, NULL, NULL, NULL, 0); + ippDelete(response); + + if (!export_all) + { + printer_count = cgiGetSize("PRINTER_NAME"); + + for (i = 0; i < printer_count; i ++) + { + for (j = 0; j < export_count; j ++) + if (!strcasecmp(cgiGetArray("PRINTER_NAME", i), + cgiGetArray("EXPORT_NAME", j))) + break; + + cgiSetArray("PRINTER_EXPORT", i, j < export_count ? "Y" : ""); + } + } } - else - cgiCopyTemplateLang("printer-deleted.tmpl"); + /* + * Show form... + */ + + cgiCopyTemplateLang("samba-export.tmpl"); cgiEndHTML(); } @@ -2602,13 +2666,13 @@ do_delete_printer(http_t *http, /* I - HTTP connection */ */ static void -do_menu(http_t *http, /* I - HTTP connection */ - cups_lang_t *language) /* I - Client's language */ +do_menu(http_t *http) /* I - HTTP connection */ { cups_file_t *cupsd; /* cupsd.conf file */ char line[1024], /* Line from cupsd.conf file */ *value; /* Value on line */ const char *server_root; /* Location of config files */ + const char *datadir; /* Location of data files */ ipp_t *request, /* IPP request */ *response; /* IPP response */ ipp_attribute_t *attr; /* IPP attribute */ @@ -2623,7 +2687,7 @@ do_menu(http_t *http, /* I - HTTP connection */ snprintf(line, sizeof(line), "%s/cupsd.conf", server_root); - cgiStartHTML("Administration"); + cgiStartHTML(cgiText(_("Administration"))); printf("<!-- \"%s\" -->\n", line); @@ -2637,7 +2701,7 @@ do_menu(http_t *http, /* I - HTTP connection */ * Unable to open - log an error... */ - cgiStartHTML("Administration"); + cgiSetVariable("MESSAGE", cgiText(_("Unable to open cupsd.conf file:"))); cgiSetVariable("ERROR", strerror(errno)); cgiCopyTemplateLang("error.tmpl"); cgiEndHTML(); @@ -2779,15 +2843,7 @@ do_menu(http_t *http, /* I - HTTP connection */ * Get the list of printers and their devices... */ - request = ippNew(); - request->request.op.operation_id = CUPS_GET_PRINTERS; - request->request.op.request_id = 1; - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET, - "attributes-charset", NULL, cupsLangEncoding(language)); - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE, - "attributes-natural-language", NULL, language->language); + request = ippNewRequest(CUPS_GET_PRINTERS); ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD, "requested-attributes", NULL, "device-uri"); @@ -2804,45 +2860,22 @@ do_menu(http_t *http, /* I - HTTP connection */ */ int i; /* Looping var */ - int num_printer_devices; /* Number of devices for local printers */ - char **printer_devices; /* Printer devices for local printers */ + cups_array_t *printer_devices; /* Printer devices for local printers */ + char *printer_device; /* Current printer device */ /* - * Count the number of printers we have... + * Allocate an array and copy the device strings... */ - for (num_printer_devices = 0, - attr = ippFindAttribute(response, "device-uri", IPP_TAG_URI); - attr; - num_printer_devices ++, - attr = ippFindNextAttribute(response, "device-uri", IPP_TAG_URI)); + printer_devices = cupsArrayNew((cups_array_func_t)strcmp, NULL); - if (num_printer_devices > 0) + for (attr = ippFindAttribute(response, "device-uri", IPP_TAG_URI); + attr; + attr = ippFindNextAttribute(response, "device-uri", IPP_TAG_URI)) { - /* - * Allocate an array and copy the device strings... - */ - - printer_devices = calloc(num_printer_devices, sizeof(char *)); - - for (i = 0, attr = ippFindAttribute(response, "device-uri", IPP_TAG_URI); - attr; - i ++, attr = ippFindNextAttribute(response, "device-uri", IPP_TAG_URI)) - { - printer_devices[i] = strdup(attr->values[0].string.text); - } - - /* - * Sort the printer devices as needed... - */ - - if (num_printer_devices > 1) - qsort(printer_devices, num_printer_devices, sizeof(char *), - compare_printer_devices); + cupsArrayAdd(printer_devices, strdup(attr->values[0].string.text)); } - else - printer_devices = NULL; /* * Free the printer list and get the device list... @@ -2850,15 +2883,7 @@ do_menu(http_t *http, /* I - HTTP connection */ ippDelete(response); - request = ippNew(); - request->request.op.operation_id = CUPS_GET_DEVICES; - request->request.op.request_id = 1; - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET, - "attributes-charset", NULL, cupsLangEncoding(language)); - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE, - "attributes-natural-language", NULL, language->language); + request = ippNewRequest(CUPS_GET_DEVICES); if ((response = cupsDoRequest(http, request, "/")) != NULL) { @@ -2893,15 +2918,15 @@ do_menu(http_t *http, /* I - HTTP connection */ while (attr && attr->group_tag == IPP_TAG_PRINTER) { - if (strcmp(attr->name, "device-info") == 0 && + if (!strcmp(attr->name, "device-info") && attr->value_tag == IPP_TAG_TEXT) device_info = attr->values[0].string.text; - if (strcmp(attr->name, "device-make-and-model") == 0 && + if (!strcmp(attr->name, "device-make-and-model") && attr->value_tag == IPP_TAG_TEXT) device_make_and_model = attr->values[0].string.text; - if (strcmp(attr->name, "device-uri") == 0 && + if (!strcmp(attr->name, "device-uri") && attr->value_tag == IPP_TAG_URI) device_uri = attr->values[0].string.text; @@ -2921,8 +2946,7 @@ do_menu(http_t *http, /* I - HTTP connection */ * device... */ - if (!bsearch(&device_uri, printer_devices, num_printer_devices, - sizeof(char *), compare_printer_devices)) + if (!cupsArrayFind(printer_devices, (void *)device_uri)) { /* * Not found, so it must be a new printer... @@ -2984,7 +3008,7 @@ do_menu(http_t *http, /* I - HTTP connection */ options_ptr += strlen(options_ptr); cgiFormEncode(options_ptr, device_uri, - sizeof(options) - (options_ptr - options)); + sizeof(options) - (options_ptr - options)); options_ptr += strlen(options_ptr); if (options_ptr < (options + sizeof(options) - 1)) @@ -3010,18 +3034,52 @@ do_menu(http_t *http, /* I - HTTP connection */ break; } + ippDelete(response); + /* * Free the device list... */ - ippDelete(response); + for (printer_device = (char *)cupsArrayFirst(printer_devices); + printer_device; + printer_device = (char *)cupsArrayNext(printer_devices)) + free(printer_device); - if (num_printer_devices) - free(printer_devices); + cupsArrayDelete(printer_devices); } } /* + * See if Samba and the Windows drivers are installed... + */ + + if ((datadir = getenv("CUPS_DATADIR")) == NULL) + datadir = CUPS_DATADIR; + + snprintf(line, sizeof(line), "%s/drivers/pscript5.dll", datadir); + if (!access(line, 0)) + { + /* + * Found Windows 2000 driver file, see if we have smbclient and + * rpcclient... + */ + + if (cupsFileFind("smbclient", getenv("PATH"), line, sizeof(line)) && + cupsFileFind("rpcclient", getenv("PATH"), line, sizeof(line))) + cgiSetVariable("HAVE_SAMBA", "Y"); + else + { + if (!cupsFileFind("smbclient", getenv("PATH"), line, sizeof(line))) + fputs("ERROR: smbclient not found!\n", stderr); + + if (!cupsFileFind("rpcclient", getenv("PATH"), line, sizeof(line))) + fputs("ERROR: rpcclient not found!\n", stderr); + } + } + else + perror(line); + + /* * Finally, show the main menu template... */ @@ -3037,23 +3095,21 @@ do_menu(http_t *http, /* I - HTTP connection */ static void do_printer_op(http_t *http, /* I - HTTP connection */ - cups_lang_t *language, /* I - Client's language */ ipp_op_t op, /* I - Operation to perform */ const char *title) /* I - Title of page */ { - ipp_t *request, /* IPP request */ - *response; /* IPP response */ + ipp_t *request; /* IPP request */ char uri[HTTP_MAX_URI]; /* Printer URI */ - const char *printer; /* Printer name (purge-jobs) */ - ipp_status_t status; /* Operation status... */ + const char *printer, /* Printer name (purge-jobs) */ + *is_class; /* Is a class? */ - if ((printer = cgiGetVariable("PRINTER_NAME")) != NULL) - httpAssembleURIf(uri, sizeof(uri), "ipp", NULL, "localhost", 0, - "/printers/%s", printer); - else + is_class = cgiGetVariable("IS_CLASS"); + printer = cgiGetVariable("PRINTER_NAME"); + + if (!printer) { - cgiSetVariable("ERROR", ippErrorString(IPP_NOT_FOUND)); + cgiSetVariable("ERROR", cgiText(_("Missing form variable!"))); cgiStartHTML(title); cgiCopyTemplateLang("error.tmpl"); cgiEndHTML(); @@ -3069,17 +3125,10 @@ do_printer_op(http_t *http, /* I - HTTP connection */ * printer-uri */ - request = ippNew(); - - request->request.op.operation_id = op; - request->request.op.request_id = 1; - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET, - "attributes-charset", NULL, cupsLangEncoding(language)); - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE, - "attributes-natural-language", NULL, language->language); + request = ippNewRequest(op); + httpAssembleURIf(uri, sizeof(uri), "ipp", NULL, "localhost", 0, + is_class ? "/classes/%s" : "/printers/%s", printer); ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, uri); @@ -3087,20 +3136,12 @@ do_printer_op(http_t *http, /* I - HTTP connection */ * Do the request and get back a response... */ - if ((response = cupsDoRequest(http, request, "/admin/")) != NULL) - { - status = response->request.status.status_code; + ippDelete(cupsDoRequest(http, request, "/admin/")); - ippDelete(response); - } - else - status = cupsLastError(); - - if (status > IPP_OK_CONFLICT) + if (cupsLastError() > IPP_OK_CONFLICT) { cgiStartHTML(title); - cgiSetVariable("ERROR", ippErrorString(status)); - cgiCopyTemplateLang("error.tmpl"); + cgiShowIPPError(_("Unable to change printer:")); } else { @@ -3108,11 +3149,13 @@ do_printer_op(http_t *http, /* I - HTTP connection */ * Redirect successful updates back to the printer page... */ - char refresh[1024]; /* Refresh URL */ + char url[1024], /* Printer/class URL */ + refresh[1024]; /* Refresh URL */ - cgiFormEncode(uri, printer, sizeof(uri)); - snprintf(refresh, sizeof(refresh), "5;/admin?OP=redirect&URL=/printers/%s", - uri); + + cgiRewriteURL(uri, url, sizeof(url), NULL); + cgiFormEncode(uri, url, sizeof(uri)); + snprintf(refresh, sizeof(refresh), "5;/admin/?OP=redirect&URL=%s", uri); cgiSetVariable("refresh_page", refresh); cgiStartHTML(title); @@ -3140,15 +3183,14 @@ do_printer_op(http_t *http, /* I - HTTP connection */ */ static void -do_set_allowed_users( - http_t *http, /* I - HTTP connection */ - cups_lang_t *language) /* I - Language */ +do_set_allowed_users(http_t *http) /* I - HTTP connection */ { int i; /* Looping var */ ipp_t *request, /* IPP request */ *response; /* IPP response */ char uri[HTTP_MAX_URI]; /* Printer URI */ const char *printer, /* Printer name (purge-jobs) */ + *is_class, /* Is a class? */ *users, /* List of users or groups */ *type; /* Allow/deny type */ int num_users; /* Number of users */ @@ -3156,7 +3198,6 @@ do_set_allowed_users( *end, /* Pointer to end of users string */ quote; /* Quote character */ ipp_attribute_t *attr; /* Attribute */ - ipp_status_t status; /* Operation status... */ static const char * const attrs[] = /* Requested attributes */ { "requesting-user-name-allowed", @@ -3164,13 +3205,13 @@ do_set_allowed_users( }; - if ((printer = cgiGetVariable("PRINTER_NAME")) != NULL) - httpAssembleURIf(uri, sizeof(uri), "ipp", NULL, "localhost", 0, - "/printers/%s", printer); - else + is_class = cgiGetVariable("IS_CLASS"); + printer = cgiGetVariable("PRINTER_NAME"); + + if (!printer) { - cgiSetVariable("ERROR", ippErrorString(IPP_NOT_FOUND)); - cgiStartHTML("Set Allowed Users"); + cgiSetVariable("ERROR", cgiText(_("Missing form variable!"))); + cgiStartHTML(cgiText(_("Set Allowed Users"))); cgiCopyTemplateLang("error.tmpl"); cgiEndHTML(); return; @@ -3193,17 +3234,10 @@ do_set_allowed_users( * requested-attributes */ - request = ippNew(); - - request->request.op.operation_id = IPP_GET_PRINTER_ATTRIBUTES; - request->request.op.request_id = 1; - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET, - "attributes-charset", NULL, cupsLangEncoding(language)); - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE, - "attributes-natural-language", NULL, language->language); + request = ippNewRequest(IPP_GET_PRINTER_ATTRIBUTES); + httpAssembleURIf(uri, sizeof(uri), "ipp", NULL, "localhost", 0, + is_class ? "/classes/%s" : "/printers/%s", printer); ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, uri); @@ -3215,24 +3249,17 @@ do_set_allowed_users( * Do the request and get back a response... */ - if ((response = cupsDoRequest(http, request, "/admin/")) != NULL) + if ((response = cupsDoRequest(http, request, "/")) != NULL) { - status = response->request.status.status_code; - cgiSetIPPVars(response, NULL, NULL, NULL, 0); ippDelete(response); } - else - status = cupsLastError(); - cgiStartHTML("Set Allowed Users"); + cgiStartHTML(cgiText(_("Set Allowed Users"))); - if (status > IPP_OK_CONFLICT) - { - cgiSetVariable("ERROR", ippErrorString(status)); - cgiCopyTemplateLang("error.tmpl"); - } + if (cupsLastError() > IPP_OK_CONFLICT) + cgiShowIPPError(_("Unable to get printer attributes:")); else cgiCopyTemplateLang("users.tmpl"); @@ -3284,7 +3311,7 @@ do_set_allowed_users( } /* - * Build a CUPS-Add-Printer request, which requires the following + * Build a CUPS-Add-Printer/Class request, which requires the following * attributes: * * attributes-charset @@ -3293,17 +3320,10 @@ do_set_allowed_users( * requesting-user-name-{allowed,denied} */ - request = ippNew(); - - request->request.op.operation_id = CUPS_ADD_PRINTER; - request->request.op.request_id = 1; - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET, - "attributes-charset", NULL, cupsLangEncoding(language)); - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE, - "attributes-natural-language", NULL, language->language); + request = ippNewRequest(is_class ? CUPS_ADD_CLASS : CUPS_ADD_PRINTER); + httpAssembleURIf(uri, sizeof(uri), "ipp", NULL, "localhost", 0, + is_class ? "/classes/%s" : "/printers/%s", printer); ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, uri); @@ -3372,22 +3392,12 @@ do_set_allowed_users( * Do the request and get back a response... */ - if ((response = cupsDoRequest(http, request, "/admin/")) != NULL) - { - status = response->request.status.status_code; - - cgiSetIPPVars(response, NULL, NULL, NULL, 0); - - ippDelete(response); - } - else - status = cupsLastError(); + ippDelete(cupsDoRequest(http, request, "/admin/")); - if (status > IPP_OK_CONFLICT) + if (cupsLastError() > IPP_OK_CONFLICT) { - cgiStartHTML("Set Allowed Users"); - cgiSetVariable("ERROR", ippErrorString(status)); - cgiCopyTemplateLang("error.tmpl"); + cgiStartHTML(cgiText(_("Set Allowed Users"))); + cgiShowIPPError(_("Unable to change printer:")); } else { @@ -3395,16 +3405,19 @@ do_set_allowed_users( * Redirect successful updates back to the printer page... */ - char refresh[1024]; /* Refresh URL */ + char url[1024], /* Printer/class URL */ + refresh[1024]; /* Refresh URL */ - cgiFormEncode(uri, printer, sizeof(uri)); - snprintf(refresh, sizeof(refresh), "5;/admin?OP=redirect&URL=/printers/%s", - uri); + + cgiRewriteURL(uri, url, sizeof(url), NULL); + cgiFormEncode(uri, url, sizeof(uri)); + snprintf(refresh, sizeof(refresh), "5;/admin/?OP=redirect&URL=%s", uri); cgiSetVariable("refresh_page", refresh); - cgiStartHTML("Set Allowed Users"); + cgiStartHTML(cgiText(_("Set Allowed Users"))); - cgiCopyTemplateLang("printer-modified.tmpl"); + cgiCopyTemplateLang(is_class ? "class-modified.tmpl" : + "printer-modified.tmpl"); } cgiEndHTML(); @@ -3417,41 +3430,32 @@ do_set_allowed_users( */ static void -do_set_sharing(http_t *http, /* I - HTTP connection */ - cups_lang_t *language) /* I - Language */ +do_set_sharing(http_t *http) /* I - HTTP connection */ { ipp_t *request, /* IPP request */ *response; /* IPP response */ char uri[HTTP_MAX_URI]; /* Printer URI */ const char *printer, /* Printer name */ + *is_class, /* Is a class? */ *shared; /* Sharing value */ - ipp_status_t status; /* Operation status... */ - if ((printer = cgiGetVariable("PRINTER_NAME")) != NULL) - httpAssembleURIf(uri, sizeof(uri), "ipp", NULL, "localhost", 0, - "/printers/%s", printer); - else - { - cgiSetVariable("ERROR", ippErrorString(IPP_NOT_FOUND)); - cgiStartHTML("Set Publishing"); - cgiCopyTemplateLang("error.tmpl"); - cgiEndHTML(); - return; - } + is_class = cgiGetVariable("IS_CLASS"); + printer = cgiGetVariable("PRINTER_NAME"); + shared = cgiGetVariable("SHARED"); - if ((shared = cgiGetVariable("SHARED")) == NULL) + if (!printer || !shared) { - cgiSetVariable("ERROR", "Missing SHARED parameter"); - cgiStartHTML("Set Publishing"); + cgiSetVariable("ERROR", cgiText(_("Missing form variable!"))); + cgiStartHTML(cgiText(_("Set Publishing"))); cgiCopyTemplateLang("error.tmpl"); cgiEndHTML(); return; } /* - * Build a CUPS-Add-Printer request, which requires the following - * attributes: + * Build a CUPS-Add-Printer/CUPS-Add-Class request, which requires the + * following attributes: * * attributes-charset * attributes-natural-language @@ -3459,17 +3463,10 @@ do_set_sharing(http_t *http, /* I - HTTP connection */ * printer-is-shared */ - request = ippNew(); - - request->request.op.operation_id = CUPS_ADD_PRINTER; - request->request.op.request_id = 1; - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET, - "attributes-charset", NULL, cupsLangEncoding(language)); - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE, - "attributes-natural-language", NULL, language->language); + request = ippNewRequest(is_class ? CUPS_ADD_CLASS : CUPS_ADD_PRINTER); + httpAssembleURIf(uri, sizeof(uri), "ipp", NULL, "localhost", 0, + is_class ? "/classes/%s" : "/printers/%s", printer); ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, uri); @@ -3481,20 +3478,15 @@ do_set_sharing(http_t *http, /* I - HTTP connection */ if ((response = cupsDoRequest(http, request, "/admin/")) != NULL) { - status = response->request.status.status_code; - cgiSetIPPVars(response, NULL, NULL, NULL, 0); ippDelete(response); } - else - status = cupsLastError(); - if (status > IPP_OK_CONFLICT) + if (cupsLastError() > IPP_OK_CONFLICT) { - cgiStartHTML("Set Publishing"); - cgiSetVariable("ERROR", ippErrorString(status)); - cgiCopyTemplateLang("error.tmpl"); + cgiStartHTML(cgiText(_("Set Publishing"))); + cgiShowIPPError(_("Unable to change printer-is-shared attribute:")); } else { @@ -3502,16 +3494,18 @@ do_set_sharing(http_t *http, /* I - HTTP connection */ * Redirect successful updates back to the printer page... */ - char refresh[1024]; /* Refresh URL */ + char url[1024], /* Printer/class URL */ + refresh[1024]; /* Refresh URL */ - cgiFormEncode(uri, printer, sizeof(uri)); - snprintf(refresh, sizeof(refresh), "5;/admin?OP=redirect&URL=/printers/%s", - uri); - cgiSetVariable("refresh_page", refresh); - cgiStartHTML("Set Publishing"); + cgiRewriteURL(uri, url, sizeof(url), NULL); + cgiFormEncode(uri, url, sizeof(uri)); + snprintf(refresh, sizeof(refresh), "5;/admin/?OP=redirect&URL=%s", uri); + cgiSetVariable("refresh_page", refresh); - cgiCopyTemplateLang("printer-modified.tmpl"); + cgiStartHTML(cgiText(_("Set Publishing"))); + cgiCopyTemplateLang(is_class ? "class-modified.tmpl" : + "printer-modified.tmpl"); } cgiEndHTML(); @@ -3568,5 +3562,5 @@ match_string(const char *a, /* I - First string */ /* - * End of "$Id: admin.c 4921 2006-01-12 21:26:26Z mike $". + * End of "$Id: admin.c 4943 2006-01-18 20:30:42Z mike $". */ diff --git a/cgi-bin/cgi.h b/cgi-bin/cgi.h index ac63c4546..0ffe2950d 100644 --- a/cgi-bin/cgi.h +++ b/cgi-bin/cgi.h @@ -1,5 +1,5 @@ /* - * "$Id: cgi.h 4921 2006-01-12 21:26:26Z mike $" + * "$Id: cgi.h 4931 2006-01-14 20:37:40Z mike $" * * CGI support library definitions. * @@ -80,6 +80,8 @@ extern char *cgiGetTemplateDir(void); 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 cgiPrintTestPage(http_t *http, const char *dest); extern char *cgiRewriteURL(const char *uri, char *url, int urlsize, const char *newresource); extern void cgiSetArray(const char *name, int element, @@ -95,12 +97,13 @@ extern int cgiSetIPPVars(ipp_t *response, const char *filter_name, extern void cgiSetServerVersion(void); extern void cgiSetSize(const char *name, int size); 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 const char *cgiText(const char *message); #endif /* !_CUPS_CGI_H_ */ /* - * End of "$Id: cgi.h 4921 2006-01-12 21:26:26Z mike $". + * End of "$Id: cgi.h 4931 2006-01-14 20:37:40Z mike $". */ diff --git a/cgi-bin/classes.c b/cgi-bin/classes.c index 52c12efab..355928af6 100644 --- a/cgi-bin/classes.c +++ b/cgi-bin/classes.c @@ -1,5 +1,5 @@ /* - * "$Id: classes.c 4921 2006-01-12 21:26:26Z mike $" + * "$Id: classes.c 4931 2006-01-14 20:37:40Z mike $" * * Class status CGI for the Common UNIX Printing System (CUPS). * @@ -23,7 +23,9 @@ * * Contents: * - * main() - Main entry for CGI. + * main() - Main entry for CGI. + * show_all_classes() - Show all classes... + * show_class() - Show a single class. */ /* @@ -34,6 +36,14 @@ /* + * Local functions... + */ + +void show_all_classes(http_t *http, const char *username); +void show_class(http_t *http, const char *printer); + + +/* * 'main()' - Main entry for CGI. */ @@ -41,17 +51,14 @@ int /* O - Exit status */ main(int argc, /* I - Number of command-line arguments */ char *argv[]) /* I - Command-line arguments */ { - cups_lang_t *language; /* Language information */ - char *pclass; /* Printer class name */ + const char *pclass; /* Class name */ + const char *user; /* Username */ http_t *http; /* Connection to the server */ ipp_t *request, /* IPP request */ *response; /* IPP response */ ipp_attribute_t *attr; /* IPP attribute */ - ipp_status_t status; /* Operation status... */ - char uri[HTTP_MAX_URI]; /* Printer URI */ - const char *which_jobs; /* Which jobs to show */ const char *op; /* Operation to perform, if any */ - static const char *def_attrs[] = /* Attributes for default printer */ + static const char *def_attrs[] = /* Attributes for default printer */ { "printer-name", "printer-uri-supported" @@ -63,6 +70,7 @@ main(int argc, /* I - Number of command-line arguments */ */ cgiInitialize(); + op = cgiGetVariable("OP"); /* @@ -72,60 +80,38 @@ main(int argc, /* I - Number of command-line arguments */ cgiSetVariable("SECTION", "classes"); /* - * Get the request language... + * See if we are displaying a printer or all classes... */ - language = cupsLangDefault(); + if (!strcmp(argv[0], "/") || strstr(argv[0], "classes.cgi")) + pclass = NULL; + else + pclass = argv[0]; /* - * Connect to the HTTP server... + * See who is logged in... */ - http = httpConnectEncrypt(cupsServer(), ippPort(), cupsEncryption()); + if ((user = getenv("REMOTE_USER")) == NULL) + user = "guest"; /* - * Tell the client to expect UTF-8 encoded HTML... + * Connect to the HTTP server... */ - puts("Content-Type: text/html;charset=utf-8\n"); + http = httpConnectEncrypt(cupsServer(), ippPort(), cupsEncryption()); /* - * See if we need to show a list of printers or the status of a - * single printer... + * Get the default printer... */ - cgiSetServerVersion(); - - pclass = argv[0]; - if (strcmp(pclass, "/") == 0 || strcmp(pclass, "classes.cgi") == 0) - { - pclass = NULL; - cgiSetVariable("TITLE", _cupsLangString(language, _("Class"))); - } - else - cgiSetVariable("TITLE", pclass); - - if (op == NULL || strcasecmp(op, "print-test-page") != 0) + if (!op) { /* - * Show the standard header... - */ - - cgiCopyTemplateLang("header.tmpl"); - - /* * Get the default destination... */ - request = ippNew(); - request->request.op.operation_id = CUPS_GET_DEFAULT; - request->request.op.request_id = 1; - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET, - "attributes-charset", NULL, cupsLangEncoding(language)); - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE, - "attributes-natural-language", NULL, language->language); + request = ippNewRequest(CUPS_GET_DEFAULT); ippAddStrings(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD, "requested-attributes", @@ -150,247 +136,328 @@ main(int argc, /* I - Number of command-line arguments */ } /* - * Get the class info... + * See if we need to show a list of classes or the status of a + * single printer... */ - request = ippNew(); + if (!pclass) + show_all_classes(http, user); + 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 + { + /* + * Unknown/bad operation... + */ - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET, - "attributes-charset", NULL, cupsLangEncoding(language)); + if (pclass) + cgiStartHTML(pclass); + else + cgiStartHTML(cgiText(_("Classes"))); - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE, - "attributes-natural-language", NULL, language->language); + cgiCopyTemplateLang("error-op.tmpl"); + cgiEndHTML(); + } - if (pclass == NULL) - { - /* - * Build a CUPS_GET_CLASSES request, which requires the following - * attributes: - * - * attributes-charset - * attributes-natural-language - */ + /* + * Close the HTTP server connection... + */ - request->request.op.operation_id = CUPS_GET_CLASSES; - request->request.op.request_id = 1; + httpClose(http); - if (getenv("REMOTE_USER") != NULL) - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "requesting-user-name", - NULL, getenv("REMOTE_USER")); - } - else - { - /* - * Build an IPP_GET_PRINTER_ATTRIBUTES request, which requires the following - * attributes: - * - * attributes-charset - * attributes-natural-language - * printer-uri - */ + /* + * Return with no errors... + */ - request->request.op.operation_id = IPP_GET_PRINTER_ATTRIBUTES; - request->request.op.request_id = 1; + return (0); +} - httpAssembleURIf(uri, sizeof(uri), "ipp", NULL, "localhost", 0, - "/classes/%s", pclass); - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, - uri); - } - cgiGetAttributes(request, "classes.tmpl"); +/* + * 'show_all_classes()' - Show all classes... + */ - /* - * Do the request and get back a response... - */ +void +show_all_classes(http_t *http, /* I - Connection to server */ + const char *user) /* I - Username */ +{ + int i; /* Looping var */ + ipp_t *request, /* IPP request */ + *response; /* IPP response */ + cups_array_t *classes; /* Array of class objects */ + ipp_attribute_t *pclass; /* Class object */ + int ascending, /* Order of classes (0 = descending) */ + first, /* First class to show */ + count; /* Number of classes */ + const char *var; /* Form variable */ + void *search; /* Search data */ + char url[1024], /* URL for prev/next/this */ + *urlptr, /* Position in URL */ + *urlend; /* End of URL */ - if ((response = cupsDoRequest(http, request, "/")) != NULL) - { - cgiSetIPPVars(response, NULL, NULL, NULL, 0); - ippDelete(response); - } + /* + * Show the standard header... + */ + + cgiStartHTML(cgiText(_("Classes"))); + + /* + * Build a CUPS_GET_CLASSES request, which requires the following + * attributes: + * + * attributes-charset + * attributes-natural-language + * requesting-user-name + */ + + request = ippNewRequest(CUPS_GET_CLASSES); + + ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, + "requesting-user-name", NULL, user); + + cgiGetAttributes(request, "classes.tmpl"); + + /* + * Do the request and get back a response... + */ + + if ((response = cupsDoRequest(http, request, "/")) != NULL) + { /* - * Write the report... + * Get a list of matching job objects. */ - cgiCopyTemplateLang("classes.tmpl"); + if ((var = cgiGetVariable("QUERY")) != NULL) + search = cgiCompileSearch(var); + else + search = NULL; + + classes = cgiGetIPPObjects(response, search); + count = cupsArrayCount(classes); + + if (search) + cgiFreeSearch(search); /* - * Get jobs for the specified class if a class has been chosen... + * Figure out which classes to display... */ - if (pclass != NULL) - { - /* - * Build an IPP_GET_JOBS request, which requires the following - * attributes: - * - * attributes-charset - * attributes-natural-language - * printer-uri - */ + if ((var = cgiGetVariable("FIRST")) != NULL) + first = atoi(var); + else + first = 0; - request = ippNew(); + if (first >= count) + first = count - CUPS_PAGE_MAX; - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET, - "attributes-charset", NULL, cupsLangEncoding(language)); + first = (first / CUPS_PAGE_MAX) * CUPS_PAGE_MAX; - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE, - "attributes-natural-language", NULL, language->language); + if (first < 0) + first = 0; - request->request.op.operation_id = IPP_GET_JOBS; - request->request.op.request_id = 1; + sprintf(url, "%d", count); + cgiSetVariable("TOTAL", url); - httpAssembleURIf(uri, sizeof(uri), "ipp", NULL, "localhost", 0, - "/classes/%s", pclass); - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, - uri); + if ((var = cgiGetVariable("ORDER")) != NULL) + ascending = !strcasecmp(var, "asc"); + else + ascending = 1; - if ((which_jobs = cgiGetVariable("which_jobs")) != NULL) - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD, "which-jobs", - NULL, which_jobs); + if (ascending) + { + for (i = 0, pclass = (ipp_attribute_t *)cupsArrayIndex(classes, first); + i < CUPS_PAGE_MAX && pclass; + i ++, pclass = (ipp_attribute_t *)cupsArrayNext(classes)) + cgiSetIPPObjectVars(pclass, NULL, i); + } + else + { + for (i = 0, pclass = (ipp_attribute_t *)cupsArrayIndex(classes, count - first - 1); + i < CUPS_PAGE_MAX && pclass; + i ++, pclass = (ipp_attribute_t *)cupsArrayPrev(classes)) + cgiSetIPPObjectVars(pclass, NULL, i); + } - if (getenv("REMOTE_USER") != NULL) - { - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "requesting-user-name", - NULL, getenv("REMOTE_USER")); + /* + * Save navigation URLs... + */ - if (strcmp(getenv("REMOTE_USER"), "root")) - ippAddBoolean(request, IPP_TAG_OPERATION, "my-jobs", 1); - } - else - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "requesting-user-name", - NULL, "unknown"); + urlend = url + sizeof(url); - cgiGetAttributes(request, "jobs.tmpl"); + if ((var = cgiGetVariable("QUERY")) != NULL) + { + strlcpy(url, "/classes/?QUERY=", sizeof(url)); + urlptr = url + strlen(url); - /* - * Do the request and get back a response... - */ + cgiFormEncode(urlptr, var, urlend - urlptr); + urlptr += strlen(urlptr); - if ((response = cupsDoRequest(http, request, "/")) != NULL) - { - cgiSetIPPVars(response, NULL, NULL, NULL, 0); - ippDelete(response); + strlcpy(urlptr, "&", urlend - urlptr); + urlptr += strlen(urlptr); + } + else + { + strlcpy(url, "/classes/?", sizeof(url)); + urlptr = url + strlen(url); + } - cgiCopyTemplateLang("jobs.tmpl"); - } + snprintf(urlptr, urlend - urlptr, "FIRST=%d", first); + cgiSetVariable("THISURL", url); + + if (first > 0) + { + snprintf(urlptr, urlend - urlptr, "FIRST=%d&ORDER=%s", + first - CUPS_PAGE_MAX, ascending ? "asc" : "dec"); + cgiSetVariable("PREVURL", url); } - } - else - { + + if ((first + CUPS_PAGE_MAX) < count) + { + snprintf(urlptr, urlend - urlptr, "FIRST=%d&ORDER=%s", + first + CUPS_PAGE_MAX, ascending ? "asc" : "dec"); + cgiSetVariable("NEXTURL", url); + } + /* - * Print a test page... + * Then show everything... */ - char filename[1024]; /* Test page filename */ - const char *datadir; /* CUPS_DATADIR env var */ - char refresh[1024]; /* Refresh URL */ + cgiCopyTemplateLang("search.tmpl"); + cgiCopyTemplateLang("classes-header.tmpl"); - cgiFormEncode(uri, pclass, sizeof(uri)); - snprintf(refresh, sizeof(refresh), "2;/classes/%s", uri); - cgiSetVariable("refresh_page", refresh); + if (count > 0) + cgiCopyTemplateLang("pager.tmpl"); - if ((datadir = getenv("CUPS_DATADIR")) == NULL) - datadir = CUPS_DATADIR; + cgiCopyTemplateLang("classes.tmpl"); - snprintf(filename, sizeof(filename), "%s/data/testprint.ps", datadir); - httpAssembleURIf(uri, sizeof(uri), "ipp", NULL, "localhost", 0, - "/classes/%s", pclass); + if (count > 0) + cgiCopyTemplateLang("pager.tmpl"); /* - * Build an IPP_PRINT_JOB request, which requires the following - * attributes: - * - * attributes-charset - * attributes-natural-language - * printer-uri - * requesting-user-name - * document-format + * Delete the response... */ - request = ippNew(); + ippDelete(response); + } + else + { + /* + * Show the error... + */ - request->request.op.operation_id = IPP_PRINT_JOB; - request->request.op.request_id = 1; + cgiShowIPPError(_("Unable to get class list:")); + } - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET, - "attributes-charset", NULL, cupsLangEncoding(language)); + cgiEndHTML(); +} - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE, - "attributes-natural-language", NULL, language->language); - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", - NULL, uri); +/* + * 'show_class()' - Show a single class. + */ - if (getenv("REMOTE_USER") != NULL) - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "requesting-user-name", - NULL, getenv("REMOTE_USER")); - else - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "requesting-user-name", - NULL, "root"); +void +show_class(http_t *http, /* I - Connection to server */ + const char *pclass) /* I - Name of class */ +{ + ipp_t *request, /* IPP request */ + *response; /* IPP response */ + ipp_attribute_t *attr; /* IPP attribute */ + char uri[HTTP_MAX_URI]; /* Printer URI */ + char refresh[1024]; /* Refresh URL */ + + + /* + * Build an IPP_GET_PRINTER_ATTRIBUTES request, which requires the following + * attributes: + * + * attributes-charset + * attributes-natural-language + * printer-uri + */ - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "job-name", - NULL, "Test Page"); + request = ippNewRequest(IPP_GET_PRINTER_ATTRIBUTES); - ippAddString(request, IPP_TAG_JOB, IPP_TAG_MIMETYPE, "document-format", - NULL, "application/postscript"); + httpAssembleURIf(uri, sizeof(uri), "ipp", NULL, "localhost", 0, + "/classes/%s", pclass); + ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, + uri); + cgiGetAttributes(request, "classes.tmpl"); + + /* + * Do the request and get back a response... + */ + + if ((response = cupsDoRequest(http, request, "/")) != NULL) + { /* - * Do the request and get back a response... + * Got the result; set the CGI variables and check the status of a + * single-queue request... */ - if ((response = cupsDoFileRequest(http, request, uri + 15, - filename)) != NULL) + cgiSetIPPVars(response, NULL, NULL, NULL, 0); + + if (pclass && (attr = ippFindAttribute(response, "printer-state", + IPP_TAG_ENUM)) != NULL && + attr->values[0].integer == IPP_PRINTER_PROCESSING) { - status = response->request.status.status_code; - cgiSetIPPVars(response, NULL, NULL, NULL, 0); + /* + * Class is processing - automatically refresh the page until we + * are done printing... + */ - ippDelete(response); + cgiFormEncode(uri, pclass, sizeof(uri)); + snprintf(refresh, sizeof(refresh), "10;/classes/%s", uri); + cgiSetVariable("refresh_page", refresh); } - else - status = cupsLastError(); - cgiSetVariable("PRINTER_NAME", pclass); + /* + * Delete the response... + */ + + ippDelete(response); /* * Show the standard header... */ - cgiCopyTemplateLang("header.tmpl"); + cgiStartHTML(pclass); /* - * Show the result... + * Show the class status... */ - if (status > IPP_OK_CONFLICT) - { - cgiSetVariable("ERROR", ippErrorString(status)); - cgiCopyTemplateLang("error.tmpl"); - } - else - cgiCopyTemplateLang("test-page.tmpl"); - } - - cgiCopyTemplateLang("trailer.tmpl"); + cgiCopyTemplateLang("classes.tmpl"); - /* - * Close the HTTP server connection... - */ + /* + * Show jobs for the specified class... + */ - httpClose(http); - cupsLangFree(language); + cgiCopyTemplateLang("class-jobs-header.tmpl"); + cgiShowJobs(http, pclass); + } + else + { + /* + * Show the IPP error... + */ - /* - * Return with no errors... - */ + cgiStartHTML(pclass); + cgiShowIPPError(_("Unable to get class status:")); + } - return (0); + cgiEndHTML(); } /* - * End of "$Id: classes.c 4921 2006-01-12 21:26:26Z mike $". + * End of "$Id: classes.c 4931 2006-01-14 20:37:40Z mike $". */ diff --git a/cgi-bin/ipp-var.c b/cgi-bin/ipp-var.c index 292cfea24..bc20e75d2 100644 --- a/cgi-bin/ipp-var.c +++ b/cgi-bin/ipp-var.c @@ -1,5 +1,5 @@ /* - * "$Id: ipp-var.c 4921 2006-01-12 21:26:26Z mike $" + * "$Id: ipp-var.c 4931 2006-01-14 20:37:40Z mike $" * * CGI <-> IPP variable routines for the Common UNIX Printing System (CUPS). * @@ -25,10 +25,15 @@ * * cgiGetAttributes() - Get the list of attributes that are needed * by the template file. - * cupsGetIPPObjects() - Get the objects in an IPP response. + * cgiGetIPPObjects() - Get the objects in an IPP response. + * cgiMoveJobs() - Move one or more jobs. + * cgiPrintTestPage() - Print a test page. * cgiRewriteURL() - Rewrite a printer URI into a web browser URL... * cgiSetIPPObjectVars() - Set CGI variables from an IPP object. * cgiSetIPPVars() - Set CGI variables from an IPP response. + * cgiShowIPPError() - Show the last IPP error message. + * cgiShowJobs() - Show print jobs. + * cgiText() - Return localized text. */ /* @@ -165,7 +170,7 @@ cgiGetAttributes(ipp_t *request, /* I - IPP request */ /* - * 'cupsGetIPPObjects()' - Get the objects in an IPP response. + * 'cgiGetIPPObjects()' - Get the objects in an IPP response. */ cups_array_t * /* O - Array of objects */ @@ -264,6 +269,353 @@ cgiGetIPPObjects(ipp_t *response, /* I - IPP response */ /* + * 'cgiMoveJobs()' - Move one or more jobs. + * + * At least one of dest or job_id must be non-zero/NULL. + */ + +void +cgiMoveJobs(http_t *http, /* I - Connection to server */ + const char *dest, /* I - Destination or NULL */ + int job_id) /* I - Job ID or 0 for all */ +{ + int i; /* Looping var */ + const char *user; /* Username */ + ipp_t *request, /* IPP request */ + *response; /* IPP response */ + ipp_attribute_t *attr; /* Current attribute */ + const char *name; /* Destination name */ + const char *job_printer_uri; /* JOB_PRINTER_URI form variable */ + char current_dest[1024]; /* Current destination */ + + + /* + * See who is logged in... + */ + + if ((user = getenv("REMOTE_USER")) == NULL) + user = "guest"; + + /* + * See if the user has already selected a new destination... + */ + + if ((job_printer_uri = cgiGetVariable("JOB_PRINTER_URI")) == NULL) + { + /* + * Make sure necessary form variables are set... + */ + + if (job_id) + { + char temp[255]; /* Temporary string */ + + + sprintf(temp, "%d", job_id); + cgiSetVariable("JOB_ID", temp); + } + + if (dest) + cgiSetVariable("PRINTER_NAME", dest); + + /* + * No new destination specified, show the user what the available + * printers/classes are... + */ + + if (!dest) + { + /* + * Get the current destination for job N... + */ + + char job_uri[1024]; /* Job URI */ + + + request = ippNewRequest(IPP_GET_JOB_ATTRIBUTES); + + snprintf(job_uri, sizeof(job_uri), "ipp://localhost/jobs/%d", job_id); + ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "job-uri", + NULL, job_uri); + ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD, + "requested-attributes", NULL, "job-printer-uri"); + + if ((response = cupsDoRequest(http, request, "/")) != NULL) + { + if ((attr = ippFindAttribute(response, "job-printer-uri", + IPP_TAG_URI)) != NULL) + { + /* + * Pull the name from the URI... + */ + + strlcpy(current_dest, strrchr(attr->values[0].string.text, '/') + 1, + sizeof(current_dest)); + dest = current_dest; + } + + ippDelete(response); + } + + if (!dest) + { + /* + * Couldn't get the current destination... + */ + + cgiStartHTML(cgiText(_("Move Job"))); + cgiShowIPPError(_("Unable to find destination for job!")); + cgiEndHTML(); + return; + } + } + + /* + * Get the list of available destinations... + */ + + request = ippNewRequest(CUPS_GET_PRINTERS); + + ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD, + "requested-attributes", NULL, "printer-uri-supported"); + + ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, + "requesting-user-name", NULL, user); + + if ((response = cupsDoRequest(http, request, "/")) != NULL) + { + for (i = 0, attr = ippFindAttribute(response, "printer-uri-supported", + IPP_TAG_URI); + attr; + attr = ippFindNextAttribute(response, "printer-uri-supported", + IPP_TAG_URI)) + { + /* + * Pull the name from the URI... + */ + + name = strrchr(attr->values[0].string.text, '/') + 1; + + /* + * If the name is not the same as the current destination, add it! + */ + + if (strcasecmp(name, dest)) + { + cgiSetArray("JOB_PRINTER_URI", i, attr->values[0].string.text); + cgiSetArray("JOB_PRINTER_NAME", i, name); + i ++; + } + } + + ippDelete(response); + } + + /* + * Show the form... + */ + + if (job_id) + cgiStartHTML(cgiText(_("Move Job"))); + else + cgiStartHTML(cgiText(_("Move All Jobs"))); + + cgiCopyTemplateLang("job-move.tmpl"); + } + else + { + /* + * Try moving the job or jobs... + */ + + char uri[1024], /* Job/printer URI */ + resource[1024], /* Post resource */ + refresh[1024]; /* Refresh URL */ + const char *job_printer_name; /* New printer name */ + + + request = ippNewRequest(CUPS_MOVE_JOB); + + if (job_id) + { + /* + * Move 1 job... + */ + + snprintf(resource, sizeof(resource), "/jobs/%d", job_id); + + snprintf(uri, sizeof(uri), "ipp://localhost/jobs/%d", job_id); + ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "job-uri", + NULL, uri); + } + else + { + /* + * Move all active jobs on a destination... + */ + + snprintf(resource, sizeof(resource), "/%s/%s", + cgiGetVariable("SECTION"), dest); + + httpAssembleURIf(uri, sizeof(uri), "ipp", NULL, "localhost", ippPort(), + "/%s/%s", cgiGetVariable("SECTION"), dest); + ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", + NULL, uri); + } + + ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "job-printer-uri", + NULL, job_printer_uri); + + ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, + "requesting-user-name", NULL, user); + + ippDelete(cupsDoRequest(http, request, resource)); + + /* + * Show the results... + */ + + job_printer_name = strrchr(job_printer_uri, '/') + 1; + + if (cupsLastError() <= IPP_OK_CONFLICT) + { + cgiRewriteURL(job_printer_uri, resource, sizeof(resource), NULL); + cgiFormEncode(uri, resource, sizeof(uri)); + snprintf(refresh, sizeof(refresh), "2;%s", uri); + cgiSetVariable("refresh_page", refresh); + } + + if (job_id) + cgiStartHTML(cgiText(_("Move Job"))); + else + cgiStartHTML(cgiText(_("Move All Jobs"))); + + if (cupsLastError() > IPP_OK_CONFLICT) + { + if (job_id) + cgiShowIPPError(_("Unable to move job")); + else + cgiShowIPPError(_("Unable to move jobs")); + } + else + { + cgiSetVariable("JOB_PRINTER_NAME", job_printer_name); + cgiCopyTemplateLang("job-moved.tmpl"); + } + } + + cgiEndHTML(); +} + + +/* + * 'cgiPrintTestPage()' - Print a test page. + */ + +void +cgiPrintTestPage(http_t *http, /* I - Connection to server */ + const char *dest) /* I - Destination printer/class */ +{ + ipp_t *request, /* IPP request */ + *response; /* IPP response */ + char uri[HTTP_MAX_URI], /* Printer URI */ + resource[1024], /* POST resource path */ + refresh[1024], /* Refresh URL */ + filename[1024]; /* Test page filename */ + const char *datadir; /* CUPS_DATADIR env var */ + const char *user; /* Username */ + + + /* + * See who is logged in... + */ + + if ((user = getenv("REMOTE_USER")) == NULL) + user = "guest"; + + /* + * Locate the test page file... + */ + + if ((datadir = getenv("CUPS_DATADIR")) == NULL) + datadir = CUPS_DATADIR; + + snprintf(filename, sizeof(filename), "%s/data/testprint.ps", datadir); + + /* + * Point to the printer/class... + */ + + snprintf(resource, sizeof(resource), "/%s/%s", cgiGetVariable("SECTION"), + dest); + + httpAssembleURIf(uri, sizeof(uri), "ipp", NULL, "localhost", ippPort(), + "/%s/%s", cgiGetVariable("SECTION"), dest); + + /* + * Build an IPP_PRINT_JOB request, which requires the following + * attributes: + * + * attributes-charset + * attributes-natural-language + * printer-uri + * requesting-user-name + * document-format + */ + + request = ippNewRequest(IPP_PRINT_JOB); + + 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, "Test Page"); + + 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); + + ippDelete(response); + } + + if (cupsLastError() <= IPP_OK_CONFLICT) + { + /* + * Automatically reload the printer status page... + */ + + cgiFormEncode(uri, resource, sizeof(uri)); + snprintf(refresh, sizeof(refresh), "2;%s", uri); + cgiSetVariable("refresh_page", refresh); + } + + cgiStartHTML(cgiText(_("Print Test Page"))); + + if (cupsLastError() > IPP_OK_CONFLICT) + cgiShowIPPError(_("Unable to print test page:")); + else + { + cgiSetVariable("PRINTER_NAME", dest); + + cgiCopyTemplateLang("test-page.tmpl"); + } + + cgiEndHTML(); +} + + +/* * 'cgiRewriteURL()' - Rewrite a printer URI into a web browser URL... */ @@ -687,6 +1039,21 @@ cgiSetIPPVars(ipp_t *response, /* I - Response data to be copied... */ /* + * 'cgiShowIPPError()' - Show the last IPP error message. + * + * The caller must still call cgiStartHTML() and cgiEndHTML(). + */ + +void +cgiShowIPPError(const char *message) /* I - Contextual message */ +{ + cgiSetVariable("MESSAGE", cgiText(message)); + cgiSetVariable("ERROR", cupsLastErrorString()); + cgiCopyTemplateLang("error.tmpl"); +} + + +/* * 'cgiShowJobs()' - Show print jobs. */ @@ -708,7 +1075,6 @@ cgiShowJobs(http_t *http, /* I - Connection to server */ char url[1024], /* URL for prev/next/this */ *urlptr, /* Position in URL */ *urlend; /* End of URL */ - cups_lang_t *language; /* Language information */ /* @@ -720,18 +1086,7 @@ cgiShowJobs(http_t *http, /* I - Connection to server */ * printer-uri */ - request = ippNew(); - - language = cupsLangDefault(); - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET, - "attributes-charset", NULL, cupsLangEncoding(language)); - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE, - "attributes-natural-language", NULL, language->language); - - request->request.op.operation_id = IPP_GET_JOBS; - request->request.op.request_id = 1; + request = ippNewRequest(IPP_GET_JOBS); if (dest) { @@ -760,7 +1115,7 @@ cgiShowJobs(http_t *http, /* I - Connection to server */ * Get a list of matching job objects. */ - if (!dest && (var = cgiGetVariable("QUERY")) != NULL) + if ((var = cgiGetVariable("QUERY")) != NULL) search = cgiCompileSearch(var); else search = NULL; @@ -817,14 +1172,14 @@ cgiShowJobs(http_t *http, /* I - Connection to server */ urlend = url + sizeof(url); - if (dest) + if ((var = cgiGetVariable("QUERY")) != NULL) { - snprintf(url, sizeof(url), "/%s/%s?", cgiGetVariable("SECTION"), dest); - urlptr = url + strlen(url); - } - else if ((var = cgiGetVariable("QUERY")) != NULL) - { - strlcpy(url, "/jobs/?QUERY=", sizeof(url)); + if (dest) + snprintf(url, sizeof(url), "/%s/%s?QUERY=", cgiGetVariable("SECTION"), + dest); + else + strlcpy(url, "/jobs/?QUERY=", sizeof(url)); + urlptr = url + strlen(url); cgiFormEncode(urlptr, var, urlend - urlptr); @@ -835,7 +1190,11 @@ cgiShowJobs(http_t *http, /* I - Connection to server */ } else { - strlcpy(url, "/jobs/?", sizeof(url)); + if (dest) + snprintf(url, sizeof(url), "/%s/%s?", cgiGetVariable("SECTION"), dest); + else + strlcpy(url, "/jobs/?", sizeof(url)); + urlptr = url + strlen(url); } @@ -872,25 +1231,44 @@ cgiShowJobs(http_t *http, /* I - Connection to server */ * Then show everything... */ - if (!dest) - cgiCopyTemplateLang("search.tmpl"); + if (dest) + cgiSetVariable("SEARCH_DEST", dest); + + cgiCopyTemplateLang("search.tmpl"); cgiCopyTemplateLang("jobs-header.tmpl"); - if (count > CUPS_PAGE_MAX) - cgiCopyTemplateLang("page.tmpl"); + if (count > 0) + cgiCopyTemplateLang("pager.tmpl"); cgiCopyTemplateLang("jobs.tmpl"); - if (count > CUPS_PAGE_MAX) - cgiCopyTemplateLang("page.tmpl"); + if (count > 0) + cgiCopyTemplateLang("pager.tmpl"); ippDelete(response); } } +/* + * 'cgiText()' - Return localized text. + */ + +const char * /* O - Localized message */ +cgiText(const char *message) /* I - Message */ +{ + static cups_lang_t *language = NULL; + /* Language */ + + + if (!language) + language = cupsLangDefault(); + + return (_cupsLangString(language, message)); +} + /* - * End of "$Id: ipp-var.c 4921 2006-01-12 21:26:26Z mike $". + * End of "$Id: ipp-var.c 4931 2006-01-14 20:37:40Z mike $". */ diff --git a/cgi-bin/jobs.c b/cgi-bin/jobs.c index 648d38150..a73c34f90 100644 --- a/cgi-bin/jobs.c +++ b/cgi-bin/jobs.c @@ -1,5 +1,5 @@ /* - * "$Id: jobs.c 4921 2006-01-12 21:26:26Z mike $" + * "$Id: jobs.c 4931 2006-01-14 20:37:40Z mike $" * * Job status CGI for the Common UNIX Printing System (CUPS). * @@ -38,7 +38,7 @@ * Local functions... */ -static void do_job_op(http_t *http, cups_lang_t *language, ipp_op_t op); +static void do_job_op(http_t *http, int job_id, ipp_op_t op); /* @@ -49,10 +49,11 @@ int /* O - Exit status */ main(int argc, /* I - Number of command-line arguments */ char *argv[]) /* I - Command-line arguments */ { - cups_lang_t *language; /* Language information */ http_t *http; /* Connection to the server */ const char *op; /* Operation name */ - + const char *job_id_var; /* Job ID form variable */ + int job_id; /* Job ID */ + /* * Get any form variables... @@ -67,54 +68,49 @@ main(int argc, /* I - Number of command-line arguments */ cgiSetVariable("SECTION", "jobs"); /* - * Get the request language... - */ - - language = cupsLangDefault(); - - /* * Connect to the HTTP server... */ http = httpConnectEncrypt(cupsServer(), ippPort(), cupsEncryption()); /* - * Tell the client to expect UTF-8 encoded HTML... + * Get the job ID, if any... */ - puts("Content-Type: text/html;charset=utf-8\n"); + if ((job_id_var = cgiGetVariable("JOB_ID")) != NULL) + job_id = atoi(job_id_var); + else + job_id = 0; /* - * Send a standard header... + * Do the operation... */ - cgiSetVariable("TITLE", _cupsLangString(language, _("Jobs"))); - - cgiSetServerVersion(); - - cgiCopyTemplateLang("header.tmpl"); - - if ((op = cgiGetVariable("OP")) != NULL) + if ((op = cgiGetVariable("OP")) != NULL && job_id > 0) { /* * Do the operation... */ if (!strcmp(op, "cancel-job")) - do_job_op(http, language, IPP_CANCEL_JOB); + do_job_op(http, job_id, IPP_CANCEL_JOB); else if (!strcmp(op, "hold-job")) - do_job_op(http, language, IPP_HOLD_JOB); + do_job_op(http, job_id, IPP_HOLD_JOB); + else if (!strcmp(op, "move-job")) + cgiMoveJobs(http, NULL, job_id); else if (!strcmp(op, "release-job")) - do_job_op(http, language, IPP_RELEASE_JOB); + do_job_op(http, job_id, IPP_RELEASE_JOB); else if (!strcmp(op, "restart-job")) - do_job_op(http, language, IPP_RESTART_JOB); + do_job_op(http, job_id, IPP_RESTART_JOB); else { /* * Bad operation code... Display an error... */ - cgiCopyTemplateLang("job-op.tmpl"); + cgiStartHTML(cgiText(_("Jobs"))); + cgiCopyTemplateLang("error-op.tmpl"); + cgiEndHTML(); } } else @@ -123,17 +119,16 @@ main(int argc, /* I - Number of command-line arguments */ * Show a list of jobs... */ + cgiStartHTML(cgiText(_("Jobs"))); cgiShowJobs(http, NULL); + cgiEndHTML(); } - cgiCopyTemplateLang("trailer.tmpl"); - /* * Close the HTTP server connection... */ httpClose(http); - cupsLangFree(language); /* * Return with no errors... @@ -149,24 +144,13 @@ main(int argc, /* I - Number of command-line arguments */ static void do_job_op(http_t *http, /* I - HTTP connection */ - cups_lang_t *language, /* I - Client's language */ + int job_id, /* I - Job ID */ ipp_op_t op) /* I - Operation to perform */ { - ipp_t *request, /* IPP request */ - *response; /* IPP response */ + ipp_t *request; /* IPP request */ char uri[HTTP_MAX_URI]; /* Job URI */ - const char *job; /* Job ID */ - ipp_status_t status; /* Operation status... */ - + const char *user; /* Username */ - if ((job = cgiGetVariable("JOB_ID")) != NULL) - snprintf(uri, sizeof(uri), "ipp://localhost/jobs/%s", job); - else - { - cgiSetVariable("ERROR", ippErrorString(IPP_NOT_FOUND)); - cgiCopyTemplateLang("error.tmpl"); - return; - } /* * Build a job request, which requires the following @@ -178,50 +162,29 @@ do_job_op(http_t *http, /* I - HTTP connection */ * requesting-user-name */ - request = ippNew(); - - request->request.op.operation_id = op; - request->request.op.request_id = 1; - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET, - "attributes-charset", NULL, cupsLangEncoding(language)); - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE, - "attributes-natural-language", NULL, language->language); + request = ippNewRequest(op); ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "job-uri", NULL, uri); - if (getenv("REMOTE_USER") != NULL) - { - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "requesting-user-name", - NULL, getenv("REMOTE_USER")); + snprintf(uri, sizeof(uri), "ipp://localhost/jobs/%d", job_id); - if (strcmp(getenv("REMOTE_USER"), "root")) - ippAddBoolean(request, IPP_TAG_OPERATION, "my-jobs", 1); - } - else - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "requesting-user-name", - NULL, "unknown"); + if ((user = getenv("REMOTE_USER")) == NULL) + user = "guest"; + + ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, + "requesting-user-name", NULL, user); /* * Do the request and get back a response... */ - if ((response = cupsDoRequest(http, request, "/jobs")) != NULL) - { - status = response->request.status.status_code; + ippDelete(cupsDoRequest(http, request, "/jobs")); - ippDelete(response); - } - else - status = cupsLastError(); + cgiStartHTML(cgiText(_("Jobs"))); - if (status > IPP_OK_CONFLICT) - { - cgiSetVariable("ERROR", ippErrorString(status)); - cgiCopyTemplateLang("error.tmpl"); - } + if (cupsLastError() > IPP_OK_CONFLICT) + cgiShowIPPError(_("Job operation failed:")); else if (op == IPP_CANCEL_JOB) cgiCopyTemplateLang("job-cancel.tmpl"); else if (op == IPP_HOLD_JOB) @@ -230,9 +193,11 @@ do_job_op(http_t *http, /* I - HTTP connection */ cgiCopyTemplateLang("job-release.tmpl"); else if (op == IPP_RESTART_JOB) cgiCopyTemplateLang("job-restart.tmpl"); + + cgiEndHTML(); } /* - * End of "$Id: jobs.c 4921 2006-01-12 21:26:26Z mike $". + * End of "$Id: jobs.c 4931 2006-01-14 20:37:40Z mike $". */ diff --git a/cgi-bin/printers.c b/cgi-bin/printers.c index 25bb7ea70..ddc027f51 100644 --- a/cgi-bin/printers.c +++ b/cgi-bin/printers.c @@ -1,5 +1,5 @@ /* - * "$Id: printers.c 4921 2006-01-12 21:26:26Z mike $" + * "$Id: printers.c 4931 2006-01-14 20:37:40Z mike $" * * Printer status CGI for the Common UNIX Printing System (CUPS). * @@ -23,7 +23,9 @@ * * Contents: * - * main() - Main entry for CGI. + * main() - Main entry for CGI. + * show_all_printers() - Show all printers... + * show_printer() - Show a single printer. */ /* @@ -34,6 +36,14 @@ /* + * Local functions... + */ + +void show_all_printers(http_t *http, const char *username); +void show_printer(http_t *http, const char *printer); + + +/* * 'main()' - Main entry for CGI. */ @@ -41,17 +51,13 @@ int /* O - Exit status */ main(int argc, /* I - Number of command-line arguments */ char *argv[]) /* I - Command-line arguments */ { - cups_lang_t *language; /* Language information */ - char *printer; /* Printer name */ + const char *printer; /* Printer name */ + const char *user; /* Username */ http_t *http; /* Connection to the server */ ipp_t *request, /* IPP request */ *response; /* IPP response */ ipp_attribute_t *attr; /* IPP attribute */ - ipp_status_t status; /* Operation status... */ - char uri[HTTP_MAX_URI]; /* Printer URI */ - const char *which_jobs; /* Which jobs to show */ const char *op; /* Operation to perform, if any */ - char refresh[1024]; /* Refresh URL */ static const char *def_attrs[] = /* Attributes for default printer */ { "printer-name", @@ -64,13 +70,8 @@ main(int argc, /* I - Number of command-line arguments */ */ cgiInitialize(); - op = cgiGetVariable("OP"); - - /* - * Get the request language... - */ - language = cupsLangDefault(); + op = cgiGetVariable("OP"); /* * Set the web interface section... @@ -79,48 +80,38 @@ main(int argc, /* I - Number of command-line arguments */ cgiSetVariable("SECTION", "printers"); /* - * Connect to the HTTP server... + * See if we are displaying a printer or all printers... */ - http = httpConnectEncrypt(cupsServer(), ippPort(), cupsEncryption()); + if (!strcmp(argv[0], "/") || strstr(argv[0], "printers.cgi")) + printer = NULL; + else + printer = argv[0]; /* - * Tell the client to expect UTF-8 encoded HTML... + * See who is logged in... */ - puts("Content-Type: text/html;charset=utf-8\n"); + if ((user = getenv("REMOTE_USER")) == NULL) + user = "guest"; /* - * See if we need to show a list of printers or the status of a - * single printer... + * Connect to the HTTP server... */ - cgiSetServerVersion(); + http = httpConnectEncrypt(cupsServer(), ippPort(), cupsEncryption()); - printer = argv[0]; - if (strcmp(printer, "/") == 0 || strstr(printer, "printers.cgi") != NULL) - { - printer = NULL; - cgiSetVariable("TITLE", _cupsLangString(language, _("Printer"))); - } - else - cgiSetVariable("TITLE", printer); + /* + * Get the default printer... + */ - if (op == NULL || strcasecmp(op, "print-test-page") != 0) + if (!op) { /* * Get the default destination... */ - request = ippNew(); - request->request.op.operation_id = CUPS_GET_DEFAULT; - request->request.op.request_id = 1; - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET, - "attributes-charset", NULL, cupsLangEncoding(language)); - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE, - "attributes-natural-language", NULL, language->language); + request = ippNewRequest(CUPS_GET_DEFAULT); ippAddStrings(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD, "requested-attributes", @@ -145,290 +136,335 @@ main(int argc, /* I - Number of command-line arguments */ } /* - * Get the printer info... + * See if we need to show a list of printers or the status of a + * single printer... */ - request = ippNew(); + if (!printer) + show_all_printers(http, user); + else + show_printer(http, printer); + } + else if (!strcasecmp(op, "print-test-page") && printer) + cgiPrintTestPage(http, printer); + else if (!strcasecmp(op, "move-jobs") && printer) + cgiMoveJobs(http, printer, 0); + else + { + /* + * Unknown/bad operation... + */ - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET, - "attributes-charset", NULL, cupsLangEncoding(language)); + if (printer) + cgiStartHTML(printer); + else + cgiStartHTML(cgiText(_("Printers"))); - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE, - "attributes-natural-language", NULL, language->language); + cgiCopyTemplateLang("error-op.tmpl"); + cgiEndHTML(); + } - if (printer == NULL) - { - /* - * Build a CUPS_GET_PRINTERS request, which requires the following - * attributes: - * - * attributes-charset - * attributes-natural-language - */ + /* + * Close the HTTP server connection... + */ + + httpClose(http); + + /* + * Return with no errors... + */ - request->request.op.operation_id = CUPS_GET_PRINTERS; - request->request.op.request_id = 1; + return (0); +} - ippAddInteger(request, IPP_TAG_OPERATION, IPP_TAG_ENUM, - "printer-type", 0); - ippAddInteger(request, IPP_TAG_OPERATION, IPP_TAG_ENUM, - "printer-type-mask", CUPS_PRINTER_CLASS); - if (getenv("REMOTE_USER") != NULL) - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "requesting-user-name", - NULL, getenv("REMOTE_USER")); - } - else - { - /* - * Build an IPP_GET_PRINTER_ATTRIBUTES request, which requires the following - * attributes: - * - * attributes-charset - * attributes-natural-language - * printer-uri - */ +/* + * 'show_all_printers()' - Show all printers... + */ - request->request.op.operation_id = IPP_GET_PRINTER_ATTRIBUTES; - request->request.op.request_id = 1; +void +show_all_printers(http_t *http, /* I - Connection to server */ + const char *user) /* I - Username */ +{ + int i; /* Looping var */ + ipp_t *request, /* IPP request */ + *response; /* IPP response */ + cups_array_t *printers; /* Array of printer objects */ + ipp_attribute_t *printer; /* Printer object */ + int ascending, /* Order of printers (0 = descending) */ + first, /* First printer to show */ + count; /* Number of printers */ + const char *var; /* Form variable */ + void *search; /* Search data */ + char url[1024], /* URL for prev/next/this */ + *urlptr, /* Position in URL */ + *urlend; /* End of URL */ - httpAssembleURIf(uri, sizeof(uri), "ipp", NULL, "localhost", 0, - "/printers/%s", printer); - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, - uri); - } - cgiGetAttributes(request, "printers.tmpl"); + /* + * Show the standard header... + */ - /* - * Do the request and get back a response... - */ + cgiStartHTML(cgiText(_("Printers"))); - if ((response = cupsDoRequest(http, request, "/")) != NULL) - { - /* - * Got the result; set the CGI variables and check the status of a - * single-queue request... - */ + /* + * Build a CUPS_GET_PRINTERS request, which requires the following + * attributes: + * + * attributes-charset + * attributes-natural-language + * printer-type + * printer-type-mask + * requesting-user-name + */ - cgiSetIPPVars(response, NULL, NULL, NULL, 0); + request = ippNewRequest(CUPS_GET_PRINTERS); - if (printer && (attr = ippFindAttribute(response, "printer-state", - IPP_TAG_ENUM)) != NULL && - attr->values[0].integer == IPP_PRINTER_PROCESSING) - { - /* - * Printer is processing - automatically refresh the page until we - * are done printing... - */ - - cgiFormEncode(uri, printer, sizeof(uri)); - snprintf(refresh, sizeof(refresh), "10;/printers/%s", uri); - cgiSetVariable("refresh_page", refresh); - } + ippAddInteger(request, IPP_TAG_OPERATION, IPP_TAG_ENUM, + "printer-type", 0); + ippAddInteger(request, IPP_TAG_OPERATION, IPP_TAG_ENUM, + "printer-type-mask", CUPS_PRINTER_CLASS); - /* - * Delete the response... - */ + ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, + "requesting-user-name", NULL, user); - ippDelete(response); - } - else if (printer) - fprintf(stderr, "ERROR: Get-Printer-Attributes request failed - %s (%x)\n", - ippErrorString(cupsLastError()), cupsLastError()); - else - fprintf(stderr, "ERROR: CUPS-Get-Printers request failed - %s (%x)\n", - ippErrorString(cupsLastError()), cupsLastError()); + cgiGetAttributes(request, "printers.tmpl"); + /* + * Do the request and get back a response... + */ + + if ((response = cupsDoRequest(http, request, "/")) != NULL) + { /* - * Show the standard header... + * Get a list of matching job objects. */ - cgiCopyTemplateLang("header.tmpl"); + if ((var = cgiGetVariable("QUERY")) != NULL) + search = cgiCompileSearch(var); + else + search = NULL; - /* - * Write the report... - */ + printers = cgiGetIPPObjects(response, search); + count = cupsArrayCount(printers); - cgiCopyTemplateLang("printers.tmpl"); + if (search) + cgiFreeSearch(search); /* - * Get jobs for the specified printer if a printer has been chosen... + * Figure out which printers to display... */ - if (printer != NULL) - { - /* - * Build an IPP_GET_JOBS request, which requires the following - * attributes: - * - * attributes-charset - * attributes-natural-language - * printer-uri - */ + if ((var = cgiGetVariable("FIRST")) != NULL) + first = atoi(var); + else + first = 0; - request = ippNew(); + if (first >= count) + first = count - CUPS_PAGE_MAX; - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET, - "attributes-charset", NULL, cupsLangEncoding(language)); + first = (first / CUPS_PAGE_MAX) * CUPS_PAGE_MAX; - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE, - "attributes-natural-language", NULL, language->language); + if (first < 0) + first = 0; - request->request.op.operation_id = IPP_GET_JOBS; - request->request.op.request_id = 1; + sprintf(url, "%d", count); + cgiSetVariable("TOTAL", url); - httpAssembleURIf(uri, sizeof(uri), "ipp", NULL, "localhost", 0, - "/printers/%s", printer); - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, - uri); + if ((var = cgiGetVariable("ORDER")) != NULL) + ascending = !strcasecmp(var, "asc"); + else + ascending = 1; - if ((which_jobs = cgiGetVariable("which_jobs")) != NULL) - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD, "which-jobs", - NULL, which_jobs); + if (ascending) + { + 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); + } + 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); + } - if (getenv("REMOTE_USER") != NULL) - { - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "requesting-user-name", - NULL, getenv("REMOTE_USER")); + /* + * Save navigation URLs... + */ - if (strcmp(getenv("REMOTE_USER"), "root")) - ippAddBoolean(request, IPP_TAG_OPERATION, "my-jobs", 1); - } - else - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "requesting-user-name", - NULL, "unknown"); + urlend = url + sizeof(url); - cgiGetAttributes(request, "jobs.tmpl"); + if ((var = cgiGetVariable("QUERY")) != NULL) + { + strlcpy(url, "/printers/?QUERY=", sizeof(url)); + urlptr = url + strlen(url); - /* - * Do the request and get back a response... - */ + cgiFormEncode(urlptr, var, urlend - urlptr); + urlptr += strlen(urlptr); - if ((response = cupsDoRequest(http, request, "/")) != NULL) - { - cgiSetIPPVars(response, NULL, NULL, NULL, 0); - ippDelete(response); + strlcpy(urlptr, "&", urlend - urlptr); + urlptr += strlen(urlptr); + } + else + { + strlcpy(url, "/printers/?", sizeof(url)); + urlptr = url + strlen(url); + } - cgiCopyTemplateLang("jobs.tmpl"); - } - else - fprintf(stderr, "ERROR: Get-Jobs request failed - %s (%x)\n", - ippErrorString(cupsLastError()), cupsLastError()); + snprintf(urlptr, urlend - urlptr, "FIRST=%d", first); + cgiSetVariable("THISURL", url); + + if (first > 0) + { + snprintf(urlptr, urlend - urlptr, "FIRST=%d&ORDER=%s", + first - CUPS_PAGE_MAX, ascending ? "asc" : "dec"); + cgiSetVariable("PREVURL", url); } - } - else - { + + if ((first + CUPS_PAGE_MAX) < count) + { + snprintf(urlptr, urlend - urlptr, "FIRST=%d&ORDER=%s", + first + CUPS_PAGE_MAX, ascending ? "asc" : "dec"); + cgiSetVariable("NEXTURL", url); + } + /* - * Print a test page... + * Then show everything... */ - char filename[1024]; /* Test page filename */ - const char *datadir; /* CUPS_DATADIR env var */ + cgiCopyTemplateLang("search.tmpl"); + cgiCopyTemplateLang("printers-header.tmpl"); - cgiFormEncode(uri, printer, sizeof(uri)); - snprintf(refresh, sizeof(refresh), "2;/printers/%s", uri); - cgiSetVariable("refresh_page", refresh); + if (count > 0) + cgiCopyTemplateLang("pager.tmpl"); - if ((datadir = getenv("CUPS_DATADIR")) == NULL) - datadir = CUPS_DATADIR; + cgiCopyTemplateLang("printers.tmpl"); - snprintf(filename, sizeof(filename), "%s/data/testprint.ps", datadir); - httpAssembleURIf(uri, sizeof(uri), "ipp", NULL, "localhost", 0, - "/printers/%s", printer); + if (count > 0) + cgiCopyTemplateLang("pager.tmpl"); /* - * Build an IPP_PRINT_JOB request, which requires the following - * attributes: - * - * attributes-charset - * attributes-natural-language - * printer-uri - * requesting-user-name - * document-format + * Delete the response... */ - request = ippNew(); + ippDelete(response); + } + else + { + /* + * Show the error... + */ - request->request.op.operation_id = IPP_PRINT_JOB; - request->request.op.request_id = 1; + cgiShowIPPError(_("Unable to get printer list:")); + } - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET, - "attributes-charset", NULL, cupsLangEncoding(language)); + cgiEndHTML(); +} - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE, - "attributes-natural-language", NULL, language->language); - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", - NULL, uri); +/* + * 'show_printer()' - Show a single printer. + */ - if (getenv("REMOTE_USER") != NULL) - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "requesting-user-name", - NULL, getenv("REMOTE_USER")); - else - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "requesting-user-name", - NULL, "root"); +void +show_printer(http_t *http, /* I - Connection to server */ + const char *printer) /* I - Name of printer */ +{ + ipp_t *request, /* IPP request */ + *response; /* IPP response */ + ipp_attribute_t *attr; /* IPP attribute */ + char uri[HTTP_MAX_URI]; /* Printer URI */ + char refresh[1024]; /* Refresh URL */ - 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"); + /* + * Build an IPP_GET_PRINTER_ATTRIBUTES request, which requires the following + * attributes: + * + * attributes-charset + * attributes-natural-language + * printer-uri + */ + + request = ippNewRequest(IPP_GET_PRINTER_ATTRIBUTES); + + httpAssembleURIf(uri, sizeof(uri), "ipp", NULL, "localhost", 0, + "/printers/%s", printer); + ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, + uri); + + cgiGetAttributes(request, "printers.tmpl"); + + /* + * Do the request and get back a response... + */ + if ((response = cupsDoRequest(http, request, "/")) != NULL) + { /* - * Do the request and get back a response... + * Got the result; set the CGI variables and check the status of a + * single-queue request... */ - if ((response = cupsDoFileRequest(http, request, uri + 15, - filename)) != NULL) + cgiSetIPPVars(response, NULL, NULL, NULL, 0); + + if (printer && (attr = ippFindAttribute(response, "printer-state", + IPP_TAG_ENUM)) != NULL && + attr->values[0].integer == IPP_PRINTER_PROCESSING) { - status = response->request.status.status_code; - cgiSetIPPVars(response, NULL, NULL, NULL, 0); + /* + * Printer is processing - automatically refresh the page until we + * are done printing... + */ - ippDelete(response); + cgiFormEncode(uri, printer, sizeof(uri)); + snprintf(refresh, sizeof(refresh), "10;/printers/%s", uri); + cgiSetVariable("refresh_page", refresh); } - else - status = cupsLastError(); - cgiSetVariable("PRINTER_NAME", printer); + /* + * Delete the response... + */ + + ippDelete(response); /* * Show the standard header... */ - cgiCopyTemplateLang("header.tmpl"); + cgiStartHTML(printer); /* - * Show the result... + * Show the printer status... */ - if (status > IPP_OK_CONFLICT) - { - cgiSetVariable("ERROR", ippErrorString(status)); - cgiCopyTemplateLang("error.tmpl"); - } - else - cgiCopyTemplateLang("test-page.tmpl"); - } - - cgiCopyTemplateLang("trailer.tmpl"); + cgiCopyTemplateLang("printers.tmpl"); - /* - * Close the HTTP server connection... - */ + /* + * Show jobs for the specified printer... + */ - httpClose(http); - cupsLangFree(language); + cgiCopyTemplateLang("printer-jobs-header.tmpl"); + cgiShowJobs(http, printer); + } + else + { + /* + * Show the IPP error... + */ - /* - * Return with no errors... - */ + cgiStartHTML(printer); + cgiShowIPPError(_("Unable to get printer status:")); + } - return (0); + cgiEndHTML(); } /* - * End of "$Id: printers.c 4921 2006-01-12 21:26:26Z mike $". + * End of "$Id: printers.c 4931 2006-01-14 20:37:40Z mike $". */ diff --git a/conf/Makefile b/conf/Makefile index fe060d9c9..684693806 100644 --- a/conf/Makefile +++ b/conf/Makefile @@ -1,9 +1,9 @@ # -# "$Id: Makefile 4664 2005-09-17 22:56:56Z mike $" +# "$Id: Makefile 4972 2006-01-24 14:48:12Z mike $" # # Configuration file makefile for the Common UNIX Printing System (CUPS). # -# Copyright 1993-2005 by Easy Software Products. +# Copyright 1993-2006 by Easy Software Products. # # These coded instructions, statements, and computer programs are the # property of Easy Software Products and are protected by Federal @@ -28,7 +28,7 @@ include ../Makedefs # Config files... # -KEEP = classes.conf client.conf cupsd.conf printers.conf +KEEP = client.conf cupsd.conf REPLACE = mime.convs mime.types @@ -50,7 +50,7 @@ clean: # Install files... # -install: +install: all $(INSTALL_DIR) $(SERVERROOT) for file in $(KEEP); do \ if test -r $(SERVERROOT)/$$file ; then \ @@ -59,6 +59,7 @@ install: $(INSTALL_DATA) $$file $(SERVERROOT) ; \ fi ; \ done + $(INSTALL_DATA) cupsd.conf $(SERVERROOT)/cupsd.conf.default for file in $(REPLACE); do \ if test -r $(SERVERROOT)/$$file ; then \ $(MV) $(SERVERROOT)/$$file $(SERVERROOT)/$$file.O ; \ @@ -76,5 +77,5 @@ install: # -# End of "$Id: Makefile 4664 2005-09-17 22:56:56Z mike $". +# End of "$Id: Makefile 4972 2006-01-24 14:48:12Z mike $". # diff --git a/conf/classes.conf b/conf/classes.conf deleted file mode 100644 index 408796883..000000000 --- a/conf/classes.conf +++ /dev/null @@ -1,89 +0,0 @@ -# -# "$Id: classes.conf 4494 2005-02-18 02:18:11Z mike $" -# -# Sample class configuration file for the Common UNIX Printing System -# (CUPS) scheduler. -# -# Copyright 1997-2005 by Easy Software Products, all rights reserved. -# -# These coded instructions, statements, and computer programs are the -# property of Easy Software Products and are protected by Federal -# copyright law. Distribution and use rights are outlined in the file -# "LICENSE.txt" which should have been included with this file. If this -# file is missing or damaged please contact Easy Software Products -# at: -# -# Attn: CUPS Licensing Information -# Easy Software Products -# 44141 Airport View Drive, Suite 204 -# Hollywood, Maryland 20636 USA -# -# Voice: (301) 373-9600 -# EMail: cups-info@cups.org -# WWW: http://www.cups.org -# - -######################################################################## -# # -# This is a sample class configuration file. This file is included # -# from the main configuration file (cups.conf) and lists all of the # -# printer classes known to the system. # -# # -######################################################################## - -# -# Each class starts with a <Class name> definition. Class names -# can be up to 128 characters in length and are *not* case sensitive. -# -# One <DefaultClass name> entry can appear in this file; if you don't -# define a default destination, the first printer or class becomes -# the default. -# - -#<Class sample> -# -# Info: the description for the class. -# - -#Info Acme LaserPrint 1000 Printers - -# -# Location: the location of the printer. -# - -#Location Room 101 in the activities building - -# -# State: sets the initial state of the class. Can be one of the -# following: -# -# Idle - Class is available to print new jobs. -# Stopped - Class is disabled but accepting new jobs. -# - -#State Idle - -# -# StateMessage: sets the printer-state-message attribute for the class. -# - -#StateMessage Class is idle. - -# -# Accepting: is the class accepting jobs? -# -#Accepting Yes -#Accepting No -# - -# -# Printer: adds a printer to the class. -# - -#Printer sample -#Printer sample@host2 -#</Class> - -# -# End of "$Id: classes.conf 4494 2005-02-18 02:18:11Z mike $". -# diff --git a/conf/printcap b/conf/printcap deleted file mode 100644 index 230c3017d..000000000 --- a/conf/printcap +++ /dev/null @@ -1,2 +0,0 @@ -# This is a dummy printcap file that is automatically generated by the -# CUPS software for old applications that rely on it. diff --git a/conf/printers.conf b/conf/printers.conf deleted file mode 100644 index 3848459c9..000000000 --- a/conf/printers.conf +++ /dev/null @@ -1,96 +0,0 @@ -# -# "$Id: printers.conf 4494 2005-02-18 02:18:11Z mike $" -# -# Sample printer configuration file for the Common UNIX Printing System -# (CUPS) scheduler. -# -# Copyright 1997-2005 by Easy Software Products, all rights reserved. -# -# These coded instructions, statements, and computer programs are the -# property of Easy Software Products and are protected by Federal -# copyright law. Distribution and use rights are outlined in the file -# "LICENSE.txt" which should have been included with this file. If this -# file is missing or damaged please contact Easy Software Products -# at: -# -# Attn: CUPS Licensing Information -# Easy Software Products -# 44141 Airport View Drive, Suite 204 -# Hollywood, Maryland 20636 USA -# -# Voice: (301) 373-9600 -# EMail: cups-info@cups.org -# WWW: http://www.cups.org -# - -######################################################################## -# # -# This is a sample printer configuration file. This file is included # -# from the main configuration file (cups.conf) and lists all of the # -# printers known to the system. # -# # -######################################################################## - -# -# Each printer starts with a <Printer name> definition. Printer names -# can be up to 128 characters in length and are *not* case sensitive. -# -# One <DefaultPrinter name> entry can appear in this file; if you don't -# define a default destination, the first printer or class becomes the -# default. -# - -#<Printer sample> -# -# Info: the description for the printer. -# - -#Info Acme LaserPrint 1000 - -# -# Location: the location of the printer. -# - -#Location Room 101 in the activities building - -# -# DeviceURI: the device URI for this printer. -# - -#DeviceURI parallel:/dev/plp -#DeviceURI serial:/dev/ttyd1?baud=38400+size=8+parity=none+flow=soft -#DeviceURI scsi:/dev/scsi/sc1d6l0 -#DeviceURI socket://hostname:port -#DeviceURI tftp://hostname/path -#DeviceURI ftp://hostname/path -#DeviceURI http://hostname[:port]/path -#DeviceURI ipp://hostname/path -#DeviceURI smb://hostname/printer - -# -# State: sets the initial state of the printer. Can be one of the -# following: -# -# Idle - Printer is available to print new jobs. -# Stopped - Printer is disabled but accepting new jobs. -# - -#State Idle - -# -# StateMessage: sets the printer-state-message attribute for the printer. -# - -#StateMessage Printer is idle. - -# -# Accepting: is the printer accepting jobs? -# -#Accepting Yes -#Accepting No - -#</Printer> - -# -# End of "$Id: printers.conf 4494 2005-02-18 02:18:11Z mike $". -# diff --git a/config-scripts/cups-common.m4 b/config-scripts/cups-common.m4 index 045991676..28b45a3b7 100644 --- a/config-scripts/cups-common.m4 +++ b/config-scripts/cups-common.m4 @@ -1,5 +1,5 @@ dnl -dnl "$Id: cups-common.m4 4833 2005-11-12 21:46:52Z mike $" +dnl "$Id: cups-common.m4 4979 2006-01-25 17:47:43Z mike $" dnl dnl Common configuration stuff for the Common UNIX Printing System (CUPS). dnl @@ -159,6 +159,11 @@ AC_TRY_COMPILE([#include <time.h>],[struct tm t; AC_DEFINE(HAVE_TM_GMTOFF), AC_MSG_RESULT(no)) +dnl See if we have POSIX ACL support... +dnl TODO: Linux/Solaris/IRIX/etc. version + +AC_CHECK_FUNCS(acl_init) + dnl Flags for "ar" command... case $uname in Darwin* | *BSD*) @@ -176,6 +181,29 @@ case $uname in Darwin*) BACKLIBS="-framework IOKit" LIBS="-framework CoreFoundation $LIBS" + + dnl Check for CFLocaleCreateCanonicalLocaleIdentifierFromString... + AC_MSG_CHECKING(for CFLocaleCreateCanonicalLocaleIdentifierFromString) + if test "$uname" = "Darwin" -a $uversion -ge 70; then + AC_DEFINE(HAVE_CF_LOCALE_ID) + AC_MSG_RESULT(yes) + else + AC_MSG_RESULT(no) + fi + + dnl Check for framework headers... + AC_CHECK_HEADER(CoreFoundation/CoreFoundation.h,AC_DEFINE(HAVE_COREFOUNDATION_H)) + AC_CHECK_HEADER(CoreFoundation/CFPriv.h,AC_DEFINE(HAVE_CFPRIV_H)) + AC_CHECK_HEADER(CoreFoundation/CFBundlePriv.h,AC_DEFINE(HAVE_CFBUNDLEPRIV_H)) + + dnl Check for the new membership functions in MacOSX 10.4 (Tiger)... + AC_CHECK_HEADER(membership.h,AC_DEFINE(HAVE_MEMBERSHIP_H)) + AC_CHECK_HEADER(membershipPriv.h,AC_DEFINE(HAVE_MEMBERSHIPPRIV_H)) + AC_CHECK_FUNCS(mbr_uid_to_uuid) + + dnl Check for notify_post support + AC_CHECK_HEADER(notify.h,AC_DEFINE(HAVE_NOTIFY_H)) + AC_CHECK_FUNCS(notify_post) ;; *) BACKLIBS="" @@ -193,5 +221,5 @@ AC_SUBST(DEFAULT_IPP_PORT) AC_DEFINE_UNQUOTED(CUPS_DEFAULT_IPP_PORT,$DEFAULT_IPP_PORT) dnl -dnl End of "$Id: cups-common.m4 4833 2005-11-12 21:46:52Z mike $". +dnl End of "$Id: cups-common.m4 4979 2006-01-25 17:47:43Z mike $". dnl diff --git a/config-scripts/cups-compiler.m4 b/config-scripts/cups-compiler.m4 index f597e2773..1bf262dbc 100644 --- a/config-scripts/cups-compiler.m4 +++ b/config-scripts/cups-compiler.m4 @@ -1,5 +1,5 @@ dnl -dnl "$Id: cups-compiler.m4 4915 2006-01-11 15:57:53Z mike $" +dnl "$Id: cups-compiler.m4 4953 2006-01-19 20:30:48Z mike $" dnl dnl Compiler stuff for the Common UNIX Printing System (CUPS). dnl @@ -27,12 +27,14 @@ dnl for them... OPTIM="" AC_SUBST(OPTIM) +AC_ARG_WITH(optim, [ --with-optim="flags" set optimization flags ]) + AC_ARG_ENABLE(debug, [ --enable-debug turn on debugging, default=no], [if test x$enable_debug = xyes; then OPTIM="-g" fi]) -AC_ARG_WITH(optim, [ --with-optim="flags" set optimization flags ]) +AC_ARG_ENABLE(pie, [ --enable-pie use GCC -fpie option, default=no]) dnl Update compiler options... CXXLIBS="" @@ -64,16 +66,10 @@ if test -n "$GCC"; then ;; Linux*) - AC_MSG_CHECKING(if GCC supports -fpie) - - OLDCFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -fpie" - AC_TRY_COMPILE(,, + if test x$enable_pie = xyes; then OPTIM="$OPTIM -fpie" LDFLAGS="$LDFLAGS -pie" - AC_MSG_RESULT(yes), - CFLAGS="$OLDCFLAGS" - AC_MSG_RESULT(no)) + fi ;; esac @@ -196,5 +192,5 @@ if test $uname = HP-UX; then fi dnl -dnl End of "$Id: cups-compiler.m4 4915 2006-01-11 15:57:53Z mike $". +dnl End of "$Id: cups-compiler.m4 4953 2006-01-19 20:30:48Z mike $". dnl diff --git a/config-scripts/cups-directories.m4 b/config-scripts/cups-directories.m4 index 9cbcc26aa..836ec6742 100644 --- a/config-scripts/cups-directories.m4 +++ b/config-scripts/cups-directories.m4 @@ -1,5 +1,5 @@ dnl -dnl "$Id: cups-directories.m4 4873 2005-12-07 01:46:54Z mike $" +dnl "$Id: cups-directories.m4 4933 2006-01-16 00:26:57Z mike $" dnl dnl Directory stuff for the Common UNIX Printing System (CUPS). dnl @@ -43,11 +43,15 @@ if test "$bindir" = "\${exec_prefix}/bin"; then bindir="$exec_prefix/bin" fi +AC_DEFINE_UNQUOTED(CUPS_BINDIR, "$bindir") + dnl Fix "sbindir" variable... if test "$sbindir" = "\${exec_prefix}/sbin"; then sbindir="$exec_prefix/sbin" fi +AC_DEFINE_UNQUOTED(CUPS_SBINDIR, "$sbindir") + dnl Fix "sharedstatedir" variable if it hasn't been specified... if test "$sharedstatedir" = "\${prefix}/com" -a "$prefix" = "/"; then sharedstatedir="/usr/com" @@ -275,5 +279,5 @@ AC_DEFINE_UNQUOTED(CUPS_STATEDIR, "$localstatedir/run/cups") AC_SUBST(CUPS_STATEDIR) dnl -dnl End of "$Id: cups-directories.m4 4873 2005-12-07 01:46:54Z mike $". +dnl End of "$Id: cups-directories.m4 4933 2006-01-16 00:26:57Z mike $". dnl diff --git a/config-scripts/cups-opsys.m4 b/config-scripts/cups-opsys.m4 index 5b2b1502c..b2b53126d 100644 --- a/config-scripts/cups-opsys.m4 +++ b/config-scripts/cups-opsys.m4 @@ -1,5 +1,5 @@ dnl -dnl "$Id: cups-opsys.m4 4833 2005-11-12 21:46:52Z mike $" +dnl "$Id: cups-opsys.m4 4960 2006-01-20 16:41:20Z mike $" dnl dnl Operating system stuff for the Common UNIX Printing System (CUPS). dnl @@ -24,7 +24,8 @@ dnl dnl Get the operating system and version number... uname=`uname` -uversion=`uname -r | sed -e '1,$s/[[^0-9]]//g'` +uversion=`uname -r | sed -e '1,$s/^[[^0-9]]*\([[0-9]]*\)\.\([[0-9]]*\).*/\1\2/'` + case "$uname" in GNU* | GNU/*) uname="GNU" @@ -95,5 +96,5 @@ AC_DEFINE_UNQUOTED(CUPS_DEFAULT_USER, "$CUPS_USER") AC_DEFINE_UNQUOTED(CUPS_DEFAULT_GROUP, "$CUPS_GROUP") dnl -dnl "$Id: cups-opsys.m4 4833 2005-11-12 21:46:52Z mike $" +dnl "$Id: cups-opsys.m4 4960 2006-01-20 16:41:20Z mike $" dnl diff --git a/config.h.in b/config.h.in index 9b853da17..efc0e2f20 100644 --- a/config.h.in +++ b/config.h.in @@ -1,5 +1,5 @@ /* - * "$Id: config.h.in 4760 2005-10-08 20:11:08Z mike $" + * "$Id: config.h.in 4979 2006-01-25 17:47:43Z mike $" * * Configuration file for the Common UNIX Printing System (CUPS). * @@ -71,6 +71,7 @@ * variables at run-time... */ +#define CUPS_BINDIR "/usr/bin" #define CUPS_CACHEDIR "/var/cache/cups" #define CUPS_DATADIR "/usr/share/cups" #define CUPS_DOCROOT "/usr/share/doc/cups" @@ -78,6 +79,7 @@ #define CUPS_LOCALEDIR "/usr/share/locale" #define CUPS_LOGDIR "/var/logs/cups" #define CUPS_REQUESTS "/var/spool/cups" +#define CUPS_SBINDIR "/usr/sbin" #define CUPS_SERVERBIN "/usr/lib/cups" #define CUPS_SERVERROOT "/etc/cups" #define CUPS_STATEDIR "/var/run/cups" @@ -208,6 +210,13 @@ /* + * Do we have the POSIX ACL functions? + */ + +#undef HAVE_ACL_INIT + + +/* * Do we have the langinfo.h header file? */ @@ -336,8 +345,42 @@ #define CUPS_PYTHON "/usr/bin/python" +/* + * Do we have Darwin's CoreFoundation and SystemConfiguration frameworks? + */ + +#undef HAVE_COREFOUNDATION +#undef HAVE_SYSTEMCONFIGURATION + + +/* + * Do we have CoreFoundation public and private headers? + */ + +#undef HAVE_COREFOUNDATION_H +#undef HAVE_CFPRIV_H +#undef HAVE_CFBUNDLEPRIV_H + + +/* + * Do we have MacOSX 10.4's mbr_XXX functions()? + */ + +#undef HAVE_MEMBERSHIP_H +#undef HAVE_MEMBERSHIPPRIV_H +#undef HAVE_MBR_UID_TO_UUID + + +/* + * Do we have Darwin's notify_post() header and function? + */ + +#undef HAVE_NOTIFY_H +#undef HAVE_NOTIFY_POST + + #endif /* !_CUPS_CONFIG_H_ */ /* - * End of "$Id: config.h.in 4760 2005-10-08 20:11:08Z mike $". + * End of "$Id: config.h.in 4979 2006-01-25 17:47:43Z mike $". */ diff --git a/configure.in b/configure.in index 2057cd5f9..0135039a2 100644 --- a/configure.in +++ b/configure.in @@ -1,9 +1,9 @@ dnl -dnl "$Id: configure.in 4873 2005-12-07 01:46:54Z mike $" +dnl "$Id: configure.in 4971 2006-01-24 14:33:18Z mike $" dnl dnl Configuration script for the Common UNIX Printing System (CUPS). dnl -dnl Copyright 1997-2005 by Easy Software Products, all rights reserved. +dnl Copyright 1997-2006 by Easy Software Products, all rights reserved. dnl dnl These coded instructions, statements, and computer programs are the dnl property of Easy Software Products and are protected by Federal @@ -46,12 +46,12 @@ AC_SUBST(MAKEDEFS) sinclude(config-scripts/cups-scripting.m4) -AC_OUTPUT(Makedefs packaging/cups.list cups.sh cups-config +AC_OUTPUT(Makedefs packaging/cups.list init/cups.sh cups-config conf/cupsd.conf conf/pam.std doc/index.html doc/help/standard.html templates/edit-config.tmpl) chmod +x cups-config dnl -dnl End of "$Id: configure.in 4873 2005-12-07 01:46:54Z mike $". +dnl End of "$Id: configure.in 4971 2006-01-24 14:33:18Z mike $". dnl diff --git a/cups/Dependencies b/cups/Dependencies index 8b3a12288..fa951c4ef 100644 --- a/cups/Dependencies +++ b/cups/Dependencies @@ -1,66 +1,74 @@ # DO NOT DELETE array.o: array.h string.h ../config.h debug.h -attr.o: ppd.h file.h debug.h string.h ../config.h -auth.o: globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h file.h -auth.o: i18n.h language.h array.h normalize.h transcode.h debug.h -backchannel.o: cups.h ipp.h http.h string.h ../config.h md5.h ppd.h file.h -dest.o: globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h file.h -dest.o: i18n.h language.h array.h normalize.h transcode.h +attr.o: ppd.h array.h file.h debug.h string.h ../config.h +auth.o: globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h +auth.o: array.h file.h i18n.h language.h normalize.h transcode.h debug.h +backchannel.o: cups.h ipp.h http.h string.h ../config.h md5.h ppd.h array.h +backchannel.o: file.h +custom.o: globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h +custom.o: array.h file.h i18n.h language.h normalize.h transcode.h debug.h +dest.o: globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h +dest.o: array.h file.h i18n.h language.h normalize.h transcode.h dir.o: dir.h string.h ../config.h debug.h -emit.o: ppd.h file.h string.h ../config.h -encode.o: cups.h ipp.h http.h string.h ../config.h md5.h ppd.h file.h debug.h +emit.o: ppd.h array.h file.h string.h ../config.h +encode.o: cups.h ipp.h http.h string.h ../config.h md5.h ppd.h array.h file.h +encode.o: debug.h file.o: http-private.h ../config.h http.h string.h md5.h ../cups/debug.h file.o: file.h -getputfile.o: cups.h ipp.h http.h string.h ../config.h md5.h ppd.h file.h -getputfile.o: language.h array.h debug.h +getputfile.o: cups.h ipp.h http.h string.h ../config.h md5.h ppd.h array.h +getputfile.o: file.h language.h debug.h globals.o: http-private.h ../config.h http.h string.h md5.h globals.h cups.h -globals.o: ipp.h ppd.h file.h i18n.h language.h array.h normalize.h +globals.o: ipp.h ppd.h array.h file.h i18n.h language.h normalize.h globals.o: transcode.h http.o: http-private.h ../config.h http.h string.h md5.h globals.h cups.h -http.o: ipp.h ppd.h file.h i18n.h language.h array.h normalize.h transcode.h +http.o: ipp.h ppd.h array.h file.h i18n.h language.h normalize.h transcode.h http.o: debug.h http-addr.o: globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h -http-addr.o: file.h i18n.h language.h array.h normalize.h transcode.h debug.h +http-addr.o: array.h file.h i18n.h language.h normalize.h transcode.h debug.h http-addrlist.o: http-private.h ../config.h http.h string.h md5.h globals.h -http-addrlist.o: cups.h ipp.h ppd.h file.h i18n.h language.h array.h +http-addrlist.o: cups.h ipp.h ppd.h array.h file.h i18n.h language.h http-addrlist.o: normalize.h transcode.h debug.h http-support.o: debug.h globals.h string.h ../config.h cups.h ipp.h http.h -http-support.o: md5.h ppd.h file.h i18n.h language.h array.h normalize.h +http-support.o: md5.h ppd.h array.h file.h i18n.h language.h normalize.h http-support.o: transcode.h ipp.o: http-private.h ../config.h http.h string.h md5.h globals.h cups.h -ipp.o: ipp.h ppd.h file.h i18n.h language.h array.h normalize.h transcode.h +ipp.o: ipp.h ppd.h array.h file.h i18n.h language.h normalize.h transcode.h ipp.o: debug.h ipp-support.o: globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h -ipp-support.o: file.h i18n.h language.h array.h normalize.h transcode.h +ipp-support.o: array.h file.h i18n.h language.h normalize.h transcode.h ipp-support.o: debug.h -langprintf.o: string.h ../config.h i18n.h language.h array.h transcode.h +langprintf.o: globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h +langprintf.o: array.h file.h i18n.h language.h normalize.h transcode.h language.o: globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h -language.o: file.h i18n.h language.h array.h normalize.h transcode.h debug.h -mark.o: ppd.h file.h string.h ../config.h debug.h +language.o: array.h file.h i18n.h language.h normalize.h transcode.h debug.h +localize.o: globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h +localize.o: array.h file.h i18n.h language.h normalize.h transcode.h debug.h +mark.o: ppd.h array.h file.h string.h ../config.h debug.h md5.o: md5.h string.h ../config.h md5passwd.o: http.h string.h ../config.h md5.h normalize.o: globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h -normalize.o: file.h i18n.h language.h array.h normalize.h transcode.h debug.h -options.o: cups.h ipp.h http.h string.h ../config.h md5.h ppd.h file.h -options.o: debug.h -page.o: ppd.h file.h string.h ../config.h -ppd.o: globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h file.h -ppd.o: i18n.h language.h array.h normalize.h transcode.h debug.h +normalize.o: array.h file.h i18n.h language.h normalize.h transcode.h debug.h +options.o: cups.h ipp.h http.h string.h ../config.h md5.h ppd.h array.h +options.o: file.h debug.h +page.o: ppd.h array.h file.h string.h ../config.h +ppd.o: globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h array.h +ppd.o: file.h i18n.h language.h normalize.h transcode.h debug.h snprintf.o: string.h ../config.h string.o: string.h ../config.h tempfile.o: globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h -tempfile.o: file.h i18n.h language.h array.h normalize.h transcode.h debug.h +tempfile.o: array.h file.h i18n.h language.h normalize.h transcode.h debug.h transcode.o: globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h -transcode.o: file.h i18n.h language.h array.h normalize.h transcode.h +transcode.o: array.h file.h i18n.h language.h normalize.h transcode.h usersys.o: http-private.h ../config.h http.h string.h md5.h globals.h cups.h -usersys.o: ipp.h ppd.h file.h i18n.h language.h array.h normalize.h +usersys.o: ipp.h ppd.h array.h file.h i18n.h language.h normalize.h usersys.o: transcode.h -util.o: globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h file.h -util.o: i18n.h language.h array.h normalize.h transcode.h debug.h +util.o: globals.h string.h ../config.h cups.h ipp.h http.h md5.h ppd.h +util.o: array.h file.h i18n.h language.h normalize.h transcode.h debug.h testarray.o: ../cups/string.h ../config.h string.h array.h dir.h debug.h testfile.o: string.h ../config.h file.h debug.h testhttp.o: http.h string.h ../config.h md5.h testi18n.o: language.h array.h string.h ../config.h transcode.h normalize.h testipp.o: ../cups/string.h ../config.h string.h ipp.h http.h md5.h testlang.o: i18n.h language.h array.h +testppd.o: ../cups/string.h ../config.h string.h ppd.h array.h file.h diff --git a/cups/Makefile b/cups/Makefile index 1834c1312..3393108c8 100644 --- a/cups/Makefile +++ b/cups/Makefile @@ -1,5 +1,5 @@ # -# "$Id: Makefile 4918 2006-01-12 05:14:40Z mike $" +# "$Id: Makefile 4961 2006-01-20 22:19:13Z mike $" # # API library Makefile for the Common UNIX Printing System (CUPS). # @@ -35,6 +35,7 @@ LIBOBJS = \ attr.o \ auth.o \ backchannel.o \ + custom.o \ dest.o \ dir.o \ emit.o \ @@ -50,10 +51,12 @@ LIBOBJS = \ ipp-support.o \ langprintf.o \ language.o \ + localize.o \ mark.o \ md5.o \ md5passwd.o \ normalize.o \ + notify.o \ options.o \ page.o \ ppd.o \ @@ -71,6 +74,7 @@ OBJS = \ testi18n.o \ testipp.o \ testlang.o \ + testppd.o \ php_cups_wrap.o @@ -105,7 +109,8 @@ TARGETS = \ testhttp \ testi18n \ testipp \ - testlang + testlang \ + testppd # @@ -177,7 +182,7 @@ libcups.so.2 libcups.sl.2: $(LIBOBJS) libcups.2.dylib: $(LIBOBJS) echo Linking $@... $(DSO) $(DSOFLAGS) -o $@ \ - -install_name $(libdir)/libcups.dylib \ + -install_name $(libdir)/$@ \ -current_version 2.7.0 \ -compatibility_version 2.0.0 \ $(LIBOBJS) $(SSLLIBS) $(COMMONLIBS) $(LIBZ) @@ -299,6 +304,16 @@ testlang: testlang.o libcups.a # +# testppd (dependency on static CUPS library is intentional) +# + +testppd: testppd.o libcups.a + echo Linking $@... + $(CC) $(LDFLAGS) -o $@ testppd.o libcups.a \ + $(SSLLIBS) $(COMMONLIBS) $(LIBZ) + + +# # Automatic API help files... # @@ -338,5 +353,5 @@ include Dependencies # -# End of "$Id: Makefile 4918 2006-01-12 05:14:40Z mike $". +# End of "$Id: Makefile 4961 2006-01-20 22:19:13Z mike $". # diff --git a/cups/array.c b/cups/array.c index 88f26cd72..71d649847 100644 --- a/cups/array.c +++ b/cups/array.c @@ -1,5 +1,5 @@ /* - * "$Id: array.c 4921 2006-01-12 21:26:26Z mike $" + * "$Id: array.c 4970 2006-01-24 14:05:45Z mike $" * * Sorted array routines for the Common UNIX Printing System (CUPS). * @@ -34,6 +34,7 @@ * cupsArrayFind() - Find an element in the array. * cupsArrayFirst() - Get the first element in the array. * cupsArrayIndex() - Get the N-th element in the array. + * cupsArrayInsert() - Insert an element in the array. * cupsArrayLast() - Get the last element in the array. * cupsArrayNew() - Create a new array. * cupsArrayNext() - Get the next element in the array. @@ -486,6 +487,111 @@ cupsArrayIndex(cups_array_t *a, /* I - Array */ /* + * 'cupsArrayInsert()' - Insert an element in the array. + * + * When inserting an element in a sorted array, this function works + * just like cupsArrayAdd(). For unsorted arrays, the element is + * inserted at the beginning of the array. + */ + +int /* O - 0 on failure, 1 on success */ +cupsArrayInsert(cups_array_t *a, /* I - Array */ + void *e) /* I - Element */ +{ + int i; /* Looping var */ + + + DEBUG_printf(("cupsArrayInsert(a=%p, e=%p)\n", a, e)); + + /* + * Range check input... + */ + + if (!a || !e) + { + DEBUG_puts("cupsArrayInsert: returning 0"); + return (0); + } + + /* + * Inserting into a sorted array is the same as adding... + */ + + if (a->compare) + return (cupsArrayAdd(a, e)); + + /* + * Verify we have room for the new element... + */ + + if (a->num_elements >= a->alloc_elements) + { + /* + * Allocate additional elements; start with 16 elements, then + * double the size until 1024 elements, then add 1024 elements + * thereafter... + */ + + void **temp; /* New array elements */ + int count; /* New allocation count */ + + + if (a->alloc_elements == 0) + { + count = 16; + temp = malloc(count * sizeof(void *)); + } + else + { + if (a->alloc_elements < 1024) + count = a->alloc_elements * 2; + else + count = a->alloc_elements + 1024; + + temp = realloc(a->elements, count * sizeof(void *)); + } + + DEBUG_printf(("cupsArrayInsert: count=%d\n", count)); + + if (!temp) + { + DEBUG_puts("cupsAddInsert: allocation failed, returning 0"); + return (0); + } + + a->alloc_elements = count; + a->elements = temp; + } + + /* + * Insert the element... + */ + + memmove(a->elements + 1, a->elements, a->num_elements * sizeof(void *)); + + if (a->current >= 0) + a->current ++; + + for (i = 0; i < a->num_saved; i ++) + if (a->saved[i] >= 0) + a->saved[i] ++; + + a->elements[0] = e; + a->num_elements ++; + a->insert = 0; + +#ifdef DEBUG + for (i = 0; i < a->num_elements; i ++) + printf("cupsArrayInsert: a->elements[%d]=%p\n", i, a->elements[i]); +#endif /* DEBUG */ + + DEBUG_puts("cupsArrayInsert: returning 1"); + + return (1); +} + + +/* * 'cupsArrayLast()' - Get the last element in the array. */ @@ -824,5 +930,5 @@ cups_find(cups_array_t *a, /* I - Array */ /* - * End of "$Id: array.c 4921 2006-01-12 21:26:26Z mike $". + * End of "$Id: array.c 4970 2006-01-24 14:05:45Z mike $". */ diff --git a/cups/array.h b/cups/array.h index 1043121e2..3c7509237 100644 --- a/cups/array.h +++ b/cups/array.h @@ -1,5 +1,5 @@ /* - * "$Id: array.h 4921 2006-01-12 21:26:26Z mike $" + * "$Id: array.h 4970 2006-01-24 14:05:45Z mike $" * * Sorted array definitions for the Common UNIX Printing System (CUPS). * @@ -65,6 +65,7 @@ extern cups_array_t *cupsArrayDup(cups_array_t *a); extern void *cupsArrayFind(cups_array_t *a, void *e); extern void *cupsArrayFirst(cups_array_t *a); extern void *cupsArrayIndex(cups_array_t *a, int n); +extern int cupsArrayInsert(cups_array_t *a, void *e); extern void *cupsArrayLast(cups_array_t *a); extern cups_array_t *cupsArrayNew(cups_array_func_t f, void *d); extern void *cupsArrayNext(cups_array_t *a); @@ -79,5 +80,5 @@ extern int cupsArraySave(cups_array_t *a); #endif /* !_CUPS_ARRAY_H_ */ /* - * End of "$Id: array.h 4921 2006-01-12 21:26:26Z mike $". + * End of "$Id: array.h 4970 2006-01-24 14:05:45Z mike $". */ diff --git a/cups/backend.h b/cups/backend.h index 199780a05..a816b2f07 100644 --- a/cups/backend.h +++ b/cups/backend.h @@ -1,5 +1,5 @@ /* - * "$Id: backend.h 4703 2005-09-26 19:33:58Z mike $" + * "$Id: backend.h 4973 2006-01-25 02:36:02Z mike $" * * Backend definitions for the Common UNIX Printing System (CUPS). * @@ -36,15 +36,15 @@ typedef enum cups_backend_e /**** Backend exit codes ****/ { CUPS_BACKEND_OK = 0, /* Job completed successfully */ CUPS_BACKEND_FAILED = 1, /* Job failed, use error-policy */ - CUPS_BACKEND_CANCEL = 2, /* Job failed, cancel job */ + CUPS_BACKEND_AUTH_REQUIRED = 2, /* Job failed, authentication required */ CUPS_BACKEND_HOLD = 3, /* Job failed, hold job */ CUPS_BACKEND_STOP = 4, /* Job failed, stop queue */ - CUPS_BACKEND_AUTH_REQUIRED = 5 /* Job failed, authentication required */ + CUPS_BACKEND_CANCEL = 5 /* Job failed, cancel job */ } cups_backend_t; #endif /* !_CUPS_BACKEND_H_ */ /* - * End of "$Id: backend.h 4703 2005-09-26 19:33:58Z mike $". + * End of "$Id: backend.h 4973 2006-01-25 02:36:02Z mike $". */ diff --git a/cups/cups.h b/cups/cups.h index 84a0f3793..6263b82e6 100644 --- a/cups/cups.h +++ b/cups/cups.h @@ -1,5 +1,5 @@ /* - * "$Id: cups.h 4918 2006-01-12 05:14:40Z mike $" + * "$Id: cups.h 4973 2006-01-25 02:36:02Z mike $" * * API definitions for the Common UNIX Printing System (CUPS). * @@ -33,10 +33,12 @@ # include "ipp.h" # include "ppd.h" +# include "language.h" + /* * With GCC 3.0 and higher, we can mark old APIs "deprecated" so you get - * an error at compile-time. + * a warning at compile-time. */ # if defined(__GNUC__) && __GNUC__ > 2 @@ -223,6 +225,8 @@ extern void cupsEncodeOptions2(ipp_t *ipp, int num_options, cups_option_t *options, ipp_tag_t group_tag); extern const char *cupsLastErrorString(void); +extern char *cupsNotifySubject(cups_lang_t *lang, ipp_t *event); +extern char *cupsNotifyText(cups_lang_t *lang, ipp_t *event); extern cups_file_t *cupsTempFile2(char *filename, int len); @@ -233,5 +237,5 @@ extern cups_file_t *cupsTempFile2(char *filename, int len); #endif /* !_CUPS_CUPS_H_ */ /* - * End of "$Id: cups.h 4918 2006-01-12 05:14:40Z mike $". + * End of "$Id: cups.h 4973 2006-01-25 02:36:02Z mike $". */ diff --git a/cups/custom.c b/cups/custom.c new file mode 100644 index 000000000..1d4482665 --- /dev/null +++ b/cups/custom.c @@ -0,0 +1,115 @@ +/* + * "$Id: custom.c 4938 2006-01-17 15:11:15Z mike $" + * + * PPD custom option routines for the Common UNIX Printing System (CUPS). + * + * Copyright 1997-2006 by Easy Software Products, all rights reserved. + * + * These coded instructions, statements, and computer programs are the + * property of Easy Software Products and are protected by Federal + * copyright law. Distribution and use rights are outlined in the file + * "LICENSE.txt" which should have been included with this file. If this + * file is missing or damaged please contact Easy Software Products + * at: + * + * Attn: CUPS Licensing Information + * Easy Software Products + * 44141 Airport View Drive, Suite 204 + * Hollywood, Maryland 20636 USA + * + * Voice: (301) 373-9600 + * EMail: cups-info@cups.org + * WWW: http://www.cups.org + * + * PostScript is a trademark of Adobe Systems, Inc. + * + * This code and any derivative of it may be used and distributed + * freely under the terms of the GNU General Public License when + * used with GNU Ghostscript or its derivatives. Use of the code + * (or any derivative of it) with software other than GNU + * GhostScript (or its derivatives) is governed by the CUPS license + * agreement. + * + * This file is subject to the Apple OS-Developed Software exception. + * + * Contents: + * + */ + +/* + * Include necessary headers. + */ + +#include "globals.h" +#include "debug.h" + + +/* + * 'ppdFindCustomOption()' - Find a custom option. + */ + +ppd_coption_t * /* O - Custom option or NULL */ +ppdFindCustomOption(ppd_file_t *ppd, /* I - PPD file */ + const char *keyword)/* I - Custom option name */ +{ + ppd_coption_t key; /* Custom option search key */ + + + if (!ppd) + return (NULL); + + strlcpy(key.keyword, keyword, sizeof(key.keyword)); + return ((ppd_coption_t *)cupsArrayFind(ppd->coptions, &key)); +} + + +/* + * 'ppdFindCustomParam()' - Find a parameter for a custom option. + */ + +ppd_cparam_t * /* O - Custom parameter or NULL */ +ppdFindCustomParam(ppd_coption_t *opt, /* I - Custom option */ + const char *name) /* I - Parameter name */ +{ + ppd_cparam_t key; /* Custom parameter search key */ + + + if (!opt) + return (NULL); + + strlcpy(key.name, name, sizeof(key.name)); + return ((ppd_cparam_t *)cupsArrayFind(opt->params, &key)); +} + + +/* + * 'ppdFirstCustomParam()' - Return the first parameter for a custom option. + */ + +ppd_cparam_t * /* O - Custom parameter or NULL */ +ppdFirstCustomParam(ppd_coption_t *opt) /* I - Custom option */ +{ + if (!opt) + return (NULL); + + return ((ppd_cparam_t *)cupsArrayFirst(opt->params)); +} + + +/* + * 'ppdNextCustomParam()' - Return the next parameter for a custom option. + */ + +ppd_cparam_t * /* O - Custom parameter or NULL */ +ppdNextCustomParam(ppd_coption_t *opt) /* I - Custom option */ +{ + if (!opt) + return (NULL); + + return ((ppd_cparam_t *)cupsArrayNext(opt->params)); +} + + +/* + * End of "$Id: custom.c 4938 2006-01-17 15:11:15Z mike $". + */ diff --git a/cups/dest.c b/cups/dest.c index 042e7b54b..96db76308 100644 --- a/cups/dest.c +++ b/cups/dest.c @@ -1,5 +1,5 @@ /* - * "$Id: dest.c 4918 2006-01-12 05:14:40Z mike $" + * "$Id: dest.c 4979 2006-01-25 17:47:43Z mike $" * * User-defined destination (and option) support for the Common UNIX * Printing System (CUPS). @@ -45,6 +45,10 @@ #include <stdlib.h> #include <ctype.h> +#ifdef HAVE_NOTIFY_H +# include <notify.h> +#endif /* HAVE_NOTIFY_H */ + /* * Local functions... @@ -562,16 +566,21 @@ cupsSetDests2(http_t *http, /* I - HTTP connection */ } /* - * Free the temporary destinations... + * Free the temporary destinations and close the file... */ cupsFreeDests(num_temps, temps); + fclose(fp); + +#ifdef HAVE_NOTIFY_POST /* - * Close the file and return... + * Send a notification so that MacOS X applications can know about the + * change, too. */ - fclose(fp); + notify_post("com.apple.printerListChange"); +#endif /* HAVE_NOTIFY_POST */ return (0); } @@ -739,17 +748,35 @@ cups_get_sdests(http_t *http, /* I - HTTP connection */ int num_dests, /* I - Number of destinations */ cups_dest_t **dests) /* IO - Destinations */ { + int i; /* Looping var */ cups_dest_t *dest; /* Current destination */ ipp_t *request, /* IPP Request */ *response; /* IPP Response */ ipp_attribute_t *attr; /* Current attribute */ - cups_lang_t *language; /* Default language */ - const char *name; /* printer-name attribute */ - char job_sheets[1024]; /* job-sheets option */ + int accepting, /* printer-is-accepting-jobs attribute */ + shared, /* printer-is-shared attribute */ + state, /* printer-state attribute */ + change_time, /* printer-state-change-time attribute */ + type; /* printer-type attribute */ + const char *info, /* printer-info attribute */ + *make_model, /* printer-make-and-model attribute */ + *name; /* printer-name attribute */ + char job_sheets[1024], /* job-sheets option */ + reasons[1024], /* printer-state-reasons attribute */ + *rptr, /* Pointer into reasons string */ + temp[255]; /* Temporary string for numbers */ static const char * const pattrs[] = /* Attributes we're interested in */ { + "job-sheets-default", + "printer-info", + "printer-is-accepting-jobs", + "printer-is-shared", + "printer-make-and-model", "printer-name", - "job-sheets-default" + "printer-state", + "printer-state-change-time", + "printer-state-reasons", + "printer-type" }; @@ -759,27 +786,18 @@ cups_get_sdests(http_t *http, /* I - HTTP connection */ * * attributes-charset * attributes-natural-language + * requesting-user-name */ - request = ippNew(); - - request->request.op.operation_id = op; - request->request.op.request_id = 1; - - language = cupsLangDefault(); - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET, - "attributes-charset", NULL, cupsLangEncoding(language)); - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE, - "attributes-natural-language", NULL, language->language); - - cupsLangFree(language); + request = ippNewRequest(op); ippAddStrings(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD, "requested-attributes", sizeof(pattrs) / sizeof(pattrs[0]), NULL, pattrs); + ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, + "requesting-user-name", NULL, cupsUser()); + /* * Do the request and get back a response... */ @@ -802,17 +820,21 @@ cups_get_sdests(http_t *http, /* I - HTTP connection */ * Pull the needed attributes from this job... */ - name = NULL; + accepting = 0; + change_time = 0; + info = NULL; + make_model = NULL; + name = NULL; + shared = 1; + state = IPP_PRINTER_IDLE; + type = CUPS_PRINTER_LOCAL; strcpy(job_sheets, ""); + strcpy(reasons, ""); while (attr != NULL && attr->group_tag == IPP_TAG_PRINTER) { - if (strcmp(attr->name, "printer-name") == 0 && - attr->value_tag == IPP_TAG_NAME) - name = attr->values[0].string.text; - - if (strcmp(attr->name, "job-sheets-default") == 0 && + if (!strcmp(attr->name, "job-sheets-default") && (attr->value_tag == IPP_TAG_KEYWORD || attr->value_tag == IPP_TAG_NAME)) { @@ -820,8 +842,46 @@ cups_get_sdests(http_t *http, /* I - HTTP connection */ snprintf(job_sheets, sizeof(job_sheets), "%s,%s", attr->values[0].string.text, attr->values[1].string.text); else - strcpy(job_sheets, attr->values[0].string.text); + strlcpy(job_sheets, attr->values[0].string.text, + sizeof(job_sheets)); } + else if (!strcmp(attr->name, "printer-info") && + attr->value_tag == IPP_TAG_TEXT) + info = attr->values[0].string.text; + else if (!strcmp(attr->name, "printer-is-accepting-jobs") && + attr->value_tag == IPP_TAG_BOOLEAN) + accepting = attr->values[0].boolean; + else if (!strcmp(attr->name, "printer-is-shared") && + attr->value_tag == IPP_TAG_BOOLEAN) + shared = attr->values[0].boolean; + else if (!strcmp(attr->name, "printer-make-and-model") && + attr->value_tag == IPP_TAG_TEXT) + make_model = attr->values[0].string.text; + else if (!strcmp(attr->name, "printer-name") && + attr->value_tag == IPP_TAG_NAME) + name = attr->values[0].string.text; + else if (!strcmp(attr->name, "printer-state") && + attr->value_tag == IPP_TAG_ENUM) + state = attr->values[0].integer; + else if (!strcmp(attr->name, "printer-state-change-time") && + attr->value_tag == IPP_TAG_INTEGER) + change_time = attr->values[0].integer; + else if (!strcmp(attr->name, "printer-state-reasons") && + attr->value_tag == IPP_TAG_KEYWORD) + { + strlcpy(reasons, attr->values[0].string.text, sizeof(reasons)); + for (i = 1, rptr = reasons + strlen(reasons); + i < attr->num_values; + i ++) + { + snprintf(rptr, sizeof(reasons) - (rptr - reasons), ",%s", + attr->values[i].string.text); + rptr += strlen(rptr); + } + } + else if (!strcmp(attr->name, "printer-type") && + attr->value_tag == IPP_TAG_ENUM) + type = attr->values[0].integer; attr = attr->next; } @@ -841,10 +901,56 @@ cups_get_sdests(http_t *http, /* I - HTTP connection */ num_dests = cupsAddDest(name, NULL, num_dests, dests); if ((dest = cupsGetDest(name, NULL, num_dests, *dests)) != NULL) + { if (job_sheets[0]) - dest->num_options = cupsAddOption("job-sheets", job_sheets, 0, + dest->num_options = cupsAddOption("job-sheets", job_sheets, + dest->num_options, + &(dest->options)); + + if (info) + dest->num_options = cupsAddOption("printer-info", info, + dest->num_options, + &(dest->options)); + + sprintf(temp, "%d", accepting); + dest->num_options = cupsAddOption("printer-is-accepting-jobs", temp, + dest->num_options, + &(dest->options)); + + sprintf(temp, "%d", shared); + dest->num_options = cupsAddOption("printer-is-shared", temp, + dest->num_options, + &(dest->options)); + + if (make_model) + dest->num_options = cupsAddOption("printer-make-and-model", + make_model, dest->num_options, &(dest->options)); + sprintf(temp, "%d", state); + dest->num_options = cupsAddOption("printer-state", temp, + dest->num_options, + &(dest->options)); + + if (change_time) + { + sprintf(temp, "%d", change_time); + dest->num_options = cupsAddOption("printer-state-change-time", temp, + dest->num_options, + &(dest->options)); + } + + if (reasons[0]) + dest->num_options = cupsAddOption("printer-state-reasons", reasons, + dest->num_options, + &(dest->options)); + + sprintf(temp, "%d", type); + dest->num_options = cupsAddOption("printer-type", temp, + dest->num_options, + &(dest->options)); + } + if (attr == NULL) break; } @@ -861,5 +967,5 @@ cups_get_sdests(http_t *http, /* I - HTTP connection */ /* - * End of "$Id: dest.c 4918 2006-01-12 05:14:40Z mike $". + * End of "$Id: dest.c 4979 2006-01-25 17:47:43Z mike $". */ diff --git a/cups/emit.c b/cups/emit.c index 88ebc226c..7fa67dd0f 100644 --- a/cups/emit.c +++ b/cups/emit.c @@ -1,5 +1,5 @@ /* - * "$Id: emit.c 4785 2005-10-13 19:39:05Z mike $" + * "$Id: emit.c 4980 2006-01-25 19:57:45Z mike $" * * PPD code emission routines for the Common UNIX Printing System (CUPS). * @@ -27,14 +27,17 @@ * * Contents: * - * ppdCollect() - Collect all marked options that reside in the - * specified section. - * ppdEmit() - Emit code for marked options to a file. - * ppdEmitFd() - Emit code for marked options to a file. - * ppdEmitJCL() - Emit code for JCL options to a file. - * ppdEmitJCLEnd() - Emit JCLEnd code to a file. - * ppd_handle_media() - Handle media selection... - * ppd_sort() - Sort options by ordering numbers... + * ppdCollect() - Collect all marked options that reside in the + * specified section. + * ppdCollect2() - Collect all marked options that reside in the + * specified section and minimum order. + * ppdEmit() - Emit code for marked options to a file. + * ppdEmitAfterOrder() - Emit a subset of the code for marked options to a file. + * ppdEmitFd() - Emit code for marked options to a file. + * ppdEmitJCL() - Emit code for JCL options to a file. + * ppdEmitJCLEnd() - Emit JCLEnd code to a file. + * ppd_handle_media() - Handle media selection... + * ppd_sort() - Sort options by ordering numbers... */ /* @@ -79,6 +82,23 @@ ppdCollect(ppd_file_t *ppd, /* I - PPD file data */ ppd_section_t section, /* I - Section to collect */ ppd_choice_t ***choices) /* O - Pointers to choices */ { + return (ppdCollect2(ppd, section, 0.0, choices)); +} + + +/* + * 'ppdCollect2()' - Collect all marked options that reside in the + * specified section and minimum order. + * + * @since CUPS 1.2@ + */ + +int /* O - Number of options marked */ +ppdCollect2(ppd_file_t *ppd, /* I - PPD file data */ + ppd_section_t section, /* I - Section to collect */ + float min_order, /* I - Minimum OrderDependency value */ + ppd_choice_t ***choices) /* O - Pointers to choices */ +{ int i, j, k, m; /* Looping vars */ ppd_group_t *g, /* Current group */ *sg; /* Current sub-group */ @@ -105,7 +125,7 @@ ppdCollect(ppd_file_t *ppd, /* I - PPD file data */ for (i = ppd->num_groups, g = ppd->groups; i > 0; i --, g ++) { for (j = g->num_options, o = g->options; j > 0; j --, o ++) - if (o->section == section) + if (o->section == section && o->order >= min_order) for (k = o->num_choices, c = o->choices; k > 0; k --, c ++) if (c->marked && count < 1000) { @@ -115,7 +135,7 @@ ppdCollect(ppd_file_t *ppd, /* I - PPD file data */ for (j = g->num_subgroups, sg = g->subgroups; j > 0; j --, sg ++) for (k = sg->num_options, o = sg->options; k > 0; k --, o ++) - if (o->section == section) + if (o->section == section && o->order >= min_order) for (m = o->num_choices, c = o->choices; m > 0; m --, c ++) if (c->marked && count < 1000) { @@ -160,6 +180,29 @@ ppdEmit(ppd_file_t *ppd, /* I - PPD file record */ FILE *fp, /* I - File to write to */ ppd_section_t section) /* I - Section to write */ { + return (ppdEmitAfterOrder(ppd, fp, section, 0, 0.0)); +} + + +/* + * 'ppdEmitAfterOrder()' - Emit a subset of the code for marked options to a file. + * + * When "limit" is non-zero, this function only emits options whose + * OrderDependency value is greater than or equal to "min_order". + * + * When "limit" is zero, this function is identical to ppdEmit(). + * + * @since CUPS 1.2@ + */ + +int /* O - 0 on success, -1 on failure */ +ppdEmitAfterOrder( + ppd_file_t *ppd, /* I - PPD file record */ + FILE *fp, /* I - File to write to */ + ppd_section_t section, /* I - Section to write */ + int limit, /* I - Non-zero to use min_order, 0 to include all */ + float min_order) /* I - Lowest order dependency to include */ +{ int i, /* Looping var */ count; /* Number of choices */ ppd_choice_t **choices; /* Choices */ @@ -176,7 +219,7 @@ ppdEmit(ppd_file_t *ppd, /* I - PPD file record */ * Collect the options we need to emit and emit them! */ - if ((count = ppdCollect(ppd, section, &choices)) == 0) + if ((count = ppdCollect2(ppd, section, min_order, &choices)) == 0) return (0); for (i = 0; i < count; i ++) @@ -197,9 +240,9 @@ ppdEmit(ppd_file_t *ppd, /* I - PPD file record */ * Send DSC comments with option... */ - if ((strcasecmp(((ppd_option_t *)choices[i]->option)->keyword, "PageSize") == 0 || - strcasecmp(((ppd_option_t *)choices[i]->option)->keyword, "PageRegion") == 0) && - strcasecmp(choices[i]->choice, "Custom") == 0) + if ((!strcasecmp(choices[i]->option->keyword, "PageSize") || + !strcasecmp(choices[i]->option->keyword, "PageRegion")) && + !strcasecmp(choices[i]->choice, "Custom")) { /* * Variable size; write out standard size options, using the @@ -208,15 +251,16 @@ ppdEmit(ppd_file_t *ppd, /* I - PPD file record */ ppd_attr_t *attr; /* PPD attribute */ int pos, /* Position of custom value */ - values[5], /* Values for custom command */ orientation; /* Orientation to use */ - + float values[5]; /* Values for custom command */ + int isfloat[5]; /* Whether each value is float or int */ fputs("%%BeginFeature: *CustomPageSize True\n", fp); size = ppdPageSize(ppd, "Custom"); memset(values, 0, sizeof(values)); + memset(isfloat, 0, sizeof(isfloat)); if ((attr = ppdFindAttr(ppd, "ParamCustomPageSize", "Width")) != NULL) { @@ -228,7 +272,8 @@ ppdEmit(ppd_file_t *ppd, /* I - PPD file record */ else pos = 0; - values[pos] = (int)size->width; + values[pos] = size->width; + isfloat[pos] = 1; if ((attr = ppdFindAttr(ppd, "ParamCustomPageSize", "Height")) != NULL) { @@ -240,7 +285,8 @@ ppdEmit(ppd_file_t *ppd, /* I - PPD file record */ else pos = 1; - values[pos] = (int)size->length; + values[pos] = size->length; + isfloat[pos] = 1; /* * According to the Adobe PPD specification, an orientation of 1 @@ -292,8 +338,11 @@ ppdEmit(ppd_file_t *ppd, /* I - PPD file record */ values[pos] = orientation; - fprintf(fp, "%d %d %d %d %d\n", values[0], values[1], - values[2], values[3], values[4]); + for (pos = 0; pos < 5; pos ++) + if (isfloat[pos]) + fprintf(fp, "%.2f\n", values[pos]); + else + fprintf(fp, "%.0f\n", values[pos]); if (choices[i]->code == NULL) { @@ -306,8 +355,75 @@ ppdEmit(ppd_file_t *ppd, /* I - PPD file record */ fputs(ppd_custom_code, fp); } } + else if (!strcasecmp(choices[i]->choice, "Custom")) + { + /* + * Custom option... + */ + + ppd_coption_t *coption; /* Custom option */ + ppd_cparam_t *cparam; /* Custom parameter */ + const char *s; /* Pointer into string value */ + + + /* + * TODO: Support custom options with more than 1 parameter... + */ + + if ((coption = ppdFindCustomOption(ppd, choices[i]->option->keyword)) + != NULL && + (cparam = (ppd_cparam_t *)cupsArrayFirst(coption->params)) != NULL) + { + if (fprintf(fp, "%%%%BeginFeature: *Custom%s True\n", + coption->keyword) < 0) + { + free(choices); + return (-1); + } + + switch (cparam->type) + { + case PPD_CUSTOM_CURVE : + case PPD_CUSTOM_INVCURVE : + case PPD_CUSTOM_POINTS : + case PPD_CUSTOM_REAL : + if (fprintf(fp, "%f\n", cparam->current.custom_real) < 0) + { + free(choices); + return (-1); + } + break; + + case PPD_CUSTOM_INT : + if (fprintf(fp, "%d\n", cparam->current.custom_int) < 0) + { + free(choices); + return (-1); + } + break; + + case PPD_CUSTOM_PASSCODE : + case PPD_CUSTOM_PASSWORD : + case PPD_CUSTOM_STRING : + putc('(', fp); + + for (s = cparam->current.custom_string; *s; s ++) + if (*s < ' ' || *s == '(' || *s == ')' || *s >= 127) + fprintf(fp, "\\%03o", *s & 255); + else + putc(*s, fp); + + if (fputs(")\n", fp) < 0) + { + free(choices); + return (-1); + } + break; + } + } + } else if (fprintf(fp, "%%%%BeginFeature: *%s %s\n", - ((ppd_option_t *)choices[i]->option)->keyword, + choices[i]->option->keyword, choices[i]->choice) < 0) { free(choices); @@ -397,9 +513,9 @@ ppdEmitFd(ppd_file_t *ppd, /* I - PPD file record */ * Send DSC comments with option... */ - if ((strcasecmp(((ppd_option_t *)choices[i]->option)->keyword, "PageSize") == 0 || - strcasecmp(((ppd_option_t *)choices[i]->option)->keyword, "PageRegion") == 0) && - strcasecmp(choices[i]->choice, "Custom") == 0) + if ((!strcasecmp(choices[i]->option->keyword, "PageSize") || + !strcasecmp(choices[i]->option->keyword, "PageRegion")) && + !strcasecmp(choices[i]->choice, "Custom")) { custom_size = 1; @@ -410,8 +526,7 @@ ppdEmitFd(ppd_file_t *ppd, /* I - PPD file record */ custom_size = 0; snprintf(buf, sizeof(buf), "%%%%BeginFeature: *%s %s\n", - ((ppd_option_t *)choices[i]->option)->keyword, - choices[i]->choice); + choices[i]->option->keyword, choices[i]->choice); } if (write(fd, buf, strlen(buf)) < 1) @@ -748,10 +863,9 @@ ppd_handle_media(ppd_file_t *ppd) if (!rpr) rpr = ppdFindAttr(ppd, "RequiresPageRegion", "All"); - if (strcasecmp(size->name, "Custom") == 0 || - (manual_feed == NULL && input_slot == NULL) || - (manual_feed != NULL && strcasecmp(manual_feed->choice, "False") == 0) || - (input_slot != NULL && (input_slot->code == NULL || !input_slot->code[0]))) + if (!strcasecmp(size->name, "Custom") || (!manual_feed && !input_slot) || + !((manual_feed && !strcasecmp(manual_feed->choice, "True")) || + (input_slot && input_slot->code && input_slot->code[0]))) { /* * Manual feed was not selected and/or the input slot selection does @@ -802,9 +916,9 @@ static int /* O - -1 if c1 < c2, 0 if equal, 1 otherwise */ ppd_sort(ppd_choice_t **c1, /* I - First choice */ ppd_choice_t **c2) /* I - Second choice */ { - if (((ppd_option_t *)(*c1)->option)->order < ((ppd_option_t *)(*c2)->option)->order) + if ((*c1)->option->order < (*c2)->option->order) return (-1); - else if (((ppd_option_t *)(*c1)->option)->order > ((ppd_option_t *)(*c2)->option)->order) + else if ((*c1)->option->order > (*c2)->option->order) return (1); else return (0); @@ -812,5 +926,5 @@ ppd_sort(ppd_choice_t **c1, /* I - First choice */ /* - * End of "$Id: emit.c 4785 2005-10-13 19:39:05Z mike $". + * End of "$Id: emit.c 4980 2006-01-25 19:57:45Z mike $". */ diff --git a/cups/encode.c b/cups/encode.c index be1aab28d..af16f5481 100644 --- a/cups/encode.c +++ b/cups/encode.c @@ -1,9 +1,9 @@ /* - * "$Id: encode.c 4918 2006-01-12 05:14:40Z mike $" + * "$Id: encode.c 4977 2006-01-25 15:52:30Z mike $" * * Option encoding routines for the Common UNIX Printing System (CUPS). * - * Copyright 1997-2005 by Easy Software Products. + * Copyright 1997-2006 by Easy Software Products. * * These coded instructions, statements, and computer programs are the * property of Easy Software Products and are protected by Federal @@ -25,9 +25,10 @@ * * Contents: * - * cupsEncodeOptions() - Encode printer options into IPP attributes. - * cupsEncodeOptions2() - Encode printer options into IPP attributes for - * a group. + * cupsEncodeOptions() - Encode printer options into IPP attributes. + * cupsEncodeOptions2() - Encode printer options into IPP attributes for + * a group. + * compare_ipp_options() - Compare two IPP options. */ /* @@ -35,6 +36,7 @@ */ #include "cups.h" +#include "ipp-private.h" #include <stdlib.h> #include <ctype.h> #include "string.h" @@ -43,6 +45,8 @@ /* * Local list of option names and the value tags they should use... + * + * **** THIS LIST MUST BE SORTED **** */ typedef struct @@ -89,9 +93,19 @@ static const _ipp_option_t ipp_options[] = { "penwidth", IPP_TAG_INTEGER, IPP_TAG_JOB }, { "ppi", IPP_TAG_INTEGER, IPP_TAG_JOB }, { "prettyprint", IPP_TAG_BOOLEAN, IPP_TAG_JOB }, + { "printer-info", IPP_TAG_TEXT, IPP_TAG_PRINTER }, + { "printer-is-accepting-jobs",IPP_TAG_BOOLEAN, IPP_TAG_PRINTER }, + { "printer-is-shared", IPP_TAG_BOOLEAN, IPP_TAG_PRINTER }, + { "printer-make-and-model", IPP_TAG_TEXT, IPP_TAG_PRINTER }, + { "printer-more-info", IPP_TAG_URI, IPP_TAG_PRINTER }, { "printer-resolution", IPP_TAG_RESOLUTION, IPP_TAG_JOB }, + { "printer-state", IPP_TAG_ENUM, IPP_TAG_PRINTER }, + { "printer-state-change-time",IPP_TAG_INTEGER, IPP_TAG_PRINTER }, + { "printer-state-reasons", IPP_TAG_KEYWORD, IPP_TAG_PRINTER }, + { "printer-type", IPP_TAG_ENUM, IPP_TAG_PRINTER }, { "printer-uri", IPP_TAG_URI, IPP_TAG_OPERATION }, { "print-quality", IPP_TAG_ENUM, IPP_TAG_JOB }, + { "queued-job-count", IPP_TAG_INTEGER, IPP_TAG_PRINTER }, { "raw", IPP_TAG_MIMETYPE, IPP_TAG_OPERATION }, { "saturation", IPP_TAG_INTEGER, IPP_TAG_JOB }, { "scaling", IPP_TAG_INTEGER, IPP_TAG_JOB }, @@ -101,6 +115,13 @@ static const _ipp_option_t ipp_options[] = /* + * Local functions... + */ + +static int compare_ipp_options(_ipp_option_t *a, _ipp_option_t *b); + + +/* * 'cupsEncodeOptions()' - Encode printer options into IPP attributes. * * This function adds operation, job, and then subscription attributes, @@ -189,6 +210,10 @@ cupsEncodeOptions2( for (i = 0; i < num_options; i ++) { + _ipp_option_t key, /* Search key */ + *match; /* Matching attribute */ + + /* * Skip document format options that are handled above... */ @@ -202,16 +227,21 @@ cupsEncodeOptions2( * Figure out the proper value and group tags for this option... */ - for (j = 0; j < (int)(sizeof(ipp_options) / sizeof(ipp_options[0])); j ++) - if (!strcasecmp(options[i].name, ipp_options[j].name)) - break; + key.name = options[i].name; + match = (_ipp_option_t *)bsearch(&key, ipp_options, + sizeof(ipp_options) / + sizeof(ipp_options[0]), + sizeof(ipp_options[0]), + (int (*)(const void *, + const void *)) + compare_ipp_options); - if (j < (int)(sizeof(ipp_options) / sizeof(ipp_options[0]))) + if (match) { - if (ipp_options[j].group_tag != group_tag) + if (match->group_tag != group_tag) continue; - value_tag = ipp_options[j].value_tag; + value_tag = match->value_tag; } else if (group_tag != IPP_TAG_JOB) continue; @@ -467,5 +497,17 @@ cupsEncodeOptions2( /* - * End of "$Id: encode.c 4918 2006-01-12 05:14:40Z mike $". + * 'compare_ipp_options()' - Compare two IPP options. + */ + +static int /* O - Result of comparison */ +compare_ipp_options(_ipp_option_t *a, /* I - First option */ + _ipp_option_t *b) /* I - Second option */ +{ + return (strcmp(a->name, b->name)); +} + + +/* + * End of "$Id: encode.c 4977 2006-01-25 15:52:30Z mike $". */ diff --git a/cups/extended.c b/cups/extended.c deleted file mode 100644 index 6bc5cfae7..000000000 --- a/cups/extended.c +++ /dev/null @@ -1,307 +0,0 @@ -/* - * "$Id: extended.c 4494 2005-02-18 02:18:11Z mike $" - * - * Extended option routines for the Common UNIX Printing System (CUPS). - * - * Copyright 1997-2005 by Easy Software Products, all rights reserved. - * - * These coded instructions, statements, and computer programs are the - * property of Easy Software Products and are protected by Federal - * copyright law. Distribution and use rights are outlined in the file - * "LICENSE.txt" which should have been included with this file. If this - * file is missing or damaged please contact Easy Software Products - * at: - * - * Attn: CUPS Licensing Information - * Easy Software Products - * 44141 Airport View Drive, Suite 204 - * Hollywood, Maryland 20636 USA - * - * Voice: (301) 373-9600 - * EMail: cups-info@cups.org - * WWW: http://www.cups.org - * - * PostScript is a trademark of Adobe Systems, Inc. - * - * This file is subject to the Apple OS-Developed Software exception. - * - * Contents: - * - * ppdFindExtOption() - Return a pointer to the extended option. - * ppdMarkCurve() - Mark an extended curve option. - * ppdMarkGamma() - Mark an extended gamma option. - * ppdMarkInteger() - Mark an extended integer option. - * ppdMarkIntegerArray() - Mark an extended integer array option. - * ppdMarkReal() - Mark an extended real option. - * ppdMarkRealArray() - Mark an extended real array option. - * ppdMarkText() - Mark an extended text option. - */ - -/* - * Include necessary headers... - */ - -#include "ppd.h" -#include "string.h" -#include "debug.h" - - -/* - * Local functions... - */ - -static void ppd_unmark_choices(ppd_option_t *option); - - -/* - * 'ppdFindExtOption()' - Return a pointer to the extended option. - */ - -ppd_ext_option_t * /* O - Pointer to option or NULL */ -ppdFindExtOption(ppd_file_t *ppd, /* I - PPD file data */ - const char *option) /* I - Option/Keyword name */ -{ - int i; /* Looping var */ - ppd_ext_option_t **o; /* Pointer to option */ - - - if (ppd == NULL || option == NULL) - return (NULL); - - for (i = ppd->num_extended, o = ppd->extended; i > 0; i --, o ++) - if (strcasecmp(o[0]->keyword, option) == 0) - return (*o); - - return (NULL); -} - - -/* - * 'ppdFindExtParam()' - Find an extended parameter. - */ - -ppd_ext_param_t * /* O - Parameter or NULL */ -ppdFindExtParam(ppd_ext_option_t *opt, /* I - Option */ - const char *param)/* I - Parameter name */ -{ - int i; /* Looping var */ - ppd_ext_param_t **p; /* Pointer to parameter */ - - - if (opt == NULL || param == NULL) - return (NULL); - - for (i = opt->num_params, p = opt->params; i > 0; i --, p ++) - if (strcasecmp(p[0]->keyword, param) == 0) - return (*p); - - return (NULL); -} - - -/* - * 'ppdMarkCurve()' - Mark an extended curve option. - */ - -int /* O - Number of conflicts */ -ppdMarkCurve(ppd_file_t *ppd, /* I - PPD file */ - const char *keyword, /* I - Option name */ - const char *param, /* I - Parameter name */ - float low, /* I - Lower (start) value */ - float high, /* I - Upper (end) value */ - float gvalue) /* I - Gamma value for range */ -{ - ppd_ext_option_t *o; /* Extended option */ - ppd_ext_param_t *p; /* Extended parameter */ - - - if ((o = ppdFindExtOption(ppd, keyword)) == NULL) - return (-1); - - if ((p = ppdFindExtParam(o, param)) == NULL) - return (-1); - - ppd_unmark_choices(o->option); - - return (ppdConflicts(ppd)); -} - - -/* - * 'ppdMarkGamma()' - Mark an extended gamma option. - */ - -int /* O - Number of conflicts */ -ppdMarkGamma(ppd_file_t *ppd, /* I - PPD file */ - const char *keyword, /* I - Option name */ - const char *param, /* I - Parameter name */ - float gvalue) /* I - Gamma value */ -{ - ppd_ext_option_t *o; /* Extended option */ - ppd_ext_param_t *p; /* Extended parameter */ - - - if ((o = ppdFindExtOption(ppd, keyword)) == NULL) - return (-1); - - if ((p = ppdFindExtParam(o, param)) == NULL) - return (-1); - - ppd_unmark_choices(o->option); - - return (ppdConflicts(ppd)); -} - - -/* - * 'ppdMarkInteger()' - Mark an extended integer option. - */ - -int /* O - Number of conflicts */ -ppdMarkInteger(ppd_file_t *ppd, /* I - PPD file */ - const char *keyword, /* I - Option name */ - const char *param, /* I - Parameter name */ - int value) /* I - Option value */ -{ - ppd_ext_option_t *o; /* Extended option */ - ppd_ext_param_t *p; /* Extended parameter */ - - - if ((o = ppdFindExtOption(ppd, keyword)) == NULL) - return (-1); - - if ((p = ppdFindExtParam(o, param)) == NULL) - return (-1); - - ppd_unmark_choices(o->option); - - return (ppdConflicts(ppd)); -} - - -/* - * 'ppdMarkIntegerArray()' - Mark an extended integer array option. - */ - -int /* O - Number of conflicts */ -ppdMarkIntegerArray(ppd_file_t *ppd, /* I - PPD file */ - const char *keyword,/* I - Option name */ - const char *param, /* I - Parameter name */ - int num_values, - /* I - Number of values */ - const int *values) /* I - Values */ -{ - ppd_ext_option_t *o; /* Extended option */ - ppd_ext_param_t *p; /* Extended parameter */ - - - if ((o = ppdFindExtOption(ppd, keyword)) == NULL) - return (-1); - - if ((p = ppdFindExtParam(o, param)) == NULL) - return (-1); - - ppd_unmark_choices(o->option); - - return (ppdConflicts(ppd)); -} - - -/* - * 'ppdMarkReal()' - Mark an extended real option. - */ - -int /* O - Number of conflicts */ -ppdMarkReal(ppd_file_t *ppd, /* I - PPD file */ - const char *keyword, /* I - Option name */ - const char *param, /* I - Parameter name */ - float value) /* I - Option value */ -{ - ppd_ext_option_t *o; /* Extended option */ - ppd_ext_param_t *p; /* Extended parameter */ - - - if ((o = ppdFindExtOption(ppd, keyword)) == NULL) - return (-1); - - if ((p = ppdFindExtParam(o, param)) == NULL) - return (-1); - - ppd_unmark_choices(o->option); - - return (ppdConflicts(ppd)); -} - - -/* - * 'ppdMarkRealArray()' - Mark an extended real array option. - */ - -int /* O - Number of conflicts */ -ppdMarkRealArray(ppd_file_t *ppd, /* I - PPD file */ - const char *keyword, /* I - Option name */ - const char *param, /* I - Parameter name */ - int num_values,/* I - Number of values */ - const float *values) /* I - Values */ -{ - ppd_ext_option_t *o; /* Extended option */ - ppd_ext_param_t *p; /* Extended parameter */ - - - if ((o = ppdFindExtOption(ppd, keyword)) == NULL) - return (-1); - - if ((p = ppdFindExtParam(o, param)) == NULL) - return (-1); - - ppd_unmark_choices(o->option); - - return (ppdConflicts(ppd)); -} - - -/* - * 'ppdMarkText()' - Mark an extended text option. - */ - -int /* O - Number of conflicts */ -ppdMarkText(ppd_file_t *ppd, /* I - PPD file */ - const char *keyword, /* I - Option name */ - const char *param, /* I - Parameter name */ - const char *value) /* I - Option value */ -{ - ppd_ext_option_t *o; /* Extended option */ - ppd_ext_param_t *p; /* Extended parameter */ - - - if ((o = ppdFindExtOption(ppd, keyword)) == NULL) - return (-1); - - if ((p = ppdFindExtParam(o, param)) == NULL) - return (-1); - - ppd_unmark_choices(o->option); - - return (ppdConflicts(ppd)); -} - - -/* - * 'ppd_unmark_choices()' - Unmark all "canned" choices. - */ - -static void -ppd_unmark_choices(ppd_option_t *option)/* I - Option choice */ -{ - int i; /* Looping var */ - ppd_choice_t *c; /* Current choice */ - - - for (i = option->num_choices, c = option->choices; i > 0; i --, c++) - c->marked = 0; -} - - -/* - * End of "$Id: extended.c 4494 2005-02-18 02:18:11Z mike $". - */ diff --git a/cups/file.c b/cups/file.c index 05c553031..daad1c372 100644 --- a/cups/file.c +++ b/cups/file.c @@ -1,5 +1,5 @@ /* - * "$Id: file.c 4844 2005-11-21 17:37:57Z mike $" + * "$Id: file.c 4983 2006-01-25 21:53:43Z mike $" * * File functions for the Common UNIX Printing System (CUPS). * @@ -31,6 +31,7 @@ * cupsFileClose() - Close a CUPS file. * cupsFileCompression() - Return whether a file is compressed. * cupsFileEOF() - Return the end-of-file status. + * cupsFileFind() - Find a file using the specified path. * cupsFileFlush() - Flush pending output. * cupsFileGetChar() - Get a single character from a file. * cupsFileGetConf() - Get a line from a configuration file... @@ -99,14 +100,14 @@ struct _cups_file_s /**** CUPS file structure... ****/ char mode, /* Mode ('r' or 'w') */ compressed, /* Compression used? */ eof, /* End of file? */ - buf[2048], /* Buffer */ + buf[4096], /* Buffer */ *ptr, /* Pointer into buffer */ *end; /* End of buffer data */ off_t pos; /* File position for start of buffer */ #ifdef HAVE_LIBZ z_stream stream; /* (De)compression stream */ - Bytef cbuf[1024]; /* (De)compression buffer */ + Bytef cbuf[4096]; /* (De)compression buffer */ uLong crc; /* (De)compression CRC */ #endif /* HAVE_LIBZ */ }; @@ -272,6 +273,91 @@ cupsFileEOF(cups_file_t *fp) /* I - CUPS file */ /* + * 'cupsFileFind()' - Find a file using the specified path. + * + * This function allows the paths in the path string to be separated by + * colons (UNIX standard) or semicolons (Windows standard) and stores the + * result in the buffer supplied. If the file cannot be found in any of + * the supplied paths, NULL is returned. A NULL path only matches the + * current directory. + */ + +const char * /* O - Full path to file or NULL */ +cupsFileFind(const char *filename, /* I - File to find */ + const char *path, /* I - Colon/semicolon-separated path */ + char *buffer, /* I - Filename buffer */ + int bufsize) /* I - Size of filename buffer */ +{ + char *bufptr, /* Current position in buffer */ + *bufend; /* End of buffer */ + + + /* + * Range check input... + */ + + if (!filename || !buffer || bufsize < 2) + return (NULL); + + if (!path) + { + /* + * No path, so check current directory... + */ + + if (!access(filename, 0)) + { + strlcpy(buffer, filename, bufsize); + return (buffer); + } + else + return (NULL); + } + + /* + * Now check each path and return the first match... + */ + + bufend = buffer + bufsize - 1; + bufptr = buffer; + + while (*path) + { + if (*path == ';' || *path == ':') + { + if (bufptr > buffer && bufptr[-1] != '/' && bufptr < bufend) + *bufptr++ = '/'; + + strlcpy(bufptr, filename, bufend - bufptr); + + if (!access(buffer, 0)) + return (buffer); + + bufptr = buffer; + } + else if (bufptr < bufend) + *bufptr++ = *path; + + path ++; + } + + /* + * Check the last path... + */ + + if (bufptr > buffer && bufptr[-1] != '/' && bufptr < bufend) + *bufptr++ = '/'; + + strlcpy(bufptr, filename, bufend - bufptr); + + if (!access(buffer, 0)) + return (buffer); + else + return (NULL); +} + + +/* * 'cupsFileFlush()' - Flush pending output. */ @@ -1325,7 +1411,7 @@ cups_fill(cups_file_t *fp) /* I - CUPS file */ * file... */ - if ((bytes = cups_read(fp, (char *)fp->cbuf, sizeof(fp->cbuf))) < 0) + if ((bytes = cups_read(fp, (char *)fp->buf, sizeof(fp->buf))) < 0) { /* * Can't read from file! @@ -1334,15 +1420,14 @@ cups_fill(cups_file_t *fp) /* I - CUPS file */ return (-1); } - if (bytes < 10 || fp->cbuf[0] != 0x1f || fp->cbuf[1] != 0x8b || - fp->cbuf[2] != 8 || (fp->cbuf[3] & 0xe0) != 0) + if (bytes < 10 || fp->buf[0] != 0x1f || + (unsigned char)fp->buf[1] != 0x8b || + fp->buf[2] != 8 || (fp->buf[3] & 0xe0) != 0) { /* * Not a gzip'd file! */ - memcpy(fp->buf, fp->cbuf, bytes); - fp->ptr = fp->buf; fp->end = fp->buf + bytes; @@ -1353,10 +1438,10 @@ cups_fill(cups_file_t *fp) /* I - CUPS file */ * Parse header junk: extra data, original name, and comment... */ - ptr = (unsigned char *)fp->cbuf + 10; - end = (unsigned char *)fp->cbuf + bytes; + ptr = (unsigned char *)fp->buf + 10; + end = (unsigned char *)fp->buf + bytes; - if (fp->cbuf[3] & 0x04) + if (fp->buf[3] & 0x04) { /* * Skip extra data... @@ -1384,7 +1469,7 @@ cups_fill(cups_file_t *fp) /* I - CUPS file */ } } - if (fp->cbuf[3] & 0x08) + if (fp->buf[3] & 0x08) { /* * Skip original name data... @@ -1405,7 +1490,7 @@ cups_fill(cups_file_t *fp) /* I - CUPS file */ } } - if (fp->cbuf[3] & 0x10) + if (fp->buf[3] & 0x10) { /* * Skip comment data... @@ -1426,7 +1511,7 @@ cups_fill(cups_file_t *fp) /* I - CUPS file */ } } - if (fp->cbuf[3] & 0x02) + if (fp->buf[3] & 0x02) { /* * Skip header CRC data... @@ -1445,15 +1530,22 @@ cups_fill(cups_file_t *fp) /* I - CUPS file */ } /* + * Copy the flate-compressed data to the compression buffer... + */ + + if ((bytes = end - ptr) > 0) + memcpy(fp->cbuf, ptr, bytes); + + /* * Setup the decompressor data... */ fp->stream.zalloc = (alloc_func)0; fp->stream.zfree = (free_func)0; fp->stream.opaque = (voidpf)0; - fp->stream.next_in = (Bytef *)ptr; + fp->stream.next_in = (Bytef *)fp->cbuf; fp->stream.next_out = NULL; - fp->stream.avail_in = end - ptr; + fp->stream.avail_in = bytes; fp->stream.avail_out = 0; fp->crc = crc32(0L, Z_NULL, 0); @@ -1509,29 +1601,30 @@ cups_fill(cups_file_t *fp) /* I - CUPS file */ */ fp->eof = 1; - return (-1); } + else + { + tcrc = (((((trailer[3] << 8) | trailer[2]) << 8) | trailer[1]) << 8) | + trailer[0]; - tcrc = (((((trailer[3] << 8) | trailer[2]) << 8) | trailer[1]) << 8) | - trailer[0]; + if (tcrc != fp->crc) + { + /* + * Bad CRC, mark end-of-file... + */ + + fp->eof = 1; + + return (-1); + } - if (tcrc != fp->crc) - { /* - * Bad CRC, mark end-of-file... + * Otherwise, reset the compressed flag so that we re-read the + * file header... */ - fp->eof = 1; - return (-1); + fp->compressed = 0; } - - /* - * Otherwise, reset the current pointer so that we re-read the - * file header... - */ - - fp->ptr = NULL; - continue; } bytes = sizeof(fp->buf) - fp->stream.avail_out; @@ -1543,7 +1636,8 @@ cups_fill(cups_file_t *fp) /* I - CUPS file */ fp->ptr = fp->buf; fp->end = fp->buf + bytes; - return (bytes); + if (bytes) + return (bytes); } } #endif /* HAVE_LIBZ */ @@ -1676,5 +1770,5 @@ cups_write(cups_file_t *fp, /* I - CUPS file */ /* - * End of "$Id: file.c 4844 2005-11-21 17:37:57Z mike $". + * End of "$Id: file.c 4983 2006-01-25 21:53:43Z mike $". */ diff --git a/cups/file.h b/cups/file.h index c7de9ef0f..fa9088c15 100644 --- a/cups/file.h +++ b/cups/file.h @@ -1,5 +1,5 @@ /* - * "$Id: file.h 4857 2005-11-30 19:25:17Z mike $" + * "$Id: file.h 4933 2006-01-16 00:26:57Z mike $" * * Public file definitions for the Common UNIX Printing System (CUPS). * @@ -74,6 +74,8 @@ typedef struct _cups_file_s cups_file_t;/**** CUPS file type ****/ extern int cupsFileClose(cups_file_t *fp); extern int cupsFileCompression(cups_file_t *fp); extern int cupsFileEOF(cups_file_t *fp); +extern const char *cupsFileFind(const char *filename, const char *path, + char *buffer, int bufsize); extern int cupsFileFlush(cups_file_t *fp); extern int cupsFileGetChar(cups_file_t *fp); extern char *cupsFileGetConf(cups_file_t *fp, char *buf, size_t buflen, @@ -101,5 +103,5 @@ extern ssize_t cupsFileWrite(cups_file_t *fp, const char *buf, size_t bytes); #endif /* !_CUPS_FILE_H_ */ /* - * End of "$Id: file.h 4857 2005-11-30 19:25:17Z mike $". + * End of "$Id: file.h 4933 2006-01-16 00:26:57Z mike $". */ diff --git a/cups/getputfile.c b/cups/getputfile.c index 8a5dc9330..82c9bdf28 100644 --- a/cups/getputfile.c +++ b/cups/getputfile.c @@ -1,5 +1,5 @@ /* - * "$Id: getputfile.c 4918 2006-01-12 05:14:40Z mike $" + * "$Id: getputfile.c 4984 2006-01-25 21:55:36Z mike $" * * Get/put file functions for the Common UNIX Printing System (CUPS). * @@ -125,7 +125,11 @@ cupsGetFd(http_t *http, /* I - HTTP connection to server */ if (cupsDoAuthentication(http, "GET", resource)) break; - httpReconnect(http); + if (httpReconnect(http)) + { + status = HTTP_ERROR; + break; + } continue; } @@ -136,7 +140,11 @@ cupsGetFd(http_t *http, /* I - HTTP connection to server */ httpFlush(http); /* Reconnect... */ - httpReconnect(http); + if (httpReconnect(http)) + { + status = HTTP_ERROR; + break; + } /* Upgrade with encryption... */ httpEncryption(http, HTTP_ENCRYPT_REQUIRED); @@ -340,7 +348,11 @@ cupsPutFd(http_t *http, /* I - HTTP connection to server */ if (cupsDoAuthentication(http, "PUT", resource)) break; - httpReconnect(http); + if (httpReconnect(http)) + { + status = HTTP_ERROR; + break; + } continue; } @@ -351,7 +363,11 @@ cupsPutFd(http_t *http, /* I - HTTP connection to server */ httpFlush(http); /* Reconnect... */ - httpReconnect(http); + if (httpReconnect(http)) + { + status = HTTP_ERROR; + break; + } /* Upgrade with encryption... */ httpEncryption(http, HTTP_ENCRYPT_REQUIRED); @@ -431,5 +447,5 @@ cupsPutFile(http_t *http, /* I - HTTP connection to server */ /* - * End of "$Id: getputfile.c 4918 2006-01-12 05:14:40Z mike $". + * End of "$Id: getputfile.c 4984 2006-01-25 21:55:36Z mike $". */ diff --git a/cups/globals.c b/cups/globals.c index d7c6ac293..3335e5163 100644 --- a/cups/globals.c +++ b/cups/globals.c @@ -1,5 +1,5 @@ /* - * "$Id: globals.c 4922 2006-01-12 22:05:06Z mike $" + * "$Id: globals.c 4967 2006-01-24 03:42:15Z mike $" * * Global variable access routines for the Common UNIX Printing System (CUPS). * @@ -152,6 +152,18 @@ globals_init() static void globals_destructor(void *value) /* I - Data to free */ { + _cups_globals_t *cg; /* Global data */ + + + cg = (_cups_globals_t *)value; + + if (cg->http) + httpClose(cg->http); + + _cupsLangFlush(cg); + _cupsCharmapFlush(cg); + _cupsNormalizeMapsFlush(cg); + free(value); } @@ -198,5 +210,5 @@ _cupsGlobals(void) /* - * End of "$Id: globals.c 4922 2006-01-12 22:05:06Z mike $". + * End of "$Id: globals.c 4967 2006-01-24 03:42:15Z mike $". */ diff --git a/cups/globals.h b/cups/globals.h index cff946a96..e1db6dc00 100644 --- a/cups/globals.h +++ b/cups/globals.h @@ -1,5 +1,5 @@ /* - * "$Id: globals.h 4918 2006-01-12 05:14:40Z mike $" + * "$Id: globals.h 4967 2006-01-24 03:42:15Z mike $" * * Global variable definitions for the Common UNIX Printing System (CUPS). * @@ -94,6 +94,7 @@ typedef struct _cups_globals_s /**** CUPS global state data ****/ /* language.c */ cups_lang_t *lang_cache; /* Language string cache */ + cups_lang_t *lang_default; /* Default language */ # ifdef __APPLE__ # ifdef HAVE_CF_LOCALE_ID char language[32]; /* Cached language */ @@ -140,6 +141,9 @@ typedef struct _cups_globals_s /**** CUPS global state data ****/ extern const char *_cupsGetPassword(const char *prompt); extern _cups_globals_t *_cupsGlobals(void); +extern void _cupsLangFlush(_cups_globals_t *cg); +extern void _cupsCharmapFlush(_cups_globals_t *cg); +extern void _cupsNormalizeMapsFlush(_cups_globals_t *cg); /* @@ -152,5 +156,5 @@ extern _cups_globals_t *_cupsGlobals(void); #endif /* !_CUPS_GLOBALS_H_ */ /* - * End of "$Id: globals.h 4918 2006-01-12 05:14:40Z mike $". + * End of "$Id: globals.h 4967 2006-01-24 03:42:15Z mike $". */ diff --git a/cups/http-addr.c b/cups/http-addr.c index ac4763bd2..4363a86a5 100644 --- a/cups/http-addr.c +++ b/cups/http-addr.c @@ -1,5 +1,5 @@ /* - * "$Id: http-addr.c 4806 2005-10-21 18:49:24Z mike $" + * "$Id: http-addr.c 4950 2006-01-19 16:07:57Z mike $" * * HTTP address routines for the Common UNIX Printing System (CUPS). * @@ -133,8 +133,7 @@ httpAddrLocalhost( { #ifdef AF_INET6 if (addr->addr.sa_family == AF_INET6 && - (IN6_IS_ADDR_LOOPBACK(&(addr->ipv6.sin6_addr)) || - IN6_IS_ADDR_UNSPECIFIED(&(addr->ipv6.sin6_addr)))) + IN6_IS_ADDR_LOOPBACK(&(addr->ipv6.sin6_addr))) return (1); #endif /* AF_INET6 */ @@ -541,5 +540,5 @@ httpGetHostname(char *s, /* I - String buffer for name */ /* - * End of "$Id: http-addr.c 4806 2005-10-21 18:49:24Z mike $". + * End of "$Id: http-addr.c 4950 2006-01-19 16:07:57Z mike $". */ diff --git a/cups/http-addrlist.c b/cups/http-addrlist.c index ed6194471..0a77b7ea6 100644 --- a/cups/http-addrlist.c +++ b/cups/http-addrlist.c @@ -1,9 +1,9 @@ /* - * "$Id: http-addrlist.c 4815 2005-10-31 20:40:17Z mike $" + * "$Id: http-addrlist.c 4976 2006-01-25 15:07:40Z mike $" * * HTTP address list routines for the Common UNIX Printing System (CUPS). * - * Copyright 1997-2005 by Easy Software Products, all rights reserved. + * Copyright 1997-2006 by Easy Software Products, all rights reserved. * * These coded instructions, statements, and computer programs are the * property of Easy Software Products and are protected by Federal @@ -90,6 +90,11 @@ httpAddrConnect( setsockopt(*sock, SOL_SOCKET, SO_REUSEPORT, &val, sizeof(val)); #endif /* SO_REUSEPORT */ +#ifdef SO_NOSIGPIPE + val = 1; + setsockopt(*sock, SOL_SOCKET, SO_NOSIGPIPE, &val, sizeof(val)); +#endif /* SO_NOSIGPIPE */ + /* * Using TCP_NODELAY improves responsiveness, especially on systems * with a slow loopback interface... @@ -584,5 +589,5 @@ httpAddrGetList(const char *hostname, /* I - Hostname, IP address, or NULL for p /* - * End of "$Id: http-addrlist.c 4815 2005-10-31 20:40:17Z mike $". + * End of "$Id: http-addrlist.c 4976 2006-01-25 15:07:40Z mike $". */ diff --git a/cups/http-private.h b/cups/http-private.h index 5ecf57983..dd6fb2256 100644 --- a/cups/http-private.h +++ b/cups/http-private.h @@ -1,5 +1,5 @@ /* - * "$Id: http-private.h 4800 2005-10-18 18:06:20Z mike $" + * "$Id: http-private.h 4973 2006-01-25 02:36:02Z mike $" * * Private HTTP definitions for the Common UNIX Printing System (CUPS). * @@ -64,6 +64,7 @@ typedef int socklen_t; # endif /* __sgi */ # include "http.h" +# include "ipp-private.h" # if defined HAVE_LIBSSL /* @@ -122,5 +123,5 @@ extern const char *hstrerror(int error); #endif /* !_CUPS_HTTP_PRIVATE_H_ */ /* - * End of "$Id: http-private.h 4800 2005-10-18 18:06:20Z mike $". + * End of "$Id: http-private.h 4973 2006-01-25 02:36:02Z mike $". */ diff --git a/cups/http-support.c b/cups/http-support.c index b62496a3e..0770f138a 100644 --- a/cups/http-support.c +++ b/cups/http-support.c @@ -1,5 +1,5 @@ /* - * "$Id: http-support.c 4903 2006-01-10 20:02:46Z mike $" + * "$Id: http-support.c 4961 2006-01-20 22:19:13Z mike $" * * HTTP support routines for the Common UNIX Printing System (CUPS) scheduler. * @@ -320,6 +320,9 @@ httpAssembleURIf(char *uri, /* I - URI buffer */ if (resourcef) { + char *query; /* Pointer to query string */ + + va_start(ap, resourcef); bytes = vsnprintf(resource, sizeof(resource), resourcef, ap); va_end(ap); @@ -327,9 +330,27 @@ httpAssembleURIf(char *uri, /* I - URI buffer */ if (bytes >= sizeof(resource)) goto assemble_overflow; + /* + * Temporarily remove query string if present... + */ + + if ((query = strchr(resource, '?')) != NULL) + *query = '\0'; + ptr = http_copy_encode(ptr, resource, end, NULL); if (!ptr) goto assemble_overflow; + + if (query) + { + /* + * Copy query string without encoding... + */ + + *query = '?'; + strlcpy(ptr, query, end - ptr); + ptr += strlen(ptr); + } } else if (ptr < end) *ptr++ = '/'; @@ -398,9 +419,17 @@ httpDecode64_2(char *out, /* I - String to write to */ * Range check input... */ - if (!out || !outlen || *outlen < 1 || !in || !*in) + if (!out || !outlen || *outlen < 1 || !in) return (NULL); + if (!*in) + { + *out = '\0'; + *outlen = 0; + + return (out); + } + /* * Convert from base-64 to bytes... */ @@ -991,10 +1020,33 @@ httpSeparateURI(const char *uri, /* I - Universal Resource Identifier */ status = HTTP_URI_MISSING_RESOURCE; *resource = '/'; - uri = http_copy_decode(resource + 1, uri, resourcelen - 1, ""); + + /* + * Copy any query string without decoding it... + */ + + if (*uri == '?') + { + strlcpy(resource + 1, uri, resourcelen - 1); + uri += strlen(uri); + } + else + resource[1] = '\0'; } else - uri = http_copy_decode(resource, uri, resourcelen, ""); + { + uri = http_copy_decode(resource, uri, resourcelen, "?"); + + if (uri && *uri == '?') + { + /* + * Concatenate any query string without decoding it... + */ + + strlcat(resource, uri, resourcelen); + uri += strlen(uri); + } + } if (!uri) { @@ -1191,5 +1243,5 @@ http_copy_encode(char *dst, /* O - Destination buffer */ /* - * End of "$Id: http-support.c 4903 2006-01-10 20:02:46Z mike $". + * End of "$Id: http-support.c 4961 2006-01-20 22:19:13Z mike $". */ diff --git a/cups/http.c b/cups/http.c index 2ef480b4a..b094a5d49 100644 --- a/cups/http.c +++ b/cups/http.c @@ -1,9 +1,9 @@ /* - * "$Id: http.c 4914 2006-01-11 02:04:22Z mike $" + * "$Id: http.c 4995 2006-01-26 20:14:42Z mike $" * * HTTP routines for the Common UNIX Printing System (CUPS). * - * Copyright 1997-2005 by Easy Software Products, all rights reserved. + * Copyright 1997-2006 by Easy Software Products, all rights reserved. * * These coded instructions, statements, and computer programs are the * property of Easy Software Products and are protected by Federal @@ -379,11 +379,52 @@ void httpFlush(http_t *http) /* I - HTTP data */ { char buffer[8192]; /* Junk buffer */ + int blocking; /* To block or not to block */ DEBUG_printf(("httpFlush(http=%p), state=%d\n", http, http->state)); + /* + * Temporarily set non-blocking mode so we don't get stuck in httpRead()... + */ + + blocking = http->blocking; + http->blocking = 0; + + /* + * Read any data we can... + */ + while (httpRead(http, buffer, sizeof(buffer)) > 0); + + /* + * Restore blocking and reset the connection if we didn't get all of + * the remaining data... + */ + + http->blocking = blocking; + + if (http->state != HTTP_WAITING && http->fd >= 0) + { + /* + * Didn't get the data back, so close the current connection. + */ + + http->state = HTTP_WAITING; + +#ifdef HAVE_SSL + if (http->tls) + http_shutdown_ssl(http); +#endif /* HAVE_SSL */ + +#ifdef WIN32 + closesocket(http->fd); +#else + close(http->fd); +#endif /* WIN32 */ + + http->fd = -1; + } } @@ -829,21 +870,23 @@ httpInitialize(void) if (!initialized) WSAStartup(MAKEWORD(1,1), &winsockdata); -#elif defined(HAVE_SIGSET) - sigset(SIGPIPE, SIG_IGN); -#elif defined(HAVE_SIGACTION) - struct sigaction action; /* POSIX sigaction data */ - - +#elif !defined(SO_NOSIGPIPE) /* * Ignore SIGPIPE signals... */ +# ifdef HAVE_SIGSET + sigset(SIGPIPE, SIG_IGN); +# elif defined(HAVE_SIGACTION) + struct sigaction action; /* POSIX sigaction data */ + + memset(&action, 0, sizeof(action)); action.sa_handler = SIG_IGN; sigaction(SIGPIPE, &action, NULL); -#else +# else signal(SIGPIPE, SIG_IGN); +# endif /* !SO_NOSIGPIPE */ #endif /* WIN32 */ #ifdef HAVE_GNUTLS @@ -1166,7 +1209,7 @@ httpRead(http_t *http, /* I - HTTP data */ { ch = buffer[i + j] & 255; - if (ch < ' ' || ch == 127) + if (ch < ' ' || ch >= 127) ch = '.'; putchar(ch); @@ -1191,17 +1234,34 @@ _httpReadCDSA( void *data, /* I - Data buffer */ size_t *dataLength) /* IO - Number of bytes */ { + OSStatus result; /* Return value */ ssize_t bytes; /* Number of bytes read */ - bytes = recv((int)connection, data, *dataLength, 0); - if (bytes >= 0) + for (;;) { - *dataLength = bytes; - return (0); + bytes = recv((int)connection, data, *dataLength, 0); + + if (bytes > 0) + { + result = (bytes == *dataLength); + *dataLength = bytes; + + return (result); + } + + if (bytes == 0) + return (errSSLClosedAbort); + + if (errno == EAGAIN) + return (errSSLWouldBlock); + + if (errno == EPIPE) + return (errSSLClosedAbort); + + if (errno != EINTR) + return (errSSLInternal); } - else - return (-1); } #endif /* HAVE_SSL && HAVE_CDSASSL */ @@ -1705,17 +1765,31 @@ _httpWriteCDSA( const void *data, /* I - Data buffer */ size_t *dataLength) /* IO - Number of bytes */ { - ssize_t bytes; /* Number of write written */ + OSStatus result; /* Return value */ + ssize_t bytes; /* Number of bytes read */ - bytes = write((int)connection, data, *dataLength); - if (bytes >= 0) + for (;;) { - *dataLength = bytes; - return (0); + bytes = write((int)connection, data, *dataLength); + + if (bytes >= 0) + { + result = (bytes == *dataLength) ? 0 : errSSLWouldBlock; + *dataLength = bytes; + + return (result); + } + + if (errno == EAGAIN) + return (errSSLWouldBlock); + + if (errno == EPIPE) + return (errSSLClosedAbort); + + if (errno != EINTR) + return (errSSLInternal); } - else - return (-1); } #endif /* HAVE_SSL && HAVE_CDSASSL */ @@ -1755,20 +1829,32 @@ http_read_ssl(http_t *http, /* I - HTTP data */ return (gnutls_record_recv(((http_tls_t *)(http->tls))->session, buf, len)); # elif defined(HAVE_CDSASSL) + int result; /* Return value */ OSStatus error; /* Error info */ size_t processed; /* Number of bytes processed */ error = SSLRead((SSLContextRef)http->tls, buf, len, &processed); - if (error == 0) - return (processed); - else + switch (error) { - http->error = error; - - return (-1); + case 0 : + result = (int)processed; + break; + case errSSLClosedGraceful : + result = 0; + break; + case errSSLWouldBlock : + errno = EAGAIN; + result = -1; + break; + default : + errno = EPIPE; + result = -1; + break; } + + return (result); # endif /* HAVE_LIBSSL */ } #endif /* HAVE_SSL */ @@ -1843,7 +1929,8 @@ http_send(http_t *http, /* I - HTTP data */ */ if (http->status == HTTP_ERROR || http->status >= HTTP_BAD_REQUEST) - httpReconnect(http); + if (httpReconnect(http)) + return (-1); /* * Send the request header... @@ -2186,6 +2273,9 @@ http_wait(http_t *http, /* I - HTTP data */ DEBUG_printf(("http_wait(http=%p, msec=%d)\n", http, msec)); + if (http->fd < 0) + return (0); + /* * Check the SSL/TLS buffers for data first... */ @@ -2413,24 +2503,37 @@ http_write_ssl(http_t *http, /* I - HTTP data */ # elif defined(HAVE_GNUTLS) return (gnutls_record_send(((http_tls_t *)(http->tls))->session, buf, len)); # elif defined(HAVE_CDSASSL) + int result; /* Return value */ OSStatus error; /* Error info */ size_t processed; /* Number of bytes processed */ error = SSLWrite((SSLContextRef)http->tls, buf, len, &processed); - if (error == 0) - return (processed); - else + switch (error) { - http->error = error; - return (-1); + case 0 : + result = (int)processed; + break; + case errSSLClosedGraceful : + result = 0; + break; + case errSSLWouldBlock : + errno = EAGAIN; + result = -1; + break; + default : + errno = EPIPE; + result = -1; + break; } + + return (result); # endif /* HAVE_LIBSSL */ } #endif /* HAVE_SSL */ /* - * End of "$Id: http.c 4914 2006-01-11 02:04:22Z mike $". + * End of "$Id: http.c 4995 2006-01-26 20:14:42Z mike $". */ diff --git a/cups/http.h b/cups/http.h index 2a2e645ae..1384e6d7d 100644 --- a/cups/http.h +++ b/cups/http.h @@ -1,5 +1,5 @@ /* - * "$Id: http.h 4906 2006-01-10 20:53:28Z mike $" + * "$Id: http.h 4973 2006-01-25 02:36:02Z mike $" * * Hyper-Text Transport Protocol definitions for the Common UNIX Printing * System (CUPS). @@ -59,7 +59,7 @@ /* * With GCC 3.0 and higher, we can mark old APIs "deprecated" so you get - * an error at compile-time. + * a warning at compile-time. */ # if defined(__GNUC__) && __GNUC__ > 2 @@ -113,7 +113,7 @@ extern "C" { # define HTTP_MAX_URI 1024 /* Max length of URI string */ # define HTTP_MAX_HOST 256 /* Max length of hostname string */ -# define HTTP_MAX_BUFFER 1024 /* Max length of data buffer */ +# define HTTP_MAX_BUFFER 2048 /* Max length of data buffer */ # define HTTP_MAX_VALUE 256 /* Max header field value length */ @@ -323,8 +323,6 @@ typedef struct http_s /**** HTTP connection structure. ****/ int used; /* Number of bytes used in buffer */ char buffer[HTTP_MAX_BUFFER]; /* Buffer for incoming data */ - char wbuffer[HTTP_MAX_BUFFER]; - /* Buffer for outgoing data */ int auth_type; /* Authentication in use */ _cups_md5_state_t md5_state; /* MD5 state */ char nonce[HTTP_MAX_VALUE]; @@ -343,10 +341,12 @@ typedef struct http_s /**** HTTP connection structure. ****/ /* Username:password string @since CUPS 1.1.20@ */ int digest_tries; /* Number of tries for digest auth @since CUPS 1.1.20@ */ /**** New in CUPS 1.2 ****/ + off_t data_remaining; /* Number of bytes left @since CUPS 1.2@ */ http_addr_t *hostaddr; /* Current host address and port @since CUPS 1.2@ */ http_addrlist_t *addrlist; /* List of valid addresses @since CUPS 1.2@ */ + char wbuffer[HTTP_MAX_BUFFER]; + /* Buffer for outgoing data */ int wused; /* Write buffer bytes used @since CUPS 1.2@ */ - off_t data_remaining; /* Number of bytes left @since CUPS 1.2@ */ } http_t; @@ -469,5 +469,5 @@ extern void httpSetLength(http_t *http, size_t length); #endif /* !_CUPS_HTTP_H_ */ /* - * End of "$Id: http.h 4906 2006-01-10 20:53:28Z mike $". + * End of "$Id: http.h 4973 2006-01-25 02:36:02Z mike $". */ diff --git a/cups/i18n.h b/cups/i18n.h index 00a597f95..c2f3f474e 100644 --- a/cups/i18n.h +++ b/cups/i18n.h @@ -1,5 +1,5 @@ /* - * "$Id: i18n.h 4903 2006-01-10 20:02:46Z mike $" + * "$Id: i18n.h 4924 2006-01-13 01:55:20Z mike $" * * (Private) localization support for the Common UNIX Printing System (CUPS). * @@ -66,14 +66,12 @@ extern char *_cupsSaveLocale(int category, const char *locale); /**** New in CUPS 1.2 ****/ extern const char *_cupsEncodingName(cups_encoding_t encoding); -extern int _cupsLangPrintf(FILE *fp, cups_lang_t *lang, - const char *message, ...) +extern int _cupsLangPrintf(FILE *fp, const char *message, ...) # ifdef __GNUC__ -__attribute__ ((__format__ (__printf__, 3, 4))) +__attribute__ ((__format__ (__printf__, 2, 3))) # endif /* __GNUC__ */ ; -extern int _cupsLangPuts(FILE *fp, cups_lang_t *lang, - const char *message); +extern int _cupsLangPuts(FILE *fp, const char *message); extern const char *_cupsLangString(cups_lang_t *lang, const char *message); extern void _cupsMessageFree(cups_array_t *a); extern cups_array_t *_cupsMessageLoad(const char *filename); @@ -86,5 +84,5 @@ extern const char *_cupsMessageLookup(cups_array_t *a, const char *m); #endif /* !_CUPS_I18N_H_ */ /* - * End of "$Id: i18n.h 4903 2006-01-10 20:02:46Z mike $". + * End of "$Id: i18n.h 4924 2006-01-13 01:55:20Z mike $". */ diff --git a/cups/ipp-private.h b/cups/ipp-private.h new file mode 100644 index 000000000..37473987f --- /dev/null +++ b/cups/ipp-private.h @@ -0,0 +1,65 @@ +/* + * "$Id: ipp-private.h 4973 2006-01-25 02:36:02Z mike $" + * + * Private IPP definitions for the Common UNIX Printing System (CUPS). + * + * Copyright 1997-2006 by Easy Software Products. + * + * These coded instructions, statements, and computer programs are the + * property of Easy Software Products and are protected by Federal + * copyright law. Distribution and use rights are outlined in the file + * "LICENSE.txt" which should have been included with this file. If this + * file is missing or damaged please contact Easy Software Products + * at: + * + * Attn: CUPS Licensing Information + * Easy Software Products + * 44141 Airport View Drive, Suite 204 + * Hollywood, Maryland 20636 USA + * + * Voice: (301) 373-9600 + * EMail: cups-info@cups.org + * WWW: http://www.cups.org + * + * This file is subject to the Apple OS-Developed Software exception. + */ + +#ifndef _CUPS_IPP_PRIVATE_H_ +# define _CUPS_IPP_PRIVATE_H_ + +/* + * Include necessary headers... + */ + +# include "ipp.h" + + +/* + * C++ magic... + */ + +# ifdef __cplusplus +extern "C" { +# endif /* __cplusplus */ + + +/* + * Prototypes for private functions... + */ + +extern ipp_attribute_t *_ipp_add_attr(ipp_t *, int); +extern void _ipp_free_attr(ipp_attribute_t *); + + +/* + * C++ magic... + */ + +# ifdef __cplusplus +} +# endif /* __cplusplus */ +#endif /* !_CUPS_IPP_H_ */ + +/* + * End of "$Id: ipp-private.h 4973 2006-01-25 02:36:02Z mike $". + */ diff --git a/cups/ipp-support.c b/cups/ipp-support.c index cceda0ff1..8c1a82daa 100644 --- a/cups/ipp-support.c +++ b/cups/ipp-support.c @@ -1,5 +1,5 @@ /* - * "$Id: ipp-support.c 4785 2005-10-13 19:39:05Z mike $" + * "$Id: ipp-support.c 4987 2006-01-26 00:25:21Z mike $" * * Internet Printing Protocol support functions for the Common UNIX * Printing System (CUPS). @@ -321,12 +321,10 @@ ippPort(void) void ippSetPort(int p) /* I - Port number to use */ { - fprintf(stderr, "ippSetPort(p=%d)\n", p); - _cupsGlobals()->ipp_port = p; } /* - * End of "$Id: ipp-support.c 4785 2005-10-13 19:39:05Z mike $". + * End of "$Id: ipp-support.c 4987 2006-01-26 00:25:21Z mike $". */ diff --git a/cups/ipp.c b/cups/ipp.c index bc9045b22..fbe7e39de 100644 --- a/cups/ipp.c +++ b/cups/ipp.c @@ -1,5 +1,5 @@ /* - * "$Id: ipp.c 4922 2006-01-12 22:05:06Z mike $" + * "$Id: ipp.c 4995 2006-01-26 20:14:42Z mike $" * * Internet Printing Protocol support functions for the Common UNIX * Printing System (CUPS). @@ -1023,6 +1023,7 @@ ippReadIO(void *src, /* I - Data source */ *bufptr; /* Pointer into buffer */ ipp_attribute_t *attr; /* Current attribute */ ipp_tag_t tag; /* Current tag */ + ipp_tag_t value_tag; /* Current value tag */ ipp_value_t *value; /* Current value */ @@ -1163,14 +1164,15 @@ ippReadIO(void *src, /* I - Data source */ if (ipp->current == NULL) return (IPP_ERROR); - attr = ipp->current; + attr = ipp->current; + value_tag = (ipp_tag_t)(attr->value_tag & IPP_TAG_MASK); /* * Make sure we aren't adding a new value of a different * type... */ - if (attr->value_tag == IPP_TAG_ZERO) + if (value_tag == IPP_TAG_ZERO) { /* * Setting the value of a collection member... @@ -1178,9 +1180,9 @@ ippReadIO(void *src, /* I - Data source */ attr->value_tag = tag; } - else if (attr->value_tag == IPP_TAG_STRING || - (attr->value_tag >= IPP_TAG_TEXTLANG && - attr->value_tag <= IPP_TAG_MIMETYPE)) + else if (value_tag == IPP_TAG_STRING || + (value_tag >= IPP_TAG_TEXTLANG && + value_tag <= IPP_TAG_MIMETYPE)) { /* * String values can sometimes come across in different @@ -1191,7 +1193,7 @@ ippReadIO(void *src, /* I - Data source */ (tag < IPP_TAG_TEXTLANG || tag > IPP_TAG_MIMETYPE)) return (IPP_ERROR); } - else if (attr->value_tag != tag) + else if (value_tag != tag) return (IPP_ERROR); /* @@ -1709,6 +1711,8 @@ ippWriteIO(void *dst, /* I - Destination */ DEBUG_printf(("ippWrite: wrote group tag = %x\n", attr->group_tag)); *bufptr++ = attr->group_tag; } + else if (attr->group_tag == IPP_TAG_ZERO) + continue; /* * Write the attribute tag and name. The current implementation @@ -2402,10 +2406,10 @@ _ipp_add_attr(ipp_t *ipp, /* I - IPP message */ attr = calloc(sizeof(ipp_attribute_t) + (num_values - 1) * sizeof(ipp_value_t), 1); - attr->num_values = num_values; - if (attr != NULL) { + attr->num_values = num_values; + if (ipp->last == NULL) ipp->attrs = attr; else @@ -2466,7 +2470,7 @@ _ipp_free_attr(ipp_attribute_t *attr) /* I - Attribute to free */ break; /* anti-compiler-warning-code */ } - if (attr->name != NULL) + if (attr->name) free(attr->name); free(attr); @@ -2759,5 +2763,5 @@ ipp_write_file(int *fd, /* I - File descriptor */ /* - * End of "$Id: ipp.c 4922 2006-01-12 22:05:06Z mike $". + * End of "$Id: ipp.c 4995 2006-01-26 20:14:42Z mike $". */ diff --git a/cups/ipp.h b/cups/ipp.h index 24b64a1de..f011a35e4 100644 --- a/cups/ipp.h +++ b/cups/ipp.h @@ -1,5 +1,5 @@ /* - * "$Id: ipp.h 4922 2006-01-12 22:05:06Z mike $" + * "$Id: ipp.h 4995 2006-01-26 20:14:42Z mike $" * * Internet Printing Protocol definitions for the Common UNIX Printing * System (CUPS). @@ -72,7 +72,7 @@ extern "C" { * Types and structures... */ -typedef enum /**** Format tags for attribute formats... ****/ +typedef enum /**** Format tags for attribute formats... ****/ { IPP_TAG_ZERO = 0x00, IPP_TAG_OPERATION, @@ -109,17 +109,17 @@ typedef enum /**** Format tags for attribute formats... ****/ IPP_TAG_LANGUAGE, IPP_TAG_MIMETYPE, IPP_TAG_MEMBERNAME, - IPP_TAG_MASK = 0x7fffffff, /* Mask for copied attribute values */ - IPP_TAG_COPY = -0x7fffffff-1 /* Bitflag for copied attribute values */ + IPP_TAG_MASK = 0x7fffffff, /* Mask for copied attribute values */ + IPP_TAG_COPY = -0x7fffffff-1 /* Bitflag for copied attribute values */ } ipp_tag_t; -typedef enum /**** Resolution units... ****/ +typedef enum /**** Resolution units... ****/ { IPP_RES_PER_INCH = 3, IPP_RES_PER_CM } ipp_res_t; -typedef enum /**** Finishings... ****/ +typedef enum /**** Finishings... ****/ { IPP_FINISHINGS_NONE = 3, IPP_FINISHINGS_STAPLE, @@ -151,22 +151,22 @@ typedef enum /**** Finishings... ****/ IPP_FINISHINGS_BIND_BOTTOM } ipp_finish_t; -typedef enum /**** Orientation... ****/ +typedef enum /**** Orientation... ****/ { - IPP_PORTRAIT = 3, /* No rotation */ - IPP_LANDSCAPE, /* 90 degrees counter-clockwise */ - IPP_REVERSE_LANDSCAPE, /* 90 degrees clockwise */ - IPP_REVERSE_PORTRAIT /* 180 degrees */ + IPP_PORTRAIT = 3, /* No rotation */ + IPP_LANDSCAPE, /* 90 degrees counter-clockwise */ + IPP_REVERSE_LANDSCAPE, /* 90 degrees clockwise */ + IPP_REVERSE_PORTRAIT /* 180 degrees */ } ipp_orient_t; -typedef enum /**** Qualities... ****/ +typedef enum /**** Qualities... ****/ { IPP_QUALITY_DRAFT = 3, IPP_QUALITY_NORMAL, IPP_QUALITY_HIGH } ipp_quality_t; -typedef enum /**** Job States.... */ +typedef enum /**** Job States.... */ { IPP_JOB_PENDING = 3, IPP_JOB_HELD, @@ -177,23 +177,23 @@ typedef enum /**** Job States.... */ IPP_JOB_COMPLETED } ipp_jstate_t; -typedef enum /**** Printer States.... */ +typedef enum /**** Printer States.... */ { IPP_PRINTER_IDLE = 3, IPP_PRINTER_PROCESSING, IPP_PRINTER_STOPPED } ipp_pstate_t; -typedef enum /**** IPP states... ****/ +typedef enum /**** IPP states... ****/ { - IPP_ERROR = -1, /* An error occurred */ - IPP_IDLE, /* Nothing is happening/request completed */ - IPP_HEADER, /* The request header needs to be sent/received */ - IPP_ATTRIBUTE, /* One or more attributes need to be sent/received */ - IPP_DATA /* IPP request data needs to be sent/received */ + IPP_ERROR = -1, /* An error occurred */ + IPP_IDLE, /* Nothing is happening/request completed */ + IPP_HEADER, /* The request header needs to be sent/received */ + IPP_ATTRIBUTE, /* One or more attributes need to be sent/received */ + IPP_DATA /* IPP request data needs to be sent/received */ } ipp_state_t; -typedef enum /**** IPP operations... ****/ +typedef enum /**** IPP operations... ****/ { IPP_PRINT_JOB = 0x0002, IPP_PRINT_URI, @@ -242,10 +242,10 @@ typedef enum /**** IPP operations... ****/ IPP_PRIVATE = 0x4000, CUPS_GET_DEFAULT, CUPS_GET_PRINTERS, - CUPS_ADD_PRINTER, + CUPS_ADD_MODIFY_PRINTER, CUPS_DELETE_PRINTER, CUPS_GET_CLASSES, - CUPS_ADD_CLASS, + CUPS_ADD_MODIFY_CLASS, CUPS_DELETE_CLASS, CUPS_ACCEPT_JOBS, CUPS_REJECT_JOBS, @@ -256,7 +256,11 @@ typedef enum /**** IPP operations... ****/ CUPS_AUTHENTICATE_JOB } ipp_op_t; -typedef enum /**** IPP status codes... ****/ +/* Old names for the operations */ +#define CUPS_ADD_PRINTER CUPS_ADD_MODIFY_PRINTER +#define CUPS_ADD_CLASS CUPS_ADD_MODIFY_CLASS + +typedef enum /**** IPP status codes... ****/ { IPP_OK = 0x0000, IPP_OK_SUBST, @@ -304,105 +308,105 @@ typedef enum /**** IPP status codes... ****/ IPP_PRINTER_IS_DEACTIVATED } ipp_status_t; -typedef unsigned char ipp_uchar_t;/**** Unsigned 8-bit integer/character ****/ +typedef unsigned char ipp_uchar_t; /**** Unsigned 8-bit integer/character ****/ /**** New in CUPS 1.1.19 ****/ typedef int (*ipp_iocb_t)(void *, ipp_uchar_t *, int); - /**** IPP IO Callback Function ****/ + /**** IPP IO Callback Function ****/ -typedef union /**** Request Header ****/ +typedef union /**** Request Header ****/ { - struct /* Any Header */ + struct /* Any Header */ { - ipp_uchar_t version[2]; /* Protocol version number */ - int op_status; /* Operation ID or status code*/ - int request_id; /* Request ID */ + ipp_uchar_t version[2]; /* Protocol version number */ + int op_status; /* Operation ID or status code*/ + int request_id; /* Request ID */ } any; - struct /* Operation Header */ + struct /* Operation Header */ { - ipp_uchar_t version[2]; /* Protocol version number */ - ipp_op_t operation_id; /* Operation ID */ - int request_id; /* Request ID */ + ipp_uchar_t version[2]; /* Protocol version number */ + ipp_op_t operation_id; /* Operation ID */ + int request_id; /* Request ID */ } op; - struct /* Status Header */ + struct /* Status Header */ { - ipp_uchar_t version[2]; /* Protocol version number */ - ipp_status_t status_code; /* Status code */ - int request_id; /* Request ID */ + ipp_uchar_t version[2]; /* Protocol version number */ + ipp_status_t status_code; /* Status code */ + int request_id; /* Request ID */ } status; /**** New in CUPS 1.1.19 ****/ - struct /* Event Header */ + struct /* Event Header */ { - ipp_uchar_t version[2]; /* Protocol version number */ - ipp_status_t status_code; /* Status code */ - int request_id; /* Request ID */ + ipp_uchar_t version[2]; /* Protocol version number */ + ipp_status_t status_code; /* Status code */ + int request_id; /* Request ID */ } event; } ipp_request_t; /**** New in CUPS 1.1.19 ****/ typedef struct ipp_str ipp_t; -typedef union /**** Attribute Value ****/ +typedef union /**** Attribute Value ****/ { - int integer; /* Integer/enumerated value */ + int integer; /* Integer/enumerated value */ - char boolean; /* Boolean value */ + char boolean; /* Boolean value */ - ipp_uchar_t date[11]; /* Date/time value */ + ipp_uchar_t date[11]; /* Date/time value */ struct { - int xres, /* Horizontal resolution */ - yres; /* Vertical resolution */ - ipp_res_t units; /* Resolution units */ - } resolution; /* Resolution value */ + int xres, /* Horizontal resolution */ + yres; /* Vertical resolution */ + ipp_res_t units; /* Resolution units */ + } resolution; /* Resolution value */ struct { - int lower, /* Lower value */ - upper; /* Upper value */ - } range; /* Range of integers value */ + int lower, /* Lower value */ + upper; /* Upper value */ + } range; /* Range of integers value */ struct { - char *charset; /* Character set */ - char *text; /* String */ - } string; /* String with language value */ + char *charset; /* Character set */ + char *text; /* String */ + } string; /* String with language value */ struct { - int length; /* Length of attribute */ - void *data; /* Data in attribute */ - } unknown; /* Unknown attribute type */ + int length; /* Length of attribute */ + void *data; /* Data in attribute */ + } unknown; /* Unknown attribute type */ /**** New in CUPS 1.1.19 ****/ - ipp_t *collection; /* Collection value */ + ipp_t *collection; /* Collection value */ } ipp_value_t; -typedef struct ipp_attribute_s /**** Attribute ****/ +typedef struct ipp_attribute_s /**** Attribute ****/ { - struct ipp_attribute_s *next; /* Next attribute in list */ - ipp_tag_t group_tag, /* Job/Printer/Operation group tag */ - value_tag; /* What type of value is it? */ - char *name; /* Name of attribute */ - int num_values; /* Number of values */ - ipp_value_t values[1]; /* Values */ + struct ipp_attribute_s *next; /* Next attribute in list */ + ipp_tag_t group_tag, /* Job/Printer/Operation group tag */ + value_tag; /* What type of value is it? */ + char *name; /* Name of attribute */ + int num_values; /* Number of values */ + ipp_value_t values[1]; /* Values */ } ipp_attribute_t; -struct ipp_str /**** IPP Request/Response/Notification ****/ +struct ipp_str /**** IPP Request/Response/Notification ****/ { - ipp_state_t state; /* State of request */ - ipp_request_t request; /* Request header */ - ipp_attribute_t *attrs, /* Attributes */ - *last, /* Last attribute in list */ - *current; /* Current attribute (for read/write) */ - ipp_tag_t curtag; /* Current attribute group tag */ + ipp_state_t state; /* State of request */ + ipp_request_t request; /* Request header */ + ipp_attribute_t *attrs, /* Attributes */ + *last, /* Last attribute in list */ + *current; /* Current attribute (for read/write) */ + ipp_tag_t curtag; /* Current attribute group tag */ /**** New in CUPS 1.2 ****/ - ipp_attribute_t *prev; /* Previous attribute (for read) */ + ipp_attribute_t *prev; /* Previous attribute (for read) */ }; @@ -410,18 +414,39 @@ struct ipp_str /**** IPP Request/Response/Notification ****/ * Prototypes... */ -extern ipp_attribute_t *ippAddBoolean(ipp_t *ipp, ipp_tag_t group, const char *name, char value); -extern ipp_attribute_t *ippAddBooleans(ipp_t *ipp, ipp_tag_t group, const char *name, int num_values, const char *values); -extern ipp_attribute_t *ippAddDate(ipp_t *ipp, ipp_tag_t group, const char *name, const ipp_uchar_t *value); -extern ipp_attribute_t *ippAddInteger(ipp_t *ipp, ipp_tag_t group, ipp_tag_t type, const char *name, int value); -extern ipp_attribute_t *ippAddIntegers(ipp_t *ipp, ipp_tag_t group, ipp_tag_t type, const char *name, int num_values, const int *values); -extern ipp_attribute_t *ippAddRange(ipp_t *ipp, ipp_tag_t group, const char *name, int lower, int upper); -extern ipp_attribute_t *ippAddRanges(ipp_t *ipp, ipp_tag_t group, const char *name, int num_values, const int *lower, const int *upper); -extern ipp_attribute_t *ippAddResolution(ipp_t *ipp, ipp_tag_t group, const char *name, ipp_res_t units, int xres, int yres); -extern ipp_attribute_t *ippAddResolutions(ipp_t *ipp, ipp_tag_t group, const char *name, int num_values, ipp_res_t units, const int *xres, const int *yres); +extern ipp_attribute_t *ippAddBoolean(ipp_t *ipp, ipp_tag_t group, + const char *name, char value); +extern ipp_attribute_t *ippAddBooleans(ipp_t *ipp, ipp_tag_t group, + const char *name, int num_values, + const char *values); +extern ipp_attribute_t *ippAddDate(ipp_t *ipp, ipp_tag_t group, + const char *name, const ipp_uchar_t *value); +extern ipp_attribute_t *ippAddInteger(ipp_t *ipp, ipp_tag_t group, + ipp_tag_t type, const char *name, + int value); +extern ipp_attribute_t *ippAddIntegers(ipp_t *ipp, ipp_tag_t group, + ipp_tag_t type, const char *name, + int num_values, const int *values); +extern ipp_attribute_t *ippAddRange(ipp_t *ipp, ipp_tag_t group, + const char *name, int lower, int upper); +extern ipp_attribute_t *ippAddRanges(ipp_t *ipp, ipp_tag_t group, + const char *name, int num_values, + const int *lower, const int *upper); +extern ipp_attribute_t *ippAddResolution(ipp_t *ipp, ipp_tag_t group, + const char *name, ipp_res_t units, + int xres, int yres); +extern ipp_attribute_t *ippAddResolutions(ipp_t *ipp, ipp_tag_t group, + const char *name, int num_values, + ipp_res_t units, const int *xres, + const int *yres); extern ipp_attribute_t *ippAddSeparator(ipp_t *ipp); -extern ipp_attribute_t *ippAddString(ipp_t *ipp, ipp_tag_t group, ipp_tag_t type, const char *name, const char *charset, const char *value); -extern ipp_attribute_t *ippAddStrings(ipp_t *ipp, ipp_tag_t group, ipp_tag_t type, const char *name, int num_values, const char *charset, const char * const *values); +extern ipp_attribute_t *ippAddString(ipp_t *ipp, ipp_tag_t group, + ipp_tag_t type, const char *name, + const char *charset, const char *value); +extern ipp_attribute_t *ippAddStrings(ipp_t *ipp, ipp_tag_t group, + ipp_tag_t type, const char *name, + int num_values, const char *charset, + const char * const *values); extern time_t ippDateToTime(const ipp_uchar_t *date); extern void ippDelete(ipp_t *ipp); extern const char *ippErrorString(ipp_status_t error); @@ -438,13 +463,18 @@ extern int ippPort(void); extern void ippSetPort(int p); /**** New in CUPS 1.1.19 ****/ -extern ipp_attribute_t *ippAddCollection(ipp_t *ipp, ipp_tag_t group, const char *name, ipp_t *value); -extern ipp_attribute_t *ippAddCollections(ipp_t *ipp, ipp_tag_t group, const char *name, int num_values, const ipp_t **values); +extern ipp_attribute_t *ippAddCollection(ipp_t *ipp, ipp_tag_t group, + const char *name, ipp_t *value); +extern ipp_attribute_t *ippAddCollections(ipp_t *ipp, ipp_tag_t group, + const char *name, int num_values, + const ipp_t **values); extern void ippDeleteAttribute(ipp_t *ipp, ipp_attribute_t *attr); extern ipp_state_t ippReadFile(int fd, ipp_t *ipp); -extern ipp_state_t ippReadIO(void *src, ipp_iocb_t cb, int blocking, ipp_t *parent, ipp_t *ipp); +extern ipp_state_t ippReadIO(void *src, ipp_iocb_t cb, int blocking, + ipp_t *parent, ipp_t *ipp); extern ipp_state_t ippWriteFile(int fd, ipp_t *ipp); -extern ipp_state_t ippWriteIO(void *dst, ipp_iocb_t cb, int blocking, ipp_t *parent, ipp_t *ipp); +extern ipp_state_t ippWriteIO(void *dst, ipp_iocb_t cb, int blocking, + ipp_t *parent, ipp_t *ipp); /**** New in CUPS 1.2 ****/ extern ipp_attribute_t *ippAddOctetString(ipp_t *ipp, ipp_tag_t group, @@ -455,13 +485,6 @@ extern ipp_t *ippNewRequest(ipp_op_t op); extern const char *ippOpString(ipp_op_t op); extern ipp_op_t ippOpValue(const char *name); -/* - * "Private" functions used internally by CUPS... - */ - -extern ipp_attribute_t *_ipp_add_attr(ipp_t *, int); -extern void _ipp_free_attr(ipp_attribute_t *); - /* * C++ magic... @@ -473,5 +496,5 @@ extern void _ipp_free_attr(ipp_attribute_t *); #endif /* !_CUPS_IPP_H_ */ /* - * End of "$Id: ipp.h 4922 2006-01-12 22:05:06Z mike $". + * End of "$Id: ipp.h 4995 2006-01-26 20:14:42Z mike $". */ diff --git a/cups/langprintf.c b/cups/langprintf.c index 5f0b40b84..4430c6792 100644 --- a/cups/langprintf.c +++ b/cups/langprintf.c @@ -1,10 +1,10 @@ /* - * "$Id: langprintf.c 4898 2006-01-08 23:13:20Z mike $" + * "$Id: langprintf.c 4924 2006-01-13 01:55:20Z mike $" * * Localized printf/puts functions for the Common UNIX Printing * System (CUPS). * - * Copyright 2002 by Easy Software Products. + * Copyright 2002-2006 by Easy Software Products. * * These coded instructions, statements, and computer programs are the * property of Easy Software Products and are protected by Federal @@ -35,9 +35,7 @@ */ #include <stdio.h> -#include "string.h" -#include "i18n.h" -#include "transcode.h" +#include "globals.h" /* @@ -46,7 +44,6 @@ int /* O - Number of bytes written */ _cupsLangPrintf(FILE *fp, /* I - File to write to */ - cups_lang_t *language, /* I - Language to use */ const char *message, /* I - Message string to use */ ...) /* I - Additional arguments as needed */ { @@ -54,6 +51,7 @@ _cupsLangPrintf(FILE *fp, /* I - File to write to */ char buffer[2048], /* Message buffer */ output[8192]; /* Output buffer */ va_list ap; /* Pointer to additional arguments */ + _cups_globals_t *cg; /* Global data */ /* @@ -63,8 +61,10 @@ _cupsLangPrintf(FILE *fp, /* I - File to write to */ if (!fp || !message) return (-1); - if (!language) - language = cupsLangDefault(); + cg = _cupsGlobals(); + + if (!cg->lang_default) + cg->lang_default = cupsLangDefault(); /* * Format the string... @@ -72,7 +72,7 @@ _cupsLangPrintf(FILE *fp, /* I - File to write to */ va_start(ap, message); bytes = vsnprintf(buffer, sizeof(buffer), - _cupsLangString(language, message), ap); + _cupsLangString(cg->lang_default, message), ap); va_end(ap); /* @@ -80,7 +80,7 @@ _cupsLangPrintf(FILE *fp, /* I - File to write to */ */ bytes = cupsUTF8ToCharset(output, (cups_utf8_t *)buffer, sizeof(output), - language->encoding); + cg->lang_default->encoding); /* * Write the string and return the number of bytes written... @@ -99,11 +99,11 @@ _cupsLangPrintf(FILE *fp, /* I - File to write to */ int /* O - Number of bytes written */ _cupsLangPuts(FILE *fp, /* I - File to write to */ - cups_lang_t *language, /* I - Language to use */ const char *message) /* I - Message string to use */ { int bytes; /* Number of bytes formatted */ char output[2048]; /* Message buffer */ + _cups_globals_t *cg; /* Global data */ /* @@ -113,16 +113,19 @@ _cupsLangPuts(FILE *fp, /* I - File to write to */ if (!fp || !message) return (-1); - if (!language) - language = cupsLangDefault(); + cg = _cupsGlobals(); + + if (!cg->lang_default) + cg->lang_default = cupsLangDefault(); /* * Transcode to the destination charset... */ bytes = cupsUTF8ToCharset(output, - (cups_utf8_t *)_cupsLangString(language, message), - sizeof(output), language->encoding); + (cups_utf8_t *)_cupsLangString(cg->lang_default, + message), + sizeof(output), cg->lang_default->encoding); /* * Write the string and return the number of bytes written... @@ -136,5 +139,5 @@ _cupsLangPuts(FILE *fp, /* I - File to write to */ /* - * End of "$Id: langprintf.c 4898 2006-01-08 23:13:20Z mike $". + * End of "$Id: langprintf.c 4924 2006-01-13 01:55:20Z mike $". */ diff --git a/cups/language.c b/cups/language.c index aa263878e..3f8f2a8f9 100644 --- a/cups/language.c +++ b/cups/language.c @@ -1,5 +1,5 @@ /* - * "$Id: language.c 4922 2006-01-12 22:05:06Z mike $" + * "$Id: language.c 4985 2006-01-25 21:57:18Z mike $" * * I18N/language support for the Common UNIX Printing System (CUPS). * @@ -31,6 +31,7 @@ * cupsLangEncoding() - Return the character encoding (us-ascii, etc.) * for the given language. * cupsLangFlush() - Flush all language data out of the cache. + * _cupsLangFlush() - Flush all language data out of the cache. * cupsLangFree() - Free language data. * cupsLangGet() - Get a language. * _cupsLangString() - Get a message string. @@ -60,6 +61,9 @@ #else # include <unistd.h> #endif /* WIN32 */ +#ifdef HAVE_COREFOUNDATION_H +# include <CoreFoundation/CoreFoundation.h> +#endif /* HAVE_COREFOUNDATION_H */ /* @@ -67,7 +71,6 @@ */ #ifdef __APPLE__ -# include <CoreFoundation/CoreFoundation.h> static const char *appleLangDefault(void); #endif /* __APPLE__ */ static cups_lang_t *cups_cache_lookup(const char *name, @@ -202,9 +205,19 @@ cupsLangEncoding(cups_lang_t *lang) /* I - Language data */ void cupsLangFlush(void) { + _cupsLangFlush(_cupsGlobals()); +} + + +/* + * '_cupsLangFlush()' - Flush all language data out of the cache. + */ + +void +_cupsLangFlush(_cups_globals_t *cg) /* I - Global data */ +{ cups_lang_t *lang, /* Current language */ *next; /* Next language */ - _cups_globals_t *cg = _cupsGlobals(); /* Pointer to library globals */ /* @@ -1236,5 +1249,5 @@ cups_unquote(char *d, /* O - Unquoted string */ /* - * End of "$Id: language.c 4922 2006-01-12 22:05:06Z mike $". + * End of "$Id: language.c 4985 2006-01-25 21:57:18Z mike $". */ diff --git a/cups/localize.c b/cups/localize.c new file mode 100644 index 000000000..97662b7be --- /dev/null +++ b/cups/localize.c @@ -0,0 +1,187 @@ +/* + * "$Id: localize.c 4937 2006-01-17 04:03:22Z mike $" + * + * PPD custom option routines for the Common UNIX Printing System (CUPS). + * + * Copyright 1997-2006 by Easy Software Products, all rights reserved. + * + * These coded instructions, statements, and computer programs are the + * property of Easy Software Products and are protected by Federal + * copyright law. Distribution and use rights are outlined in the file + * "LICENSE.txt" which should have been included with this file. If this + * file is missing or damaged please contact Easy Software Products + * at: + * + * Attn: CUPS Licensing Information + * Easy Software Products + * 44141 Airport View Drive, Suite 204 + * Hollywood, Maryland 20636 USA + * + * Voice: (301) 373-9600 + * EMail: cups-info@cups.org + * WWW: http://www.cups.org + * + * PostScript is a trademark of Adobe Systems, Inc. + * + * This code and any derivative of it may be used and distributed + * freely under the terms of the GNU General Public License when + * used with GNU Ghostscript or its derivatives. Use of the code + * (or any derivative of it) with software other than GNU + * GhostScript (or its derivatives) is governed by the CUPS license + * agreement. + * + * This file is subject to the Apple OS-Developed Software exception. + * + * Contents: + * + * ppdLocalize() - Localize the PPD file to the current locale. + */ + +/* + * Include necessary headers. + */ + +#include "globals.h" +#include "debug.h" + + +/* + * Local functions... + */ + +static const char *ppd_text(ppd_file_t *ppd, const char *keyword, + const char *spec, const char *ll_CC, + const char *ll); + + +/* + * 'ppdLocalize()' - Localize the PPD file to the current locale. + */ + +int /* O - 0 on success, -1 on error */ +ppdLocalize(ppd_file_t *ppd) /* I - PPD file */ +{ + int i, j, k; /* Looping vars */ + ppd_group_t *group; /* Current group */ + ppd_option_t *option; /* Current option */ + ppd_choice_t *choice; /* Current choice */ + ppd_coption_t *coption; /* Current custom option */ + ppd_cparam_t *cparam; /* Current custom parameter */ + cups_lang_t *lang; /* Current language */ + char ckeyword[PPD_MAX_NAME], /* Custom keyword */ + ll_CC[6], /* Language + country locale */ + ll[3]; /* Language locale */ + const char *text; /* Localized text */ + + + /* + * Range check input... + */ + + if (!ppd) + return (-1); + + /* + * Get the default language... + */ + + if ((lang = cupsLangDefault()) == NULL) + return (-1); + + strlcpy(ll_CC, lang->language, sizeof(ll_CC)); + strlcpy(ll, lang->language, sizeof(ll)); + + /* + * Now lookup all of the groups, options, choices, etc. + */ + + for (i = ppd->num_groups, group = ppd->groups; i > 0; i --, group ++) + { + if ((text = ppd_text(ppd, "Translation", group->name, ll_CC, ll)) != NULL) + strlcpy(group->text, text, sizeof(group->text)); + + for (j = group->num_options, option = group->options; j > 0; j --, option ++) + { + if ((text = ppd_text(ppd, "Translation", option->keyword, ll_CC, + ll)) != NULL) + strlcpy(option->text, text, sizeof(option->text)); + + for (k = option->num_choices, choice = option->choices; + k > 0; + k --, choice ++) + { + if (strcmp(choice->choice, "Custom")) + text = ppd_text(ppd, option->keyword, choice->choice, ll_CC, ll); + else + { + snprintf(ckeyword, sizeof(ckeyword), "Custom%s", option->keyword); + + text = ppd_text(ppd, ckeyword, "True", ll_CC, ll); + } + + if (text) + strlcpy(choice->text, text, sizeof(choice->text)); + } + } + } + + /* + * Translate any custom parameters... + */ + + for (coption = (ppd_coption_t *)cupsArrayFirst(ppd->coptions); + coption; + coption = (ppd_coption_t *)cupsArrayNext(ppd->coptions)) + { + for (cparam = (ppd_cparam_t *)cupsArrayFirst(coption->params); + cparam; + cparam = (ppd_cparam_t *)cupsArrayNext(coption->params)) + { + snprintf(ckeyword, sizeof(ckeyword), "ParamCustom%s", coption->keyword); + + if ((text = ppd_text(ppd, ckeyword, cparam->name, ll_CC, ll)) != NULL) + strlcpy(cparam->text, text, sizeof(cparam->text)); + } + } + + return (0); +} + + +/* + * 'ppd_text()' - Find the localized text as needed... + */ + +static const char * /* O - Localized text or NULL */ +ppd_text(ppd_file_t *ppd, /* I - PPD file */ + const char *keyword, /* I - Main keyword */ + const char *spec, /* I - Option keyword */ + const char *ll_CC, /* I - Language + country locale */ + const char *ll) /* I - Language locale */ +{ + char lkeyword[PPD_MAX_NAME]; /* Localization keyword */ + ppd_attr_t *attr; /* Current attribute */ + + + /* + * Look for Keyword.ll_CC, then Keyword.ll... + */ + + snprintf(lkeyword, sizeof(lkeyword), "%s.%s", keyword, ll_CC); + if ((attr = ppdFindAttr(ppd, lkeyword, spec)) == NULL) + { + snprintf(lkeyword, sizeof(lkeyword), "%s.%s", keyword, ll); + attr = ppdFindAttr(ppd, lkeyword, spec); + } + + /* + * Return text if we find it... + */ + + return (attr ? attr->text : NULL); +} + + +/* + * End of "$Id: localize.c 4937 2006-01-17 04:03:22Z mike $". + */ diff --git a/cups/mark.c b/cups/mark.c index cbeb54ff1..33202bda9 100644 --- a/cups/mark.c +++ b/cups/mark.c @@ -1,5 +1,5 @@ /* - * "$Id: mark.c 4494 2005-02-18 02:18:11Z mike $" + * "$Id: mark.c 4980 2006-01-25 19:57:45Z mike $" * * Option marking routines for the Common UNIX Printing System (CUPS). * @@ -239,28 +239,23 @@ ppd_option_t * /* O - Pointer to option or NULL */ ppdFindOption(ppd_file_t *ppd, /* I - PPD file data */ const char *option) /* I - Option/Keyword name */ { - int i, j, k; /* Looping vars */ - ppd_option_t *o; /* Pointer to option */ - ppd_group_t *g, /* Pointer to group */ - *sg; /* Pointer to subgroup */ + ppd_option_t key; /* Option search key */ + + /* + * Range check input... + */ - if (ppd == NULL || option == NULL) + if (!ppd || !option) return (NULL); - for (i = ppd->num_groups, g = ppd->groups; i > 0; i --, g ++) - { - for (j = g->num_options, o = g->options; j > 0; j --, o ++) - if (strcasecmp(o->keyword, option) == 0) - return (o); + /* + * Search... + */ - for (j = g->num_subgroups, sg = g->subgroups; j > 0; j --, sg ++) - for (k = sg->num_options, o = sg->options; k > 0; k --, o ++) - if (strcasecmp(o->keyword, option) == 0) - return (o); - } + strlcpy(key.keyword, option, sizeof(key.keyword)); - return (NULL); + return ((ppd_option_t *)cupsArrayFind(ppd->options, &key)); } @@ -323,92 +318,203 @@ ppdMarkOption(ppd_file_t *ppd, /* I - PPD file record */ const char *option, /* I - Keyword */ const char *choice) /* I - Option name */ { - int i; /* Looping var */ - ppd_option_t *o; /* Option pointer */ - ppd_choice_t *c; /* Choice pointer */ + int i, j; /* Looping vars */ + ppd_option_t *o; /* Option pointer */ + ppd_choice_t *c; /* Choice pointer */ - if (ppd == NULL) + /* + * Range check input... + */ + + if (!ppd || !option || !choice) return (0); - if (strcasecmp(option, "PageSize") == 0 && strncasecmp(choice, "Custom.", 7) == 0) - { - /* - * Handle variable page sizes... - */ + /* + * AP_D_InputSlot is the "default input slot" on MacOS X, and setting + * it clears the regular InputSlot choices... + */ - ppdPageSize(ppd, choice); - choice = "Custom"; + if (!strcasecmp(option, "AP_D_InputSlot")) + { + if ((o = ppdFindOption(ppd, "InputSlot")) != NULL) + for (i = 0; i < o->num_choices; i ++) + o->choices[i].marked = 0; } + /* + * Check for custom options... + */ + if ((o = ppdFindOption(ppd, option)) == NULL) return (0); - for (i = o->num_choices, c = o->choices; i > 0; i --, c ++) - if (strcasecmp(c->choice, choice) == 0) - break; - if (i) + if (!strncasecmp(choice, "Custom.", 7) /* TODO || strchr(choice, '=') */ ) { /* - * Option found; mark it and then handle unmarking any other options. + * Handle a custom option... */ - c->marked = 1; + if ((c = ppdFindChoice(o, "Custom")) == NULL) + return (0); - if (o->ui != PPD_UI_PICKMANY) - for (i = o->num_choices, c = o->choices; i > 0; i --, c ++) - if (strcasecmp(c->choice, choice) != 0) - c->marked = 0; + if (!strcasecmp(option, "PageSize")) + { + /* + * Handle custom page sizes... + */ - if (strcasecmp(option, "PageSize") == 0 || strcasecmp(option, "PageRegion") == 0) + ppdPageSize(ppd, choice); + } + else { /* - * Mark current page size... + * Handle other custom options... */ - for (i = 0; i < ppd->num_sizes; i ++) - ppd->sizes[i].marked = strcasecmp(ppd->sizes[i].name, choice) == 0; + ppd_coption_t *coption; /* Custom option */ + ppd_cparam_t *cparam; /* Custom parameter */ + char units[33]; /* Custom points units */ + /* - * Unmark the current PageSize or PageRegion setting, as appropriate... + * TODO: Detect and support custom option values using the + * collection format "{Name1=foo Name2=bar}". For now, just + * support Custom.value for single-valued custom options. */ - if (strcasecmp(option, "PageSize") == 0) + if ((coption = ppdFindCustomOption(ppd, option)) != NULL) { - if ((o = ppdFindOption(ppd, "PageRegion")) != NULL) - for (i = 0; i < o->num_choices; i ++) - o->choices[i].marked = 0; - } - else - { - if ((o = ppdFindOption(ppd, "PageSize")) != NULL) - for (i = 0; i < o->num_choices; i ++) - o->choices[i].marked = 0; + if ((cparam = (ppd_cparam_t *)cupsArrayFirst(coption->params)) == NULL) + return (0); + + switch (cparam->type) + { + case PPD_CUSTOM_CURVE : + case PPD_CUSTOM_INVCURVE : + case PPD_CUSTOM_REAL : + cparam->current.custom_real = atof(choice + 7); + break; + + case PPD_CUSTOM_POINTS : + if (sscanf(choice + 7, "%f%s", &(cparam->current.custom_points), + units) < 2) + strcpy(units, "pt"); + + if (!strcasecmp(units, "cm")) + cparam->current.custom_points *= 72.0 / 2.54; + else if (!strcasecmp(units, "mm")) + cparam->current.custom_points *= 72.0 / 25.4; + else if (!strcasecmp(units, "m")) + cparam->current.custom_points *= 72.0 / 0.0254; + else if (!strcasecmp(units, "in")) + cparam->current.custom_points *= 72.0; + else if (!strcasecmp(units, "ft")) + cparam->current.custom_points *= 12 * 72.0; + break; + + case PPD_CUSTOM_INT : + cparam->current.custom_int = atoi(choice + 7); + break; + + case PPD_CUSTOM_PASSCODE : + case PPD_CUSTOM_PASSWORD : + case PPD_CUSTOM_STRING : + if (cparam->current.custom_string) + free(cparam->current.custom_string); + + cparam->current.custom_string = strdup(choice + 7); + break; + } } } - else if (strcasecmp(option, "InputSlot") == 0) - { - /* - * Unmark ManualFeed option... - */ + } + else + { + for (i = o->num_choices, c = o->choices; i > 0; i --, c ++) + if (!strcasecmp(c->choice, choice)) + break; - if ((o = ppdFindOption(ppd, "ManualFeed")) != NULL) - for (i = 0; i < o->num_choices; i ++) - o->choices[i].marked = 0; - } - else if (strcasecmp(option, "ManualFeed") == 0) - { - /* - * Unmark InputSlot option... - */ + if (!i) + return (0); + } - if ((o = ppdFindOption(ppd, "InputSlot")) != NULL) - for (i = 0; i < o->num_choices; i ++) - o->choices[i].marked = 0; - } + /* + * Option found; mark it and then handle unmarking any other options. + */ + + c->marked = 1; + + if (o->ui != PPD_UI_PICKMANY) + { + /* + * Unmark all other choices... + */ + + for (i = o->num_choices, c = o->choices; i > 0; i --, c ++) + if (strcasecmp(c->choice, choice)) + { + c->marked = 0; + + if (!strcasecmp(option, "PageSize") || + !strcasecmp(option, "PageRegion")) + { + /* + * Mark current page size... + */ + + for (j = 0; j < ppd->num_sizes; j ++) + ppd->sizes[i].marked = !strcasecmp(ppd->sizes[i].name, + choice); + + /* + * Unmark the current PageSize or PageRegion setting, as + * appropriate... + */ + + if (!strcasecmp(option, "PageSize")) + { + if ((o = ppdFindOption(ppd, "PageRegion")) != NULL) + for (j = 0; j < o->num_choices; j ++) + o->choices[i].marked = 0; + } + else + { + if ((o = ppdFindOption(ppd, "PageSize")) != NULL) + for (j = 0; j < o->num_choices; j ++) + o->choices[j].marked = 0; + } + } + else if (!strcasecmp(option, "InputSlot")) + { + /* + * Unmark ManualFeed True and possibly mark ManualFeed False + * option... + */ + + if ((o = ppdFindOption(ppd, "ManualFeed")) != NULL) + for (j = 0; j < o->num_choices; j ++) + o->choices[j].marked = !strcasecmp(o->choices[j].choice, "False"); + } + else if (!strcasecmp(option, "ManualFeed") && + !strcasecmp(choice, "True")) + { + /* + * Unmark InputSlot option... + */ + + if ((o = ppdFindOption(ppd, "InputSlot")) != NULL) + for (j = 0; j < o->num_choices; j ++) + o->choices[j].marked = 0; + } + } } + /* + * Return the number of conflicts... + */ + return (ppdConflicts(ppd)); } @@ -439,5 +545,5 @@ ppd_defaults(ppd_file_t *ppd, /* I - PPD file */ /* - * End of "$Id: mark.c 4494 2005-02-18 02:18:11Z mike $". + * End of "$Id: mark.c 4980 2006-01-25 19:57:45Z mike $". */ diff --git a/cups/normalize.c b/cups/normalize.c index cbeb3daae..35e77304d 100644 --- a/cups/normalize.c +++ b/cups/normalize.c @@ -1,5 +1,5 @@ /* - * "$Id: normalize.c 4903 2006-01-10 20:02:46Z mike $" + * "$Id: normalize.c 4967 2006-01-24 03:42:15Z mike $" * * Unicode normalization for the Common UNIX Printing System (CUPS). * @@ -26,6 +26,7 @@ * cupsNormalizeMapsGet() - Get all norm maps to cache. * cupsNormalizeMapsFree() - Free all norm maps in cache. * cupsNormalizeMapsFlush() - Flush all norm maps in cache. + * _cupsNormalizeMapsFlush() - Flush all normalization maps in cache. * cupsUTF8Normalize() - Normalize UTF-8 string. * cupsUTF32Normalize() - Normalize UTF-32 string. * cupsUTF8CaseFold() - Case fold UTF-8 string. @@ -315,12 +316,22 @@ cupsNormalizeMapsFree(void) void cupsNormalizeMapsFlush(void) { + _cupsNormalizeMapsFlush(_cupsGlobals()); +} + + +/* + * '_cupsNormalizeMapsFlush()' - Flush all normalization maps in cache. + */ + +void +_cupsNormalizeMapsFlush( + _cups_globals_t *cg) /* I - Global data */ +{ _cups_norm_map_t *nmap; /* Unicode Normalization Map */ _cups_norm_map_t *nextnorm; /* Next Unicode Normalization Map */ _cups_fold_map_t *fmap; /* Unicode Case Folding Map */ _cups_fold_map_t *nextfold; /* Next Unicode Case Folding Map */ - _cups_globals_t *cg = _cupsGlobals(); - /* Pointer to library globals */ /* @@ -2173,5 +2184,5 @@ compare_propchar(const void *k1, /* I - Key char */ /* - * End of "$Id: normalize.c 4903 2006-01-10 20:02:46Z mike $" + * End of "$Id: normalize.c 4967 2006-01-24 03:42:15Z mike $" */ diff --git a/cups/notify.c b/cups/notify.c new file mode 100644 index 000000000..2a89aca3c --- /dev/null +++ b/cups/notify.c @@ -0,0 +1,211 @@ +/* + * "$Id: notify.c 4961 2006-01-20 22:19:13Z mike $" + * + * Notification routines for the Common UNIX Printing System (CUPS). + * + * Copyright 2005-2006 by Easy Software Products. + * + * These coded instructions, statements, and computer programs are the + * property of Easy Software Products and are protected by Federal + * copyright law. Distribution and use rights are outlined in the file + * "LICENSE.txt" which should have been included with this file. If this + * file is missing or damaged please contact Easy Software Products + * at: + * + * Attn: CUPS Licensing Information + * Easy Software Products + * 44141 Airport View Drive, Suite 204 + * Hollywood, Maryland 20636 USA + * + * Voice: (301) 373-9600 + * EMail: cups-info@cups.org + * WWW: http://www.cups.org + * + * This file is subject to the Apple OS-Developed Software exception. + * + * Contents: + * + * cupsNotifySubject() - Return the subject for the given notification + * message. + * cupsNotifyText() - Return the text for the given notification message. + */ + +/* + * Include necessary headers... + */ + +#include "globals.h" + + +/* + * 'cupsNotifySubject()' - Return the subject for the given notification message. + * + * The returned string must be freed by the caller using free(). + * + * @since CUPS 1.2@ + */ + +char * /* O - Subject string or NULL */ +cupsNotifySubject(cups_lang_t *lang, /* I - Language data */ + ipp_t *event) /* I - Event data */ +{ + char buffer[1024]; /* Subject buffer */ + const char *prefix, /* Prefix on subject */ + *state; /* Printer/job state string */ + ipp_attribute_t *job_id, /* notify-job-id */ + *job_name, /* job-name */ + *job_state, /* job-state */ + *printer_name, /* printer-name */ + *printer_state, /* printer-state */ + *printer_uri, /* notify-printer-uri */ + *subscribed; /* notify-subscribed-event */ + + + /* + * Range check input... + */ + + if (!event || !lang) + return (NULL); + + /* + * Get the required attributes... + */ + + job_id = ippFindAttribute(event, "notify-job-id", IPP_TAG_INTEGER); + job_name = ippFindAttribute(event, "job-name", IPP_TAG_NAME); + job_state = ippFindAttribute(event, "job-state", IPP_TAG_ENUM); + printer_name = ippFindAttribute(event, "printer-name", IPP_TAG_NAME); + printer_state = ippFindAttribute(event, "printer-state", IPP_TAG_ENUM); + printer_uri = ippFindAttribute(event, "notify-printer-uri", IPP_TAG_URI); + subscribed = ippFindAttribute(event, "notify-subscribed-event", + IPP_TAG_KEYWORD); + + + if (job_id && printer_name && printer_uri && job_state) + { + /* + * Job event... + */ + + prefix = _cupsLangString(lang, _("Print Job:")); + + switch (job_state->values[0].integer) + { + case IPP_JOB_PENDING : + state = _cupsLangString(lang, _("pending")); + break; + case IPP_JOB_HELD : + state = _cupsLangString(lang, _("held")); + break; + case IPP_JOB_PROCESSING : + state = _cupsLangString(lang, _("processing")); + break; + case IPP_JOB_STOPPED : + state = _cupsLangString(lang, _("stopped")); + break; + case IPP_JOB_CANCELLED : + state = _cupsLangString(lang, _("canceled")); + break; + case IPP_JOB_ABORTED : + state = _cupsLangString(lang, _("aborted")); + break; + case IPP_JOB_COMPLETED : + state = _cupsLangString(lang, _("completed")); + break; + default : + state = _cupsLangString(lang, _("unknown")); + break; + } + + snprintf(buffer, sizeof(buffer), "%s %s-%d (%s) %s", + prefix, + printer_name->values[0].string.text, + job_id->values[0].integer, + job_name ? job_name->values[0].string.text : + _cupsLangString(lang, _("untitled")), + state); + } + else if (printer_uri && printer_name && printer_state) + { + /* + * Printer event... + */ + + prefix = _cupsLangString(lang, _("Printer:")); + + switch (printer_state->values[0].integer) + { + case IPP_PRINTER_IDLE : + state = _cupsLangString(lang, _("idle")); + break; + case IPP_PRINTER_PROCESSING : + state = _cupsLangString(lang, _("processing")); + break; + case IPP_PRINTER_STOPPED : + state = _cupsLangString(lang, _("stopped")); + break; + default : + state = _cupsLangString(lang, _("unknown")); + break; + } + + snprintf(buffer, sizeof(buffer), "%s %s %s", + prefix, + printer_name->values[0].string.text, + state); + } + else if (subscribed) + strlcpy(buffer, subscribed->values[0].string.text, sizeof(buffer)); + else + return (NULL); + + /* + * Duplicate and return the subject string... + */ + + return (strdup(buffer)); +} + + +/* + * 'cupsNotifyText()' - Return the text for the given notification message. + * + * The returned string must be freed by the caller using free(). + * + * @since CUPS 1.2@ + */ + +char * /* O - Message text or NULL */ +cupsNotifyText(cups_lang_t *lang, /* I - Language data */ + ipp_t *event) /* I - Event data */ +{ + ipp_attribute_t *notify_text; /* notify-text */ + + + /* + * Range check input... + */ + + if (!event || !lang) + return (NULL); + + /* + * Get the notify-text attribute from the server... + */ + + if ((notify_text = ippFindAttribute(event, "notify-text", + IPP_TAG_TEXT)) == NULL) + return (NULL); + + /* + * Return a copy... + */ + + return (strdup(notify_text->values[0].string.text)); +} + + +/* + * End of "$Id: notify.c 4961 2006-01-20 22:19:13Z mike $". + */ diff --git a/cups/options.c b/cups/options.c index f6883d4b0..cbaa59190 100644 --- a/cups/options.c +++ b/cups/options.c @@ -1,5 +1,5 @@ /* - * "$Id: options.c 4918 2006-01-12 05:14:40Z mike $" + * "$Id: options.c 4980 2006-01-25 19:57:45Z mike $" * * Option routines for the Common UNIX Printing System (CUPS). * @@ -367,6 +367,7 @@ cupsMarkOptions( char *val, /* Pointer into value */ *ptr, /* Pointer into string */ s[255]; /* Temporary string */ + const char *page_size; /* PageSize option */ cups_option_t *optptr; /* Current option */ ppd_option_t *option; /* PPD option */ static const char * const duplex_options[] = @@ -407,16 +408,23 @@ cupsMarkOptions( * Mark options... */ - conflict = 0; + conflict = 0; for (i = num_options, optptr = options; i > 0; i --, optptr ++) if (!strcasecmp(optptr->name, "media")) { /* * Loop through the option string, separating it at commas and - * marking each individual option. + * marking each individual option as long as the corresponding + * PPD option (PageSize, InputSlot, etc.) is not also set. + * + * For PageSize, we also check for an empty option value since + * some versions of MacOS X use it to specify auto-selection + * of the media based solely on the size. */ + page_size = cupsGetOption("PageSize", num_options, options); + for (val = optptr->value; *val;) { /* @@ -434,7 +442,7 @@ cupsMarkOptions( * Mark it... */ - if (cupsGetOption("PageSize", num_options, options) == NULL) + if (!page_size || !page_size[0]) if (ppdMarkOption(ppd, "PageSize", s)) conflict = 1; @@ -569,5 +577,5 @@ cupsMarkOptions( /* - * End of "$Id: options.c 4918 2006-01-12 05:14:40Z mike $". + * End of "$Id: options.c 4980 2006-01-25 19:57:45Z mike $". */ diff --git a/cups/ppd.c b/cups/ppd.c index 91f0c5535..672ee27d3 100644 --- a/cups/ppd.c +++ b/cups/ppd.c @@ -1,5 +1,5 @@ /* - * "$Id: ppd.c 4910 2006-01-10 21:30:48Z mike $" + * "$Id: ppd.c 4990 2006-01-26 02:21:45Z mike $" * * PPD file routines for the Common UNIX Printing System (CUPS). * @@ -34,28 +34,29 @@ * * Contents: * - * _ppd_attr_compare() - Compare two attributes. - * ppdClose() - Free all memory used by the PPD file. - * ppdErrorString() - Returns the text assocated with a status. - * ppdLastError() - Return the status from the last ppdOpen*(). - * ppdOpen() - Read a PPD file into memory. - * ppdOpenFd() - Read a PPD file into memory. - * ppdOpenFile() - Read a PPD file into memory. - * ppdSetConformance() - Set the conformance level for PPD files. - * ppd_add_attr() - Add an attribute to the PPD data. - * ppd_add_choice() - Add a choice to an option. - * ppd_add_size() - Add a page size. - * ppd_compare_groups() - Compare two groups. - * ppd_compare_options() - Compare two options. - * ppd_decode() - Decode a string value... - * ppd_free_group() - Free a single UI group. - * ppd_free_option() - Free a single option. - * ppd_get_extoption() - Get an extended option record. - * ppd_get_extparam() - Get an extended parameter record. - * ppd_get_group() - Find or create the named group as needed. - * ppd_get_option() - Find or create the named option as needed. - * ppd_read() - Read a line from a PPD file, skipping comment - * lines as necessary. + * _ppd_attr_compare() - Compare two attributes. + * ppdClose() - Free all memory used by the PPD file. + * ppdErrorString() - Returns the text assocated with a status. + * ppdLastError() - Return the status from the last ppdOpen*(). + * ppdOpen() - Read a PPD file into memory. + * ppdOpenFd() - Read a PPD file into memory. + * ppdOpenFile() - Read a PPD file into memory. + * ppdSetConformance() - Set the conformance level for PPD files. + * ppd_add_attr() - Add an attribute to the PPD data. + * ppd_add_choice() - Add a choice to an option. + * ppd_add_size() - Add a page size. + * ppd_compare_coptions() - Compare two custom options. + * ppd_compare_cparams() - Compare two custom parameters. + * ppd_compare_options() - Compare two options. + * ppd_decode() - Decode a string value... + * ppd_free_group() - Free a single UI group. + * ppd_free_option() - Free a single option. + * ppd_get_coption() - Get a custom option record. + * ppd_get_cparam() - Get a custom parameter record. + * ppd_get_group() - Find or create the named group as needed. + * ppd_get_option() - Find or create the named option as needed. + * ppd_read() - Read a line from a PPD file, skipping comment + * lines as necessary. */ /* @@ -96,19 +97,16 @@ static ppd_attr_t *ppd_add_attr(ppd_file_t *ppd, const char *name, const char *value); static ppd_choice_t *ppd_add_choice(ppd_option_t *option, const char *name); static ppd_size_t *ppd_add_size(ppd_file_t *ppd, const char *name); -#ifndef __APPLE__ -static int ppd_compare_groups(ppd_group_t *g0, ppd_group_t *g1); -static int ppd_compare_options(ppd_option_t *o0, ppd_option_t *o1); -#endif /* !__APPLE__ */ +static int ppd_compare_coptions(ppd_coption_t *a, ppd_coption_t *b); +static int ppd_compare_cparams(ppd_cparam_t *a, ppd_cparam_t *b); +static int ppd_compare_options(ppd_option_t *a, ppd_option_t *b); static int ppd_decode(char *string); static void ppd_free_group(ppd_group_t *group); static void ppd_free_option(ppd_option_t *option); -#if 0 -static ppd_ext_option_t *ppd_get_extoption(ppd_file_t *ppd, const char *name); -static ppd_ext_param_t *ppd_get_extparam(ppd_ext_option_t *opt, - const char *param, - const char *text); -#endif /* 0 */ +static ppd_coption_t *ppd_get_coption(ppd_file_t *ppd, const char *name); +static ppd_cparam_t *ppd_get_cparam(ppd_coption_t *opt, + const char *param, + const char *text); static ppd_group_t *ppd_get_group(ppd_file_t *ppd, const char *name, const char *text, _cups_globals_t *cg); static ppd_option_t *ppd_get_option(ppd_group_t *group, const char *name); @@ -150,18 +148,15 @@ ppdClose(ppd_file_t *ppd) /* I - PPD file record */ char **font; /* Current font */ char **filter; /* Current filter */ ppd_attr_t **attr; /* Current attribute */ -#if 0 - int j; /* Looping var */ - ppd_ext_option_t **opt; /* Current extended option */ - ppd_ext_param_t **param; /* Current extended parameter */ -#endif /* 0 */ + ppd_coption_t *coption; /* Current custom option */ + ppd_cparam_t *cparam; /* Current custom parameter */ /* - * Range check the PPD file record... + * Range check arguments... */ - if (ppd == NULL) + if (!ppd) return; /* @@ -200,23 +195,21 @@ ppdClose(ppd_file_t *ppd) /* I - PPD file record */ ppd_free(ppd->groups); } + cupsArrayDelete(ppd->options); + /* * Free any page sizes... */ if (ppd->num_sizes > 0) - { ppd_free(ppd->sizes); - } /* * Free any constraints... */ if (ppd->num_consts > 0) - { ppd_free(ppd->consts); - } /* * Free any filters... @@ -251,9 +244,7 @@ ppdClose(ppd_file_t *ppd) /* I - PPD file record */ */ if (ppd->num_profiles > 0) - { ppd_free(ppd->profiles); - } /* * Free any attributes... @@ -270,22 +261,41 @@ ppdClose(ppd_file_t *ppd) /* I - PPD file record */ ppd_free(ppd->attrs); } -#if 0 - if (ppd->num_extended) + /* + * Free custom options... + */ + + for (coption = (ppd_coption_t *)cupsArrayFirst(ppd->coptions); + coption; + coption = (ppd_coption_t *)cupsArrayNext(ppd->coptions)) { - for (i = ppd->num_extended, opt = ppd->extended; i > 0; i --, opt ++) + for (cparam = (ppd_cparam_t *)cupsArrayFirst(coption->params); + cparam; + cparam = (ppd_cparam_t *)cupsArrayNext(coption->params)) { - ppd_free((*opt)->code); + switch (cparam->type) + { + case PPD_CUSTOM_PASSCODE : + case PPD_CUSTOM_PASSWORD : + case PPD_CUSTOM_STRING : + ppd_free(cparam->current.custom_string); + ppd_free(cparam->minimum.custom_string); + ppd_free(cparam->maximum.custom_string); + break; - for (j = (*opt)->num_params, param = (*opt)->params; j > 0; j --, param ++) - ppd_free((*param)->value); + default : + break; + } - ppd_free((*opt)->params); + free(cparam); } - ppd_free(ppd->extended); + cupsArrayDelete(coption->params); + + free(coption); } -#endif /* 0 */ + + cupsArrayDelete(ppd->coptions); /* * Free the whole record... @@ -306,33 +316,34 @@ ppdErrorString(ppd_status_t status) /* I - PPD status */ { static const char * const messages[] =/* Status messages */ { - "OK", - "Unable to open PPD file", - "NULL PPD file pointer", - "Memory allocation error", - "Missing PPD-Adobe-4.x header", - "Missing value string", - "Internal error", - "Bad OpenGroup", - "OpenGroup without a CloseGroup first", - "Bad OpenUI/JCLOpenUI", - "OpenUI/JCLOpenUI without a CloseUI/JCLCloseUI first", - "Bad OrderDependency", - "Bad UIConstraints", - "Missing asterisk in column 1", - "Line longer than the maximum allowed (255 characters)", - "Illegal control character", - "Illegal main keyword string", - "Illegal option keyword string", - "Illegal translation string", - "Illegal whitespace character" + _("OK"), + _("Unable to open PPD file"), + _("NULL PPD file pointer"), + _("Memory allocation error"), + _("Missing PPD-Adobe-4.x header"), + _("Missing value string"), + _("Internal error"), + _("Bad OpenGroup"), + _("OpenGroup without a CloseGroup first"), + _("Bad OpenUI/JCLOpenUI"), + _("OpenUI/JCLOpenUI without a CloseUI/JCLCloseUI first"), + _("Bad OrderDependency"), + _("Bad UIConstraints"), + _("Missing asterisk in column 1"), + _("Line longer than the maximum allowed (255 characters)"), + _("Illegal control character"), + _("Illegal main keyword string"), + _("Illegal option keyword string"), + _("Illegal translation string"), + _("Illegal whitespace character"), + _("Bad custom parameter") }; if (status < PPD_OK || status > PPD_ILLEGAL_WHITESPACE) - return ("Unknown"); + return (_cupsLangString(cupsLangDefault(), _("Unknown"))); else - return (messages[status]); + return (_cupsLangString(cupsLangDefault(), messages[status])); } @@ -400,7 +411,7 @@ ppd_file_t * /* O - PPD file record */ ppdOpen2(cups_file_t *fp) /* I - File to read from */ { char *oldlocale; /* Old locale settings */ - int i, j, k, m; /* Looping vars */ + int i, j, k; /* Looping vars */ int count; /* Temporary count */ ppd_file_t *ppd; /* PPD file record */ ppd_group_t *group, /* Current group */ @@ -538,6 +549,8 @@ ppdOpen2(cups_file_t *fp) /* I - File to read from */ ppd->color_device = 0; ppd->colorspace = PPD_CS_GRAY; ppd->landscape = -90; + ppd->coptions = cupsArrayNew((cups_array_func_t)ppd_compare_coptions, + NULL); /* * Get the default language for the user... @@ -832,6 +845,7 @@ ppdOpen2(cups_file_t *fp) /* I - File to read from */ ppd->fonts[ppd->num_fonts] = strdup(name); ppd->num_fonts ++; } +#if 0 else if (!strcmp(keyword, "ParamCustomPageSize")) { if (!strcmp(name, "Width")) @@ -841,87 +855,202 @@ ppdOpen2(cups_file_t *fp) /* I - File to read from */ sscanf(string, "%*s%*s%f%f", ppd->custom_min + 1, ppd->custom_max + 1); } - else if (!strcmp(keyword, "HWMargins")) - sscanf(string, "%f%f%f%f", ppd->custom_margins + 0, - ppd->custom_margins + 1, ppd->custom_margins + 2, - ppd->custom_margins + 3); - else if (!strcmp(keyword, "CustomPageSize") && - !strcmp(name, "True")) +#endif /* 0 */ + else if (!strncmp(keyword, "ParamCustom", 11)) { - DEBUG_puts("Processing CustomPageSize..."); + ppd_coption_t *coption; /* Custom option */ + ppd_cparam_t *cparam; /* Custom parameter */ + int corder; /* Order number */ + char ctype[33], /* Data type */ + cminimum[65], /* Minimum value */ + cmaximum[65]; /* Maximum value */ + + + /* + * Get the custom option and parameter... + */ - if (!ppd->variable_sizes) + if ((coption = ppd_get_coption(ppd, keyword + 11)) == NULL) { - ppd->variable_sizes = 1; + cg->ppd_status = PPD_ALLOC_ERROR; - /* - * Add a "Custom" page size entry... - */ + goto error; + } - ppd_add_size(ppd, "Custom"); + if ((cparam = ppd_get_cparam(coption, name, text)) == NULL) + { + cg->ppd_status = PPD_ALLOC_ERROR; - /* - * Add a "Custom" page size option... - */ + goto error; + } + + /* + * Get the parameter data... + */ + + if (sscanf(string, "%d%32s%64s%64s", &corder, ctype, cminimum, + cmaximum) != 4) + { + cg->ppd_status = PPD_BAD_CUSTOM_PARAM; + + goto error; + } + + cparam->order = corder; - if ((option = ppdFindOption(ppd, "PageSize")) == NULL) + if (!strcmp(ctype, "curve")) + { + cparam->type = PPD_CUSTOM_CURVE; + cparam->minimum.custom_curve = atof(cminimum); + cparam->maximum.custom_curve = atof(cmaximum); + } + else if (!strcmp(ctype, "int")) + { + cparam->type = PPD_CUSTOM_INT; + cparam->minimum.custom_int = atoi(cminimum); + cparam->maximum.custom_int = atoi(cmaximum); + } + else if (!strcmp(ctype, "invcurve")) + { + cparam->type = PPD_CUSTOM_INVCURVE; + cparam->minimum.custom_invcurve = atof(cminimum); + cparam->maximum.custom_invcurve = atof(cmaximum); + } + else if (!strcmp(ctype, "passcode")) + { + cparam->type = PPD_CUSTOM_PASSCODE; + cparam->minimum.custom_passcode = strdup(cminimum); + cparam->maximum.custom_passcode = strdup(cmaximum); + } + else if (!strcmp(ctype, "password")) + { + cparam->type = PPD_CUSTOM_PASSWORD; + cparam->minimum.custom_password = strdup(cminimum); + cparam->maximum.custom_password = strdup(cmaximum); + } + else if (!strcmp(ctype, "points")) + { + cparam->type = PPD_CUSTOM_POINTS; + cparam->minimum.custom_points = atof(cminimum); + cparam->maximum.custom_points = atof(cmaximum); + } + else if (!strcmp(ctype, "real")) + { + cparam->type = PPD_CUSTOM_REAL; + cparam->minimum.custom_real = atof(cminimum); + cparam->maximum.custom_real = atof(cmaximum); + } + else if (!strcmp(ctype, "string")) + { + cparam->type = PPD_CUSTOM_STRING; + cparam->minimum.custom_string = strdup(cminimum); + cparam->maximum.custom_string = strdup(cmaximum); + } + else + { + cg->ppd_status = PPD_BAD_CUSTOM_PARAM; + + goto error; + } + + /* + * Now special-case for CustomPageSize... + */ + + if (!strcmp(coption->keyword, "PageSize")) + { + if (!strcmp(name, "Width")) + { + ppd->custom_min[0] = cparam->minimum.custom_points; + ppd->custom_max[0] = cparam->maximum.custom_points; + } + else if (!strcmp(name, "Height")) { - ppd_group_t *gtemp; + ppd->custom_min[1] = cparam->minimum.custom_points; + ppd->custom_max[1] = cparam->maximum.custom_points; + } + } + } + else if (!strcmp(keyword, "HWMargins")) + sscanf(string, "%f%f%f%f", ppd->custom_margins + 0, + ppd->custom_margins + 1, ppd->custom_margins + 2, + ppd->custom_margins + 3); + else if (!strncmp(keyword, "Custom", 6) && !strcmp(name, "True")) + { + ppd_coption_t *coption; /* Custom option */ - DEBUG_puts("PageSize option not found for CustomPageSize..."); + DEBUG_puts("Processing Custom option..."); - if ((gtemp = ppd_get_group(ppd, "General", _("General"), cg)) == NULL) - { - DEBUG_puts("Unable to get general group!"); + /* + * Get the option and custom option... + */ - goto error; - } + if ((option = ppdFindOption(ppd, keyword + 6)) == NULL) + { + ppd_group_t *gtemp; /* Temporary group */ - if ((option = ppd_get_option(gtemp, "PageSize")) == NULL) - { - DEBUG_puts("Unable to get PageSize option!"); - cg->ppd_status = PPD_ALLOC_ERROR; + DEBUG_printf(("%s option not found for %s...\n", keyword + 6, keyword)); - goto error; - } - } + if ((gtemp = ppd_get_group(ppd, "General", _("General"), cg)) == NULL) + { + DEBUG_puts("Unable to get general group!"); - if ((choice = ppd_add_choice(option, "Custom")) == NULL) + goto error; + } + + if ((option = ppd_get_option(gtemp, keyword + 6)) == NULL) { - DEBUG_puts("Unable to add Custom choice!"); + DEBUG_printf(("Unable to get %s option!\n", keyword + 6)); cg->ppd_status = PPD_ALLOC_ERROR; goto error; } - - strlcpy(choice->text, _("Variable"), sizeof(choice->text)); - option = NULL; } - if ((option = ppdFindOption(ppd, "PageSize")) == NULL) + if ((coption = ppd_get_coption(ppd, keyword + 6)) == NULL) { - DEBUG_puts("Unable to find PageSize option!"); - - cg->ppd_status = PPD_INTERNAL_ERROR; + cg->ppd_status = PPD_ALLOC_ERROR; goto error; } - if ((choice = ppdFindChoice(option, "Custom")) == NULL) + /* + * Add the "custom" option... + */ + + if ((choice = ppd_add_choice(option, "Custom")) == NULL) { - DEBUG_puts("Unable to find Custom choice!"); + DEBUG_puts("Unable to add Custom choice!"); - cg->ppd_status = PPD_INTERNAL_ERROR; + cg->ppd_status = PPD_ALLOC_ERROR; goto error; } + strlcpy(choice->text, text[0] ? text : _("Custom"), + sizeof(choice->text)); + choice->code = string; - option = NULL; string = NULL; /* Don't add as an attribute below */ + option = NULL; + + /* + * Now process custom page sizes specially... + */ + + if (!strcmp(keyword, "CustomPageSize")) + { + ppd->variable_sizes = 1; + + /* + * Add a "Custom" page size entry... + */ + + ppd_add_size(ppd, "Custom"); + } } else if (!strcmp(keyword, "LandscapeOrientation")) { @@ -1127,7 +1256,7 @@ ppdOpen2(cups_file_t *fp) /* I - File to read from */ * Find the JCL group, and add if needed... */ - group = ppd_get_group(ppd, "JCL", "JCL", cg); + group = ppd_get_group(ppd, "JCL", _("JCL"), cg); if (group == NULL) goto error; @@ -1530,220 +1659,6 @@ ppdOpen2(cups_file_t *fp) /* I - File to read from */ choice->code = string; string = NULL; /* Don't add as an attribute below */ } -#if 0 - else if (strcmp(keyword, "cupsUIType") == 0 && - (mask & (PPD_KEYWORD | PPD_STRING)) == (PPD_KEYWORD | PPD_STRING) && - option != NULL) - { - /* - * Define an extended option value type... - */ - - extopt = ppd_get_extoption(ppd, name); - - if (strcmp(string, "Text") == 0) - option->ui = PPD_UI_CUPS_TEXT; - else if (strcmp(string, "Integer") == 0) - { - option->ui = PPD_UI_CUPS_INTEGER; - extopt->defval.integer = 0; - extopt->minval.integer = 0; - extopt->maxval.integer = 100; - } - else if (strcmp(string, "Real") == 0) - { - option->ui = PPD_UI_CUPS_REAL; - extopt->defval.real = 0.0; - extopt->minval.real = 0.0; - extopt->maxval.real = 1.0; - } - else if (strcmp(string, "Gamma") == 0) - { - option->ui = PPD_UI_CUPS_GAMMA; - extopt->defval.gamma = 1.0; - extopt->minval.gamma = 1.0; - extopt->maxval.gamma = 10.0; - } - else if (strcmp(string, "Curve") == 0) - { - option->ui = PPD_UI_CUPS_CURVE; - extopt->defval.curve.start = 0.0; - extopt->defval.curve.end = 0.0; - extopt->defval.curve.gamma = 1.0; - extopt->minval.curve.start = 0.0; - extopt->minval.curve.end = 0.0; - extopt->minval.curve.gamma = 1.0; - extopt->maxval.curve.start = 1.0; - extopt->maxval.curve.end = 1.0; - extopt->maxval.curve.gamma = 10.0; - } - else if (strcmp(string, "IntegerArray") == 0) - { - option->ui = PPD_UI_CUPS_INTEGER_ARRAY; - extopt->defval.integer_array.num_elements = 2; - extopt->minval.integer_array.num_elements = 2; - extopt->maxval.integer_array.num_elements = 16; - } - else if (strcmp(string, "RealArray") == 0) - { - option->ui = PPD_UI_CUPS_REAL_ARRAY; - extopt->defval.real_array.num_elements = 2; - extopt->minval.real_array.num_elements = 2; - extopt->maxval.real_array.num_elements = 16; - } - } - else if (strcmp(keyword, "cupsUIDefault") == 0 && - (mask & (PPD_KEYWORD | PPD_STRING)) == (PPD_KEYWORD | PPD_STRING) && - option != NULL) - { - /* - * Define an extended option minimum value... - */ - - extopt = ppd_get_extoption(ppd, name); - - switch (option->ui) - { - case PPD_UI_CUPS_INTEGER : - sscanf(string, "%d", &(extopt->defval.integer)); - break; - - case PPD_UI_CUPS_REAL : - sscanf(string, "%f", &(extopt->defval.real)); - break; - - case PPD_UI_CUPS_GAMMA : - sscanf(string, "%f", &(extopt->defval.gamma)); - break; - - case PPD_UI_CUPS_CURVE : - sscanf(string, "%f%f%f", &(extopt->defval.curve.start), - &(extopt->defval.curve.end), - &(extopt->defval.curve.gamma)); - break; - - case PPD_UI_CUPS_INTEGER_ARRAY : - extopt->defval.integer_array.elements = calloc(1, sizeof(int)); - sscanf(string, "%d%d", &(extopt->defval.integer_array.num_elements), - extopt->defval.integer_array.elements); - break; - - case PPD_UI_CUPS_REAL_ARRAY : - extopt->defval.real_array.elements = calloc(1, sizeof(float)); - sscanf(string, "%d%f", &(extopt->defval.real_array.num_elements), - extopt->defval.real_array.elements); - break; - - default : - break; - } - } - else if (strcmp(keyword, "cupsUIMinimum") == 0 && - (mask & (PPD_KEYWORD | PPD_STRING)) == (PPD_KEYWORD | PPD_STRING) && - option != NULL) - { - /* - * Define an extended option minimum value... - */ - - extopt = ppd_get_extoption(ppd, name); - - switch (option->ui) - { - case PPD_UI_CUPS_INTEGER : - sscanf(string, "%d", &(extopt->minval.integer)); - break; - - case PPD_UI_CUPS_REAL : - sscanf(string, "%f", &(extopt->minval.real)); - break; - - case PPD_UI_CUPS_GAMMA : - sscanf(string, "%f", &(extopt->minval.gamma)); - break; - - case PPD_UI_CUPS_CURVE : - sscanf(string, "%f%f%f", &(extopt->minval.curve.start), - &(extopt->minval.curve.end), - &(extopt->minval.curve.gamma)); - break; - - case PPD_UI_CUPS_INTEGER_ARRAY : - extopt->minval.integer_array.elements = calloc(1, sizeof(int)); - sscanf(string, "%d%d", &(extopt->minval.integer_array.num_elements), - extopt->minval.integer_array.elements); - break; - - case PPD_UI_CUPS_REAL_ARRAY : - extopt->minval.real_array.elements = calloc(1, sizeof(float)); - sscanf(string, "%d%f", &(extopt->minval.real_array.num_elements), - extopt->minval.real_array.elements); - break; - - default : - break; - } - } - else if (strcmp(keyword, "cupsUIMaximum") == 0 && - (mask & (PPD_KEYWORD | PPD_STRING)) == (PPD_KEYWORD | PPD_STRING) && - option != NULL) - { - /* - * Define an extended option maximum value... - */ - - extopt = ppd_get_extoption(ppd, name); - - switch (option->ui) - { - case PPD_UI_CUPS_INTEGER : - sscanf(string, "%d", &(extopt->maxval.integer)); - break; - - case PPD_UI_CUPS_REAL : - sscanf(string, "%f", &(extopt->maxval.real)); - break; - - case PPD_UI_CUPS_GAMMA : - sscanf(string, "%f", &(extopt->maxval.gamma)); - break; - - case PPD_UI_CUPS_CURVE : - sscanf(string, "%f%f%f", &(extopt->maxval.curve.start), - &(extopt->maxval.curve.end), - &(extopt->maxval.curve.gamma)); - break; - - case PPD_UI_CUPS_INTEGER_ARRAY : - extopt->maxval.integer_array.elements = calloc(1, sizeof(int)); - sscanf(string, "%d%d", &(extopt->maxval.integer_array.num_elements), - extopt->maxval.integer_array.elements); - break; - - case PPD_UI_CUPS_REAL_ARRAY : - extopt->maxval.real_array.elements = calloc(1, sizeof(float)); - sscanf(string, "%d%f", &(extopt->maxval.real_array.num_elements), - extopt->maxval.real_array.elements); - break; - - default : - break; - } - } - else if (strcmp(keyword, "cupsUICommand") == 0 && - (mask & (PPD_KEYWORD | PPD_STRING)) == (PPD_KEYWORD | PPD_STRING) && - option != NULL) - { - /* - * Define an extended option command... - */ - - extopt = ppd_get_extoption(ppd, name); - - extopt->command = string; - string = NULL; - } -#endif /* 0 */ /* * Add remaining lines with keywords and string values as attributes... @@ -1753,9 +1668,7 @@ ppdOpen2(cups_file_t *fp) /* I - File to read from */ (mask & (PPD_KEYWORD | PPD_STRING)) == (PPD_KEYWORD | PPD_STRING)) ppd_add_attr(ppd, keyword, name, text, string); else - { ppd_free(string); - } } /* @@ -1786,91 +1699,33 @@ ppdOpen2(cups_file_t *fp) /* I - File to read from */ return (NULL); } -#ifndef __APPLE__ /* - * Make sure that all PPD files with an InputSlot option have an - * "auto" choice that maps to no specific tray or media type. + * Create the sorted options array and set the option back-pointer for + * each choice and custom option... */ - if ((option = ppdFindOption(ppd, "InputSlot")) != NULL) - { - for (i = 0; i < option->num_choices; i ++) - if (option->choices[i].code == NULL || !option->choices[i].code[0] || - !strncasecmp(option->choices[i].choice, "Auto", 4)) - break; - - if (i >= option->num_choices) - { - /* - * No "auto" input slot, add one... - */ - - choice = ppd_add_choice(option, "Auto"); - - strlcpy(choice->text, _("Auto"), sizeof(choice->text)); - choice->code = NULL; - } - } -#endif /* !__APPLE__ */ - - /* - * Set the option back-pointer for each choice... - */ - -#ifndef __APPLE__ - qsort(ppd->groups, ppd->num_groups, sizeof(ppd_group_t), - (int (*)(const void *, const void *))ppd_compare_groups); -#endif /* !__APPLE__ */ + ppd->options = cupsArrayNew((cups_array_func_t)ppd_compare_options, NULL); for (i = ppd->num_groups, group = ppd->groups; i > 0; i --, group ++) { -#ifndef __APPLE__ - qsort(group->options, group->num_options, sizeof(ppd_option_t), - (int (*)(const void *, const void *))ppd_compare_options); -#endif /* !__APPLE__ */ - for (j = group->num_options, option = group->options; j > 0; j --, option ++) { - for (k = 0; k < option->num_choices; k ++) - option->choices[k].option = (void *)option; - } + ppd_coption_t *coption; /* Custom option */ -#ifndef __APPLE__ - qsort(group->subgroups, group->num_subgroups, sizeof(ppd_group_t), - (int (*)(const void *, const void *))ppd_compare_groups); -#endif /* !__APPLE__ */ - for (j = group->num_subgroups, subgroup = group->subgroups; - j > 0; - j --, subgroup ++) - { -#ifndef __APPLE__ - qsort(subgroup->options, subgroup->num_options, sizeof(ppd_option_t), - (int (*)(const void *, const void *))ppd_compare_options); -#endif /* !__APPLE__ */ - - for (k = group->num_options, option = group->options; - k > 0; - k --, option ++) - { - for (m = 0; m < option->num_choices; m ++) - option->choices[m].option = (void *)option; - } - } - } + cupsArrayAdd(ppd->options, option); -#if 0 - /* - * Set the option pointers for all extended options... - */ + for (k = 0; k < option->num_choices; k ++) + option->choices[k].option = option; - for (i = 0; i < ppd->num_extended; i ++) - ppd->extended[i]->option = ppdFindOption(ppd, ppd->extended[i]->keyword); -#endif /* 0 */ + if ((coption = ppdFindCustomOption(ppd, option->keyword)) != NULL) + coption->option = option; + } + } /* * Sort the attributes... @@ -1915,7 +1770,7 @@ ppdOpen2(cups_file_t *fp) /* I - File to read from */ ppd_file_t * /* O - PPD file record */ ppdOpenFd(int fd) /* I - File to read from */ { - FILE *fp; /* File pointer */ + cups_file_t *fp; /* CUPS file pointer */ ppd_file_t *ppd; /* PPD file record */ _cups_globals_t *cg = _cupsGlobals(); /* Global data */ @@ -1942,18 +1797,16 @@ ppdOpenFd(int fd) /* I - File to read from */ * Try to open the file and parse it... */ - if ((fp = fdopen(fd, "r")) != NULL) + if ((fp = cupsFileOpenFd(fd, "r")) != NULL) { - setbuf(fp, NULL); - - ppd = ppdOpen(fp); + ppd = ppdOpen2(fp); - fclose(fp); + cupsFileClose(fp); } else { cg->ppd_status = PPD_FILE_OPEN_ERROR; - ppd = NULL; + ppd = NULL; } return (ppd); @@ -2149,16 +2002,27 @@ ppd_add_size(ppd_file_t *ppd, /* I - PPD file */ } -#ifndef __APPLE__ /* - * 'ppd_compare_groups()' - Compare two groups. + * 'ppd_compare_coptions()' - Compare two custom options. */ static int /* O - Result of comparison */ -ppd_compare_groups(ppd_group_t *g0, /* I - First group */ - ppd_group_t *g1) /* I - Second group */ +ppd_compare_coptions(ppd_coption_t *a, /* I - First option */ + ppd_coption_t *b) /* I - Second option */ { - return (strcasecmp(g0->text, g1->text)); + return (strcasecmp(a->keyword, b->keyword)); +} + + +/* + * 'ppd_compare_cparams()' - Compare two custom parameters. + */ + +static int /* O - Result of comparison */ +ppd_compare_cparams(ppd_cparam_t *a, /* I - First parameter */ + ppd_cparam_t *b) /* I - Second parameter */ +{ + return (strcasecmp(a->name, b->name)); } @@ -2167,12 +2031,11 @@ ppd_compare_groups(ppd_group_t *g0, /* I - First group */ */ static int /* O - Result of comparison */ -ppd_compare_options(ppd_option_t *o0, /* I - First option */ - ppd_option_t *o1) /* I - Second option */ +ppd_compare_options(ppd_option_t *a, /* I - First option */ + ppd_option_t *b) /* I - Second option */ { - return (strcasecmp(o0->text, o1->text)); + return (strcasecmp(a->keyword, b->keyword)); } -#endif /* !__APPLE__ */ /* @@ -2291,132 +2154,86 @@ ppd_free_option(ppd_option_t *option) /* I - Option to free */ } -#if 0 /* - * 'ppd_get_extoption()' - Get an extended option record. + * 'ppd_get_coption()' - Get a custom option record. */ -static ppd_ext_option_t * /* O - Extended option... */ -ppd_get_extoption(ppd_file_t *ppd, /* I - PPD file */ - const char *name) /* I - Name of option */ +static ppd_coption_t * /* O - Custom option... */ +ppd_get_coption(ppd_file_t *ppd, /* I - PPD file */ + const char *name) /* I - Name of option */ { - ppd_ext_option_t **temp, /* New array pointer */ - *extopt; /* New extended option */ + ppd_coption_t *copt; /* New custom option */ /* * See if the option already exists... */ - if ((extopt = ppdFindExtOption(ppd, name)) != NULL) - return (extopt); + if ((copt = ppdFindCustomOption(ppd, name)) != NULL) + return (copt); /* - * Not found, so create the extended option record... + * Not found, so create the custom option record... */ - if ((extopt = calloc(1, sizeof(ppd_ext_option_t))) == NULL) + if ((copt = calloc(1, sizeof(ppd_coption_t))) == NULL) return (NULL); - strlcpy(extopt->keyword, name, sizeof(extopt->keyword)); - - /* - * Add this record to the end of the array... - */ - - if (ppd->num_extended == 0) - temp = malloc(sizeof(ppd_ext_option_t *)); - else - temp = realloc(ppd->extended, sizeof(ppd_ext_option_t *) * - (ppd->num_extended + 1)); - - if (temp == NULL) - { - free(extopt); - return (NULL); - } + strlcpy(copt->keyword, name, sizeof(copt->keyword)); - ppd->extended = temp; - temp[ppd->num_extended] = extopt; + copt->params = cupsArrayNew((cups_array_func_t)ppd_compare_cparams, NULL); - ppd->num_extended ++; + cupsArrayAdd(ppd->coptions, copt); /* * Return the new record... */ - return (extopt); + return (copt); } /* - * 'ppd_get_extparam()' - Get an extended parameter record. + * 'ppd_get_cparam()' - Get a custom parameter record. */ -static ppd_ext_param_t * /* O - Extended option... */ -ppd_get_extparam(ppd_ext_option_t *opt, /* I - PPD file */ - const char *param,/* I - Name of parameter */ - const char *text) /* I - Human-readable text */ +static ppd_cparam_t * /* O - Extended option... */ +ppd_get_cparam(ppd_coption_t *opt, /* I - PPD file */ + const char *param, /* I - Name of parameter */ + const char *text) /* I - Human-readable text */ { - ppd_ext_param_t **temp, /* New array pointer */ - *extparam; /* New extended parameter */ + ppd_cparam_t *cparam; /* New custom parameter */ /* * See if the parameter already exists... */ - if ((extparam = ppdFindExtParam(opt, param)) != NULL) - return (extparam); + if ((cparam = ppdFindCustomParam(opt, param)) != NULL) + return (cparam); /* - * Not found, so create the extended parameter record... + * Not found, so create the custom parameter record... */ - if ((extparam = calloc(1, sizeof(ppd_ext_param_t))) == NULL) + if ((cparam = calloc(1, sizeof(ppd_cparam_t))) == NULL) return (NULL); - if ((extparam->value = calloc(4, sizeof(ppd_ext_value_t))) == NULL) - { - ppd_free(extparam); - return (NULL); - } - - extparam->defval = extparam->value + 1; - extparam->minval = extparam->value + 2; - extparam->maxval = extparam->value + 3; - - strlcpy(extparam->keyword, param, sizeof(extparam->keyword)); - strlcpy(extparam->text, text, sizeof(extparam->text)); + strlcpy(cparam->name, param, sizeof(cparam->name)); + strlcpy(cparam->text, text, sizeof(cparam->text)); /* - * Add this record to the end of the array... + * Add this record to the array... */ - if (opt->num_params == 0) - temp = malloc(sizeof(ppd_ext_param_t *)); - else - temp = realloc(opt->params, sizeof(ppd_ext_param_t *) * - (opt->num_params + 1)); - - if (temp == NULL) - { - free(extparam); - return (NULL); - } - - opt->params = temp; - temp[opt->num_params] = extparam; - - opt->num_params ++; + cupsArrayAdd(opt->params, cparam); /* * Return the new record... */ - return (extparam); + return (cparam); } -#endif /* 0 */ /* @@ -2635,7 +2452,11 @@ ppd_read(cups_file_t *fp, /* I - File to read from */ */ if ((ch = cupsFilePeekChar(fp)) == EOF) + { + ch = '\n'; break; + } + if (ch == 0x0a) cupsFileGetChar(fp); } @@ -2871,13 +2692,6 @@ ppd_read(cups_file_t *fp, /* I - File to read from */ if (line[0] != '*') /* All lines start with an asterisk */ { - if (cg->ppd_conform == PPD_CONFORM_STRICT) - { - cg->ppd_status = PPD_MISSING_ASTERISK; - free(line); - return (0); - } - /* * Allow lines consisting of just whitespace... */ @@ -3066,5 +2880,5 @@ ppd_read(cups_file_t *fp, /* I - File to read from */ /* - * End of "$Id: ppd.c 4910 2006-01-10 21:30:48Z mike $". + * End of "$Id: ppd.c 4990 2006-01-26 02:21:45Z mike $". */ diff --git a/cups/ppd.h b/cups/ppd.h index 0edef2410..0ac53fa28 100644 --- a/cups/ppd.h +++ b/cups/ppd.h @@ -1,10 +1,10 @@ /* - * "$Id: ppd.h 4785 2005-10-13 19:39:05Z mike $" + * "$Id: ppd.h 4980 2006-01-25 19:57:45Z mike $" * * PostScript Printer Description definitions for the Common UNIX Printing * System (CUPS). * - * Copyright 1997-2005 by Easy Software Products, all rights reserved. + * Copyright 1997-2006 by Easy Software Products, all rights reserved. * * These coded instructions, statements, and computer programs are the * property of Easy Software Products and are protected by Federal @@ -42,6 +42,7 @@ */ # include <stdio.h> +# include "array.h" # include "file.h" @@ -58,307 +59,265 @@ extern "C" { * PPD version... */ -# define PPD_VERSION 4.3 /* Kept in sync with Adobe version number */ +# define PPD_VERSION 4.3 /* Kept in sync with Adobe version number */ /* * PPD size limits (defined in Adobe spec) */ -# define PPD_MAX_NAME 41 /* Maximum size of name + 1 for nul */ -# define PPD_MAX_TEXT 81 /* Maximum size of text + 1 for nul */ -# define PPD_MAX_LINE 256 /* Maximum size of line + 1 for nul */ +# define PPD_MAX_NAME 41 /* Maximum size of name + 1 for nul */ +# define PPD_MAX_TEXT 81 /* Maximum size of text + 1 for nul */ +# define PPD_MAX_LINE 256 /* Maximum size of line + 1 for nul */ /* * Types and structures... */ -typedef enum ppd_ui_e /**** UI Types ****/ +typedef enum ppd_ui_e /**** UI Types ****/ { - PPD_UI_BOOLEAN, /* True or False option */ - PPD_UI_PICKONE, /* Pick one from a list */ - PPD_UI_PICKMANY /* Pick zero or more from a list */ + PPD_UI_BOOLEAN, /* True or False option */ + PPD_UI_PICKONE, /* Pick one from a list */ + PPD_UI_PICKMANY /* Pick zero or more from a list */ } ppd_ui_t; -typedef enum ppd_section_e /**** Order dependency sections ****/ +typedef enum ppd_section_e /**** Order dependency sections ****/ { - PPD_ORDER_ANY, /* Option code can be anywhere in the file */ - PPD_ORDER_DOCUMENT, /* ... must be in the DocumentSetup section */ - PPD_ORDER_EXIT, /* ... must be sent prior to the document */ - PPD_ORDER_JCL, /* ... must be sent as a JCL command */ - PPD_ORDER_PAGE, /* ... must be in the PageSetup section */ - PPD_ORDER_PROLOG /* ... must be in the Prolog section */ + PPD_ORDER_ANY, /* Option code can be anywhere in the file */ + PPD_ORDER_DOCUMENT, /* ... must be in the DocumentSetup section */ + PPD_ORDER_EXIT, /* ... must be sent prior to the document */ + PPD_ORDER_JCL, /* ... must be sent as a JCL command */ + PPD_ORDER_PAGE, /* ... must be in the PageSetup section */ + PPD_ORDER_PROLOG /* ... must be in the Prolog section */ } ppd_section_t; -typedef enum ppd_cs_e /**** Colorspaces ****/ +typedef enum ppd_cs_e /**** Colorspaces ****/ { - PPD_CS_CMYK = -4, /* CMYK colorspace */ - PPD_CS_CMY, /* CMY colorspace */ - PPD_CS_GRAY = 1, /* Grayscale colorspace */ - PPD_CS_RGB = 3, /* RGB colorspace */ - PPD_CS_RGBK, /* RGBK (K = gray) colorspace */ - PPD_CS_N /* DeviceN colorspace */ + PPD_CS_CMYK = -4, /* CMYK colorspace */ + PPD_CS_CMY, /* CMY colorspace */ + PPD_CS_GRAY = 1, /* Grayscale colorspace */ + PPD_CS_RGB = 3, /* RGB colorspace */ + PPD_CS_RGBK, /* RGBK (K = gray) colorspace */ + PPD_CS_N /* DeviceN colorspace */ } ppd_cs_t; -typedef enum ppd_status_e /**** Status Codes @since CUPS 1.1.19@ ****/ +typedef enum ppd_status_e /**** Status Codes @since CUPS 1.1.19@ ****/ { - PPD_OK = 0, /* OK */ - PPD_FILE_OPEN_ERROR, /* Unable to open PPD file */ - PPD_NULL_FILE, /* NULL PPD file pointer */ - PPD_ALLOC_ERROR, /* Memory allocation error */ - PPD_MISSING_PPDADOBE4, /* Missing PPD-Adobe-4.x header */ - PPD_MISSING_VALUE, /* Missing value string */ - PPD_INTERNAL_ERROR, /* Internal error */ - PPD_BAD_OPEN_GROUP, /* Bad OpenGroup */ - PPD_NESTED_OPEN_GROUP, /* OpenGroup without a CloseGroup first */ - PPD_BAD_OPEN_UI, /* Bad OpenUI/JCLOpenUI */ - PPD_NESTED_OPEN_UI, /* OpenUI/JCLOpenUI without a CloseUI/JCLCloseUI first */ - PPD_BAD_ORDER_DEPENDENCY, /* Bad OrderDependency */ - PPD_BAD_UI_CONSTRAINTS, /* Bad UIConstraints */ - PPD_MISSING_ASTERISK, /* Missing asterisk in column 0 */ - PPD_LINE_TOO_LONG, /* Line longer than 255 chars */ - PPD_ILLEGAL_CHARACTER, /* Illegal control character */ - PPD_ILLEGAL_MAIN_KEYWORD, /* Illegal main keyword string */ - PPD_ILLEGAL_OPTION_KEYWORD, /* Illegal option keyword string */ - PPD_ILLEGAL_TRANSLATION, /* Illegal translation string */ - PPD_ILLEGAL_WHITESPACE /* Illegal whitespace character */ + PPD_OK = 0, /* OK */ + PPD_FILE_OPEN_ERROR, /* Unable to open PPD file */ + PPD_NULL_FILE, /* NULL PPD file pointer */ + PPD_ALLOC_ERROR, /* Memory allocation error */ + PPD_MISSING_PPDADOBE4, /* Missing PPD-Adobe-4.x header */ + PPD_MISSING_VALUE, /* Missing value string */ + PPD_INTERNAL_ERROR, /* Internal error */ + PPD_BAD_OPEN_GROUP, /* Bad OpenGroup */ + PPD_NESTED_OPEN_GROUP, /* OpenGroup without a CloseGroup first */ + PPD_BAD_OPEN_UI, /* Bad OpenUI/JCLOpenUI */ + PPD_NESTED_OPEN_UI, /* OpenUI/JCLOpenUI without a CloseUI/JCLCloseUI first */ + PPD_BAD_ORDER_DEPENDENCY, /* Bad OrderDependency */ + PPD_BAD_UI_CONSTRAINTS, /* Bad UIConstraints */ + PPD_MISSING_ASTERISK, /* Missing asterisk in column 0 */ + PPD_LINE_TOO_LONG, /* Line longer than 255 chars */ + PPD_ILLEGAL_CHARACTER, /* Illegal control character */ + PPD_ILLEGAL_MAIN_KEYWORD, /* Illegal main keyword string */ + PPD_ILLEGAL_OPTION_KEYWORD, /* Illegal option keyword string */ + PPD_ILLEGAL_TRANSLATION, /* Illegal translation string */ + PPD_ILLEGAL_WHITESPACE, /* Illegal whitespace character */ + PPD_BAD_CUSTOM_PARAM /* Bad custom parameter */ } ppd_status_t; -typedef enum ppd_conform_e /**** Conformance Levels ****/ +typedef enum ppd_conform_e /**** Conformance Levels ****/ { - PPD_CONFORM_RELAXED, /* Relax whitespace and control char */ - PPD_CONFORM_STRICT /* Require strict conformance */ + PPD_CONFORM_RELAXED, /* Relax whitespace and control char */ + PPD_CONFORM_STRICT /* Require strict conformance */ } ppd_conform_t; -typedef struct ppd_attr_str /**** PPD Attribute Structure @since CUPS 1.1.19@ ****/ +typedef struct ppd_attr_s /**** PPD Attribute Structure @since CUPS 1.1.19@ ****/ { - char name[PPD_MAX_NAME]; - /* Name of attribute (cupsXYZ) */ - char spec[PPD_MAX_NAME]; - /* Specifier string, if any */ - char text[PPD_MAX_TEXT]; - /* Human-readable text, if any */ - char *value; /* Value string */ + char name[PPD_MAX_NAME]; /* Name of attribute (cupsXYZ) */ + char spec[PPD_MAX_NAME]; /* Specifier string, if any */ + char text[PPD_MAX_TEXT]; /* Human-readable text, if any */ + char *value; /* Value string */ } ppd_attr_t; -typedef struct ppd_option_str ppd_option_t; - /**** Options ****/ +typedef struct ppd_option_s ppd_option_t; + /**** Options ****/ -typedef struct ppd_choice_str /**** Option choices ****/ +typedef struct ppd_choice_s /**** Option choices ****/ { - char marked; /* 0 if not selected, 1 otherwise */ - char choice[PPD_MAX_NAME]; - /* Computer-readable option name */ - char text[PPD_MAX_TEXT]; - /* Human-readable option name */ - char *code; /* Code to send for this option */ - ppd_option_t *option; /* Pointer to parent option structure */ + char marked; /* 0 if not selected, 1 otherwise */ + char choice[PPD_MAX_NAME]; /* Computer-readable option name */ + char text[PPD_MAX_TEXT]; /* Human-readable option name */ + char *code; /* Code to send for this option */ + ppd_option_t *option; /* Pointer to parent option structure */ } ppd_choice_t; -struct ppd_option_str /**** Options ****/ +struct ppd_option_s /**** Options ****/ { - char conflicted; /* 0 if no conflicts exist, 1 otherwise */ - char keyword[PPD_MAX_NAME]; - /* Option keyword name ("PageSize", etc.) */ - char defchoice[PPD_MAX_NAME]; - /* Default option choice */ - char text[PPD_MAX_TEXT]; - /* Human-readable text */ - ppd_ui_t ui; /* Type of UI option */ - ppd_section_t section; /* Section for command */ - float order; /* Order number */ - int num_choices; /* Number of option choices */ - ppd_choice_t *choices; /* Option choices */ + char conflicted; /* 0 if no conflicts exist, 1 otherwise */ + char keyword[PPD_MAX_NAME]; /* Option keyword name ("PageSize", etc.) */ + char defchoice[PPD_MAX_NAME];/* Default option choice */ + char text[PPD_MAX_TEXT]; /* Human-readable text */ + ppd_ui_t ui; /* Type of UI option */ + ppd_section_t section; /* Section for command */ + float order; /* Order number */ + int num_choices; /* Number of option choices */ + ppd_choice_t *choices; /* Option choices */ }; -typedef struct ppd_group_str /**** Groups ****/ +typedef struct ppd_group_s /**** Groups ****/ { /**** Group text strings are limited to 39 chars + nul in order to **** preserve binary compatibility and allow applications to get **** the group's keyword name. ****/ char text[PPD_MAX_TEXT - PPD_MAX_NAME]; - /* Human-readable group name */ - char name[PPD_MAX_NAME]; - /* Group name @since CUPS 1.1.18@ */ - int num_options; /* Number of options */ - ppd_option_t *options; /* Options */ - int num_subgroups; /* Number of sub-groups */ - struct ppd_group_str *subgroups; - /* Sub-groups (max depth = 1) */ + /* Human-readable group name */ + char name[PPD_MAX_NAME]; /* Group name @since CUPS 1.1.18@ */ + int num_options; /* Number of options */ + ppd_option_t *options; /* Options */ + int num_subgroups; /* Number of sub-groups */ + struct ppd_group_s *subgroups; /* Sub-groups (max depth = 1) */ } ppd_group_t; -typedef struct /**** Constraints ****/ +typedef struct /**** Constraints ****/ { - char option1[PPD_MAX_NAME]; - /* First keyword */ - char choice1[PPD_MAX_NAME]; - /* First option/choice (blank for all) */ - char option2[PPD_MAX_NAME]; - /* Second keyword */ - char choice2[PPD_MAX_NAME]; - /* Second option/choice (blank for all) */ + char option1[PPD_MAX_NAME]; /* First keyword */ + char choice1[PPD_MAX_NAME]; /* First option/choice (blank for all) */ + char option2[PPD_MAX_NAME]; /* Second keyword */ + char choice2[PPD_MAX_NAME]; /* Second option/choice (blank for all) */ } ppd_const_t; -typedef struct ppd_size_str /**** Page Sizes ****/ +typedef struct ppd_size_s /**** Page Sizes ****/ { - int marked; /* Page size selected? */ - char name[PPD_MAX_NAME]; - /* Media size option */ - float width; /* Width of media in points */ - float length; /* Length of media in points */ - float left; /* Left printable margin in points */ - float bottom; /* Bottom printable margin in points */ - float right; /* Right printable margin in points */ - float top; /* Top printable margin in points */ + int marked; /* Page size selected? */ + char name[PPD_MAX_NAME]; /* Media size option */ + float width; /* Width of media in points */ + float length; /* Length of media in points */ + float left; /* Left printable margin in points */ + float bottom; /* Bottom printable margin in points */ + float right; /* Right printable margin in points */ + float top; /* Top printable margin in points */ } ppd_size_t; -typedef struct ppd_emul_str /**** Emulators ****/ +typedef struct ppd_emul_s /**** Emulators ****/ { - char name[PPD_MAX_NAME]; - /* Emulator name */ - char *start; /* Code to switch to this emulation */ - char *stop; /* Code to stop this emulation */ + char name[PPD_MAX_NAME]; /* Emulator name */ + char *start; /* Code to switch to this emulation */ + char *stop; /* Code to stop this emulation */ } ppd_emul_t; -typedef struct ppd_profile_str /**** sRGB Color Profiles ****/ +typedef struct ppd_profile_s /**** sRGB Color Profiles ****/ { char resolution[PPD_MAX_NAME]; - /* Resolution or "-" */ + /* Resolution or "-" */ char media_type[PPD_MAX_NAME]; - /* Media type or "-" */ - float density; /* Ink density to use */ - float gamma; /* Gamma correction to use */ - float matrix[3][3]; /* Transform matrix */ + /* Media type or "-" */ + float density; /* Ink density to use */ + float gamma; /* Gamma correction to use */ + float matrix[3][3]; /* Transform matrix */ } ppd_profile_t; /**** New in CUPS 1.2 ****/ -# if 0 -typedef enum ppd_ext_ui_e /**** Extended UI Types @since CUPS 1.2@ ****/ +typedef enum ppd_cptype_e /**** Custom Parameter Type @since CUPS 1.2@ ****/ { - PPD_UI_CUPS_TEXT, /* Specify a string */ - PPD_UI_CUPS_INTEGER, /* Specify an integer number */ - PPD_UI_CUPS_REAL, /* Specify a real number */ - PPD_UI_CUPS_GAMMA, /* Specify a gamma number */ - PPD_UI_CUPS_CURVE, /* Specify start, end, and gamma numbers */ - PPD_UI_CUPS_INTEGER_ARRAY, /* Specify an array of integer numbers */ - PPD_UI_CUPS_REAL_ARRAY, /* Specify an array of real numbers */ - PPD_UI_CUPS_XY_ARRAY /* Specify an array of X/Y real numbers */ -} ppd_ext_ui_t; - -typedef union ppd_ext_value_u /**** Extended Values @since CUPS 1.2@ ****/ + PPD_CUSTOM_CURVE, /* Curve value for f(x) = x^value */ + PPD_CUSTOM_INT, /* Integer number value */ + PPD_CUSTOM_INVCURVE, /* Curve value for f(x) = x^(1/value) */ + PPD_CUSTOM_PASSCODE, /* String of (hidden) numbers */ + PPD_CUSTOM_PASSWORD, /* String of (hidden) characters */ + PPD_CUSTOM_POINTS, /* Measurement value in points */ + PPD_CUSTOM_REAL, /* Real number value */ + PPD_CUSTOM_STRING /* String of characters */ +} ppd_cptype_t; + +typedef union ppd_cpvalue_u /**** Custom Parameter Value @since CUPS 1.2@ ****/ { - char *text; /* Text value */ - int integer; /* Integer value */ - float real; /* Real value */ - float gamma; /* Gamma value */ - struct - { - float start; /* Linear (density) start value for curve */ - float end; /* Linear (density) end value for curve */ - float gamma; /* Gamma correction */ - } curve; /* Curve values */ - struct - { - int num_elements; /* Number of array elements */ - int *elements; /* Array of integer values */ - } integer_array; /* Integer array value */ - struct - { - int num_elements; /* Number of array elements */ - float *elements; /* Array of real values */ - } real_array; /* Real array value */ - struct - { - int num_elements; /* Number of array elements */ - float *elements; /* Array of XY values */ - } xy_array; /* XY array value */ -} ppd_ext_value_t; - -typedef struct ppd_ext_param_str/**** Extended Parameter @since CUPS 1.2@ ****/ + float custom_curve; /* Gamma value */ + int custom_int; /* Integer value */ + float custom_invcurve; /* Gamma value */ + char *custom_passcode; /* Passcode value */ + char *custom_password; /* Password value */ + float custom_points; /* Measurement value */ + float custom_real; /* Real value */ + char *custom_string; /* String value */ +} ppd_cpvalue_t; + +typedef struct ppd_cparam_s /**** Custom Parameter @since CUPS 1.2@ ****/ { - char keyword[PPD_MAX_NAME]; - /* Parameter name */ - char text[PPD_MAX_TEXT]; - /* Human-readable text */ - ppd_ext_value_t *value; /* Current values */ - ppd_ext_value_t *defval; /* Default values */ - ppd_ext_value_t *minval; /* Minimum numeric values */ - ppd_ext_value_t *maxval; /* Maximum numeric values */ -} ppd_ext_param_t; - -typedef struct ppd_ext_option_str - /**** Extended Options @since CUPS 1.2@ ****/ + char name[PPD_MAX_NAME]; /* Parameter name */ + char text[PPD_MAX_TEXT]; /* Human-readable text */ + int order; /* Order (0 to N) */ + ppd_cptype_t type; /* Parameter type */ + ppd_cpvalue_t minimum, /* Minimum value */ + maximum, /* Maximum value */ + current; /* Current value */ +} ppd_cparam_t; + +typedef struct ppd_coption_s /**** Custom Option @since CUPS 1.2@ ****/ { - char keyword[PPD_MAX_NAME]; - /* Name of option that is being extended... */ - ppd_option_t *option; /* Option that is being extended... */ - int marked; /* Extended option is marked */ - char *code; /* Generic PS code for extended options */ - int num_params; /* Number of parameters */ - ppd_ext_param_t **params; /* Parameters */ -} ppd_ext_option_t; -# endif /* 0 */ - -typedef struct ppd_file_str /**** Files ****/ + char keyword[PPD_MAX_NAME]; /* Name of option that is being extended... */ + ppd_option_t *option; /* Option that is being extended... */ + int marked; /* Extended option is marked */ + cups_array_t *params; /* Parameters */ +} ppd_coption_t; + +typedef struct ppd_file_s /**** PPD File ****/ { - int language_level; /* Language level of device */ - int color_device; /* 1 = color device, 0 = grayscale */ - int variable_sizes; /* 1 = supports variable sizes, 0 = doesn't */ - int accurate_screens; - /* 1 = supports accurate screens, 0 = not */ - int contone_only; /* 1 = continuous tone only, 0 = not */ - int landscape; /* -90 or 90 */ - int model_number; /* Device-specific model number */ - int manual_copies; /* 1 = Copies done manually, 0 = hardware */ - int throughput; /* Pages per minute */ - ppd_cs_t colorspace; /* Default colorspace */ - char *patches; /* Patch commands to be sent to printer */ - int num_emulations; /* Number of emulations supported */ - ppd_emul_t *emulations; /* Emulations and the code to invoke them */ - char *jcl_begin; /* Start JCL commands */ - char *jcl_ps; /* Enter PostScript interpreter */ - char *jcl_end; /* End JCL commands */ - char *lang_encoding; /* Language encoding */ - char *lang_version; /* Language version (English, Spanish, etc.) */ - char *modelname; /* Model name (general) */ - char *ttrasterizer; /* Truetype rasterizer */ - char *manufacturer; /* Manufacturer name */ - char *product; /* Product name (from PS RIP/interpreter) */ - char *nickname; /* Nickname (specific) */ - char *shortnickname; /* Short version of nickname */ - int num_groups; /* Number of UI groups */ - ppd_group_t *groups; /* UI groups */ - int num_sizes; /* Number of page sizes */ - ppd_size_t *sizes; /* Page sizes */ - float custom_min[2]; /* Minimum variable page size */ - float custom_max[2]; /* Maximum variable page size */ - float custom_margins[4];/* Margins around page */ - int num_consts; /* Number of UI/Non-UI constraints */ - ppd_const_t *consts; /* UI/Non-UI constraints */ - int num_fonts; /* Number of pre-loaded fonts */ - char **fonts; /* Pre-loaded fonts */ - int num_profiles; /* Number of sRGB color profiles */ - ppd_profile_t *profiles; /* sRGB color profiles */ - int num_filters; /* Number of filters */ - char **filters; /* Filter strings... */ + int language_level; /* Language level of device */ + int color_device; /* 1 = color device, 0 = grayscale */ + int variable_sizes; /* 1 = supports variable sizes, 0 = doesn't */ + int accurate_screens; /* 1 = supports accurate screens, 0 = not */ + int contone_only; /* 1 = continuous tone only, 0 = not */ + int landscape; /* -90 or 90 */ + int model_number; /* Device-specific model number */ + int manual_copies; /* 1 = Copies done manually, 0 = hardware */ + int throughput; /* Pages per minute */ + ppd_cs_t colorspace; /* Default colorspace */ + char *patches; /* Patch commands to be sent to printer */ + int num_emulations; /* Number of emulations supported */ + ppd_emul_t *emulations; /* Emulations and the code to invoke them */ + char *jcl_begin; /* Start JCL commands */ + char *jcl_ps; /* Enter PostScript interpreter */ + char *jcl_end; /* End JCL commands */ + char *lang_encoding; /* Language encoding */ + char *lang_version; /* Language version (English, Spanish, etc.) */ + char *modelname; /* Model name (general) */ + char *ttrasterizer; /* Truetype rasterizer */ + char *manufacturer; /* Manufacturer name */ + char *product; /* Product name (from PS RIP/interpreter) */ + char *nickname; /* Nickname (specific) */ + char *shortnickname; /* Short version of nickname */ + int num_groups; /* Number of UI groups */ + ppd_group_t *groups; /* UI groups */ + int num_sizes; /* Number of page sizes */ + ppd_size_t *sizes; /* Page sizes */ + float custom_min[2]; /* Minimum variable page size */ + float custom_max[2]; /* Maximum variable page size */ + float custom_margins[4]; /* Margins around page */ + int num_consts; /* Number of UI/Non-UI constraints */ + ppd_const_t *consts; /* UI/Non-UI constraints */ + int num_fonts; /* Number of pre-loaded fonts */ + char **fonts; /* Pre-loaded fonts */ + int num_profiles; /* Number of sRGB color profiles */ + ppd_profile_t *profiles; /* sRGB color profiles */ + int num_filters; /* Number of filters */ + char **filters; /* Filter strings... */ /**** New in CUPS 1.1 ****/ - int flip_duplex; /* 1 = Flip page for back sides @since CUPS 1.1@ */ + int flip_duplex; /* 1 = Flip page for back sides @since CUPS 1.1@ */ /**** New in CUPS 1.1.19 ****/ - char *protocols; /* Protocols (BCP, TBCP) string @since CUPS 1.1.19@ */ - char *pcfilename; /* PCFileName string @since CUPS 1.1.19@ */ - int num_attrs; /* Number of attributes @since CUPS 1.1.19@ */ - int cur_attr; /* Current attribute @since CUPS 1.1.19@ */ - ppd_attr_t **attrs; /* Attributes @since CUPS 1.1.19@ */ + char *protocols; /* Protocols (BCP, TBCP) string @since CUPS 1.1.19@ */ + char *pcfilename; /* PCFileName string @since CUPS 1.1.19@ */ + int num_attrs; /* Number of attributes @since CUPS 1.1.19@ */ + int cur_attr; /* Current attribute @since CUPS 1.1.19@ */ + ppd_attr_t **attrs; /* Attributes @since CUPS 1.1.19@ */ /**** New in CUPS 1.2 ****/ -# if 0 - int num_extended; /* Number of extended options @since CUPS 1.2@ */ - ppd_ext_option_t **extended; /* Extended options @since CUPS 1.2@ */ -# endif /* 0 */ + cups_array_t *options; /* Option lookup array @since CUPS 1.2@ */ + cups_array_t *coptions; /* Custom options array @since CUPS 1.2@ */ } ppd_file_t; @@ -403,7 +362,19 @@ extern ppd_status_t ppdLastError(int *line); extern void ppdSetConformance(ppd_conform_t c); /**** New in CUPS 1.2 ****/ +extern int ppdCollect2(ppd_file_t *ppd, ppd_section_t section, + float min_order, ppd_choice_t ***choices); +extern int ppdEmitAfterOrder(ppd_file_t *ppd, FILE *fp, + ppd_section_t section, int limit, + float min_order); extern int ppdEmitJCLEnd(ppd_file_t *ppd, FILE *fp); +extern ppd_coption_t *ppdFindCustomOption(ppd_file_t *ppd, + const char *keyword); +extern ppd_cparam_t *ppdFindCustomParam(ppd_coption_t *opt, + const char *name); +extern ppd_cparam_t *ppdFirstCustomParam(ppd_coption_t *opt); +extern ppd_cparam_t *ppdNextCustomParam(ppd_coption_t *opt); +extern int ppdLocalize(ppd_file_t *ppd); extern ppd_file_t *ppdOpen2(cups_file_t *fp); @@ -417,5 +388,5 @@ extern ppd_file_t *ppdOpen2(cups_file_t *fp); #endif /* !_CUPS_PPD_H_ */ /* - * End of "$Id: ppd.h 4785 2005-10-13 19:39:05Z mike $". + * End of "$Id: ppd.h 4980 2006-01-25 19:57:45Z mike $". */ diff --git a/cups/sample.ppd b/cups/sample.ppd deleted file mode 100644 index 87e56006c..000000000 --- a/cups/sample.ppd +++ /dev/null @@ -1,299 +0,0 @@ -*PPD-Adobe: "4.3" -*% -*% "$Id: sample.ppd 2620 2002-08-14 05:34:15Z mike $" -*% -*% Sample HP DeskJet driver PPD file for the Common UNIX Printing -*% System (CUPS). -*% -*% Copyright 1997-2002 by Easy Software Products. -*% -*% These coded instructions, statements, and computer programs are the -*% property of Easy Software Products and are protected by Federal -*% copyright law. Distribution and use rights are outlined in the file -*% "LICENSE.txt" which should have been included with this file. If this -*% file is missing or damaged please contact Easy Software Products -*% at: -*% -*% Attn: CUPS Licensing Information -*% Easy Software Products -*% 44141 Airport View Drive, Suite 204 -*% Hollywood, Maryland 20636-3111 USA -*% -*% Voice: (301) 373-9603 -*% EMail: cups-info@cups.org -*% WWW: http://www.cups.org -*% -*FormatVersion: "4.3" -*FileVersion: "1.1" -*LanguageVersion: English -*LanguageEncoding: ISOLatin1 -*PCFileName: "DESKJET.PPD" -*Manufacturer: "ESP" -*Product: "(CUPS v1.1)" -*cupsVersion: 1.1 -*cupsManualCopies: True -*cupsFilter: "application/vnd.cups-raster 0 rastertohp" -*cupsModelNumber: 1 -*ModelName: "HP DeskJet Series" -*ShortNickName: "HP DeskJet Series" -*NickName: "HP DeskJet Series CUPS v1.1" -*PSVersion: "(3010.000) 550" -*LanguageLevel: "3" -*ColorDevice: True -*DefaultColorSpace: RGB -*FileSystem: False -*Throughput: "1" -*LandscapeOrientation: Plus90 -*VariablePaperSize: False -*TTRasterizer: Type42 - -*UIConstraints: *PageSize Executive *InputSlot Envelope -*UIConstraints: *PageSize Letter *InputSlot Envelope -*UIConstraints: *PageSize Legal *InputSlot Envelope -*UIConstraints: *PageSize Tabloid *InputSlot Envelope -*UIConstraints: *PageSize A3 *InputSlot Envelope -*UIConstraints: *PageSize A4 *InputSlot Envelope -*UIConstraints: *PageSize A5 *InputSlot Envelope -*UIConstraints: *PageSize B5 *InputSlot Envelope -*UIConstraints: *Resolution 600dpi *ColorModel CMYK - -*OpenUI *PageSize/Media Size: PickOne -*OrderDependency: 10 AnySetup *PageSize -*DefaultPageSize: Letter -*PageSize Letter/US Letter: "<</PageSize[612 792]/ImagingBBox null>>setpagedevice" -*PageSize Legal/US Legal: "<</PageSize[612 1008]/ImagingBBox null>>setpagedevice" -*PageSize Executive/US Executive: "<</PageSize[522 756]/ImagingBBox null>>setpagedevice" -*PageSize Tabloid/US Tabloid: "<</PageSize[792 1224]/ImagingBBox null>>setpagedevice" -*PageSize A3/A3: "<</PageSize[842 1191]/ImagingBBox null>>setpagedevice" -*PageSize A4/A4: "<</PageSize[595 842]/ImagingBBox null>>setpagedevice" -*PageSize A5/A5: "<</PageSize[421 595]/ImagingBBox null>>setpagedevice" -*PageSize B5/B5 (JIS): "<</PageSize[516 729]/ImagingBBox null>>setpagedevice" -*PageSize EnvISOB5/Envelope B5: "<</PageSize[499 709]/ImagingBBox null>>setpagedevice" -*PageSize Env10/Envelope #10: "<</PageSize[297 684]/ImagingBBox null>>setpagedevice" -*PageSize EnvC5/Envelope C5: "<</PageSize[459 649]/ImagingBBox null>>setpagedevice" -*PageSize EnvDL/Envelope DL: "<</PageSize[312 624]/ImagingBBox null>>setpagedevice" -*PageSize EnvMonarch/Envelope Monarch: "<</PageSize[279 540]/ImagingBBox null>>setpagedevice" -*CloseUI: *PageSize - -*OpenUI *PageRegion: PickOne -*OrderDependency: 10 AnySetup *PageRegion -*DefaultPageRegion: Letter -*PageRegion Letter/US Letter: "<</PageSize[612 792]/ImagingBBox null>>setpagedevice" -*PageRegion Legal/US Legal: "<</PageSize[612 1008]/ImagingBBox null>>setpagedevice" -*PageRegion Executive/US Executive: "<</PageSize[522 756]/ImagingBBox null>>setpagedevice" -*PageRegion Tabloid/US Tabloid: "<</PageSize[792 1224]/ImagingBBox null>>setpagedevice" -*PageRegion A3/A3: "<</PageSize[842 1191]/ImagingBBox null>>setpagedevice" -*PageRegion A4/A4: "<</PageSize[595 842]/ImagingBBox null>>setpagedevice" -*PageRegion A5/A5: "<</PageSize[421 595]/ImagingBBox null>>setpagedevice" -*PageRegion B5/B5 (JIS): "<</PageSize[516 729]/ImagingBBox null>>setpagedevice" -*PageRegion EnvISOB5/Envelope B5: "<</PageSize[499 709]/ImagingBBox null>>setpagedevice" -*PageRegion Env10/Envelope #10: "<</PageSize[297 684]/ImagingBBox null>>setpagedevice" -*PageRegion EnvC5/Envelope C5: "<</PageSize[459 649]/ImagingBBox null>>setpagedevice" -*PageRegion EnvDL/Envelope DL: "<</PageSize[312 624]/ImagingBBox null>>setpagedevice" -*PageRegion EnvMonarch/Envelope Monarch: "<</PageSize[279 540]/ImagingBBox null>>setpagedevice" -*CloseUI: *PageRegion - -*DefaultImageableArea: Letter -*ImageableArea Letter/US Letter: "18 36 594 756" -*ImageableArea Legal/US Legal: "18 36 594 972" -*ImageableArea Executive/US Executive: "18 36 504 684" -*ImageableArea Tabloid/US Tabloid: "18 36 774 1188" -*ImageableArea A3/A3: "18 36 824 1155" -*ImageableArea A4/A4: "18 36 577 806" -*ImageableArea A5/A5: "18 36 403 559" -*ImageableArea B5/JIS B5: "18 36 498 693" -*ImageableArea EnvISOB5/B5 (ISO): "18 36 463 673" -*ImageableArea Env10/Com-10: "18 36 279 648" -*ImageableArea EnvC5/EnvC5: "18 36 441 613" -*ImageableArea EnvDL/EnvDL: "18 36 294 588" -*ImageableArea EnvMonarch/Envelope Monarch: "18 36 261 504" - -*DefaultPaperDimension: Letter -*PaperDimension Letter/US Letter: "612 792" -*PaperDimension Legal/US Legal: "612 1008" -*PaperDimension Executive/US Executive: "522 756" -*PaperDimension Tabloid/US Tabloid: "792 1224" -*PaperDimension A3/A3: "842 1191" -*PaperDimension A4/A4: "595 842" -*PaperDimension A5/A5: "421 595" -*PaperDimension B5/B5 (JIS): "516 729" -*PaperDimension EnvISOB5/Envelope B5: "499 709" -*PaperDimension Env10/Envelope #10: "297 684" -*PaperDimension EnvC5/Envelope C5: "459 649" -*PaperDimension EnvDL/Envelope DL: "312 624" -*PaperDimension EnvMonarch/Envelope Monarch: "279 540" - -*OpenUI *MediaType/Media Type: PickOne -*OrderDependency: 10 AnySetup *MediaType -*DefaultMediaType: Plain -*MediaType Plain/Plain Paper: "<</MediaType(Plain)/cupsMediaType 0>>setpagedevice" -*MediaType Bond/Bond Paper: "<</MediaType(Bond)/cupsMediaType 1>>setpagedevice" -*MediaType Special/Special Paper: "<</MediaType(Special)/cupsMediaType 2>>setpagedevice" -*MediaType Transparency/Transparency: "<</MediaType(Transparency)/cupsMediaType 3>>setpagedevice" -*MediaType Glossy/Glossy Paper: "<</MediaType(Glossy)/cupsMediaType 4>>setpagedevice" -*CloseUI: *MediaType - -*OpenUI *InputSlot/Media Source: PickOne -*OrderDependency: 10 AnySetup *InputSlot -*DefaultInputSlot: Tray -*InputSlot Tray/Tray: "<</cupsMediaPosition 1>>setpagedevice" -*InputSlot Manual/Manual Feed: "<</cupsMediaPosition 2>>setpagedevice" -*InputSlot Envelope/Envelope Feed: "<</cupsMediaPosition 3>>setpagedevice" -*CloseUI: *InputSlot - -*OpenUI *Resolution/Output Resolution: PickOne -*OrderDependency: 20 AnySetup *Resolution -*DefaultResolution: 300dpi -*Resolution 150dpi/150 DPI: "<</HWResolution[150 150]>>setpagedevice" -*Resolution 300dpi/300 DPI: "<</HWResolution[300 300]>>setpagedevice" -*Resolution 600dpi/600 DPI: "<</HWResolution[600 600]/cupsColorSpace 3>>setpagedevice" -*CloseUI: *Resolution - -*OpenUI *ColorModel/Output Mode: PickOne -*OrderDependency: 10 AnySetup *ColorModel -*DefaultColorModel: CMYK -*ColorModel CMYK/CMYK Color: "<</cupsColorOrder 1/cupsColorSpace 8/cupsCompression 2>>setpagedevice" -*ColorModel RGB/CMY Color: "<</cupsColorOrder 1/cupsColorSpace 4/cupsCompression 2>>setpagedevice" -*ColorModel Gray/Grayscale: "<</cupsColorOrder 0/cupsColorSpace 3/cupsCompression 2>>setpagedevice" -*CloseUI: *ColorModel - -*OpenGroup Extended/Extended Options - -*OpenUI IntOption/Integer: PickOne -*OrderDependency: 10 AnySetup *IntOption -*DefaultIntOption: None -*IntOption None: "" -*IntOption 1: "<</cupsInteger0 1>>setpagedevice" -*IntOption 2: "<</cupsInteger0 2>>setpagedevice" -*IntOption 3: "<</cupsInteger0 3>>setpagedevice" -*IntOption 4: "<</cupsInteger0 4>>setpagedevice" -*IntOption 5: "<</cupsInteger0 5>>setpagedevice" -*cupsUIType IntOption: Integer -*cupsUIMinimum IntOption: "1" -*cupsUIMaximum IntOption: "5" -*cupsUICommand IntOption: "<</cupsInteger0 3 1 roll>>setpagedevice>>" -*CloseUI: *IntOption - -*OpenUI RealOption/Real Number: PickOne -*OrderDependency: 10 AnySetup *RealOption -*DefaultRealOption: None -*RealOption None: "" -*RealOption 1: "<</cupsReal0 1>>setpagedevice" -*RealOption 2: "<</cupsReal0 2>>setpagedevice" -*RealOption 3: "<</cupsReal0 3>>setpagedevice" -*RealOption 4: "<</cupsReal0 4>>setpagedevice" -*RealOption 5: "<</cupsReal0 5>>setpagedevice" -*cupsUIType RealOption: Real -*cupsUIMinimum RealOption: "1" -*cupsUIMaximum RealOption: "5" -*cupsUICommand RealOption: "<</cupsReal0 3 1 roll>>setpagedevice>>" -*CloseUI: *RealOption - -*OpenUI TextOption/Text: PickOne -*OrderDependency: 10 AnySetup *TextOption -*DefaultTextOption: None -*TextOption None: "" -*TextOption NOFORN: "<</cupsString0 (NOFORN)>>setpagedevice" -*TextOption FOIA: "<</cupsString0 (FOIA)>>setpagedevice" -*TextOption FOUO: "<</cupsString0 (FOUO)>>setpagedevice" -*cupsUIType TextOption: Text -*cupsUICommand TextOption: "<</cupsString0 3 1 roll>>setpagedevice>>" -*CloseUI: *TextOption - -*OpenUI GammaOption/Gamma Curve: PickOne -*OrderDependency: 10 AnySetup *GammaOption -*DefaultGammaOption: None -*GammaOption None: "" -*GammaOption 1: "<</cupsReal1 1>>setpagedevice" -*GammaOption 1.5: "<</cupsReal1 1.5>>setpagedevice" -*GammaOption 2.0: "<</cupsReal1 2>>setpagedevice" -*GammaOption 2.5: "<</cupsReal1 2.5>>setpagedevice" -*GammaOption 3.0: "<</cupsReal1 3>>setpagedevice" -*cupsUIType GammaOption: Integer -*cupsUIMinimum GammaOption: "1" -*cupsUIMaximum GammaOption: "3" -*cupsUICommand GammaOption: "<</cupsReal1 3 1 roll>>setpagedevice>>" -*CloseUI: *GammaOption - -*OpenUI CurveOption/Curve: PickOne -*OrderDependency: 10 AnySetup *CurveOption -*DefaultCurveOption: None -*CurveOption None: "" -*CurveOption 1: "<</cupsReal2 0/cupsReal3 1/cupsReal4 1>>setpagedevice" -*CurveOption 2: "<</cupsReal2 0/cupsReal3 1/cupsReal4 2>>setpagedevice" -*CurveOption 3: "<</cupsReal2 0/cupsReal3 1/cupsReal4 3>>setpagedevice" -*CurveOption 4: "<</cupsReal2 0/cupsReal3 1/cupsReal4 4>>setpagedevice" -*CurveOption 5: "<</cupsReal2 0/cupsReal3 1/cupsReal4 5>>setpagedevice" -*cupsUIType CurveOption: Curve -*cupsUIMinimum CurveOption: "0 0 1" -*cupsUIMaximum CurveOption: "1 1 5" -*cupsUICommand CurveOption: "<</cupsReal2 5 index/cupsReal3 6 index/cupsReal4 7 index>>setpagedevice pop pop pop>>" -*CloseUI: *CurveOption - -*OpenUI IntArrayOption/Integer Array: PickOne -*OrderDependency: 10 AnySetup *IntArrayOption -*DefaultIntArrayOption: None -*IntArrayOption None: "" -*IntArrayOption Linear: "<</cupsInteger[0 255]>>setpagedevice" -*IntArrayOption Parametric: "<</cupsInteger[0 28 113 255]>>setpagedevice" -*IntArrayOption Sine: "<</cupsInteger[0 44 87 128 164 195 221 240 251 255]>>setpagedevice" -*cupsUIType IntArrayOption: IntegerArray -*cupsUIMinimum IntArrayOption: "2 0" -*cupsUIMaximum IntArrayOption: "16 255" -*cupsUICommand IntArrayOption: "<</cupsInteger 3 1 roll>>setpagedevice>>" -*CloseUI: *IntArrayOption - -*OpenUI RealArrayOption/Real Array: PickOne -*OrderDependency: 10 AnySetup *RealArrayOption -*DefaultRealArrayOption: None -*RealArrayOption None: "" -*RealArrayOption Linear: "<</cupsReal[0 255]>>setpagedevice" -*RealArrayOption Parametric: "<</cupsReal[0 28 113 255]>>setpagedevice" -*RealArrayOption Sine: "<</cupsReal[0 44 87 128 164 195 221 240 251 255]>>setpagedevice" -*cupsUIType RealArrayOption: RealArray -*cupsUIMinimum RealArrayOption: "2 0" -*cupsUIMaximum RealArrayOption: "16 255" -*cupsUICommand RealArrayOption: "<</cupsReal 3 1 roll>>setpagedevice>>" -*CloseUI: *RealArrayOption - -*CloseGroup - -*DefaultFont: Courier -*Font AvantGarde-Book: Standard "(001.006S)" Standard ROM -*Font AvantGarde-BookOblique: Standard "(001.006S)" Standard ROM -*Font AvantGarde-Demi: Standard "(001.007S)" Standard ROM -*Font AvantGarde-DemiOblique: Standard "(001.007S)" Standard ROM -*Font Bookman-Demi: Standard "(001.004S)" Standard ROM -*Font Bookman-DemiItalic: Standard "(001.004S)" Standard ROM -*Font Bookman-Light: Standard "(001.004S)" Standard ROM -*Font Bookman-LightItalic: Standard "(001.004S)" Standard ROM -*Font Courier: Standard "(002.004S)" Standard ROM -*Font Courier-Bold: Standard "(002.004S)" Standard ROM -*Font Courier-BoldOblique: Standard "(002.004S)" Standard ROM -*Font Courier-Oblique: Standard "(002.004S)" Standard ROM -*Font Helvetica: Standard "(001.006S)" Standard ROM -*Font Helvetica-Bold: Standard "(001.007S)" Standard ROM -*Font Helvetica-BoldOblique: Standard "(001.007S)" Standard ROM -*Font Helvetica-Narrow: Standard "(001.006S)" Standard ROM -*Font Helvetica-Narrow-Bold: Standard "(001.007S)" Standard ROM -*Font Helvetica-Narrow-BoldOblique: Standard "(001.007S)" Standard ROM -*Font Helvetica-Narrow-Oblique: Standard "(001.006S)" Standard ROM -*Font Helvetica-Oblique: Standard "(001.006S)" Standard ROM -*Font NewCenturySchlbk-Bold: Standard "(001.009S)" Standard ROM -*Font NewCenturySchlbk-BoldItalic: Standard "(001.007S)" Standard ROM -*Font NewCenturySchlbk-Italic: Standard "(001.006S)" Standard ROM -*Font NewCenturySchlbk-Roman: Standard "(001.007S)" Standard ROM -*Font Palatino-Bold: Standard "(001.005S)" Standard ROM -*Font Palatino-BoldItalic: Standard "(001.005S)" Standard ROM -*Font Palatino-Italic: Standard "(001.005S)" Standard ROM -*Font Palatino-Roman: Standard "(001.005S)" Standard ROM -*Font Symbol: Special "(001.007S)" Special ROM -*Font Times-Bold: Standard "(001.007S)" Standard ROM -*Font Times-BoldItalic: Standard "(001.009S)" Standard ROM -*Font Times-Italic: Standard "(001.007S)" Standard ROM -*Font Times-Roman: Standard "(001.007S)" Standard ROM -*Font ZapfChancery-MediumItalic: Standard "(001.007S)" Standard ROM -*Font ZapfDingbats: Special "(001.004S)" Standard ROM -*% -*% End of "$Id: sample.ppd 2620 2002-08-14 05:34:15Z mike $". -*% diff --git a/cups/test.ppd b/cups/test.ppd new file mode 100644 index 000000000..5f1768cac --- /dev/null +++ b/cups/test.ppd @@ -0,0 +1,187 @@ +*PPD-Adobe: "4.3" +*% +*% "$Id: test.ppd 4939 2006-01-17 18:54:33Z mike $" +*% +*% Test PPD file for the Common UNIX Printing System (CUPS). +*% +*% This file is used to test the CUPS PPD API functions and cannot be +*% used with any known printers. Look at the PPD files in the "ppd" +*% subdirectory as well as the CUPS web site for working PPD files. +*% +*% If you are a PPD file developer, consider using the CUPS DDK to +*% create your PPD files - not only will it save you time, it produces +*% consistently high-quality files. +*% +*% Copyright 2002-2006 by Easy Software Products. +*% +*% These coded instructions, statements, and computer programs are the +*% property of Easy Software Products and are protected by Federal +*% copyright law. Distribution and use rights are outlined in the file +*% "LICENSE.txt" which should have been included with this file. If this +*% file is missing or damaged please contact Easy Software Products +*% at: +*% +*% Attn: CUPS Licensing Information +*% Easy Software Products +*% 44141 Airport View Drive, Suite 204 +*% Hollywood, Maryland 20636-3111 USA +*% +*% Voice: (301) 373-9603 +*% EMail: cups-info@cups.org +*% WWW: http://www.cups.org +*% +*FormatVersion: "4.3" +*FileVersion: "1.2" +*LanguageVersion: English +*LanguageEncoding: ISOLatin1 +*PCFileName: "TEST.PPD" +*Manufacturer: "ESP" +*Product: "(ESP Ghostscript)" +*cupsVersion: 1.2 +*cupsManualCopies: True +*cupsFilter: "application/vnd.cups-raster 0 rastertotest" +*cupsModelNumber: 1 +*ModelName: "Test" +*ShortNickName: "Test" +*NickName: "Test for CUPS v1.2" +*PSVersion: "(3010.000) 81501" +*LanguageLevel: "3" +*ColorDevice: True +*DefaultColorSpace: RGB +*FileSystem: False +*Throughput: "1" +*LandscapeOrientation: Plus90 +*TTRasterizer: Type42 + +*% These constraints are used to test ppdConflicts() +*UIConstraints: *PageSize Letter *InputSlot Envelope +*UIConstraints: *InputSlot Envelope *PageSize Letter + +*% For PageSize, we have put all of the translations in-line... +*OpenUI *PageSize/Page Size: PickOne +*fr.Translation PageSize/French Page Size: "" +*fr_CA.Translation PageSize/French Canadian Page Size: "" +*OrderDependency: 10 AnySetup *PageSize +*DefaultPageSize: Letter +*PageSize Letter/US Letter: "PageSize=Letter" +*fr.PageSize Letter/French US Letter: "" +*fr_CA.PageSize Letter/French Canadian US Letter: "" +*PageSize A4/A4: "PageSize=A4" +*fr.PageSize A4/French A4: "" +*fr_CA.PageSize A4/French Canadian A4: "" +*PageSize Env10/#10 Envelope: "PageSize=Env10" +*fr.PageSize Env10/French #10 Envelope: "" +*fr_CA.PageSize Env10/French Canadian #10 Envelope: "" +*CloseUI: *PageSize + +*% For PageRegion, we have separated the translations... +*OpenUI *PageRegion/Page Region: PickOne +*OrderDependency: 10 AnySetup *PageRegion +*DefaultPageRegion: Letter +*PageRegion Letter/US Letter: "PageRegion=Letter" +*PageRegion A4/A4: "PageRegion=A4" +*PageRegion Env10/#10 Envelope: "PageRegion=Env10" +*CloseUI: *PageRegion + +*fr.Translation PageRegion/French Page Region: "" +*fr.PageRegion Letter/French US Letter: "" +*fr.PageRegion A4/French A4: "" +*fr.PageRegion Env10/French #10 Envelope: "" + +*fr_CA.Translation PageRegion/French Canadian Page Region: "" +*fr_CA.PageRegion Letter/French Canadian US Letter: "" +*fr_CA.PageRegion A4/French Canadian A4: "" +*fr_CA.PageRegion Env10/French Canadian #10 Envelope: "" + +*DefaultImageableArea: Letter +*ImageableArea Letter: "18 36 594 756" +*ImageableArea A4: "18 36 577 806" +*ImageableArea Env10: "18 36 279 648" + +*DefaultPaperDimension: Letter +*PaperDimension Letter: "612 792" +*PaperDimension A4: "595 842" +*PaperDimension Env10: "297 684" + +*% Custom page size support +*HWMargins: 0 0 0 0 +*CustomPageSize True/Custom Page Size: "PageSize=Custom" +*ParamCustomPageSize Width: 1 points 36 1080 +*ParamCustomPageSize Height: 2 points 36 86400 +*ParamCustomPageSize WidthOffset/Width Offset: 3 points 0 0 +*ParamCustomPageSize HeightOffset/Height Offset: 4 points 0 0 +*ParamCustomPageSize Orientation: 5 int 0 0 + +*OpenUI *InputSlot/Input Slot: PickOne +*OrderDependency: 10 AnySetup *InputSlot +*DefaultInputSlot: Tray +*InputSlot Tray/Tray: "InputSlot=Tray" +*InputSlot Manual/Manual Feed: "InputSlot=Manual" +*InputSlot Envelope/Envelope Feed: "InputSlot=Envelope" +*CloseUI: *InputSlot + +*% Custom options... +*OpenGroup: Extended/Extended Options + +*OpenUI IntOption/Integer: PickOne +*OrderDependency: 10 AnySetup *IntOption +*DefaultIntOption: None +*IntOption 1: "IntOption=1" +*IntOption 2: "IntOption=2" +*IntOption 3: "IntOption=3" +*CloseUI: *IntOption + +*CustomIntOption True/Custom Integer: "IntOption=Custom" +*ParamCustomIntOption Integer: 1 int -100 100 + +*OpenUI StringOption/String: PickOne +*OrderDependency: 10 AnySetup *StringOption +*DefaultStringOption: None +*StringOption foo: "StringOption=foo" +*StringOption bar: "StringOption=bar" +*CloseUI: *StringOption + +*CustomStringOption True/Custom Stringeger: "StringOption=Custom" +*ParamCustomStringOption String: 1 string * ********** + +*CloseGroup: Extended + +*DefaultFont: Courier +*Font AvantGarde-Book: Standard "(001.006S)" Standard ROM +*Font AvantGarde-BookOblique: Standard "(001.006S)" Standard ROM +*Font AvantGarde-Demi: Standard "(001.007S)" Standard ROM +*Font AvantGarde-DemiOblique: Standard "(001.007S)" Standard ROM +*Font Bookman-Demi: Standard "(001.004S)" Standard ROM +*Font Bookman-DemiItalic: Standard "(001.004S)" Standard ROM +*Font Bookman-Light: Standard "(001.004S)" Standard ROM +*Font Bookman-LightItalic: Standard "(001.004S)" Standard ROM +*Font Courier: Standard "(002.004S)" Standard ROM +*Font Courier-Bold: Standard "(002.004S)" Standard ROM +*Font Courier-BoldOblique: Standard "(002.004S)" Standard ROM +*Font Courier-Oblique: Standard "(002.004S)" Standard ROM +*Font Helvetica: Standard "(001.006S)" Standard ROM +*Font Helvetica-Bold: Standard "(001.007S)" Standard ROM +*Font Helvetica-BoldOblique: Standard "(001.007S)" Standard ROM +*Font Helvetica-Narrow: Standard "(001.006S)" Standard ROM +*Font Helvetica-Narrow-Bold: Standard "(001.007S)" Standard ROM +*Font Helvetica-Narrow-BoldOblique: Standard "(001.007S)" Standard ROM +*Font Helvetica-Narrow-Oblique: Standard "(001.006S)" Standard ROM +*Font Helvetica-Oblique: Standard "(001.006S)" Standard ROM +*Font NewCenturySchlbk-Bold: Standard "(001.009S)" Standard ROM +*Font NewCenturySchlbk-BoldItalic: Standard "(001.007S)" Standard ROM +*Font NewCenturySchlbk-Italic: Standard "(001.006S)" Standard ROM +*Font NewCenturySchlbk-Roman: Standard "(001.007S)" Standard ROM +*Font Palatino-Bold: Standard "(001.005S)" Standard ROM +*Font Palatino-BoldItalic: Standard "(001.005S)" Standard ROM +*Font Palatino-Italic: Standard "(001.005S)" Standard ROM +*Font Palatino-Roman: Standard "(001.005S)" Standard ROM +*Font Symbol: Special "(001.007S)" Special ROM +*Font Times-Bold: Standard "(001.007S)" Standard ROM +*Font Times-BoldItalic: Standard "(001.009S)" Standard ROM +*Font Times-Italic: Standard "(001.007S)" Standard ROM +*Font Times-Roman: Standard "(001.007S)" Standard ROM +*Font ZapfChancery-MediumItalic: Standard "(001.007S)" Standard ROM +*Font ZapfDingbats: Special "(001.004S)" Standard ROM +*% +*% End of "$Id: test.ppd 4939 2006-01-17 18:54:33Z mike $". +*% diff --git a/cups/testfile.c b/cups/testfile.c index de50fc5e2..60822a276 100644 --- a/cups/testfile.c +++ b/cups/testfile.c @@ -1,5 +1,5 @@ /* - * "$Id: testfile.c 4754 2005-10-08 04:01:46Z mike $" + * "$Id: testfile.c 4942 2006-01-18 19:49:15Z mike $" * * File test program for the Common UNIX Printing System (CUPS). * @@ -57,33 +57,79 @@ int /* O - Exit status */ main(int argc, /* I - Number of command-line arguments */ char *argv[]) /* I - Command-line arguments */ { - int status; /* Exit status */ + int status; /* Exit status */ + char filename[1024]; /* Filename buffer */ - /* - * Do uncompressed file tests... - */ + if (argc == 1) + { + /* + * Do uncompressed file tests... + */ - status = read_write_tests(0); + status = read_write_tests(0); #ifdef HAVE_LIBZ - /* - * Do compressed file tests... - */ + /* + * Do compressed file tests... + */ - putchar('\n'); + putchar('\n'); - status += read_write_tests(1); + status += read_write_tests(1); #endif /* HAVE_LIBZ */ - /* - * Summarize the results and return... - */ + /* + * Test path functions... + */ + + fputs("cupsFileFind: ", stdout); + if (cupsFileFind("cat", "/bin", filename, sizeof(filename)) && + cupsFileFind("cat", "/bin:/usr/bin", filename, sizeof(filename))) + printf("PASS (%s)\n", filename); + else + { + puts("FAIL"); + status ++; + } - if (!status) - puts("\nALL TESTS PASSED!"); + /* + * Summarize the results and return... + */ + + if (!status) + puts("\nALL TESTS PASSED!"); + else + printf("\n%d TEST(S) FAILED!\n", status); + } else - printf("\n%d TEST(S) FAILED!\n", status); + { + /* + * Cat the filename on the command-line... + */ + + cups_file_t *fp; /* File pointer */ + char line[1024]; /* Line from file */ + + + if ((fp = cupsFileOpen(argv[1], "r")) == NULL) + { + perror(argv[1]); + status = 1; + } + else + { + status = 0; + + while (cupsFileGets(fp, line, sizeof(line))) + puts(line); + + if (!cupsFileEOF(fp)) + perror(argv[1]); + + cupsFileClose(fp); + } + } return (status); } @@ -396,5 +442,5 @@ read_write_tests(int compression) /* I - Use compression? */ /* - * End of "$Id: testfile.c 4754 2005-10-08 04:01:46Z mike $". + * End of "$Id: testfile.c 4942 2006-01-18 19:49:15Z mike $". */ diff --git a/cups/testhttp.c b/cups/testhttp.c index 57e94c900..69f959541 100644 --- a/cups/testhttp.c +++ b/cups/testhttp.c @@ -1,5 +1,5 @@ /* - * "$Id: testhttp.c 4809 2005-10-21 19:43:55Z mike $" + * "$Id: testhttp.c 4943 2006-01-18 20:30:42Z mike $" * * HTTP test program for the Common UNIX Printing System (CUPS). * @@ -96,6 +96,8 @@ static uri_test_t uri_tests[] = /* URI test data */ "socket", "", "server", "/", 9100, 0 }, { HTTP_URI_OK, "ipp://username:password@[v1.fe80::200:1234:5678:9abc+eth0]:999/ipp", "ipp", "username:password", "fe80::200:1234:5678:9abc%eth0", "/ipp", 999, 999 }, + { HTTP_URI_OK, "http://server/admin?DEVICE_URI=usb://HP/Photosmart%25202600%2520series?serial=MY53OK70V10400", + "http", "", "server", "/admin?DEVICE_URI=usb://HP/Photosmart%25202600%2520series?serial=MY53OK70V10400", 80, 0 }, /* Missing scheme */ { HTTP_URI_MISSING_SCHEME, "/path/to/file/index.html", @@ -510,5 +512,5 @@ main(int argc, /* I - Number of command-line arguments */ /* - * End of "$Id: testhttp.c 4809 2005-10-21 19:43:55Z mike $". + * End of "$Id: testhttp.c 4943 2006-01-18 20:30:42Z mike $". */ diff --git a/cups/testppd.c b/cups/testppd.c new file mode 100644 index 000000000..5a66a3d4a --- /dev/null +++ b/cups/testppd.c @@ -0,0 +1,86 @@ +/* + * "$Id: testppd.c 4939 2006-01-17 18:54:33Z mike $" + * + * PPD test program for the Common UNIX Printing System (CUPS). + * + * Copyright 1997-2006 by Easy Software Products. + * + * These coded instructions, statements, and computer programs are the + * property of Easy Software Products and are protected by Federal + * copyright law. Distribution and use rights are outlined in the file + * "LICENSE.txt" which should have been included with this file. If this + * file is missing or damaged please contact Easy Software Products + * at: + * + * Attn: CUPS Licensing Information + * Easy Software Products + * 44141 Airport View Drive, Suite 204 + * Hollywood, Maryland 20636 USA + * + * Voice: (301) 373-9600 + * EMail: cups-info@cups.org + * WWW: http://www.cups.org + * + * This file is subject to the Apple OS-Developed Software exception. + * + * Contents: + * + * main() - Main entry. + */ + +/* + * Include necessary headers... + */ + +#include <stdio.h> +#include <stdlib.h> +#include <cups/string.h> +#include <errno.h> +#include "ppd.h" +#ifdef WIN32 +# include <io.h> +#else +# include <unistd.h> +# include <fcntl.h> +#endif /* WIN32 */ + + +/* + * 'main()' - Main entry. + */ + +int /* O - Exit status */ +main(int argc, /* I - Number of command-line arguments */ + char *argv[]) /* I - Command-line arguments */ +{ + ppd_file_t *ppd; /* PPD file loaded from disk */ + int status; /* Status of tests (0 = success, 1 = fail) */ + + + status = 0; + + fputs("ppdOpenFile: ", stdout); + + if ((ppd = ppdOpenFile("test.ppd")) != NULL) + puts("PASS"); + else + { + ppd_status_t err; /* Last error in file */ + int line; /* Line number in file */ + + + status ++; + err = ppdLastError(&line); + + printf("FAIL (%s on line %d)\n", ppdErrorString(err), line); + } + + ppdClose(ppd); + + return (status); +} + + +/* + * End of "$Id: testppd.c 4939 2006-01-17 18:54:33Z mike $". + */ diff --git a/cups/transcode.c b/cups/transcode.c index b525b36f7..989e28b3e 100644 --- a/cups/transcode.c +++ b/cups/transcode.c @@ -1,5 +1,5 @@ /* - * "$Id: transcode.c 4903 2006-01-10 20:02:46Z mike $" + * "$Id: transcode.c 4967 2006-01-24 03:42:15Z mike $" * * Transcoding support for the Common UNIX Printing System (CUPS). * @@ -26,6 +26,7 @@ * cupsCharmapGet() - Get a character set map. * cupsCharmapFree() - Free a character set map. * cupsCharmapFlush() - Flush all character set maps out of cache. + * _cupsCharmapFlush() - Flush all character set maps out of cache. * cupsUTF8ToCharset() - Convert UTF-8 to legacy character set. * cupsCharsetToUTF8() - Convert legacy character set to UTF-8. * cupsUTF8ToUTF16() - Convert UTF-8 to UTF-16. @@ -171,22 +172,33 @@ cupsCharmapFree(const cups_encoding_t encoding) return; } + /* * 'cupsCharmapFlush()' - Flush all character set maps out of cache. */ void cupsCharmapFlush(void) { - int i; /* Looping variable */ - _cups_cmap_t *cmap; /* Legacy SBCS / Unicode Charset Map */ - _cups_vmap_t *vmap; /* Legacy VBCS / Unicode Charset Map */ - _cups_cmap_t *cnext; /* Next Legacy SBCS Charset Map */ - _cups_vmap_t *vnext; /* Next Legacy VBCS Charset Map */ - cups_ucs2_t *crow; /* Pointer to UCS-2 row in 'char2uni' */ - cups_sbcs_t *srow; /* Pointer to SBCS row in 'uni2char' */ - cups_vbcs_t *vrow; /* Pointer to VBCS row in 'uni2char' */ - _cups_globals_t *cg = _cupsGlobals(); - /* Pointer to library globals */ + _cupsCharmapFlush(_cupsGlobals()); +} + + +/* + * '_cupsCharmapFlush()' - Flush all character set maps out of cache. + */ + +void +_cupsCharmapFlush(_cups_globals_t *cg) /* I - Global data */ +{ + int i; /* Looping variable */ + _cups_cmap_t *cmap; /* Legacy SBCS / Unicode Charset Map */ + _cups_vmap_t *vmap; /* Legacy VBCS / Unicode Charset Map */ + _cups_cmap_t *cnext; /* Next Legacy SBCS Charset Map */ + _cups_vmap_t *vnext; /* Next Legacy VBCS Charset Map */ + cups_ucs2_t *crow; /* Pointer to UCS-2 row in 'char2uni' */ + cups_sbcs_t *srow; /* Pointer to SBCS row in 'uni2char' */ + cups_vbcs_t *vrow; /* Pointer to VBCS row in 'uni2char' */ + /* * Loop through SBCS charset map cache, free all memory... @@ -1664,5 +1676,5 @@ compare_wide(const void *k1, /* I - Key char */ /* - * End of "$Id: transcode.c 4903 2006-01-10 20:02:46Z mike $" + * End of "$Id: transcode.c 4967 2006-01-24 03:42:15Z mike $" */ diff --git a/cups/util.c b/cups/util.c index 7144ecec4..e26db23f2 100644 --- a/cups/util.c +++ b/cups/util.c @@ -1,5 +1,5 @@ /* - * "$Id: util.c 4918 2006-01-12 05:14:40Z mike $" + * "$Id: util.c 4987 2006-01-26 00:25:21Z mike $" * * Printing utilities for the Common UNIX Printing System (CUPS). * @@ -25,25 +25,36 @@ * * Contents: * - * cupsCancelJob() - Cancel a print job on the default server. - * cupsDoFileRequest() - Do an IPP request. - * cupsFreeJobs() - Free memory used by job data. - * cupsGetClasses() - Get a list of printer classes from the default server. - * cupsGetDefault() - Get the default printer or class from the default server. - * cupsGetDefault2() - Get the default printer or class from the specified server. - * cupsGetJobs() - Get the jobs from the default server. - * cupsGetJobs2() - Get the jobs from the specified server. - * cupsGetPPD() - Get the PPD file for a printer on the default server. - * cupsGetPPD2() - Get the PPD file for a printer on the specified server. - * cupsGetPrinters() - Get a list of printers from the default server. - * cupsLastError() - Return the last IPP status code. - * cupsLastErrorString() - Return the last IPP status-message. - * cupsPrintFile() - Print a file to a printer or class on the default server. - * cupsPrintFile2() - Print a file to a printer or class on the specified server. - * cupsPrintFiles() - Print one or more files to a printer or class on the default server. - * cupsPrintFiles2() - Print one or more files to a printer or class on the specified server. - * cups_connect() - Connect to the specified host... - * cups_set_error() - Set the last IPP status code and status-message. + * cupsCancelJob() - Cancel a print job on the default server. + * cupsDoFileRequest() - Do an IPP request. + * cupsFreeJobs() - Free memory used by job data. + * cupsGetClasses() - Get a list of printer classes from the default + * server. + * cupsGetDefault() - Get the default printer or class from the default + * server. + * cupsGetDefault2() - Get the default printer or class from the + * specified server. + * cupsGetJobs() - Get the jobs from the default server. + * cupsGetJobs2() - Get the jobs from the specified server. + * cupsGetPPD() - Get the PPD file for a printer on the default + * server. + * cupsGetPPD2() - Get the PPD file for a printer on the specified + * server. + * cupsGetPrinters() - Get a list of printers from the default server. + * cupsLastError() - Return the last IPP status code. + * cupsLastErrorString() - Return the last IPP status-message. + * cupsPrintFile() - Print a file to a printer or class on the default + * server. + * cupsPrintFile2() - Print a file to a printer or class on the + * specified server. + * cupsPrintFiles() - Print one or more files to a printer or class on + * the default server. + * cupsPrintFiles2() - Print one or more files to a printer or class on + * the specified server. + * cups_connect() - Connect to the specified host... + * cups_get_printer_uri() - Get the printer-uri-supported attribute for the + * first printer in a class. + * cups_set_error() - Set the last IPP status code and status-message. */ /* @@ -68,6 +79,10 @@ */ static char *cups_connect(const char *name, char *printer, char *hostname); +static int cups_get_printer_uri(http_t *http, const char *name, + char *host, int hostsize, int *port, + char *resource, int resourcesize, + int depth); static void cups_set_error(ipp_status_t status, const char *message); @@ -354,7 +369,11 @@ cupsDoFileRequest(http_t *http, /* I - HTTP connection to server */ if (cupsDoAuthentication(http, "POST", resource)) break; - httpReconnect(http); + if (httpReconnect(http)) + { + status = HTTP_ERROR; + break; + } continue; } @@ -1121,29 +1140,15 @@ const char * /* O - Filename for PPD file */ cupsGetPPD2(http_t *http, /* I - HTTP connection */ const char *name) /* I - Printer name */ { - int i; /* Looping var */ int http_port; /* Port number */ http_t *http2; /* Alternate HTTP connection */ - ipp_t *request, /* IPP request */ - *response; /* IPP response */ - ipp_attribute_t *attr; /* Current attribute */ - cups_lang_t *language; /* Local language */ int fd; /* PPD file */ - char uri[HTTP_MAX_URI], /* Printer URI */ - printer[HTTP_MAX_URI], /* Printer name */ - method[HTTP_MAX_URI], /* Method/scheme name */ - username[HTTP_MAX_URI], /* Username:password */ + char localhost[HTTP_MAX_URI],/* Local hostname */ hostname[HTTP_MAX_URI], /* Hostname */ resource[HTTP_MAX_URI]; /* Resource name */ int port; /* Port number */ http_status_t status; /* HTTP status from server */ _cups_globals_t *cg = _cupsGlobals(); /* Pointer to library globals */ - static const char * const requested_attrs[] = - { /* Requested attributes */ - "printer-uri-supported", - "printer-type", - "member-uris" - }; /* @@ -1161,19 +1166,24 @@ cupsGetPPD2(http_t *http, /* I - HTTP connection */ } /* - * Setup the printer URI... + * Try finding a printer URI for this printer... */ - if (httpAssembleURIf(uri, sizeof(uri), "ipp", NULL, "localhost", 0, - "/printers/%s", name) != HTTP_URI_OK) - { - cups_set_error(IPP_INTERNAL_ERROR, NULL); - + if (!cups_get_printer_uri(http, name, hostname, sizeof(hostname), &port, + resource, sizeof(resource), 0)) return (NULL); - } /* - * Get the port number we are connect to... + * Remap local hostname to localhost... + */ + + httpGetHostname(localhost, sizeof(localhost)); + + if (!strcasecmp(localhost, hostname)) + strcpy(hostname, "localhost"); + + /* + * Get the port number we are connected to... */ #ifdef AF_INET6 @@ -1186,106 +1196,6 @@ cupsGetPPD2(http_t *http, /* I - HTTP connection */ else http_port = ippPort(); - port = http_port; - - /* - * Build an IPP_GET_PRINTER_ATTRIBUTES request, which requires the following - * attributes: - * - * attributes-charset - * attributes-natural-language - * printer-uri - * requested-attributes - */ - - request = ippNew(); - - request->request.op.operation_id = IPP_GET_PRINTER_ATTRIBUTES; - request->request.op.request_id = 1; - - language = cupsLangDefault(); - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET, - "attributes-charset", NULL, cupsLangEncoding(language)); - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE, - "attributes-natural-language", NULL, language->language); - - cupsLangFree(language); - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, - "printer-uri", NULL, uri); - - DEBUG_printf(("cupsGetPPD2: printer-uri=\"%s\"\n", uri)); - - ippAddStrings(request, IPP_TAG_OPERATION, IPP_TAG_NAME, - "requested-attributes", - sizeof(requested_attrs) / sizeof(requested_attrs[0]), - NULL, requested_attrs); - - /* - * Do the request and get back a response... - */ - - if ((response = cupsDoRequest(http, request, "/")) != NULL) - { - printer[0] = '\0'; - hostname[0] = '\0'; - - if ((attr = ippFindAttribute(response, "member-uris", IPP_TAG_URI)) != NULL) - { - /* - * Get the first actual server and printer name in the class... - */ - - for (i = 0; i < attr->num_values; i ++) - { - httpSeparateURI(attr->values[i].string.text, method, sizeof(method), - username, sizeof(username), hostname, sizeof(hostname), - &port, resource, sizeof(resource)); - if (!strncmp(resource, "/printers/", 10)) - { - /* - * Found a printer! - */ - - strlcpy(printer, resource + 10, sizeof(printer)); - break; - } - } - } - else if ((attr = ippFindAttribute(response, "printer-uri-supported", - IPP_TAG_URI)) != NULL) - { - /* - * Get the actual server and printer names... - */ - - httpSeparateURI(attr->values[0].string.text, method, sizeof(method), - username, sizeof(username), hostname, sizeof(hostname), - &port, resource, sizeof(resource)); - - strlcpy(printer, strrchr(resource, '/') + 1, sizeof(printer)); - } - - ippDelete(response); - - /* - * Remap local hostname to localhost... - */ - - httpGetHostname(uri, sizeof(uri)); - - if (!strcasecmp(uri, hostname)) - strcpy(hostname, "localhost"); - } - - if (!printer[0]) - { - cups_set_error(IPP_NOT_FOUND, NULL); - return (NULL); - } - /* * Reconnect to the correct server as needed... */ @@ -1322,7 +1232,7 @@ cupsGetPPD2(http_t *http, /* I - HTTP connection */ * And send a request to the HTTP server... */ - snprintf(resource, sizeof(resource), "/printers/%s.ppd", printer); + strlcat(resource, ".ppd", sizeof(resource)); status = cupsGetFd(http2, resource, fd); @@ -1553,7 +1463,8 @@ cupsPrintFile2(http_t *http, /* I - HTTP connection */ /* - * 'cupsPrintFiles()' - Print one or more files to a printer or class on the default server. + * 'cupsPrintFiles()' - Print one or more files to a printer or class on the + * default server. */ int /* O - Job ID */ @@ -1596,7 +1507,8 @@ cupsPrintFiles(const char *name, /* I - Printer or class name */ /* - * 'cupsPrintFiles2()' - Print one or more files to a printer or class on the specified server. + * 'cupsPrintFiles2()' - Print one or more files to a printer or class on the + * specified server. * * @since CUPS 1.1.21@ */ @@ -1761,17 +1673,18 @@ cupsPrintFiles2(http_t *http, /* I - HTTP connection */ */ if (cupsGetOption("raw", num_options, options)) - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_MIMETYPE, "document-format", - NULL, "application/vnd.cups-raw"); - else if ((val = cupsGetOption("document-format", num_options, options)) != NULL) - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_MIMETYPE, "document-format", - NULL, val); + ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_MIMETYPE, + "document-format", NULL, "application/vnd.cups-raw"); + else if ((val = cupsGetOption("document-format", num_options, + options)) != NULL) + ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_MIMETYPE, + "document-format", NULL, val); else - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_MIMETYPE, "document-format", - NULL, "application/octet-stream"); + ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_MIMETYPE, + "document-format", NULL, "application/octet-stream"); - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "requesting-user-name", - NULL, cupsUser()); + ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, + "requesting-user-name", NULL, cupsUser()); /* * Is this the last document? @@ -1807,7 +1720,7 @@ cups_connect(const char *name, /* I - Destination (printer[@host]) */ char *hostname) /* O - Hostname [HTTP_MAX_URI] */ { char hostbuf[HTTP_MAX_URI]; /* Name of host */ - _cups_globals_t *cg = _cupsGlobals(); /* Pointer to library globals */ + _cups_globals_t *cg = _cupsGlobals();/* Pointer to library globals */ DEBUG_printf(("cups_connect(\"%s\", %p, %p)\n", name, printer, hostname)); @@ -1848,7 +1761,7 @@ cups_connect(const char *name, /* I - Destination (printer[@host]) */ DEBUG_printf(("connecting to %s on port %d...\n", hostname, ippPort())); if ((cg->http = httpConnectEncrypt(hostname, ippPort(), - cupsEncryption())) == NULL) + cupsEncryption())) == NULL) { DEBUG_puts("Unable to connect to server!"); @@ -1862,6 +1775,195 @@ cups_connect(const char *name, /* I - Destination (printer[@host]) */ /* + * '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 */ +cups_get_printer_uri( + http_t *http, /* I - HTTP connection */ + const char *name, /* I - Name of printer or class */ + char *host, /* I - Hostname buffer */ + int hostsize, /* I - Size of hostname buffer */ + int *port, /* O - Port number */ + char *resource, /* I - Resource buffer */ + int resourcesize, /* I - Size of resource buffer */ + int depth) /* I - Depth of query */ +{ + int i; /* Looping var */ + int http_port; /* Port number */ + http_t *http2; /* Alternate HTTP connection */ + ipp_t *request, /* IPP request */ + *response; /* IPP response */ + ipp_attribute_t *attr; /* Current attribute */ + char uri[HTTP_MAX_URI], /* printer-uri attribute */ + scheme[HTTP_MAX_URI], /* Scheme name */ + username[HTTP_MAX_URI], /* Username:password */ + classname[255]; /* Temporary class name */ + static const char * const requested_attrs[] = + { /* Requested attributes */ + "printer-uri-supported", + "printer-type", + "member-uris" + }; + + + DEBUG_printf(("cups_get_printer_uri(http=%p, name=\"%s\", host=%p, " + "hostsize=%d, resource=%p, resourcesize=%d, depth=%d)\n", + http, name ? name : "(null)", host, hostsize, + resource, resourcesize, depth)); + + /* + * Setup the printer URI... + */ + + if (httpAssembleURIf(uri, sizeof(uri), "ipp", NULL, "localhost", 0, + "/printers/%s", name) != HTTP_URI_OK) + { + cups_set_error(IPP_INTERNAL_ERROR, NULL); + + *host = '\0'; + *resource = '\0'; + + return (0); + } + + DEBUG_printf(("cups_get_printer_uri: printer-uri=\"%s\"\n", uri)); + + /* + * Get the port number we are connected to... + */ + +#ifdef AF_INET6 + if (http->hostaddr->addr.sa_family == AF_INET6) + http_port = ntohs(http->hostaddr->ipv6.sin6_port); + else +#endif /* AF_INET6 */ + if (http->hostaddr->addr.sa_family == AF_INET) + http_port = ntohs(http->hostaddr->ipv4.sin_port); + else + http_port = ippPort(); + + /* + * Build an IPP_GET_PRINTER_ATTRIBUTES request, which requires the following + * attributes: + * + * attributes-charset + * attributes-natural-language + * printer-uri + * requested-attributes + */ + + request = ippNewRequest(IPP_GET_PRINTER_ATTRIBUTES); + + ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", + NULL, uri); + + ippAddStrings(request, IPP_TAG_OPERATION, IPP_TAG_NAME, + "requested-attributes", + sizeof(requested_attrs) / sizeof(requested_attrs[0]), + NULL, requested_attrs); + + /* + * Do the request and get back a response... + */ + + if ((response = cupsDoRequest(http, request, "/")) != NULL) + { + if ((attr = ippFindAttribute(response, "member-uris", IPP_TAG_URI)) != NULL) + { + /* + * Get the first actual printer name in the class... + */ + + for (i = 0; i < attr->num_values; i ++) + { + httpSeparateURI(attr->values[i].string.text, scheme, sizeof(scheme), + username, sizeof(username), host, hostsize, + port, resource, resourcesize); + if (!strncmp(resource, "/printers/", 10)) + { + /* + * Found a printer! + */ + + ippDelete(response); + + return (1); + } + } + + /* + * No printers in this class - try recursively looking for a printer, + * but not more than 3 levels deep... + */ + + if (depth < 3) + { + for (i = 0; i < attr->num_values; i ++) + { + httpSeparateURI(attr->values[i].string.text, scheme, sizeof(scheme), + username, sizeof(username), host, hostsize, + port, resource, resourcesize); + if (!strncmp(resource, "/classes/", 9)) + { + /* + * Found a class! Connect to the right server... + */ + + if (!strcasecmp(http->hostname, host) && *port == http_port) + http2 = http; + else if ((http2 = httpConnectEncrypt(host, *port, + cupsEncryption())) == NULL) + { + DEBUG_puts("Unable to connect to server!"); + + continue; + } + + /* + * Look up printers on that server... + */ + + strlcpy(classname, resource + 9, sizeof(classname)); + + cups_get_printer_uri(http2, classname, host, hostsize, port, + resource, resourcesize, depth + 1); + + /* + * Close the connection as needed... + */ + + if (http2 != http) + httpClose(http2); + + if (*host) + return (1); + } + } + } + } + else if ((attr = ippFindAttribute(response, "printer-uri-supported", + IPP_TAG_URI)) != NULL) + { + httpSeparateURI(attr->values[0].string.text, scheme, sizeof(scheme), + username, sizeof(username), host, hostsize, + port, resource, resourcesize); + ippDelete(response); + + return (1); + } + + ippDelete(response); + } + + *host = '\0'; + *resource = '\0'; + + return (0); +} + + +/* * 'cups_set_error()' - Set the last IPP status code and status-message. */ @@ -1888,5 +1990,5 @@ cups_set_error(ipp_status_t status, /* I - IPP status code */ /* - * End of "$Id: util.c 4918 2006-01-12 05:14:40Z mike $". + * End of "$Id: util.c 4987 2006-01-26 00:25:21Z mike $". */ diff --git a/data/Makefile b/data/Makefile index bf9e47d18..60383a958 100644 --- a/data/Makefile +++ b/data/Makefile @@ -1,5 +1,5 @@ # -# "$Id: Makefile 4494 2005-02-18 02:18:11Z mike $" +# "$Id: Makefile 4950 2006-01-19 16:07:57Z mike $" # # Datafile makefile for the Common UNIX Printing System (CUPS). # @@ -136,7 +136,7 @@ clean: # Install files... # -install: +install: all $(INSTALL_DIR) $(DATADIR)/banners for file in $(BANNERS); do \ $(INSTALL_DATA) $$file $(DATADIR)/banners; \ @@ -153,8 +153,9 @@ install: for file in $(DATAFILES); do \ $(INSTALL_DATA) $$file $(DATADIR)/data; \ done + $(INSTALL_DIR) $(DATADIR)/profiles # -# End of "$Id: Makefile 4494 2005-02-18 02:18:11Z mike $". +# End of "$Id: Makefile 4950 2006-01-19 16:07:57Z mike $". # diff --git a/data/testprint.ps b/data/testprint.ps index 69a2406e3..c437ae212 100644 --- a/data/testprint.ps +++ b/data/testprint.ps @@ -6,7 +6,7 @@ %%DocumentSuppliedResources: procset testprint/1.2 %%DocumentNeededResources: font Helvetica Helvetica-Bold Times-Roman %%Creator: Michael Sweet, Easy Software Products -%%CreationDate: D:20051002193000+0500 +%%CreationDate: D:20060114093000+0500 %%Title: Test Page %%EndComments %%BeginProlog @@ -14,7 +14,7 @@ % % PostScript test page for the Common UNIX Printing System ("CUPS"). % -% Copyright 1993-2005 Easy Software Products +% Copyright 1993-2006 Easy Software Products % % These coded instructions, statements, and computer programs are the % property of Easy Software Products and are protected by Federal @@ -600,7 +600,7 @@ gsave pageHeight 8 mul % Move down... 2 copy moveto % Position text smallFont setfont % Font - (Copyright 1993-2005 Easy Software Products, All Rights Reserved.) CENTER + (Copyright 1993-2006 Easy Software Products, All Rights Reserved.) CENTER pageHeight sub % Move down... 2 copy moveto % Position text (CUPS, and the CUPS logo are the trademark property of Easy Software Products,) CENTER @@ -631,6 +631,6 @@ gsave grestore showpage % -% End of "$Id: testprint.ps 4743 2005-10-02 23:29:44Z mike $". +% End of "$Id: testprint.ps 4930 2006-01-14 16:54:03Z mike $". % %%EOF diff --git a/doc/Makefile b/doc/Makefile index ec0abad38..a6aa8a3cd 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -1,5 +1,5 @@ # -# "$Id: Makefile 4918 2006-01-12 05:14:40Z mike $" +# "$Id: Makefile 4950 2006-01-19 16:07:57Z mike $" # # Documentation makefile for the Common UNIX Printing System (CUPS). # @@ -44,7 +44,6 @@ WEBIMAGES = \ images/continue.gif \ images/delete-class.gif \ images/delete-printer.gif \ - images/draft.gif \ images/edit-configuration-file.gif \ images/esp-logo.gif \ images/happy.gif \ @@ -57,6 +56,8 @@ WEBIMAGES = \ images/manage-server.gif \ images/modify-class.gif \ images/modify-printer.gif \ + images/move-job.gif \ + images/move-jobs.gif \ images/printer-idle.gif \ images/printer-processing.gif \ images/printer-stopped.gif \ @@ -71,7 +72,12 @@ WEBIMAGES = \ images/set-as-default.gif \ images/set-printer-options.gif \ images/show-active.gif \ + images/show-all.gif \ images/show-completed.gif \ + images/show-next.gif \ + images/show-previous.gif \ + images/sort-ascending.gif \ + images/sort-descending.gif \ images/start-class.gif \ images/start-printer.gif \ images/stop-class.gif \ @@ -124,6 +130,7 @@ HELPFILES = \ help/man-lpstat.html \ help/network.html \ help/overview.html \ + help/spec-ipp.html \ help/spec-ppd.html \ help/standard.html \ help/whatsnew.html @@ -147,7 +154,7 @@ clean: # Install all documentation files... # -install: +install: all $(INSTALL_DIR) $(DOCDIR) for file in $(WEBPAGES); do \ $(INSTALL_MAN) $$file $(DOCDIR); \ diff --git a/doc/cups.css b/doc/cups.css index c33a47c7b..24c7f5ea4 100644 --- a/doc/cups.css +++ b/doc/cups.css @@ -205,3 +205,19 @@ DIV.sidebar P.l2 { margin-top: 0; text-indent: -2em; } + +TABLE.pager { + background: #cccc99; + border: solid thin #999966; + margin-top: 10px; + padding: 2px; +} + +DT { + margin-left: 3em; + margin-top: 1em; +} + +DD { + margin-left: 5em; +} diff --git a/doc/help/spec-ipp.html b/doc/help/spec-ipp.html new file mode 100644 index 000000000..24991a90d --- /dev/null +++ b/doc/help/spec-ipp.html @@ -0,0 +1,2183 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"> +<html> +<!-- SECTION: Programming --> +<head> + <title>CUPS Implementation of IPP</title> + <meta name='keywords' content='Programming, Internet Printing Protocol'> +</head> +<body> +<!-- + "$Id$" + + CUPS IPP specification for the Common UNIX Printing System (CUPS). + + Copyright 1997-2006 by Easy Software Products. + + These coded instructions, statements, and computer programs are the + property of Easy Software Products and are protected by Federal + copyright law. Distribution and use rights are outlined in the file + "LICENSE.txt" which should have been included with this file. If this + file is missing or damaged please contact Easy Software Products + at: + + Attn: CUPS Licensing Information + Easy Software Products + 44141 Airport View Drive, Suite 204 + Hollywood, Maryland 20636 USA + + Voice: (301) 373-9600 + EMail: cups-info@cups.org + WWW: http://www.cups.org +--> + +<h2 class='title'><a name='INTRODUCTION'>Introduction</a></h2> + +<p>CUPS 1.1 implements IPP/1.1 and the operations and attributes +defined in the "IPP: Job and Printer Set Operations", "IPP/1.1: +Output-bin Attribute Extension", and "IPP/1.1: finishings +'fold',' trim', and 'bale' attribute values extension" +specifications.</p> + +<p>CUPS also provides 13 new operations and many new attributes +to support multiple IPP printers and printer classes on a single +host.</p> + +<h3 class='title'><a name='IPP_URIS'>IPP URIs</a></h3> + +<p>CUPS supports the "http", "https", and "ipp" schemes. The +following resource names are used:</p> + +<dl> + + <dt><tt>scheme://hostname:port/</tt></dt> + + <dd>Can be used for all "get" operations and for server + subscriptions.</dd> + + <dt><tt>scheme://hostname:port/admin/</tt></dt> + + <dd>Used for all administrative operations.</dd> + + <dt><tt>scheme://hostname:port/classes/name</tt></dt> + + <dd>Specifies a printer class.</dd> + + <dt><tt>scheme://hostname:port/jobs/id</tt></dt> + + <dd>Specifies a job.</dd> + + <dt><tt>scheme://hostname:port/printers/name</tt></dt> + + <dd>Specifies a printer.</dd> + +</dl> + +<p>So a typical printer URI would be +"ipp://foo.bar.com/printers/LaserJet". In addition, the CUPS +server also supports normal browser access via +"http://hostname:port/" and "https://hostname:port/".</p> + +<h3 class='title'><a name='IPP_OPERATIONS'>CUPS IPP Operations</a></h3> + +<p>CUPS provides 14 extension operations in addition to most of the +standard IPP and registered extension operations: + +<div class='table'><table align='center' border='1' width='80%' +summary='Supported Operations'> +<thead> +<tr> + <TH VALIGN="TOP">Operation Name</th> + <TH VALIGN="TOP">CUPS</th> + <TH VALIGN="TOP">Code</th> + <TH VALIGN="TOP">Brief Description</th> +</tr> +</thead> +<tbody> +<tr> + <td><a href='#PRINT_JOB'>Print-Job</a></td> + <td>1.0</td> + <td>0x0002</td> + <td>Print a file.</td> +</tr> +<tr> + <td>Validate-Job</td> + <td>1.0</td> + <td>0x0004</td> + <td>Validate job attributes.</td> +</tr> +<tr> + <td><a href='#CREATE_JOB'>Create-Job</a></td> + <td>1.1</td> + <td>0x0005</td> + <td>Create a print job.</td> +</tr> +<tr> + <td>Send-Document</td> + <td>1.1</td> + <td>0x0006</td> + <td>Send a file for a print job.</td> +</tr> +<tr> + <td>Cancel-Job</td> + <td>1.0</td> + <td>0x0008</td> + <td>Cancel a print job.</td> +</tr> +<tr> + <td>Get-Job-Attributes</td> + <td>1.0</td> + <td>0x0009</td> + <td>Get job attributes.</td> +</tr> +<tr> + <td>Get-Jobs</td> + <td>1.0</td> + <td>0x000A</td> + <td>Get all jobs.</td> +</tr> +<tr> + <td>Get-Printer-Attributes</td> + <td>1.0</td> + <td>0x000B</td> + <td>Get printer attributes.</td> +</tr> +<tr> + <td>Hold-Job</td> + <td>1.1</td> + <td>0x000C</td> + <td>Hold a job for printing.</td> +</tr> +<tr> + <td>Release-Job</td> + <td>1.1</td> + <td>0x000D</td> + <td>Release a job for printing.</td> +</tr> +<tr> + <td>Restart-Job</td> + <td>1.1</td> + <td>0x000E</td> + <td>Restarts a print job.</td> +</tr> +<tr> + <td>Pause-Printer</td> + <td>1.0</td> + <td>0x0010</td> + <td>Pause printing on a printer.</td> +</tr> +<tr> + <td>Resume-Printer</td> + <td>1.0</td> + <td>0x0011</td> + <td>Resume printing on a printer.</td> +</tr> +<tr> + <td>Purge-Jobs</td> + <td>1.0</td> + <td>0x0012</td> + <td>Purge all jobs.</td> +</tr> +<tr> + <td><a href='#SET_JOB_ATTRIBUTES'>Set-Job-Attributes</a></td> + <td>1.1</td> + <td>0x0014</td> + <td>Set attributes for a pending or held job.</td> +</tr> +<tr> + <td><a href='#CREATE_PRINTER_SUBSCRIPTION'>Create-Printer-Subscription</a></td> + <td>1.2</td> + <td>0x0016</td> + <td>Creates a subscription associated with a printer or the server.</td> +</tr> +<tr> + <td>Create-Job-Subscription</td> + <td>1.2</td> + <td>0x0017</td> + <td>Creates a subscription associated with a job.</td> +</tr> +<tr> + <td>Get-Subscription-Attributes</td> + <td>1.2</td> + <td>0x0018</td> + <td>Gets the attributes for a subscription.</td> +</tr> +<tr> + <td>Get-Subscriptions</td> + <td>1.2</td> + <td>0x0019</td> + <td>Gets the attributes for zero or more subscriptions.</td> +</tr> +<tr> + <td>Renew-Subscription</td> + <td>1.2</td> + <td>0x001A</td> + <td>Renews a subscription.</td> +</tr> +<tr> + <td>Cancel-Subscription</td> + <td>1.2</td> + <td>0x001B</td> + <td>Cancels a subscription.</td> +</tr> +<tr> + <td>Get-Notifications</td> + <td>1.2</td> + <td>0x001C</td> + <td>Get notification events for <tt>ippget</tt> subscriptions.</td> +</tr> +<tr> + <td>Enable-Printer</td> + <td>1.2</td> + <td>0x0022</td> + <td>Accepts jobs on a printer.</td> +</tr> +<tr> + <td>Disable-Printer</td> + <td>1.2</td> + <td>0x0023</td> + <td>Rejects jobs on a printer.</td> +</tr> +<tr> + <td><a href='#CUPS_GET_DEFAULT'>CUPS-Get-Default</a></td> + <td>1.0</td> + <td>0x4001</td> + <td>Get the default destination.</td> +</tr> +<tr> + <td><a href='#CUPS_GET_PRINTERS'>CUPS-Get-Printers</a></td> + <td>1.0</td> + <td>0x4002</td> + <td>Get all of the available printers.</td> +</tr> +<tr> + <td><a href='#CUPS_ADD_MODIFY_PRINTER'>CUPS-Add-Modify-Printer</a></td> + <td>1.0</td> + <td>0x4003</td> + <td>Add or modify a printer.</td> +</tr> +<tr> + <td><a href='#CUPS_DELETE_PRINTER'>CUPS-Delete-Printer</a></td> + <td>1.0</td> + <td>0x4004</td> + <td>Delete a printer.</td> +</tr> +<tr> + <td><a href='#CUPS_GET_CLASSES'>CUPS-Get-Classes</a></td> + <td>1.0</td> + <td>0x4005</td> + <td>Get all of the available printer classes.</td> +</tr> +<tr> + <td><a href='#CUPS_ADD_MODIFY_CLASS'>CUPS-Add-Modify-Class</a></td> + <td>1.0</td> + <td>0x4006</td> + <td>Add or modify a printer class.</td> +</tr> +<tr> + <td><a href='#CUPS_DELETE_CLASS'>CUPS-Delete-Class</a></td> + <td>1.0</td> + <td>0x4007</td> + <td>Delete a printer class.</td> +</tr> +<tr> + <td><a href='#CUPS_ACCEPT_JOBS'>CUPS-Accept-Jobs</a></td> + <td>1.0</td> + <td>0x4008</td> + <td>Accept jobs on a printer or printer class.</td> +</tr> +<tr> + <td><a href='#CUPS_REJECT_JOBS'>CUPS-Reject-Jobs</a></td> + <td>1.0</td> + <td>0x4009</td> + <td>Reject jobs on a printer or printer class.</td> +</tr> +<tr> + <td><a href='#CUPS_SET_DEFAULT'>CUPS-Set-Default</a></td> + <td>1.0</td> + <td>0x400A</td> + <td>Set the default destination.</td> +</tr> +<tr> + <td><a href='#CUPS_GET_DEVICES'>CUPS-Get-Devices</a></td> + <td>1.1</td> + <td>0x400B</td> + <td>Get all of the available devices.</td> +</tr> +<tr> + <td><a href='#CUPS_GET_PPDS'>CUPS-Get-PPDs</a></td> + <td>1.1</td> + <td>0x400C</td> + <td>Get all of the available PPDs.</td> +</tr> +<tr> + <td><a href='#CUPS_MOVE_JOB'>CUPS-Move-Job</a></td> + <td>1.1</td> + <td>0x400D</td> + <td>Move a job to a different printer.</td> +</tr> +<tr> + <td><a href='#CUPS_AUTHENTICATE_JOB'>CUPS-Authenticate-Job</a></td> + <td>1.2</td> + <td>0x400E</td> + <td>Authenticate a job for printing.</td> +</tr> +</tbody> +</table></div> + +<h2 class='title'><a name='OPERATIONS'>Operations</a></h2> + +<p>The following sections describe the operations supported by CUPS. +In the interest of brevity, operations which use only the standard +IPP attributes are not described. + +<h3 class='title'><a name='PRINT_JOB'>Print-Job Operation</a></h3> + +<p>The Print-Job operation (0x0002) prints a file. + +<h4>Print-Job Request</h4> + +<p>The following groups of attributes are supplied as part of the +Print-Job request: + +<p>Group 1: Operation Attributes + +<dl> + + <dt>Natural Language and Character Set: + + <dd>The "attributes-charset" and "attributes-natural-language" + attributes as described in section 3.1.4.1 of the IPP Model and + Semantics document. + + <dt>"printer-uri" (uri): + + <dd>The client MUST supply a URI for the specified printer. + +</dl> + +<p>Group 2: Job Template Attributes + +<dl> + + <dt>"job-billing" (text(MAX)):<span class='info'>CUPS 1.1</span> + + <dd>The client OPTIONALLY supplies a billing string that is logged + with the page accounting information. + + <dt>"job-sheets" (1setof type3 keyword | name(MAX)):<span class='info'>CUPS 1.1</span> + + <dd>The client OPTIONALLY supplies one or two banner pages that + are printed before and after any files in the print job. The + name of "none" is reserved to indicate that no banner page + should be printed. If the client does not specify this + attribute then the value of the "job-sheets-default" printer + object attribute is used. + + <blockquote><b>Note:</b> Standard IPP only allows + specification of a single job-sheets attribute + value.</blockquote> + + <dt>"media" (1setof type3 keyword | name(MAX)): + + <dd>The client OPTIONALLY supplies one or more media attributes + specifying the size, type, source, and color of the output + media. If the client does not specify this attribute then the + value of the "media-default" printer object attribute is used. + + <blockquote><b>Note:</b> Standard IPP only allows + specification of a single media attribute + value.</blockquote> + + <dt>Other Job Template Attributes + +</dl> + +<p>The Print-Job request is followed by a file to be printed. + +<h4>Print-Job Response</h4> + +<p>The following groups of attributes are send as part of the Print-Job +Response: + +<p>Group 1: Operation Attributes + +<dl> + + <dt>Status Message: + + <dd>The standard response status message. + + <dt>Natural Language and Character Set: + + <dd>The "attributes-charset" and "attributes-natural-language" + attributes as described in section 3.1.4.2 of the IPP Model and + Semantics document. + +</dl> + +<p>Group 2: Job Attributes + +<dl> + + <dt>Standard Job Attributes + +</dl> + +<h3 class='title'><span class='info'>CUPS 1.1</span><a name='CREATE_JOB'>Create-Job Operation</a></h3> + +<p>The Create-Job operation (0x0005) creates a new, empty print job. + +<h4>Create-Job Request</h4> + +<p>The following groups of attributes are supplied as part of the +Create-Job request: + +<p>Group 1: Operation Attributes + +<dl> + + <dt>Natural Language and Character Set: + + <dd>The "attributes-charset" and "attributes-natural-language" + attributes as described in section 3.1.4.1 of the IPP Model and + Semantics document. + + <dt>"printer-uri" (uri): + + <dd>The client MUST supply a URI for the specified printer. + +</dl> + +<p>Group 2: Job Template Attributes + +<dl> + + <dt>"job-billing" (text(MAX)):<span class='info'>CUPS 1.1</span> + + <dd>The client OPTIONALLY supplies a billing string that is logged + with the page accounting information. + + <dt>"job-sheets" (1setof type3 keyword | name(MAX)):<span class='info'>CUPS 1.1</span> + + <dd>The client OPTIONALLY supplies one or two banner pages that + are printed before and after any files in the print job. The + name of "none" is reserved to indicate that no banner page + should be printed. If the client does not specify this + attribute then the value of the "job-sheets-default" printer + object attribute is used. + + <blockquote><b>Note:</b> Standard IPP only allows + specification of a single job-sheets attribute + value.</blockquote> + + <dt>"media" (1setof type3 keyword | name(MAX)): + + <dd>The client OPTIONALLY supplies one or more media attributes + specifying the size, type, source, and color of the output + media. If the client does not specify this attribute then the + value of the "media-default" printer object attribute is used. + + <blockquote><b>Note:</b> Standard IPP only allows + specification of a single media attribute + value.</blockquote> + + <dt>Standard Job Template Attributes + +</dl> + +<h4>Create-Job Response</h4> + +<p>The following groups of attributes are send as part of the +Create-Job Response: + +<p>Group 1: Operation Attributes + +<dl> + + <dt>Status Message: + + <dd>The standard response status message. + + <dt>Natural Language and Character Set: + + <dd>The "attributes-charset" and "attributes-natural-language" + attributes as described in section 3.1.4.2 of the IPP Model and + Semantics document. + +</dl> + +<p>Group 2: Job Attributes + +<dl> + + <dt>Standard Job Attributes + +</dl> + +<h3 class='title'><span class='info'>CUPS 1.1</span><a name='SET_JOB_ATTRIBUTES'>Set-Job-Attributes Operation</a></h3> + +<p>The Set-Job-Attributes operation (0x0014) changes the attributes of +an active (not completed) job. + +<h4>Set-Job-Attributes Request</h4> + +<p>The following groups of attributes are supplied as part of the +Set-Job-Attributes request: + +<p>Group 1: Operation Attributes + +<dl> + + <dt>Natural Language and Character Set: + + <dd>The "attributes-charset" and "attributes-natural-language" + attributes as described in section 3.1.4.1 of the IPP Model and + Semantics document. + + <dt>"printer-uri" (uri) and "job-id" (integer) + <br><i>OR</i> + <br>"job-uri": + + <dd>The client MUST supply a URI for the specified printer and + a job ID number, or the job URI. + +</dl> + +<p>Group 2: Job Template Attributes + +<dl> + + <dt>"job-sheets" (1setof type3 keyword | name(MAX)):<span class='info'>CUPS 1.1</span> + + <dd>The client OPTIONALLY supplies one or two banner pages that + are printed before and after any files in the print job. The + name of "none" is reserved to indicate that no banner page + should be printed. If the client does not specify this + attribute then the value of the "job-sheets-default" printer + object attribute is used. + + <blockquote><b>Note:</b> Standard IPP only allows + specification of a single job-sheets attribute + value.</blockquote> + + <dt>"media" (1setof type3 keyword | name(MAX)): + + <dd>The client OPTIONALLY supplies one or more media attributes + specifying the size, type, source, and color of the output + media. If the client does not specify this attribute then the + value of the "media-default" printer object attribute is used. + + <blockquote><b>Note:</b> Standard IPP only allows + specification of a single media attribute + value.</blockquote> + + <dt>Other Job Template Attributes + +</dl> + +<h4>Set-Job-Attributes Response</h4> + +<p>The following groups of attributes are send as part of the Set-Job-Attributes +Response: + +<p>Group 1: Operation Attributes + +<dl> + + <dt>Status Message: + + <dd>The standard response status message. + + <dt>Natural Language and Character Set: + + <dd>The "attributes-charset" and "attributes-natural-language" + attributes as described in section 3.1.4.2 of the IPP Model and + Semantics document. + +</dl> + +<h3 class='title'><span class='info'>CUPS 1.2</span><a +name='CREATE_PRINTER_SUBSCRIPTION'>Create-Printer-Subscription</a></h3> + +<p>The Create-Printer-Subscription operation (0x0016) creates a +subscription for printer or server event notifications. CUPS +provides several additional events in addition to the standard +events in the IPP notifications specification.</p> + +<h4> Request</h4> + +<p>The following groups of attributes are supplied as part of the +request:</p> + +<p>Group 1: Operation Attributes</p> + +<dl> + + <dt>Natural Language and Character Set: + + <dd>The "attributes-charset" and "attributes-natural-language" + attributes as described in section 3.1.4.1 of the IPP Model and + Semantics document. + + <dt>"printer-uri" (uri): + + <dd>The printer + (<tt>ipp://server/printers/printername</tt>), class + (<tt>ipp://server/classes/classname</tt>), or server + (<tt>ipp://server/</tt>) URI for event notifications. + + <dt>"notify-events" (1setOf keyword): + + <dd>The events to monitor. In addition to the standard + events, CUPS adds the following keywords: + <ul> + + <li><tt>printer-added</tt> - Get notified + whenever a printer or class is added</li> + + <li><tt>printer-deleted</tt> - Get notified + whenever a printer or class is deleted</li> + + <li><tt>printer-modified</tt> - Get notified + whenever a printer or class is modified</li> + + <li><tt>server-audit</tt> - Get notified when a + security condition occurs</li> + + <li><tt>server-restarted</tt> - Get notified when + the server is restarted</li> + + <li><tt>server-started</tt> - Get notified when + the server is started</li> + + <li><tt>server-stopped</tt> - Get notified when + the server is stopped</li> + + </ul> + +</dl> + +<h4> Response</h4> + +<p>The following groups of attributes are send as part of the +response:</p> + +<p>Group 1: Operation Attributes</p> + +<dl> + + <dt>Status Message: + + <dd>The standard response status message. + + <dt>Natural Language and Character Set: + + <dd>The "attributes-charset" and "attributes-natural-language" + attributes as described in section 3.1.4.2 of the IPP Model and + Semantics document. + +</dl> + +<p>Group 2: Subscription Object Attributes</p> + +<dl> + + <dt>"subscription-id" (integer): + + <dd>The subscription number. + +</dl> + +<h3 class='title'><a name='CUPS_GET_DEFAULT'>CUPS-Get-Default Operation</a></h3> + +<p>The CUPS-Get-Default operation (0x4001) returns the default printer +URI and attributes. + +<h4>CUPS-Get-Default Request</h4> + +<p>The following groups of attributes are supplied as part of the +CUPS-Get-Default request: + +<p>Group 1: Operation Attributes + +<dl> + + <dt>Natural Language and Character Set: + + <dd>The "attributes-charset" and "attributes-natural-language" + attributes as described in section 3.1.4.1 of the IPP Model and + Semantics document. + + <dt>"requested-attributes" (1setOf keyword) : + + <dd>The client OPTIONALLY supplies a set of attribute names + and/or attribute group names in whose values the requester is + interested. If the client omits this attribute, the server + responds as if this attribute had been supplied with a value of + 'all'. + +</dl> + +<h4>CUPS-Get-Default Response</h4> + +<p>The following groups of attributes are send as part of the +CUPS-Get-Default Response: + +<p>Group 1: Operation Attributes + +<dl> + + <dt>Status Message: + + <dd>The standard response status message. + + <dt>Natural Language and Character Set: + + <dd>The "attributes-charset" and "attributes-natural-language" + attributes as described in section 3.1.4.2 of the IPP Model and + Semantics document. + +</dl> + +<p>Group 2: Printer Object Attributes + +<dl> + + <dt>The set of requested attributes and their current values. + +</dl> + +<h3 class='title'><a name='CUPS_GET_PRINTERS'>CUPS-Get-Printers Operation</a></h3> + +<p>The CUPS-Get-Printers operation (0x4002) returns the printer +attributes for every printer known to the system. This may include +printers that are not served directly by the server. + +<h4>CUPS-Get-Printers Request</h4> + +<p>The following groups of attributes are supplied as part of the +CUPS-Get-Printers request: + +<p>Group 1: Operation Attributes + +<dl> + + <dt>Natural Language and Character Set: + + <dd>The "attributes-charset" and "attributes-natural-language" + attributes as described in section 3.1.4.1 of the IPP Model and + Semantics document. + + <dt>"limit" (integer (1:MAX)): + + <dd>The client OPTIONALLY supplies this attribute limiting the + number of printers that are returned. + + <dt>"printer-info" (text(127)):<span class='info'>CUPS 1.1</span> + + <dd>The client OPTIONALLY supplies this attribute to + select which printers are returned. + + <dt>"printer-location" (text(127)): <span class='info'>CUPS 1.1.7</span> + + <dd>The client OPTIONALLY supplies this attribute to + select which printers are returned. + + <dt>"printer-type" (type2 enum): <span class='info'>CUPS 1.1.7</span> + + <dd>The client OPTIONALLY supplies a printer type enumeration to + select which printers are returned. + + <dt>"printer-type-mask" (type2 enum): <span class='info'>CUPS 1.1.7</span> + + <dd>The client OPTIONALLY supplies a printer type mask + enumeration to select which bits are used in the "printer-type" + attribute. + + <dt>"requested-attributes" (1setOf keyword) : + + <dd>The client OPTIONALLY supplies a set of attribute names + and/or attribute group names in whose values the requester is + interested. If the client omits this attribute, the server + responds as if this attribute had been supplied with a value of + 'all'. + +</dl> + +<h4>CUPS-Get-Printers Response</h4> + +<p>The following groups of attributes are send as part of the +CUPS-Get-Printers Response: + +<p>Group 1: Operation Attributes + +<dl> + + <dt>Status Message: + + <dd>The standard response status message. + + <dt>Natural Language and Character Set: + + <dd>The "attributes-charset" and "attributes-natural-language" + attributes as described in section 3.1.4.2 of the IPP Model and + Semantics document. + +</dl> + +<p>Group 2: Printer Object Attributes + +<dl> + + <dt>The set of requested attributes and their current values for + each printer. + +</dl> + +<h3 class='title'><a name='CUPS_ADD_MODIFY_PRINTER'>CUPS-Add-Modify-Printer Operation</a></h3> + +<p>The CUPS-Add-Modify-Printer operation (0x4003) adds a new printer or +modifies an existing printer on the system. + +<h4>CUPS-Add-Modify-Printer Request</h4> + +<p>The following groups of attributes are supplied as part of the +CUPS-Add-Modify-Printer request: + +<p>Group 1: Operation Attributes + +<dl> + + <dt>Natural Language and Character Set: + + <dd>The "attributes-charset" and "attributes-natural-language" + attributes as described in section 3.1.4.1 of the IPP Model and + Semantics document. + + <dt>"printer-uri" (uri): + + <dd>The client MUST supply a URI for the specified printer. + +</dl> + +<p>Group 2: Printer Object Attributes + +<dl> + + <dt>"job-sheets-default" (1setOf name(127)): <span + class='info'>CUPS 1.1.7</span> + + <dd>The client OPTIONALLY supplies one or two banner page + names that are printed before and after files in a job. + The reserved name "none" is used to specify that no + banner page should be printed. + + <dt>"device-uri" (uri): + + <dd>The client OPTIONALLY supplies a device URI for the + specified printer. + + <dt>"ppd-name" (name(127)): + + <dd>The client OPTIONALLY supplies a PPD name for the specified + printer. + + <dt>"printer-is-accepting-jobs" (boolean): + + <dd>The client OPTIONALLY supplies this boolean attribute + indicating whether or not the printer object should accept new jobs. + + <dt>"printer-info" (text(127)): + + <dd>The client OPTIONALLY supplies this attribute indicating the + printer information string. + + <dt>"printer-location" (text(127)): + + <dd>The client OPTIONALLY supplies this attribute indicating a + textual location of the printer. + + <dt>"printer-more-info" (uri): + + <dd>The client OPTIONALLY supplies this attribute indicating a + URI for additional printer information. + + <dt>"printer-state" (type2 enum): + + <dd>The client OPTIONALLY supplies this attribute indicating the + initial/current state of the printer. Only the "idle" and "stopped" + enumerations are recognized. + + <dt>"printer-state-message" (text(MAX)): + + <dd>The client OPTIONALLY supplies this attribute indicating a + textual reason for the current printer state. + + <dt>"requesting-user-name-allowed" (1setof name(127) | delete) + <br><i>OR</i> + <br>"requesting-user-name-denied" (1setof name(127) | delete): + + <dd>The client OPTIONALLY supplies one of these attributes to + specify an access control list for incoming print jobs. To allow + all users access to a printer, use the delete tag for the + attribute value. + +</dl> + +<p>The CUPS-Add-Modify-Printer request can optionally be followed by a PPD +file or System V interface script to be used for the printer. The +"ppd-name" attribute overrides any file that is attached to the end of +the request with a local CUPS PPD file. + +<h4>CUPS-Add-Modify-Printer Response</h4> + +<p>The following groups of attributes are send as part of the +CUPS-Add-Modify-Printer Response: + +<p>Group 1: Operation Attributes + +<dl> + + <dt>Status Message: + + <dd>The standard response status message. + + <dt>Natural Language and Character Set: + + <dd>The "attributes-charset" and "attributes-natural-language" + attributes as described in section 3.1.4.2 of the IPP Model and + Semantics document. + +</dl> + +<h3 class='title'><a name='CUPS_DELETE_PRINTER'>CUPS-Delete-Printer Operation</a></h3> + +<p>The CUPS-Delete-Printer operation (0x4004) removes an existing +printer from the system. + +<h4>CUPS-Delete-Printer Request</h4> + +<p>The following groups of attributes are supplied as part of the +CUPS-Delete-Printer request: + +<p>Group 1: Operation Attributes + +<dl> + + <dt>Natural Language and Character Set: + + <dd>The "attributes-charset" and "attributes-natural-language" + attributes as described in section 3.1.4.1 of the IPP Model and + Semantics document. + + <dt>"printer-uri" (uri): + + <dd>The client MUST supply a URI for the specified printer. + +</dl> + +<h4>CUPS-Delete-Printer Response</h4> + +<p>The following groups of attributes are send as part of the +CUPS-Delete-Printer Response: + +<p>Group 1: Operation Attributes + +<dl> + + <dt>Status Message: + + <dd>The standard response status message. + + <dt>Natural Language and Character Set: + + <dd>The "attributes-charset" and "attributes-natural-language" + attributes as described in section 3.1.4.2 of the IPP Model and + Semantics document. + +</dl> + +<h3 class='title'><a name='CUPS_GET_CLASSES'>CUPS-Get-Classes Operation</a></h3> + +<p>The CUPS-Get-Classes operation (0x4005) returns the printer +attributes for every printer class known to the system. This may +include printer classes that are not served directly by the server. + +<h4>CUPS-Get-Classes Request</h4> + +<p>The following groups of attributes are supplied as part of the +CUPS-Get-Classes request: + +<p>Group 1: Operation Attributes + +<dl> + + <dt>Natural Language and Character Set: + + <dd>The "attributes-charset" and "attributes-natural-language" + attributes as described in section 3.1.4.1 of the IPP Model and + Semantics document. + + <dt>"limit" (integer (1:MAX)): + + <dd>The client OPTIONALLY supplies this attribute limiting the + number of printer classes that are returned. + + <dt>"printer-info" (text(127)): <span class='info'>CUPS 1.1.7</span> + <dd>The client OPTIONALLY supplies this attribute to + select which printer classes are returned. + + <dt>"printer-location" (text(127)): <span class='info'>CUPS 1.1.7</span> + <dd>The client OPTIONALLY supplies this attribute to + select which printer classes are returned. + + <dt>"printer-type" (type2 enum): <span class='info'>CUPS 1.1.7</span> + <dd>The client OPTIONALLY supplies a printer type enumeration to + select which printer classes are returned. + + <dt>"printer-type-mask" (type2 enum): <span class='info'>CUPS 1.1.7</span> + <dd>The client OPTIONALLY supplies a printer type mask + enumeration to select which bits are used in the "printer-type" + attribute. + + <dt>"requested-attributes" (1setOf keyword) : + + <dd>The client OPTIONALLY supplies a set of attribute names + and/or attribute group names in whose values the requester is + interested. If the client omits this attribute, the server responds as + if this attribute had been supplied with a value of 'all'. + +</dl> + +<h4>CUPS-Get-Classes Response</h4> + +<p>The following groups of attributes are send as part of the +CUPS-Get-Classes Response: + +<p>Group 1: Operation Attributes + +<dl> + + <dt>Status Message: + + <dd>The standard response status message. + + <dt>Natural Language and Character Set: + + <dd>The "attributes-charset" and "attributes-natural-language" + attributes as described in section 3.1.4.2 of the IPP Model and + Semantics document. + +</dl> + +<p>Group 2: Printer Class Object Attributes + +<dl> + + <dt>The set of requested attributes and their current values for + each printer class. + +</dl> + +<h3 class='title'><a name='CUPS_ADD_MODIFY_CLASS'>CUPS-Add-Modify-Class Operation</a></h3> + +<p>The CUPS-Add-Modify-Class operation (0x4006) adds a new printer class or +modifies and existing printer class on the system. + +<h4>CUPS-Add-Modify-Class Request</h4> + +<p>The following groups of attributes are supplied as part of the +CUPS-Add-Modify-Class request: + +<p>Group 1: Operation Attributes + +<dl> + + <dt>Natural Language and Character Set: + + <dd>The "attributes-charset" and "attributes-natural-language" + attributes as described in section 3.1.4.1 of the IPP Model and + Semantics document. + + <dt>"printer-uri" (uri): + + <dd>The client MUST supply a URI for the specified printer class. + +</dl> + +<p>Group 2: Printer Object Attributes + +<dl> + + <dt>"member-uris" (1setof uri): + + <dd>The client OPTIONALLY supplies the "member-uris" set + specifying the printers and printer classes that are part of the class. + + <dt>"printer-is-accepting-jobs" (boolean): + + <dd>The client OPTIONALLY supplies this boolean attribute + indicating whether or not the class object should accept new jobs. + + <dt>"printer-info" (text(127)): + + <dd>The client OPTIONALLY supplies this attribute indicating the + printer information string. + + <dt>"printer-location" (text(127)): + + <dd>The client OPTIONALLY supplies this attribute indicating a + textual location of the class. + + <dt>"printer-more-info" (uri): + + <dd>The client OPTIONALLY supplies this attribute indicating a + URI for additional class information. + + <dt>"printer-state" (type2 enum): + + <dd>The client OPTIONALLY supplies this attribute indicating the + initial/current state of the class. Only the "idle" and "stopped" + enumerations are recognized. + + <dt>"printer-state-message" (text(MAX)): + + <dd>The client OPTIONALLY supplies this attribute indicating a + textual reason for the current class state. + + <dt>"requesting-user-name-allowed" (1setof name(127)) + <br><i>OR</i> + <br>"requesting-user-name-denied" (1setof name(127)): + + <dd>The client OPTIONALLY supplies one of these attributes to + specify an access control list for incoming print jobs. To allow + all users access to a class, use the delete tag for the + attribute value. + +</dl> + +<h4>CUPS-Add-Modify-Class Response</h4> + +<p>The following groups of attributes are send as part of the CUPS-Add-Modify-Class Response: + +<p>Group 1: Operation Attributes + +<dl> + + <dt>Status Message: + + <dd>The standard response status message. + + <dt>Natural Language and Character Set: + + <dd>The "attributes-charset" and "attributes-natural-language" + attributes as described in section 3.1.4.2 of the IPP Model and + Semantics document. + +</dl> + +<h3 class='title'><a name='CUPS_DELETE_CLASS'>CUPS-Delete-Class Operation</a></h3> + +<p>The CUPS-Delete-Class operation (0x4007) removes an existing printer +class from the system. + +<h4>CUPS-Delete-Class Request</h4> + +<p>The following groups of attributes are supplied as part of the +CUPS-Delete-Class request: + +<p>Group 1: Operation Attributes + +<dl> + + <dt>Natural Language and Character Set: + + <dd>The "attributes-charset" and "attributes-natural-language" + attributes as described in section 3.1.4.1 of the IPP Model and + Semantics document. + + <dt>"printer-uri" (uri): + + <dd>The client MUST supply a URI for the specified printer class. + +</dl> + +<h4>CUPS-Delete-Class Response</h4> + +<p>The following groups of attributes are send as part of the +CUPS-Delete-Class Response: + +<p>Group 1: Operation Attributes + +<dl> + + <dt>Status Message: + + <dd>The standard response status message. + + <dt>Natural Language and Character Set: + + <dd>The "attributes-charset" and "attributes-natural-language" + attributes as described in section 3.1.4.2 of the IPP Model and + Semantics document. + +</dl> + +<h3 class='title'><a name='CUPS_ACCEPT_JOBS'>CUPS-Accept-Jobs Operation</a></h3> + +<p>The CUPS-Accept-Jobs operation (0x4008) sets the +"printer-is-accepting-jobs" attribute to true for the specified printer +or printer class. + +<h4>CUPS-Accept-Jobs Request</h4> + +<p>The following groups of attributes are supplied as part of the +CUPS-Accept-Jobs request: + +<p>Group 1: Operation Attributes + +<dl> + + <dt>Natural Language and Character Set: + + <dd>The "attributes-charset" and "attributes-natural-language" + attributes as described in section 3.1.4.1 of the IPP Model and + Semantics document. + + <dt>"printer-uri" (uri): + + <dd>The client MUST supply a URI for the specified printer or printer class. + +</dl> + +<h4>CUPS-Accept-Jobs Response</h4> + +<p>The following groups of attributes are send as part of the +CUPS-Accept-Jobs Response: + +<p>Group 1: Operation Attributes + +<dl> + + <dt>Status Message: + + <dd>The standard response status message. + + <dt>Natural Language and Character Set: + + <dd>The "attributes-charset" and "attributes-natural-language" + attributes as described in section 3.1.4.2 of the IPP Model and + Semantics document. + +</dl> + +<h3 class='title'><a name='CUPS_REJECT_JOBS'>CUPS-Reject-Jobs Operation</a></h3> + +<p>The CUPS-Reject-Jobs operation (0x4009) sets +the"printer-is-accepting-jobs" attribute to false for the specified +printer or printer class. + +<h4>CUPS-Reject-Jobs Request</h4> + +<p>The following groups of attributes are supplied as part of the +CUPS-Reject-Jobs request: + +<p>Group 1: Operation Attributes + +<dl> + + <dt>Natural Language and Character Set: + + <dd>The "attributes-charset" and "attributes-natural-language" + attributes as described in section 3.1.4.1 of the IPP Model and + Semantics document. + + <dt>"printer-uri" (uri): + + <dd>The client MUST supply a URI for the specified printer or printer class. + +</dl> + +<p>Group 2: Printer Object Attributes + +<dl> + + <dt>"printer-state-message" (text(MAX)): + + <dd>The client OPTIONALLY supplies this attribute indicating a + textual reason for the current printer state. + +</dl> + +<h4>CUPS-Reject-Jobs Response</h4> + +<p>The following groups of attributes are send as part of the +CUPS-Reject-Jobs Response: + +<p>Group 1: Operation Attributes + +<dl> + + <dt>Status Message: + + <dd>The standard response status message. + + <dt>Natural Language and Character Set: + + <dd>The "attributes-charset" and "attributes-natural-language" + attributes as described in section 3.1.4.2 of the IPP Model and + Semantics document. + +</dl> + +<h3 class='title'><a name='CUPS_SET_DEFAULT'>CUPS-Set-Default Operation</a></h3> + +<p>The CUPS-Set-Default operation (0x400A) sets the default printer +destination for all clients when a resource name of "/printers" is +specified. + +<h4>CUPS-Set-Default Request</h4> + +<p>The following groups of attributes are supplied as part of the +CUPS-Set-Default request: + +<p>Group 1: Operation Attributes + +<dl> + + <dt>Natural Language and Character Set: + + <dd>The "attributes-charset" and "attributes-natural-language" + attributes as described in section 3.1.4.1 of the IPP Model and + Semantics document. + + <dt>"printer-uri" (uri): + + <dd>The client MUST supply a URI for the specified printer or + printer class. + +</dl> + +<h4>CUPS-Set-Default Response</h4> + +<p>The following groups of attributes are send as part of the +CUPS-Set-Default Response: + +<p>Group 1: Operation Attributes + +<dl> + + <dt>Status Message: + + <dd>The standard response status message. + + <dt>Natural Language and Character Set: + + <dd>The "attributes-charset" and "attributes-natural-language" + attributes as described in section 3.1.4.2 of the IPP Model and + Semantics document. + +</dl> + +<h3 class='title'><span class='info'>CUPS 1.1</span><a name='CUPS_GET_DEVICES'>CUPS-Get-Devices Operation</a></h3> + +<p>The CUPS-Get-Devices operation (0x400B) returns all of the +supported device-uri's for the server.</p> + +<h4>CUPS-Get-Devices Request</h4> + +<p>The following groups of attributes are supplied as part of the +CUPS-Get-Devices request: + +<p>Group 1: Operation Attributes + +<dl> + + <dt>Natural Language and Character Set: + + <dd>The "attributes-charset" and "attributes-natural-language" + attributes as described in section 3.1.4.1 of the IPP Model and + Semantics document. + + <dt>"device-class" (type1 keyword): + + <dd>The client OPTIONALLY supplies a device class keyword to select + which devices are returned. + + <dt>"limit" (integer (1:MAX)): + + <dd>The client OPTIONALLY supplies this attribute limiting the number of + devices that are returned. + + <dt>"requested-attributes" (1setOf keyword) : + + <dd>The client OPTIONALLY supplies a set of attribute names and/or + attribute group names in whose values the requester is interested. If + the client omits this attribute, the server responds as if this + attribute had been supplied with a value of 'all'. + +</dl> + +<h4>CUPS-Get-Devices Response</h4> + +<p>The following groups of attributes are send as part of the +CUPS-Get-Devices Response: + +<p>Group 1: Operation Attributes + +<dl> + + <dt>Status Message: + + <dd>The standard response status message. + + <dt>Natural Language and Character Set: + + <dd>The "attributes-charset" and "attributes-natural-language" + attributes as described in section 3.1.4.2 of the IPP Model and + Semantics document. + +</dl> + +<p>Group 2: Device Object Attributes + +<dl> + + <dt>The set of requested attributes and their current values for + each device. + +</dl> + +<h3 class='title'><span class='info'>CUPS 1.1</span><a name='CUPS_GET_PPDS'>CUPS-Get-PPDs Operation</a></h3> + +<p>The CUPS-Get-PPDs operation (0x400C) returns all of the +locally available PPD files on the system.</p> + +<h4>CUPS-Get-PPDs Request</h4> + +<p>The following groups of attributes are supplied as part of the +CUPS-Get-PPDs request: + +<p>Group 1: Operation Attributes + +<dl> + + <dt>Natural Language and Character Set: + + <dd>The "attributes-charset" and "attributes-natural-language" + attributes as described in section 3.1.4.1 of the IPP Model and + Semantics document. + + <dt>"limit" (integer (1:MAX)): + + <dd>The client OPTIONALLY supplies this attribute limiting the number of + PPDs that are returned. + + <dt>"ppd-make" (text(127)): + + <dd>The client OPTIONALLY supplies a printer manufacturer to select + which PPDs are returned. + + <dt>"requested-attributes" (1setOf keyword) : + + <dd>The client OPTIONALLY supplies a set of attribute names and/or + attribute group names in whose values the requester is interested. If + the client omits this attribute, the server responds as if this + attribute had been supplied with a value of 'all'. + +</dl> + +<h4>CUPS-Get-PPDs Response</h4> + +<p>The following groups of attributes are send as part of the +CUPS-Get-PPDs Response: + +<p>Group 1: Operation Attributes + +<dl> + + <dt>Status Message: + + <dd>The standard response status message. + + <dt>Natural Language and Character Set: + + <dd>The "attributes-charset" and "attributes-natural-language" + attributes as described in section 3.1.4.2 of the IPP Model and + Semantics document. + +</dl> + +<p>Group 2: PPD Attributes + +<dl> + + <dt>The set of requested attributes and their current values for each + PPD file. + +</dl> + +<h3 class='title'><span class='info'>CUPS 1.1</span><a name='CUPS_MOVE_JOB'>CUPS-Move-Job Operation</a></h3> + +<p>The CUPS-Move-Job operation (0x400D) moves an active print job +to a different printer.</p> + +<h4>CUPS-Move-Job Request</h4> + +<p>The following groups of attributes are supplied as part of the +CUPS-Move-Job request: + +<p>Group 1: Operation Attributes + +<dl> + + <dt>Natural Language and Character Set: + + <dd>The "attributes-charset" and "attributes-natural-language" + attributes as described in section 3.1.4.1 of the IPP Model and + Semantics document. + + <dt>"printer-uri" (uri) and "job-id" (integer) + <br><i>OR</i> + <br>"job-uri": + + <dd>The client MUST supply a URI for the specified printer and + a job ID number, or the job URI. + +</dl> + +<p>Group 2: Job Template Attributes + +<dl> + + <dt>"job-printer-uri" (uri) + + <dd>The client MUST supply a URI for a printer on the same server. + +</dl> + +<h4>CUPS-Move-Job Response</h4> + +<p>The following groups of attributes are send as part of the +CUPS-Move-Job Response: + +<p>Group 1: Operation Attributes + +<dl> + + <dt>Status Message: + + <dd>The standard response status message. + + <dt>Natural Language and Character Set: + + <dd>The "attributes-charset" and "attributes-natural-language" + attributes as described in section 3.1.4.2 of the IPP Model and + Semantics document. + +</dl> + +<h3 class='title'><span class='info'>CUPS 1.2</span><a name='CUPS_AUTHENTICATE_JOB'>CUPS-Authenticate-Job Operation</a></h3> + +<p>The CUPS-Authenticate-Job operation (0x400E) authenticate a +print job for printing. Typically this is used when printing to a +remote server. The authentication information is passed in the +HTTP request.</p> + +<h4>CUPS-Authenticate-Job Request</h4> + +<p>The following groups of attributes are supplied as part of the +CUPS-Authenticate-Job request: + +<p>Group 1: Operation Attributes + +<dl> + + <dt>Natural Language and Character Set: + + <dd>The "attributes-charset" and "attributes-natural-language" + attributes as described in section 3.1.4.1 of the IPP Model and + Semantics document. + + <dt>"printer-uri" (uri) and "job-id" (integer) + <br><i>OR</i> + <br>"job-uri": + + <dd>The client MUST supply a URI for the specified printer and + a job ID number, or the job URI. + +</dl> + +<h4>CUPS-Authenticate-Job Response</h4> + +<p>The following groups of attributes are send as part of the +CUPS-Authenticate-Job Response: + +<p>Group 1: Operation Attributes + +<dl> + + <dt>Status Message: + + <dd>The standard response status message. + + <dt>Natural Language and Character Set: + + <dd>The "attributes-charset" and "attributes-natural-language" + attributes as described in section 3.1.4.2 of the IPP Model and + Semantics document. + +</dl> + +<h2 class='title'><a name='ATTRIBUTES'>Attributes</a></h2> + +<p>CUPS provides many extension attributes to support multiple +devices, PPD files, standard job filters, printers, and printer +classes.</p> + +<h3 class='title'><a name='DEVICE_ATTRIBUTES'>Device Attributes</a></h3> + +<p>Device attributes are returned by the CUPS-Get-Devices +operation and enumerate all of the available hardware devices and +network protocols that are supported by the server.</p> + +<h4>device-class (type2 keyword)</h4> + +<p>The device-class attribute specifies the class of device and can be +one of the following: + +<ul> + + <li>"file" - a disk file. + + <li>"direct" - a parallel or fixed-rate serial data port, + currently used for Centronics, IEEE-1284, and USB printer + ports. + + <li>"serial" - a variable-rate serial port. + + <li>"network" - a network connection, typically via AppSocket, + HTTP, IPP, LPD, or SMB/CIFS protocols. + +</ul> + +<h4>device-id (text(127))</h4> + +<p>The device-id attribute specifies the IEEE-1284 device ID +string for the device.</p> + +<h4>device-info (text(127))</h4> + +<p>The device-info attribute specifies a human-readable string describing +the device, e.g. "Parallel Port #1". + +<h4>device-make-and-model (text(127))</h4> + +<p>The device-makr-and-model attribute specifies a device +identification string provided by the printer connected to the device. +If the device or printer does not support identification then this +attribute contains the string "unknown". + +<h4>device-uri (uri)</h4> + +<p>The device-uri attribute specifies a unique identifier for the +device. The actual format of the device-uri string depends on the value +of the device-class attribute: + +<ul> + + <li>"file" - The device-uri will be of the form + "file:///path/to/filename". + + <li>"direct" - The device-uri will be of the form + "scheme:/dev/filename" or "scheme://vendor/identifier", + where scheme may be "parallel" or "usb" in the current + implementation. + + <li>"serial" - The device-uri will be of the form + "serial:/dev/filename?baud=value+parity=value+flow=value". + The baud value is the data rate in bits per second; the + supported values depend on the underlying hardware. + The parity value can be one of "none", "even", or "odd". + The flow value can be one of "none", "soft" (XON/XOFF + handshaking), "hard" or "rts/cts" (RTS/CTS handshaking), + or "dtrdsr" (DTR/DSR handshaking). + + <p>The URI returned by CUPS-Get-Devices will contain the + maximum baud rate supported by the device and the best + type of flow control available ("soft" or "hard"). + + <li>"network" - The device-uri will be of the form + "scheme://[username:password@]hostname[:port]/[resource]", + where scheme may be "http", "https", "ipp", "lpd", "smb", or + "socket" in the current implementation. + + <p>The URI returned by CUPS-Get-Devices will only contain + the scheme name ("scheme"). It is up to the client + application to add the appropriate host and other + information when adding a new printer. + + <p>The URI returned by Get-Printer-Attributes and + CUPS-Get-Printers has any username and password information + stripped; the information is still stored and used by the + server internally to perform any needed authentication. + +</ul> + +<h3 class='title'><a name='JOB_TEMPLATE_ATTRIBUTES'>Job Template Attributes</a></h3> + +<h4>blackplot (boolean)</h4> + +<p>The blackplot attribute specifies whether HP-GL/2 plot files should be +rendered entirely in black ink (blackplot=true) or using the colors and shades +specified in the file (blackplot=false). The default value is false. + +<h4>brightness (integer(0:200))</h4> + +<p>The brightness attribute specifies the overall brightness of the printed +output in percent. A brightness of 100 is normal, while 200 is twice as +bright and 50 is half as bright. The default value is 100. + +<p>Brightness is applied to the Cyan, Magenta, Yellow, and Black values using +the function "f(x) = brightness / 100 * x". + +<h4>columns (integer(1:4))</h4> + +<p>The columns attribute specifies the number of columns to generate when +printing text files. The default value is 1. + +<h4>cpi (type2 enum)</h4> + +<p>The cpi attribute specifies the number of characters per inch when +printing text files. Only the values 10, 12, and 17 are currently +supported. The default value is 10. + +<h4>fitplot (boolean)</h4> + +<p>The fitplot attribute specifies whether to scale HP-GL/2 plot files to +fit on the selected media (fitplot=true) or use the physical scale specified +in the plot file (fitplot=false). The default value is false. + +<h4>gamma (integer(1:10000))</h4> + +<p>The gamma attribute specifies the luminance correction for the output. +A value of 1000 specifies no correction, while values of 2000 and 500 will +generate lighter and darker output, respectively. The default value is +1000. + +<p>Gamma is applied to the Red, Green, and Blue values (or luminance for +grayscale output) using the function "f(x) = x<SUp>(1000/gamma)</SUp>". + +<h4>hue (integer(-180:180))</h4> + +<p>The hue attribute specifies a color hue rotation when printing image +files. The default value is 0. + +<h4>job-billing (text(MAX))<span class='info'>CUPS 1.1</span></h4> + +<p>The job-billing attribute provides a text value to associate with a job +for billing purposes. + +<h4>job-hold-until (keyword | name(MAX))<span class='info'>CUPS 1.1</span></h4> + +<p>The job-hold-until attribute specifies a hold time. In addition to the +standard IPP/1.1 keyword names, CUPS supports name values of the form +"HH:MM" and "HH:MM:SS" that specify a hold time. The hold time is in +Greenwich Mean Time (GMT) and <i>not</i> in the local time zone. If the +specified time is less than the current time, the job is held until the +next day. + +<h4>job-sheets (1setof type3 keyword | name(MAX))<span class='info'>CUPS 1.1</span></h4> + +<p>The job-sheets attribute specifies one or two banner files that are printed +before and after a job. The reserved value of "none" disables banner printing. +The default value is stored in the job-sheets-default attribute. + +<p>If only one value is supplied, the banner file is printed before the job. +If two values are supplied, the first value is used as the starting banner +file and the second as the ending banner file. + +<h4>job-originating-host-name (name(MAX))</h4> + +<p><i>(CUPS 1.1.5 and higher)</i> + +<p>The job-originating-host-name attribute specifies the host +from which the job was queued. The value will be the hostname or +IP address of the client depending on whether hostname +resolution is enabled. The localhost address (127.0.0.1) is +<b>always</b> resolved to the name "localhost". + +<p>This attribute is read-only. + +<h4>lpi (type2 enum)</h4> + +<p>The lpi attribute specifies the number of lines per inch when +printing text files. Only the values 6 and 8 are currently supported. +The default value is 6. + +<h4>mirror (boolean)</h4> + +<p>The mirror attribute specifies whether pages are mirrored on +their X axis, which is useful for printing transfer images on +special media. The default value is false. + +<h4>natural-scaling (integer(1:1000))<span class='info'>CUPS 1.1.9</span></h4> +<p>The natural-scaling attribute specifies the scaling of image files with +respect to the natural image size. A value of 100 specifies that the image +file should exactly the natural size, while 50 is half the natural size +and 200 is twice the natural size. The default value is 100. + +<p>The ppi option can be used to override the natural resolution of the +image, which controls the natural size. + +<h4>number-up-layout (type2 keyword)<span class='info'>CUPS 1.1.15</span></h4> +<p>The number-up-layout attribute specifies the order each input +page is placed on each output page. The following keywords are +presently defined: + +<ul> + + <li><CODE>btlr</CODE> - Bottom to top, left to right</li> + + <li><CODE>btrl</CODE> - Bottom to top, right to left</li> + + <li><CODE>lrbt</CODE> - Left to right, bottom to top</li> + + <li><CODE>lrtb</CODE> - Left to right, top to bottom (default)</li> + + <li><CODE>rlbt</CODE> - Right to left, bottom to top</li> + + <li><CODE>rltb</CODE> - Right to left, top to bottom</li> + + <li><CODE>tblr</CODE> - Top to bottom, left to right</li> + + <li><CODE>tbrl</CODE> - Top to bottom, right to left</li> + +</ul> + +<h4>page-border (type2 keyword)<span class='info'>CUPS 1.1.15</span></h4> +<p>The page-border attribute specifies whether a border is +draw around each page. The following keywords are presently +defined: + +<ul> + + <li><CODE>double</CODE> - Two hairline borders are drawn</li> + + <li><CODE>double-thick</CODE> - Two 1pt borders are drawn</li> + + <li><CODE>none</CODE> - No border is drawn (default)</li> + + <li><CODE>single</CODE> - A single hairline border is drawn</li> + + <li><CODE>single-thick</CODE> - A single 1pt border is drawn</li> + +</ul> + +<h4>page-bottom (integer(0:MAX))</h4> + +<p>The page-bottom attribute specifies the bottom margin in points (72 points +equals 1 inch). The default value is the device physical margin. + +<h4>page-label (text(MAX))<span class='info'>CUPS 1.1.7</span></h4> +<p>The page-label attribute provides a text value to place in +the header and footer on each page. If a classification level is +set on the server, then this classification is printed before +the page label. + +<h4>page-left (integer(0:MAX))</h4> + +<p>The page-left attribute specifies the left margin in points (72 points +equals 1 inch). The default value is the device physical margin. + +<h4>page-right (integer(0:MAX))</h4> + +<p>The page-right attribute specifies the right margin in points (72 points +equals 1 inch). The default value is the device physical margin. + +<h4>page-set (type2 keyword)</h4> + +<p>The page-set attribute specifies which pages to print in a file. The +supported keywords are "all", "even", and "odd". The default value is +"all". + +<h4>page-top (integer(0:MAX))</h4> + +<p>The page-top attribute specifies the top margin in points (72 points +equals 1 inch). The default value is the device physical margin. + +<h4>penwidth (integer(0:MAX))</h4> + +<p>The penwidth attribute specifies the default pen width in micrometers +when printing HP-GL/2 plot files. The default value is 1000 (1 millimeter). + +<h4>position (type2 keyword)</h4> + +<p>The position attribute specifies the location of image files on the +media. The following keyword values are recognized: + +<ul> + + <li><CODE>center</CODE> - Center the image on the page (default) + + <li><CODE>top</CODE> - Print the image centered at the top of the page + + <li><CODE>left</CODE> - Print the image centered on the left of page + + <li><CODE>right</CODE> - Print the image centered on the right of the page + + <li><CODE>top-left</CODE> - Print the image at the top left corner of + the page + + <li><CODE>top-right</CODE> - Print the image at the top right corner of + the page + + <li><CODE>bottom</CODE> - Print the image centered at the bottom of + the page + + <li><CODE>bottom-left</CODE> - Print the image at the bottom left + corner of the page + + <li><CODE>bottom-right</CODE> - Print the image at the bottom right + corner of the page + +</ul> + +<h4>ppi (integer(1:MAX))</h4> + +<p>The ppi attribute specifies the resolution of an image file in pixels +per inch. The default value is the resolution included with the file or +128 if no resolution information is available. + +<h4>prettyprint (boolean)</h4> + +<p>The prettyprint attribute specifies whether text files should be printed +with a shaded header and keyword highlighting (prettyprint=true) or without +additional formatting (prettyprint=false). The default value is false. + +<h4>saturation (integer(0:200))</h4> + +<p>The saturation attribute specifies the color saturation when +printing image files. A saturation of 100 is normal, while values of 50 +and 200 will be half and twice as colorful, respectively. The default +value is 100. + +<h4>scaling (integer(1:1000))</h4> + +<p>The scaling attribute specifies the scaling of image files with +respect to the selected media. A value of 100 specifies that the image +file should fit 100% of the page, or as much as possible given the +image dimensions. The default value is unspecified. + +<p>The scaling attribute overrides the ppi attribute if specified. + +<h4>wrap (boolean)</h4> + +<p>The wrap attribute specifies whether long lines should be wrapped +(wrap=true) or not (wrap=false) when printing text files. The default +value is true. + +<h3 class='title'><a name='PPD_ATTRIBUTES'>PPD Attributes</a></h3> + +<h4>ppd-device-id (text(127))</h4> + +<p>The ppd-device-id attribute specifies the IEEE-1284 device ID +string for the device described by the PPD file.</p> + +<h4>ppd-natural-language (naturalLanguage)</h4> + +<p>The ppd-natural-language attribute specifies the language encoding +of the PPD file (the LanguageVersion attribute in the PPD file). If the +language is unknown or undefined then "en" (English) is assumed. + +<h4>ppd-make (text(127))</h4> + +<p>The ppd-make attribute specifies the manufacturer of the printer +(the Manufacturer attribute in the PPD file). If the manufacturer +is not specified in the PPD file then an educated guess is made using +the NickName attribute in the PPD file. + +<h4>ppd-make-and-model (text(127))</h4> + +<p>The ppd-make-and-model attribute specifies the manufacturer and model +name of the PPD file (the NickName attribute in the PPD file). If the +make and model is not specified in the PPD file then the ModelName or +ShortNickName attributes are used instead. + +<h4>ppd-name (name(255))</h4> + +<p>The ppd-name attribute specifies the PPD filename on the server +relative to the model directory. The forward slash (/) is used to +delineate directories. + +<h3 class='title'><a name='PRINTER_ATTRIBUTES'>Printer Attributes</a></h3> + +<h4>job-k-limit (integer)<span class='info'>CUPS 1.1</span></h4> + +<p>The job-k-limit attribute specifies the maximum number of kilobytes that +may be printed by a user, including banner files. The default value of 0 +specifies that there is no limit. + +<h4>job-page-limit (integer)<span class='info'>CUPS 1.1</span></h4> + +<p>The job-page-limit attribute specifies the maximum number of pages that +may be printed by a user, including banner files. The default value of 0 +specifies that there is no limit. + +<h4>job-quota-period (integer)<span class='info'>CUPS 1.1</span></h4> + +<p>The job-quota-period attribute specifies the time period used for quota +calculations, in seconds. The default value of 0 specifies that the limits +apply to all jobs that have been printed by a user that are still known to +the system. + +<h4>job-sheets-supported (1setof type3 keyword | name(MAX))<span class='info'>CUPS 1.1</span></h4> + +<p>The job-sheets-supported attribute specifies the available banner files. +There will always be at least one banner file available called "none". + +<h4>printer-type (type2 enum)</h4> + +<p>The printer-type attribute specifies printer type and +capability bits for the printer or class. The default value is +computed from internal state information and the PPD file for the +printer. The following bits are defined:</p> + +<div class='table'><table align='center' border='1' width='80%' +summary='Printer Type Bits'> +<thead> +<tr> + <th>Bit</th> + <th>Description</th> +</tr> +</thead> +<tbody> +<tr> + <td>0x00000001</td> + <td>Is a printer class.</td> +</tr> +<tr> + <td>0x00000002</td> + <td>Is a remote destination.</td> +</tr> +<tr> + <td>0x00000004</td> + <td>Can print in black.</td> +</tr> +<tr> + <td>0x00000008</td> + <td>Can print in color.</td> +</tr> +<tr> + <td>0x00000010</td> + <td>Can print on both sides of the page in hardware.</td> +</tr> +<tr> + <td>0x00000020</td> + <td>Can staple output.</td> +</tr> +<tr> + <td>0x00000040</td> + <td>Can do fast copies in hardware.</td> +</tr> +<tr> + <td>0x00000080</td> + <td>Can do fast copy collation in hardware.</td> +</tr> +<tr> + <td>0x00000100</td> + <td>Can punch output.</td> +</tr> +<tr> + <td>0x00000200</td> + <td>Can cover output.</td> +</tr> +<tr> + <td>0x00000400</td> + <td>Can bind output.</td> +</tr> +<tr> + <td>0x00000800</td> + <td>Can sort output.</td> +</tr> +<tr> + <td>0x00001000</td> + <td>Can handle media up to US-Legal/A4.</td> +</tr> +<tr> + <td>0x00002000</td> + <td>Can handle media from US-Legal/A4 to ISO-C/A2.</td> +</tr> +<tr> + <td>0x00004000</td> + <td>Can handle media larger than ISO-C/A2.</td> +</tr> +<tr> + <td>0x00008000</td> + <td>Can handle user-defined media sizes.</td> +</tr> +<tr> + <td>0x00010000</td> + <td>Is an implicit (server-generated) class.</td> +</tr> +<tr> + <td>0x00020000</td> + <td>Is the a default printer on the network.</td> +</tr> +<tr> + <td>0x00040000<td> + <td>Is a facsimile device.</td> +</tr> +<tr> + <td>0x00080000</td> + <td>Is rejecting jobs.</td> +</tr> +<tr> + <td>0x00100000</td> + <td>Delete this queue.</td> +</tr> +<tr> + <td>0x00200000</td> + <td>Queue is not shared.</td> +</tr> +<tr> + <td>0x00400000</td> + <td>Queue requires authentication.</td> +</tr> +</tbody> +</table></div> + +<h4>printer-type-mask (type2 enum)<span class='info'>CUPS 1.1</span></h4> + +<p>The printer-type-mask attribute is used to choose printers or classes with +the CUPS-Get-Printers and CUPS-Get-Classes operations. The bits are defined +identically to the printer-type attribute and default to all 1's. + +<h4>requesting-user-name-allowed (1setof name(127))<span class='info'>CUPS 1.1</span></h4> + +<p>The requesting-user-name-allowed attribute lists all of the users that are +allowed to access a printer or class. Either this attribute or the +requesting-user-name-denied attribute will be defined, but not both. + +<h4>requesting-user-name-denied (1setof name(127))<span class='info'>CUPS 1.1</span></h4> + +<p>The requesting-user-name-denied attribute lists all of the users that are +not allowed to access a printer or class. Either this attribute or the +requesting-user-name-allowed attribute will be defined, but not both. + +<h3 class='title'><a name='CLASS_ATTRIBUTES'>Printer Class Attributes</a></h3> + +<h4>member-names (1setof name(127))</h4> + +<p>The member-names attribute specifies each of the printer-name attributes of +the member printers and classes. Each name corresponds to the same element of +the member-uris attribute. + +<h4>member-uris (1setof uri)</h4> + +<p>The member-uris attribute specifies each of the printer-uri attributes of +the member printers and classes. Each URI corresponds to the same element of +the member-names attribute. + +</body> +</html> diff --git a/doc/help/spec-ppd.html b/doc/help/spec-ppd.html index a6aa4677e..a6d70ba73 100644 --- a/doc/help/spec-ppd.html +++ b/doc/help/spec-ppd.html @@ -7,7 +7,7 @@ </head> <body> <!-- - "$Id: spec-ppd.html 4918 2006-01-12 05:14:40Z mike $" + "$Id: spec-ppd.html 4941 2006-01-18 13:16:40Z mike $" CUPS PPD extensions specification for the Common UNIX Printing System (CUPS). @@ -196,6 +196,14 @@ any necessary value quoting for HP-PJL commands.</p> number from 1 to N and specifies the order of values as they are placed on the stack before the command.</p> +<blockquote><b>Note:</b> Currently only CustomPageSize supports +more than 1 parameter. This restriction is due to value encoding +issues, since the "Custom.value" format does not allow for +specification of named parameters. We anticipate supporting the +collection value format "{Name1=foo Name2=bar}" for the final +CUPS 1.2 release. In addition, the collection value format will +allow string values to contain spaces.</blockquote> + <p>The "type" is one of the following keywords:</p> <ul> @@ -343,7 +351,7 @@ is not absolute, it is loaded relative to the *cupsColorProfile RGB.Glossy.720dpi/720dpi Glossy: "vendor/foo-720-glossy-rgb.icc" <em>*% Specify a default profile for printing at all other resolutions and media types</em> -*cupsICCProfile .../Default: "vendor/foo-default.icc" +*cupsICCProfile ../Default: "vendor/foo-default.icc" </pre> <h4>Customizing the Profile Selection Keywords</h4> diff --git a/doc/images/export-samba.gif b/doc/images/export-samba.gif Binary files differnew file mode 100644 index 000000000..168b20f64 --- /dev/null +++ b/doc/images/export-samba.gif diff --git a/doc/images/move-job.gif b/doc/images/move-job.gif Binary files differnew file mode 100644 index 000000000..1de4b99e0 --- /dev/null +++ b/doc/images/move-job.gif diff --git a/doc/images/move-jobs.gif b/doc/images/move-jobs.gif Binary files differnew file mode 100644 index 000000000..c71163346 --- /dev/null +++ b/doc/images/move-jobs.gif diff --git a/doc/images/show-ascending.gif b/doc/images/show-ascending.gif Binary files differdeleted file mode 100644 index 50e636cc9..000000000 --- a/doc/images/show-ascending.gif +++ /dev/null diff --git a/doc/images/show-descending.gif b/doc/images/show-descending.gif Binary files differdeleted file mode 100644 index 146e5f510..000000000 --- a/doc/images/show-descending.gif +++ /dev/null diff --git a/doc/images/sort-ascending.gif b/doc/images/sort-ascending.gif Binary files differnew file mode 100644 index 000000000..ec3510647 --- /dev/null +++ b/doc/images/sort-ascending.gif diff --git a/doc/images/sort-descending.gif b/doc/images/sort-descending.gif Binary files differnew file mode 100644 index 000000000..1b826f865 --- /dev/null +++ b/doc/images/sort-descending.gif diff --git a/doc/index.html.in b/doc/index.html.in index 1abc24997..8864d1a0b 100644 --- a/doc/index.html.in +++ b/doc/index.html.in @@ -109,12 +109,17 @@ assistance:</P> <A HREF="http://www.cups.org/" TARGET="_blank">www.cups.org</A> </PRE> +<P>Commercial support and an enhanced version of CUPS called <A +HREF="http://www.easysw.com/printpro/">ESP Print Pro</A> is +available at:</P> + +<PRE> + <A HREF="http://www.easysw.com/" TARGET="_blank">www.easysw.com</A> +</PRE> + </TD> <TD WIDTH="15"> </TD> </TR> -<TR CLASS="page"> -<TD COLSPAN="5"> </TD> -</TR> <TR CLASS="header"> <TD VALIGN="BOTTOM" WIDTH="15"><IMG SRC="/images/bottom-left.gif" WIDTH="15" HEIGHT="15" ALT=""></TD> diff --git a/filter/Makefile b/filter/Makefile index 9defb35b7..d1eb3ca49 100644 --- a/filter/Makefile +++ b/filter/Makefile @@ -1,5 +1,5 @@ # -# "$Id: Makefile 4804 2005-10-20 14:05:42Z mike $" +# "$Id: Makefile 4950 2006-01-19 16:07:57Z mike $" # # Filter makefile for the Common UNIX Printing System (CUPS). # @@ -145,7 +145,7 @@ libcupsimage.so.2 libcupsimage.sl.2: $(IMAGEOBJS) libcupsimage.2.dylib: $(IMAGEOBJS) echo Linking $@... $(DSO) $(DSOFLAGS) -o $@ \ - -install_name $(libdir)/libcupsimage.dylib \ + -install_name $(libdir)/$@ \ -current_version 2.2.0 \ -compatibility_version 2.0.0 \ $(IMAGEOBJS) $(DSOLIBS) -L../cups $(LINKCUPS) -lm @@ -281,5 +281,5 @@ include Dependencies # -# End of "$Id: Makefile 4804 2005-10-20 14:05:42Z mike $". +# End of "$Id: Makefile 4950 2006-01-19 16:07:57Z mike $". # diff --git a/filter/interpret.c b/filter/interpret.c index 37c09921f..6f8f754af 100644 --- a/filter/interpret.c +++ b/filter/interpret.c @@ -1,5 +1,5 @@ /* - * "$Id: interpret.c 4903 2006-01-10 20:02:46Z mike $" + * "$Id: interpret.c 4982 2006-01-25 21:44:44Z mike $" * * PPD command interpreter for the Common UNIX Printing System (CUPS). * @@ -92,14 +92,23 @@ cupsRasterInterpretPPD( memset(h, 0, sizeof(cups_page_header2_t)); - h->NumCopies = 1; - h->PageSize[0] = 612; - h->PageSize[1] = 792; - h->HWResolution[0] = 100; - h->HWResolution[1] = 100; - h->cupsBitsPerColor = 1; - h->cupsColorOrder = CUPS_ORDER_CHUNKED; - h->cupsColorSpace = CUPS_CSPACE_K; + h->NumCopies = 1; + h->PageSize[0] = 612; + h->PageSize[1] = 792; + h->HWResolution[0] = 100; + h->HWResolution[1] = 100; + h->cupsBitsPerColor = 1; + h->cupsColorOrder = CUPS_ORDER_CHUNKED; + h->cupsColorSpace = CUPS_CSPACE_K; + h->cupsPageScaling = 1.0f; + h->cupsPageSize[0] = 612.0f; + h->cupsPageSize[1] = 792.0f; + h->cupsImagingBBox[0] = 0.0f; + h->cupsImagingBBox[1] = 0.0f; + h->cupsImagingBBox[2] = 612.0f; + h->cupsImagingBBox[3] = 792.0f; + + strcpy(h->cupsPageSizeName, "Letter"); /* * Apply patches and options to the page header... @@ -169,6 +178,8 @@ cupsRasterInterpretPPD( bottom = size->bottom; right = size->right; top = size->top; + + strlcpy(h->cupsPageSizeName, size->name, sizeof(h->cupsPageSizeName)); } else { @@ -188,13 +199,19 @@ cupsRasterInterpretPPD( h->ImagingBoundingBox[1] = bottom; h->ImagingBoundingBox[2] = right; h->ImagingBoundingBox[3] = top; + h->cupsImagingBBox[0] = left; + h->cupsImagingBBox[1] = bottom; + h->cupsImagingBBox[2] = right; + h->cupsImagingBBox[3] = top; /* * Compute the bitmap parameters... */ - h->cupsWidth = (int)((right - left) * h->HWResolution[0] / 72.0f + 0.5f); - h->cupsHeight = (int)((top - bottom) * h->HWResolution[1] / 72.0f + 0.5f); + h->cupsWidth = (int)((right - left) * h->cupsPageScaling * + h->HWResolution[0] / 72.0f + 0.5f); + h->cupsHeight = (int)((top - bottom) * h->cupsPageScaling * + h->HWResolution[1] / 72.0f + 0.5f); switch (h->cupsColorSpace) { @@ -473,6 +490,9 @@ exec_code(cups_page_header2_t *h, /* O - Page header */ { if (sscanf(value, "[%d%d]", h->PageSize + 0, h->PageSize + 1) != 2) return (-1); + + if (sscanf(value, "[%f%f]", h->cupsPageSize + 0, h->cupsPageSize + 1) != 2) + return (-1); } else if (!strcmp(name, "Separations") && type == CUPS_TYPE_NAME) h->Separations = !strcmp(value, "true"); @@ -496,6 +516,10 @@ exec_code(cups_page_header2_t *h, /* O - Page header */ h->cupsRowFeed = atoi(value); else if (!strcmp(name, "cupsRowStep") && type == CUPS_TYPE_NUMBER) h->cupsRowStep = atoi(value); + else if (!strcmp(name, "cupsPageScaling") && type == CUPS_TYPE_NUMBER) + { + h->cupsPageScaling = atof(value); + } else if (!strncmp(name, "cupsInteger", 11) && type == CUPS_TYPE_NUMBER) { if ((i = atoi(name + 11)) >= 0 || i > 15) @@ -541,5 +565,5 @@ exec_code(cups_page_header2_t *h, /* O - Page header */ /* - * End of "$Id: interpret.c 4903 2006-01-10 20:02:46Z mike $". + * End of "$Id: interpret.c 4982 2006-01-25 21:44:44Z mike $". */ diff --git a/filter/raster.c b/filter/raster.c index 56bd695fe..10d235012 100644 --- a/filter/raster.c +++ b/filter/raster.c @@ -1,5 +1,5 @@ /* - * "$Id: raster.c 4903 2006-01-10 20:02:46Z mike $" + * "$Id: raster.c 4981 2006-01-25 21:34:00Z mike $" * * Raster file routines for the Common UNIX Printing System (CUPS). * @@ -609,7 +609,7 @@ cups_raster_read_header( */ if (r->sync == CUPS_RASTER_REVSYNC || r->sync == CUPS_RASTER_REVSYNCv1) - for (len = 74, s = (union swap_s *)&(r->header.AdvanceDistance); + for (len = 81, s = (union swap_s *)&(r->header.AdvanceDistance); len > 0; len --, s ++) s->v = (((((s->b[3] << 8) | s->b[2]) << 8) | s->b[1]) << 8) | s->b[0]; @@ -888,5 +888,5 @@ cups_write(int fd, /* I - File descriptor */ /* - * End of "$Id: raster.c 4903 2006-01-10 20:02:46Z mike $". + * End of "$Id: raster.c 4981 2006-01-25 21:34:00Z mike $". */ diff --git a/filter/raster.h b/filter/raster.h index 2b1510d0d..ecef9b9a5 100644 --- a/filter/raster.h +++ b/filter/raster.h @@ -1,5 +1,5 @@ /* - * "$Id: raster.h 4903 2006-01-10 20:02:46Z mike $" + * "$Id: raster.h 4981 2006-01-25 21:34:00Z mike $" * * Raster file definitions for the Common UNIX Printing System (CUPS). * @@ -288,12 +288,16 @@ typedef struct cups_page_header2_s /**** Version 2 Page Header @since CUPS 1.2@ unsigned cupsRowStep; /* Spacing between lines */ /**** Version 2 Dictionary Values ****/ - unsigned cupsNumColors; /* Number of colors */ - unsigned cupsInteger[16]; /* User-defined integer values */ - float cupsReal[16]; /* User-defined floating-point values */ - char cupsString[16][64]; /* User-defined string values */ - char cupsMarkerType[64]; /* Ink/toner type */ - char cupsRenderingIntent[64];/* Color rendering intent */ + unsigned cupsNumColors; /* Number of colors @since CUPS 1.2@ */ + float cupsPageScaling; /* Scaling that was applied to page data */ + float cupsPageSize[2]; /* Floating point PageSize @since CUPS 1.2@ */ + float cupsImagingBBox[4]; /* Floating point ImagingBoundingBox @since CUPS 1.2@ */ + unsigned cupsInteger[16]; /* User-defined integer values @since CUPS 1.2@ */ + float cupsReal[16]; /* User-defined floating-point values @since CUPS 1.2@ */ + char cupsString[16][64]; /* User-defined string values @since CUPS 1.2@ */ + char cupsMarkerType[64]; /* Ink/toner type @since CUPS 1.2@ */ + char cupsRenderingIntent[64];/* Color rendering intent @since CUPS 1.2@ */ + char cupsPageSizeName[64]; /* PageSize name @since CUPS 1.2@ */ } cups_page_header2_t; typedef struct _cups_raster_s /**** Raster stream data ****/ @@ -341,5 +345,5 @@ extern unsigned cupsRasterWriteHeader2(cups_raster_t *r, #endif /* !_CUPS_RASTER_H_ */ /* - * End of "$Id: raster.h 4903 2006-01-10 20:02:46Z mike $". + * End of "$Id: raster.h 4981 2006-01-25 21:34:00Z mike $". */ diff --git a/fonts/Makefile b/fonts/Makefile index 4813e234e..9f4afb8f3 100644 --- a/fonts/Makefile +++ b/fonts/Makefile @@ -1,5 +1,5 @@ # -# "$Id: Makefile,v 1.6 1999/05/10 17:42:00 mike Exp $" +# "$Id: Makefile 4950 2006-01-19 16:07:57Z mike $" # # Fonts makefile for the Common UNIX Printing System (CUPS). # @@ -50,7 +50,7 @@ clean: # Install files... # -install: +install: all $(INSTALL_DIR) $(DATADIR)/fonts for file in $(FONTS); do \ $(INSTALL_DATA) $$file $(DATADIR)/fonts; \ @@ -58,5 +58,5 @@ install: # -# End of "$Id: Makefile,v 1.6 1999/05/10 17:42:00 mike Exp $". +# End of "$Id: Makefile 4950 2006-01-19 16:07:57Z mike $". # diff --git a/init/cups.osx b/init/cups.osx index bff65dcc6..bbe5ac36b 100644 --- a/init/cups.osx +++ b/init/cups.osx @@ -8,10 +8,13 @@ StartService () { - if [ "${CUPS:=-YES-}" = "-YES-" ]; then + if [ "${CUPS:=-AUTOMATIC-}" = "-AUTOMATIC-" ]; then ConsoleMessage "Starting printing services" /usr/sbin/cupsd - fi + elif [ "${CUPS:=-AUTOMATIC-}" = "-YES-" ]; then + ConsoleMessage "Starting printing services" + /usr/sbin/cupsd + fi } StopService () @@ -21,7 +24,7 @@ StopService () if test "$pid" != ""; then ConsoleMessage "Stopping printing services" kill "${pid}" - fi + fi } RestartService () @@ -32,7 +35,10 @@ RestartService () ConsoleMessage "Restarting printing services" kill -HUP "${pid}" else - StartService + if [ "${CUPS:=-AUTOMATIC-}" = "-AUTOMATIC-" -o "${CUPS:=-AUTOMATIC-}" = "-YES-" ]; then + ConsoleMessage "Starting printing services" + /usr/sbin/cupsd + fi fi } diff --git a/init/cups.sh.in b/init/cups.sh.in index bba1d4428..06f3c924b 100755 --- a/init/cups.sh.in +++ b/init/cups.sh.in @@ -1,6 +1,6 @@ #!/bin/sh # -# "$Id: cups.sh.in 4493 2005-02-18 02:09:53Z mike $" +# "$Id: cups.sh.in 4971 2006-01-24 14:33:18Z mike $" # # Startup/shutdown script for the Common UNIX Printing System (CUPS). # @@ -207,5 +207,5 @@ exit 0 # -# End of "$Id: cups.sh.in 4493 2005-02-18 02:09:53Z mike $". +# End of "$Id: cups.sh.in 4971 2006-01-24 14:33:18Z mike $". # diff --git a/locale/Makefile b/locale/Makefile index d1a0787c7..bad408908 100644 --- a/locale/Makefile +++ b/locale/Makefile @@ -1,9 +1,9 @@ # -# "$Id: Makefile 4898 2006-01-08 23:13:20Z mike $" +# "$Id: Makefile 4965 2006-01-21 06:12:17Z mike $" # # Locale file makefile for the Common UNIX Printing System (CUPS). # -# Copyright 1993-2005 by Easy Software Products. +# Copyright 1993-2006 by Easy Software Products. # # These coded instructions, statements, and computer programs are the # property of Easy Software Products and are protected by Federal @@ -28,7 +28,7 @@ include ../Makedefs # Locales... # -LOCALES = fr +LOCALES = fr ja # @@ -50,7 +50,7 @@ clean: # Install files... # -install: +install: all $(INSTALL_DIR) $(LOCALEDIR) for loc in $(LOCALES) ; do \ $(INSTALL_DIR) $(LOCALEDIR)/$$loc ; \ @@ -95,5 +95,5 @@ translate.o: ../cups/http.h ../cups/i18n.h ../cups/language.h ../cups/string.h # -# End of "$Id: Makefile 4898 2006-01-08 23:13:20Z mike $". +# End of "$Id: Makefile 4965 2006-01-21 06:12:17Z mike $". # diff --git a/locale/cups.pot b/locale/cups.pot index e1cf6af47..0f443a783 100644 --- a/locale/cups.pot +++ b/locale/cups.pot @@ -29,7 +29,7 @@ msgid "" msgstr "" "Project-Id-Version: CUPS 1.2\n" "Report-Msgid-Bugs-To: http://www.cups.org/str.php\n" -"POT-Creation-Date: 2006-01-08 18:06-0500\n" +"POT-Creation-Date: 2006-01-18 22:26-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -37,7 +37,7 @@ msgstr "" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" -#: cgi-bin/admin.c:1276 +#: cgi-bin/admin.c:1276 cgi-bin/admin.c:1154 msgid "Options Installed" msgstr "" @@ -49,31 +49,32 @@ msgstr "" msgid "Printer" msgstr "" -#: cups/ppd.c:654 cups/ppd.c:1045 +#: cups/ppd.c:654 cups/ppd.c:1045 cups/ppd.c:660 cups/ppd.c:1167 msgid "Extra" msgstr "" -#: cups/ppd.c:656 cups/ppd.c:881 cups/ppd.c:1047 +#: cups/ppd.c:656 cups/ppd.c:881 cups/ppd.c:1047 cups/ppd.c:662 cups/ppd.c:996 +#: cups/ppd.c:1169 msgid "General" msgstr "" -#: cups/ppd.c:704 cups/ppd.c:1105 +#: cups/ppd.c:704 cups/ppd.c:1105 cups/ppd.c:710 cups/ppd.c:1224 msgid "Media Size" msgstr "" -#: cups/ppd.c:706 cups/ppd.c:1107 +#: cups/ppd.c:706 cups/ppd.c:1107 cups/ppd.c:712 cups/ppd.c:1226 msgid "Media Type" msgstr "" -#: cups/ppd.c:708 cups/ppd.c:1109 +#: cups/ppd.c:708 cups/ppd.c:1109 cups/ppd.c:714 cups/ppd.c:1228 msgid "Media Source" msgstr "" -#: cups/ppd.c:710 cups/ppd.c:1111 +#: cups/ppd.c:710 cups/ppd.c:1111 cups/ppd.c:716 cups/ppd.c:1230 msgid "Output Mode" msgstr "" -#: cups/ppd.c:712 cups/ppd.c:1113 +#: cups/ppd.c:712 cups/ppd.c:1113 cups/ppd.c:718 cups/ppd.c:1232 msgid "Resolution" msgstr "" @@ -81,11 +82,11 @@ msgstr "" msgid "Variable" msgstr "" -#: cups/ppd.c:1535 +#: cups/ppd.c:1535 cups/ppd.c:1650 msgid "Yes" msgstr "" -#: cups/ppd.c:1537 +#: cups/ppd.c:1537 cups/ppd.c:1652 msgid "No" msgstr "" @@ -93,33 +94,33 @@ msgstr "" msgid "Auto" msgstr "" -#: scheduler/client.c:2247 +#: scheduler/client.c:2247 scheduler/client.c:2251 msgid "Enter your username and password or the root username and password to access this page." msgstr "" -#: scheduler/client.c:2252 +#: scheduler/client.c:2252 scheduler/client.c:2256 msgid "You must use a https: URL to access this page." msgstr "" -#: scheduler/ipp.c:236 +#: scheduler/ipp.c:236 scheduler/ipp.c:244 #, c-format msgid "Bad request version number %d.%d!" msgstr "" -#: scheduler/ipp.c:246 +#: scheduler/ipp.c:246 scheduler/ipp.c:254 msgid "No attributes in request!" msgstr "" -#: scheduler/ipp.c:269 +#: scheduler/ipp.c:269 scheduler/ipp.c:277 #, c-format msgid "Attribute groups are out of order (%x < %x)!" msgstr "" -#: scheduler/ipp.c:379 +#: scheduler/ipp.c:379 scheduler/ipp.c:389 msgid "Missing required attributes!" msgstr "" -#: scheduler/ipp.c:575 +#: scheduler/ipp.c:575 scheduler/ipp.c:585 #, c-format msgid "%s not supported!" msgstr "" @@ -129,124 +130,140 @@ msgstr "" #: scheduler/ipp.c:4649 scheduler/ipp.c:5002 scheduler/ipp.c:5445 #: scheduler/ipp.c:5890 scheduler/ipp.c:6245 scheduler/ipp.c:6609 #: scheduler/ipp.c:7308 scheduler/ipp.c:8179 scheduler/ipp.c:8585 -#: scheduler/ipp.c:8663 scheduler/ipp.c:8836 +#: scheduler/ipp.c:8663 scheduler/ipp.c:8836 scheduler/ipp.c:696 +#: scheduler/ipp.c:1079 scheduler/ipp.c:2318 scheduler/ipp.c:2433 +#: scheduler/ipp.c:3901 scheduler/ipp.c:4621 scheduler/ipp.c:4855 +#: scheduler/ipp.c:5237 scheduler/ipp.c:5526 scheduler/ipp.c:5834 +#: scheduler/ipp.c:6113 scheduler/ipp.c:6155 scheduler/ipp.c:6657 +#: scheduler/ipp.c:7365 scheduler/ipp.c:8251 scheduler/ipp.c:8662 +#: scheduler/ipp.c:8742 scheduler/ipp.c:8917 msgid "The printer or class was not found." msgstr "" -#: scheduler/ipp.c:762 +#: scheduler/ipp.c:762 scheduler/ipp.c:777 msgid "The printer-uri must be of the form \"ipp://HOSTNAME/classes/CLASSNAME\"." msgstr "" -#: scheduler/ipp.c:778 scheduler/ipp.c:1454 +#: scheduler/ipp.c:778 scheduler/ipp.c:1454 scheduler/ipp.c:793 +#: scheduler/ipp.c:1482 #, c-format msgid "The printer-uri \"%s\" contains invalid characters." msgstr "" -#: scheduler/ipp.c:811 +#: scheduler/ipp.c:811 scheduler/ipp.c:826 #, c-format msgid "A printer named \"%s\" already exists!" msgstr "" -#: scheduler/ipp.c:904 +#: scheduler/ipp.c:904 scheduler/ipp.c:924 #, c-format msgid "Attempt to set %s printer-state to bad value %d!" msgstr "" -#: scheduler/ipp.c:1000 +#: scheduler/ipp.c:1000 scheduler/ipp.c:1022 #, c-format msgid "add_class: Unknown printer-op-policy \"%s\"." msgstr "" -#: scheduler/ipp.c:1013 +#: scheduler/ipp.c:1013 scheduler/ipp.c:1035 #, c-format msgid "add_class: Unknown printer-error-policy \"%s\"." msgstr "" -#: scheduler/ipp.c:1144 +#: scheduler/ipp.c:1144 scheduler/ipp.c:1168 msgid "Unable to allocate memory for file types!" msgstr "" -#: scheduler/ipp.c:1290 scheduler/ipp.c:4501 +#: scheduler/ipp.c:1290 scheduler/ipp.c:4501 scheduler/ipp.c:1316 +#: scheduler/ipp.c:4705 #, c-format msgid "Character set \"%s\" not supported!" msgstr "" -#: scheduler/ipp.c:1299 scheduler/ipp.c:4510 +#: scheduler/ipp.c:1299 scheduler/ipp.c:4510 scheduler/ipp.c:1325 +#: scheduler/ipp.c:4714 #, c-format msgid "Language \"%s\" not supported!" msgstr "" -#: scheduler/ipp.c:1309 scheduler/ipp.c:4520 +#: scheduler/ipp.c:1309 scheduler/ipp.c:4520 scheduler/ipp.c:1335 +#: scheduler/ipp.c:4724 #, c-format msgid "The notify-user-data value is too large (%d > 63 octets)!" msgstr "" -#: scheduler/ipp.c:1326 +#: scheduler/ipp.c:1326 scheduler/ipp.c:1352 msgid "The notify-lease-duration attribute cannot be used with job subscriptions." msgstr "" -#: scheduler/ipp.c:1438 +#: scheduler/ipp.c:1438 scheduler/ipp.c:1466 msgid "The printer-uri must be of the form \"ipp://HOSTNAME/printers/PRINTERNAME\"." msgstr "" -#: scheduler/ipp.c:1487 +#: scheduler/ipp.c:1487 scheduler/ipp.c:1515 #, c-format msgid "A class named \"%s\" already exists!" msgstr "" -#: scheduler/ipp.c:1575 +#: scheduler/ipp.c:1575 scheduler/ipp.c:1607 #, c-format msgid "File device URIs have been disabled! To enable, see the FileDevice directive in \"%s/cupsd.conf\"." msgstr "" -#: scheduler/ipp.c:1595 +#: scheduler/ipp.c:1595 scheduler/ipp.c:1627 #, c-format msgid "Bad device-uri \"%s\"!" msgstr "" -#: scheduler/ipp.c:1626 +#: scheduler/ipp.c:1626 scheduler/ipp.c:1659 #, c-format msgid "Bad port-monitor \"%s\"!" msgstr "" -#: scheduler/ipp.c:1669 +#: scheduler/ipp.c:1669 scheduler/ipp.c:1705 #, c-format msgid "Bad printer-state value %d!" msgstr "" -#: scheduler/ipp.c:1762 +#: scheduler/ipp.c:1762 scheduler/ipp.c:1800 #, c-format msgid "Unknown printer-op-policy \"%s\"." msgstr "" -#: scheduler/ipp.c:1775 +#: scheduler/ipp.c:1775 scheduler/ipp.c:1813 #, c-format msgid "Unknown printer-error-policy \"%s\"." msgstr "" -#: scheduler/ipp.c:1837 +#: scheduler/ipp.c:1837 scheduler/ipp.c:1875 #, c-format msgid "Unable to copy interface script - %s!" msgstr "" -#: scheduler/ipp.c:1862 +#: scheduler/ipp.c:1862 scheduler/ipp.c:1900 #, c-format msgid "Unable to copy PPD file - %s!" msgstr "" -#: scheduler/ipp.c:1915 +#: scheduler/ipp.c:1915 scheduler/ipp.c:1954 msgid "Unable to copy PPD file!" msgstr "" #: scheduler/ipp.c:2076 scheduler/ipp.c:2364 scheduler/ipp.c:5188 #: scheduler/ipp.c:6008 scheduler/ipp.c:6147 scheduler/ipp.c:7394 #: scheduler/ipp.c:7538 scheduler/ipp.c:7776 scheduler/ipp.c:8261 +#: scheduler/ipp.c:2116 scheduler/ipp.c:2412 scheduler/ipp.c:5102 +#: scheduler/ipp.c:5955 scheduler/ipp.c:7452 scheduler/ipp.c:7599 +#: scheduler/ipp.c:7839 scheduler/ipp.c:8334 msgid "Got a printer-uri attribute but no job-id!" msgstr "" #: scheduler/ipp.c:2097 scheduler/ipp.c:2433 scheduler/ipp.c:5210 #: scheduler/ipp.c:6029 scheduler/ipp.c:6169 scheduler/ipp.c:7416 #: scheduler/ipp.c:7560 scheduler/ipp.c:7797 scheduler/ipp.c:8282 +#: scheduler/ipp.c:2138 scheduler/ipp.c:2484 scheduler/ipp.c:5125 +#: scheduler/ipp.c:5978 scheduler/ipp.c:6201 scheduler/ipp.c:7475 +#: scheduler/ipp.c:7622 scheduler/ipp.c:7862 scheduler/ipp.c:8357 #, c-format msgid "Bad job-uri attribute \"%s\"!" msgstr "" @@ -258,111 +275,116 @@ msgstr "" msgid "Job #%d doesn't exist!" msgstr "" -#: scheduler/ipp.c:2131 +#: scheduler/ipp.c:2131 scheduler/ipp.c:2172 #, c-format msgid "Job #%d is not held for authentication!" msgstr "" -#: scheduler/ipp.c:2153 +#: scheduler/ipp.c:2153 scheduler/ipp.c:2195 #, c-format msgid "You are not authorized to authenticate job #%d owned by \"%s\"!" msgstr "" -#: scheduler/ipp.c:2221 +#: scheduler/ipp.c:2221 scheduler/ipp.c:2264 msgid "The printer-uri attribute is required!" msgstr "" -#: scheduler/ipp.c:2238 +#: scheduler/ipp.c:2238 scheduler/ipp.c:2283 msgid "Missing requesting-user-name attribute!" msgstr "" -#: scheduler/ipp.c:2277 +#: scheduler/ipp.c:2277 scheduler/ipp.c:2324 #, c-format msgid "The printer-uri \"%s\" is not valid." msgstr "" -#: scheduler/ipp.c:2410 +#: scheduler/ipp.c:2410 scheduler/ipp.c:2460 #, c-format msgid "No active jobs on %s!" msgstr "" -#: scheduler/ipp.c:2462 +#: scheduler/ipp.c:2462 scheduler/ipp.c:2513 #, c-format msgid "You are not authorized to delete job #%d owned by \"%s\"!" msgstr "" -#: scheduler/ipp.c:2476 +#: scheduler/ipp.c:2476 scheduler/ipp.c:2527 #, c-format msgid "Job #%d is already %s - can't cancel." msgstr "" -#: scheduler/ipp.c:3720 +#: scheduler/ipp.c:3720 scheduler/ipp.c:3914 msgid "The printer or class is not shared!" msgstr "" -#: scheduler/ipp.c:3746 scheduler/ipp.c:6647 +#: scheduler/ipp.c:3746 scheduler/ipp.c:6647 scheduler/ipp.c:3940 +#: scheduler/ipp.c:6695 #, c-format msgid "Destination \"%s\" is not accepting jobs." msgstr "" -#: scheduler/ipp.c:3759 scheduler/ipp.c:6443 +#: scheduler/ipp.c:3759 scheduler/ipp.c:6443 scheduler/ipp.c:3954 +#: scheduler/ipp.c:6487 #, c-format msgid "Bad copies value %d." msgstr "" -#: scheduler/ipp.c:3775 scheduler/ipp.c:6459 +#: scheduler/ipp.c:3775 scheduler/ipp.c:6459 scheduler/ipp.c:3971 +#: scheduler/ipp.c:6504 #, c-format msgid "Bad page-ranges values %d-%d." msgstr "" -#: scheduler/ipp.c:3795 +#: scheduler/ipp.c:3795 scheduler/ipp.c:3991 msgid "Too many active jobs." msgstr "" -#: scheduler/ipp.c:3801 scheduler/ipp.c:6668 +#: scheduler/ipp.c:3801 scheduler/ipp.c:6668 scheduler/ipp.c:3997 +#: scheduler/ipp.c:6716 msgid "Quota limit reached." msgstr "" -#: scheduler/ipp.c:3824 scheduler/ipp.c:6691 +#: scheduler/ipp.c:3824 scheduler/ipp.c:6691 scheduler/ipp.c:4022 +#: scheduler/ipp.c:6741 #, c-format msgid "Unable to add job for destination \"%s\"!" msgstr "" -#: scheduler/ipp.c:4469 +#: scheduler/ipp.c:4469 scheduler/ipp.c:4673 msgid "No subscription attributes in request!" msgstr "" -#: scheduler/ipp.c:4559 +#: scheduler/ipp.c:4559 scheduler/ipp.c:4763 msgid "notify-events not specified!" msgstr "" -#: scheduler/ipp.c:4577 +#: scheduler/ipp.c:4577 scheduler/ipp.c:4781 #, c-format msgid "Job %d not found!" msgstr "" -#: scheduler/ipp.c:4827 +#: scheduler/ipp.c:4827 scheduler/ipp.c:4957 msgid "No default printer" msgstr "" -#: scheduler/ipp.c:4930 +#: scheduler/ipp.c:4930 scheduler/ipp.c:5060 msgid "cups-deviced failed to execute." msgstr "" -#: scheduler/ipp.c:5393 +#: scheduler/ipp.c:5393 scheduler/ipp.c:5479 msgid "cups-driverd failed to execute." msgstr "" -#: scheduler/ipp.c:5571 +#: scheduler/ipp.c:5571 scheduler/ipp.c:5594 msgid "No destinations added." msgstr "" -#: scheduler/ipp.c:5794 +#: scheduler/ipp.c:5794 scheduler/ipp.c:5736 #, c-format msgid "notify-subscription-id %d no good!" msgstr "" -#: scheduler/ipp.c:5878 +#: scheduler/ipp.c:5878 scheduler/ipp.c:5822 #, c-format msgid "Job #%s does not exist!" msgstr "" @@ -370,129 +392,138 @@ msgstr "" #: scheduler/ipp.c:5900 scheduler/ipp.c:2116 scheduler/ipp.c:2451 #: scheduler/ipp.c:5228 scheduler/ipp.c:6047 scheduler/ipp.c:6188 #: scheduler/ipp.c:7434 scheduler/ipp.c:7578 scheduler/ipp.c:7815 -#: scheduler/ipp.c:8300 +#: scheduler/ipp.c:8300 scheduler/ipp.c:2157 scheduler/ipp.c:2502 +#: scheduler/ipp.c:5143 scheduler/ipp.c:5844 scheduler/ipp.c:5996 +#: scheduler/ipp.c:6174 scheduler/ipp.c:6219 scheduler/ipp.c:7493 +#: scheduler/ipp.c:7640 scheduler/ipp.c:7880 scheduler/ipp.c:8375 #, c-format msgid "Job #%d does not exist!" msgstr "" -#: scheduler/ipp.c:5969 +#: scheduler/ipp.c:5969 scheduler/ipp.c:5915 msgid "No subscriptions found." msgstr "" -#: scheduler/ipp.c:6058 +#: scheduler/ipp.c:6058 scheduler/ipp.c:6007 #, c-format msgid "Not authorized to hold job #%d owned by \"%s\"!" msgstr "" -#: scheduler/ipp.c:6203 scheduler/ipp.c:8315 +#: scheduler/ipp.c:6203 scheduler/ipp.c:8315 scheduler/ipp.c:6250 +#: scheduler/ipp.c:8390 #, c-format msgid "Job #%d is finished and cannot be altered!" msgstr "" -#: scheduler/ipp.c:6215 +#: scheduler/ipp.c:6215 scheduler/ipp.c:6262 #, c-format msgid "You are not authorized to move job #%d owned by \"%s\"!" msgstr "" -#: scheduler/ipp.c:6228 +#: scheduler/ipp.c:6228 scheduler/ipp.c:6098 msgid "job-printer-uri attribute missing!" msgstr "" -#: scheduler/ipp.c:6485 scheduler/ipp.c:7847 +#: scheduler/ipp.c:6485 scheduler/ipp.c:7847 scheduler/ipp.c:6531 +#: scheduler/ipp.c:7913 #, c-format msgid "Unsupported compression \"%s\"!" msgstr "" -#: scheduler/ipp.c:6504 scheduler/ipp.c:7866 +#: scheduler/ipp.c:6504 scheduler/ipp.c:7866 scheduler/ipp.c:6550 +#: scheduler/ipp.c:7932 msgid "No file!?!" msgstr "" -#: scheduler/ipp.c:6522 +#: scheduler/ipp.c:6522 scheduler/ipp.c:6568 #, c-format msgid "Could not scan type \"%s\"!" msgstr "" -#: scheduler/ipp.c:6574 scheduler/ipp.c:7936 +#: scheduler/ipp.c:6574 scheduler/ipp.c:7936 scheduler/ipp.c:6620 +#: scheduler/ipp.c:8001 #, c-format msgid "Unsupported format '%s/%s'!" msgstr "" -#: scheduler/ipp.c:6621 +#: scheduler/ipp.c:6621 scheduler/ipp.c:6669 msgid "Printer not shared!" msgstr "" -#: scheduler/ipp.c:6661 +#: scheduler/ipp.c:6661 scheduler/ipp.c:6709 #, c-format msgid "Too many jobs - %d jobs, max jobs is %d." msgstr "" -#: scheduler/ipp.c:7448 +#: scheduler/ipp.c:7448 scheduler/ipp.c:7507 #, c-format msgid "Job #%d is not held!" msgstr "" -#: scheduler/ipp.c:7459 +#: scheduler/ipp.c:7459 scheduler/ipp.c:7518 #, c-format msgid "You are not authorized to release job id %d owned by \"%s\"!" msgstr "" -#: scheduler/ipp.c:7592 +#: scheduler/ipp.c:7592 scheduler/ipp.c:7654 #, c-format msgid "Job #%d is not complete!" msgstr "" -#: scheduler/ipp.c:7608 +#: scheduler/ipp.c:7608 scheduler/ipp.c:7670 #, c-format msgid "Job #%d cannot be restarted - no files!" msgstr "" -#: scheduler/ipp.c:7619 +#: scheduler/ipp.c:7619 scheduler/ipp.c:7681 #, c-format msgid "You are not authorized to restart job id %d owned by \"%s\"!" msgstr "" -#: scheduler/ipp.c:7826 +#: scheduler/ipp.c:7826 scheduler/ipp.c:7891 #, c-format msgid "You are not authorized to send document for job #%d owned by \"%s\"!" msgstr "" -#: scheduler/ipp.c:7883 scheduler/ipp.c:8803 +#: scheduler/ipp.c:7883 scheduler/ipp.c:8803 scheduler/ipp.c:7949 +#: scheduler/ipp.c:8883 #, c-format msgid "Bad document-format \"%s\"!" msgstr "" -#: scheduler/ipp.c:8326 +#: scheduler/ipp.c:8326 scheduler/ipp.c:8401 #, c-format msgid "You are not authorized to alter job id %d owned by \"%s\"!" msgstr "" -#: scheduler/ipp.c:8371 +#: scheduler/ipp.c:8371 scheduler/ipp.c:8446 #, c-format msgid "%s cannot be changed." msgstr "" -#: scheduler/ipp.c:8387 +#: scheduler/ipp.c:8387 scheduler/ipp.c:8462 msgid "Bad job-priority value!" msgstr "" -#: scheduler/ipp.c:8395 +#: scheduler/ipp.c:8395 scheduler/ipp.c:8470 msgid "Job is completed and cannot be changed." msgstr "" -#: scheduler/ipp.c:8409 +#: scheduler/ipp.c:8409 scheduler/ipp.c:8484 msgid "Bad job-state value!" msgstr "" #: scheduler/ipp.c:8423 scheduler/ipp.c:8435 scheduler/ipp.c:8446 +#: scheduler/ipp.c:8498 scheduler/ipp.c:8510 scheduler/ipp.c:8521 msgid "Job state cannot be changed." msgstr "" -#: scheduler/ipp.c:8787 +#: scheduler/ipp.c:8787 scheduler/ipp.c:8867 #, c-format msgid "Unsupported compression attribute %s!" msgstr "" -#: scheduler/ipp.c:8815 +#: scheduler/ipp.c:8815 scheduler/ipp.c:8894 #, c-format msgid "Unsupported format \"%s\"!" msgstr "" @@ -509,49 +540,49 @@ msgid "" "exit help quit status ?\n" msgstr "" -#: berkeley/lpc.c:222 +#: berkeley/lpc.c:222 berkeley/lpc.c:221 msgid "help\t\tget help on commands\n" msgstr "" -#: berkeley/lpc.c:225 +#: berkeley/lpc.c:225 berkeley/lpc.c:223 msgid "status\t\tshow status of daemon and queue\n" msgstr "" -#: berkeley/lpc.c:228 +#: berkeley/lpc.c:228 berkeley/lpc.c:225 msgid "?Invalid help command unknown\n" msgstr "" -#: berkeley/lpc.c:478 berkeley/lpc.c:490 +#: berkeley/lpc.c:478 berkeley/lpc.c:490 berkeley/lpc.c:475 berkeley/lpc.c:487 #, c-format msgid "\tprinter is on device '%s' speed -1\n" msgstr "" -#: berkeley/lpc.c:496 +#: berkeley/lpc.c:496 berkeley/lpc.c:493 msgid "\tqueuing is enabled\n" msgstr "" -#: berkeley/lpc.c:498 +#: berkeley/lpc.c:498 berkeley/lpc.c:495 msgid "\tqueuing is disabled\n" msgstr "" -#: berkeley/lpc.c:501 +#: berkeley/lpc.c:501 berkeley/lpc.c:498 msgid "\tprinting is enabled\n" msgstr "" -#: berkeley/lpc.c:503 +#: berkeley/lpc.c:503 berkeley/lpc.c:500 msgid "\tprinting is disabled\n" msgstr "" -#: berkeley/lpc.c:506 +#: berkeley/lpc.c:506 berkeley/lpc.c:503 msgid "\tno entries\n" msgstr "" -#: berkeley/lpc.c:508 +#: berkeley/lpc.c:508 berkeley/lpc.c:505 #, c-format msgid "\t%d entries\n" msgstr "" -#: berkeley/lpc.c:510 +#: berkeley/lpc.c:510 berkeley/lpc.c:507 msgid "\tdaemon present\n" msgstr "" @@ -562,7 +593,9 @@ msgstr "" #: berkeley/lpq.c:125 berkeley/lpr.c:114 berkeley/lprm.c:107 #: systemv/accept.c:108 systemv/cancel.c:95 systemv/lpstat.c:115 #: systemv/lpadmin.c:284 systemv/lp.c:135 systemv/lpinfo.c:80 -#: systemv/lpmove.c:84 +#: systemv/lpmove.c:84 systemv/accept.c:106 systemv/cancel.c:93 +#: systemv/lpmove.c:89 berkeley/lpq.c:124 systemv/lp.c:136 +#: systemv/lpstat.c:116 #, c-format msgid "%s: Sorry, no encryption support compiled in!\n" msgstr "" @@ -591,35 +624,35 @@ msgstr "" msgid "lpq: get-jobs failed: %s\n" msgstr "" -#: berkeley/lpq.c:457 +#: berkeley/lpq.c:457 berkeley/lpq.c:444 berkeley/lpq.c:488 msgid "Rank Owner Pri Job Files Total Size\n" msgstr "" -#: berkeley/lpq.c:461 +#: berkeley/lpq.c:461 berkeley/lpq.c:448 berkeley/lpq.c:492 msgid "Rank Owner Job File(s) Total Size\n" msgstr "" -#: berkeley/lpq.c:498 +#: berkeley/lpq.c:498 berkeley/lpq.c:485 berkeley/lpq.c:529 #, c-format msgid "%s: %-33.33s [job %d localhost]\n" msgstr "" -#: berkeley/lpq.c:500 +#: berkeley/lpq.c:500 berkeley/lpq.c:487 berkeley/lpq.c:531 #, c-format msgid " %-39.39s %.0f bytes\n" msgstr "" -#: berkeley/lpq.c:506 +#: berkeley/lpq.c:506 berkeley/lpq.c:493 berkeley/lpq.c:537 #, c-format msgid "%-6s %-10.10s %-4d %-10d %-27.27s %.0f bytes\n" msgstr "" -#: berkeley/lpq.c:511 +#: berkeley/lpq.c:511 berkeley/lpq.c:498 berkeley/lpq.c:542 #, c-format msgid "%-7s %-7.7s %-7d %-31.31s %.0f bytes\n" msgstr "" -#: berkeley/lpq.c:529 +#: berkeley/lpq.c:529 berkeley/lpq.c:515 berkeley/lpq.c:559 msgid "no entries\n" msgstr "" @@ -628,22 +661,22 @@ msgstr "" msgid "lpq: get-printer-attributes failed: %s\n" msgstr "" -#: berkeley/lpq.c:605 +#: berkeley/lpq.c:605 berkeley/lpq.c:576 berkeley/lpq.c:621 #, c-format msgid "%s is ready\n" msgstr "" -#: berkeley/lpq.c:608 +#: berkeley/lpq.c:608 berkeley/lpq.c:579 berkeley/lpq.c:624 #, c-format msgid "%s is ready and printing\n" msgstr "" -#: berkeley/lpq.c:612 +#: berkeley/lpq.c:612 berkeley/lpq.c:583 berkeley/lpq.c:628 #, c-format msgid "%s is not ready\n" msgstr "" -#: berkeley/lpq.c:633 +#: berkeley/lpq.c:633 berkeley/lpq.c:601 msgid "Usage: lpq [-P dest] [-l] [+interval]\n" msgstr "" @@ -724,7 +757,7 @@ msgstr "" msgid "lpr: error - stdin is empty, so no job has been sent.\n" msgstr "" -#: berkeley/lpr.c:461 +#: berkeley/lpr.c:461 berkeley/lpr.c:460 #, c-format msgid "lpr: error - unable to print file: %s\n" msgstr "" @@ -764,85 +797,87 @@ msgstr "" msgid "lprm: Unable to cancel job(s)!\n" msgstr "" -#: systemv/accept.c:84 +#: systemv/accept.c:84 systemv/accept.c:82 #, c-format msgid "%s: Don't know what to do!\n" msgstr "" -#: systemv/accept.c:129 +#: systemv/accept.c:129 systemv/accept.c:127 #, c-format msgid "%s: Expected server name after -h!\n" msgstr "" -#: systemv/accept.c:147 +#: systemv/accept.c:147 systemv/accept.c:145 #, c-format msgid "%s: Expected reason text after -r!\n" msgstr "" -#: systemv/accept.c:157 +#: systemv/accept.c:157 systemv/accept.c:155 #, c-format msgid "%s: Unknown option '%c'!\n" msgstr "" -#: systemv/accept.c:173 +#: systemv/accept.c:173 systemv/accept.c:171 systemv/accept.c:192 #, c-format msgid "%s: Unable to connect to server: %s\n" msgstr "" #: systemv/accept.c:217 systemv/accept.c:227 systemv/accept.c:268 -#: systemv/accept.c:278 +#: systemv/accept.c:278 systemv/accept.c:206 #, c-format msgid "%s: Operation failed: %s\n" msgstr "" -#: systemv/cancel.c:118 +#: systemv/cancel.c:118 systemv/cancel.c:116 msgid "cancel: Error - expected hostname after '-h' option!\n" msgstr "" -#: systemv/cancel.c:139 +#: systemv/cancel.c:139 systemv/cancel.c:137 msgid "cancel: Error - expected username after '-u' option!\n" msgstr "" -#: systemv/cancel.c:150 +#: systemv/cancel.c:150 systemv/cancel.c:148 #, c-format msgid "cancel: Unknown option '%c'!\n" msgstr "" -#: systemv/cancel.c:207 +#: systemv/cancel.c:207 systemv/cancel.c:205 #, c-format msgid "cancel: Unknown destination \"%s\"!\n" msgstr "" -#: systemv/cancel.c:229 systemv/cancel.c:319 +#: systemv/cancel.c:229 systemv/cancel.c:319 systemv/cancel.c:227 +#: systemv/cancel.c:308 msgid "cancel: Unable to contact server!\n" msgstr "" -#: systemv/cancel.c:295 systemv/cancel.c:370 +#: systemv/cancel.c:295 systemv/cancel.c:370 systemv/cancel.c:284 +#: systemv/cancel.c:348 #, c-format msgid "cancel: %s failed: %s\n" msgstr "" -#: systemv/cupsaddsmb.c:290 +#: systemv/cupsaddsmb.c:290 systemv/cupsaddsmb.c:311 #, c-format msgid "cupsaddsmb: Missing value on line %d!\n" msgstr "" -#: systemv/cupsaddsmb.c:301 +#: systemv/cupsaddsmb.c:301 systemv/cupsaddsmb.c:322 #, c-format msgid "cupsaddsmb: Missing double quote on line %d!\n" msgstr "" -#: systemv/cupsaddsmb.c:313 +#: systemv/cupsaddsmb.c:313 systemv/cupsaddsmb.c:334 #, c-format msgid "cupsaddsmb: Bad option + choice on line %d!\n" msgstr "" -#: systemv/cupsaddsmb.c:496 +#: systemv/cupsaddsmb.c:496 systemv/cupsaddsmb.c:553 #, c-format msgid "cupsaddsmb: Unable to connect to server \"%s\" for %s - %s\n" msgstr "" -#: systemv/cupsaddsmb.c:509 +#: systemv/cupsaddsmb.c:509 systemv/cupsaddsmb.c:566 #, c-format msgid "cupsaddsmb: No PPD file for printer \"%s\" - skipping!\n" msgstr "" @@ -852,42 +887,42 @@ msgstr "" msgid "cupsaddsmb: get-printer-attributes failed for \"%s\": %s\n" msgstr "" -#: systemv/cupsaddsmb.c:578 +#: systemv/cupsaddsmb.c:578 systemv/cupsaddsmb.c:620 #, c-format msgid "cupsaddsmb: Unable to convert PPD file for %s - %s\n" msgstr "" -#: systemv/cupsaddsmb.c:633 +#: systemv/cupsaddsmb.c:633 systemv/cupsaddsmb.c:677 #, c-format msgid "cupsaddsmb: Unable to copy Windows 2000 printer driver files (%d)!\n" msgstr "" -#: systemv/cupsaddsmb.c:660 +#: systemv/cupsaddsmb.c:660 systemv/cupsaddsmb.c:704 #, c-format msgid "cupsaddsmb: Unable to copy CUPS printer driver files (%d)!\n" msgstr "" -#: systemv/cupsaddsmb.c:697 +#: systemv/cupsaddsmb.c:697 systemv/cupsaddsmb.c:739 #, c-format msgid "cupsaddsmb: Unable to install Windows 2000 printer driver files (%d)!\n" msgstr "" -#: systemv/cupsaddsmb.c:727 +#: systemv/cupsaddsmb.c:727 systemv/cupsaddsmb.c:771 #, c-format msgid "cupsaddsmb: Unable to copy Windows 9x printer driver files (%d)!\n" msgstr "" -#: systemv/cupsaddsmb.c:750 +#: systemv/cupsaddsmb.c:750 systemv/cupsaddsmb.c:792 #, c-format msgid "cupsaddsmb: Unable to install Windows 9x printer driver files (%d)!\n" msgstr "" -#: systemv/cupsaddsmb.c:771 +#: systemv/cupsaddsmb.c:771 systemv/cupsaddsmb.c:822 #, c-format msgid "cupsaddsmb: Unable to set Windows printer driver (%d)!\n" msgstr "" -#: systemv/cupsaddsmb.c:854 +#: systemv/cupsaddsmb.c:854 systemv/cupsaddsmb.c:905 msgid "" "Usage: cupsaddsmb [options] printer1 ... printerN\n" " cupsaddsmb [options] -a\n" @@ -1351,30 +1386,31 @@ msgstr "" msgid "lpstat: Need \"completed\" or \"not-completed\" after -W!\n" msgstr "" -#: systemv/lpstat.c:212 +#: systemv/lpstat.c:212 systemv/lpstat.c:213 msgid "lpstat: The -b option requires a destination argument.\n" msgstr "" #: systemv/lpstat.c:274 systemv/lpinfo.c:143 systemv/lpmove.c:105 +#: systemv/lpmove.c:110 systemv/lpstat.c:275 msgid "Error: need hostname after '-h' option!\n" msgstr "" -#: systemv/lpstat.c:433 +#: systemv/lpstat.c:433 systemv/lpstat.c:434 #, c-format msgid "lpstat: Unknown option '%c'!\n" msgstr "" -#: systemv/lpstat.c:504 +#: systemv/lpstat.c:504 systemv/lpstat.c:505 #, c-format msgid "lpstat: Invalid destination name in list \"%s\"!\n" msgstr "" -#: systemv/lpstat.c:519 +#: systemv/lpstat.c:519 systemv/lpstat.c:520 #, c-format msgid "lpstat: Unknown destination \"%s\"!\n" msgstr "" -#: systemv/lpstat.c:541 +#: systemv/lpstat.c:541 systemv/lpstat.c:542 #, c-format msgid "lpstat: Unable to connect to server %s on port %d: %s\n" msgstr "" @@ -1414,56 +1450,62 @@ msgstr "" msgid "lpstat: get-classes failed: %s\n" msgstr "" -#: systemv/lpstat.c:1033 +#: systemv/lpstat.c:1033 systemv/lpstat.c:1011 systemv/lpstat.c:1039 #, c-format msgid "members of class %s:\n" msgstr "" -#: systemv/lpstat.c:1080 +#: systemv/lpstat.c:1080 systemv/lpstat.c:1057 systemv/lpstat.c:1085 #, c-format msgid "system default destination: %s/%s\n" msgstr "" -#: systemv/lpstat.c:1083 +#: systemv/lpstat.c:1083 systemv/lpstat.c:1060 systemv/lpstat.c:1088 #, c-format msgid "system default destination: %s\n" msgstr "" -#: systemv/lpstat.c:1105 +#: systemv/lpstat.c:1105 systemv/lpstat.c:1082 systemv/lpstat.c:1110 #, c-format msgid "lpstat: error - %s environment variable names non-existent destination \"%s\"!\n" msgstr "" -#: systemv/lpstat.c:1109 +#: systemv/lpstat.c:1109 systemv/lpstat.c:1086 systemv/lpstat.c:1114 msgid "no system default destination\n" msgstr "" -#: systemv/lpstat.c:1313 +#: systemv/lpstat.c:1313 systemv/lpstat.c:1281 systemv/lpstat.c:1309 #, c-format msgid "Output for printer %s is sent to remote printer %s on %s\n" msgstr "" -#: systemv/lpstat.c:1319 systemv/lpstat.c:1323 +#: systemv/lpstat.c:1319 systemv/lpstat.c:1323 systemv/lpstat.c:1287 +#: systemv/lpstat.c:1291 systemv/lpstat.c:1315 #, c-format msgid "Output for printer %s is sent to %s\n" msgstr "" -#: systemv/lpstat.c:1331 +#: systemv/lpstat.c:1331 systemv/lpstat.c:1299 systemv/lpstat.c:1327 #, c-format msgid "Output for printer %s/%s is sent to remote printer %s on %s\n" msgstr "" -#: systemv/lpstat.c:1337 systemv/lpstat.c:1341 +#: systemv/lpstat.c:1337 systemv/lpstat.c:1341 systemv/lpstat.c:1305 +#: systemv/lpstat.c:1309 systemv/lpstat.c:1333 #, c-format msgid "Output for printer %s/%s is sent to %s\n" msgstr "" #: systemv/lpstat.c:1346 systemv/lpstat.c:1349 systemv/lpstat.c:1352 +#: systemv/lpstat.c:1314 systemv/lpstat.c:1317 systemv/lpstat.c:1320 +#: systemv/lpstat.c:1342 systemv/lpstat.c:1345 systemv/lpstat.c:1348 #, c-format msgid "device for %s: %s\n" msgstr "" #: systemv/lpstat.c:1359 systemv/lpstat.c:1362 systemv/lpstat.c:1365 +#: systemv/lpstat.c:1327 systemv/lpstat.c:1330 systemv/lpstat.c:1333 +#: systemv/lpstat.c:1355 systemv/lpstat.c:1358 systemv/lpstat.c:1361 #, c-format msgid "device for %s/%s: %s\n" msgstr "" @@ -1473,144 +1515,168 @@ msgstr "" msgid "lpstat: get-jobs failed: %s\n" msgstr "" -#: systemv/lpstat.c:1681 +#: systemv/lpstat.c:1681 systemv/lpstat.c:1635 systemv/lpstat.c:1663 #, c-format msgid "\tqueued for %s\n" msgstr "" -#: systemv/lpstat.c:2037 +#: systemv/lpstat.c:2037 systemv/lpstat.c:1971 systemv/lpstat.c:1999 #, c-format msgid "printer %s is idle. enabled since %s\n" msgstr "" -#: systemv/lpstat.c:2042 +#: systemv/lpstat.c:2042 systemv/lpstat.c:1976 systemv/lpstat.c:2004 #, c-format msgid "printer %s now printing %s-%d. enabled since %s\n" msgstr "" -#: systemv/lpstat.c:2048 +#: systemv/lpstat.c:2048 systemv/lpstat.c:1982 systemv/lpstat.c:2010 #, c-format msgid "printer %s disabled since %s -\n" msgstr "" -#: systemv/lpstat.c:2056 systemv/lpstat.c:2169 +#: systemv/lpstat.c:2056 systemv/lpstat.c:2169 systemv/lpstat.c:1990 +#: systemv/lpstat.c:2103 systemv/lpstat.c:2018 systemv/lpstat.c:2131 msgid "\treason unknown\n" msgstr "" -#: systemv/lpstat.c:2063 systemv/lpstat.c:2176 +#: systemv/lpstat.c:2063 systemv/lpstat.c:2176 systemv/lpstat.c:1997 +#: systemv/lpstat.c:2110 systemv/lpstat.c:2025 systemv/lpstat.c:2138 msgid "" "\tForm mounted:\n" "\tContent types: any\n" "\tPrinter types: unknown\n" msgstr "" -#: systemv/lpstat.c:2069 systemv/lpstat.c:2182 +#: systemv/lpstat.c:2069 systemv/lpstat.c:2182 systemv/lpstat.c:2003 +#: systemv/lpstat.c:2116 systemv/lpstat.c:2031 systemv/lpstat.c:2144 #, c-format msgid "\tDescription: %s\n" msgstr "" -#: systemv/lpstat.c:2074 systemv/lpstat.c:2187 +#: systemv/lpstat.c:2074 systemv/lpstat.c:2187 systemv/lpstat.c:2008 +#: systemv/lpstat.c:2121 systemv/lpstat.c:2036 systemv/lpstat.c:2149 msgid "\tAlerts:" msgstr "" -#: systemv/lpstat.c:2083 systemv/lpstat.c:2196 +#: systemv/lpstat.c:2083 systemv/lpstat.c:2196 systemv/lpstat.c:2017 +#: systemv/lpstat.c:2130 systemv/lpstat.c:2045 systemv/lpstat.c:2158 #, c-format msgid "\tLocation: %s\n" msgstr "" -#: systemv/lpstat.c:2088 systemv/lpstat.c:2201 +#: systemv/lpstat.c:2088 systemv/lpstat.c:2201 systemv/lpstat.c:2022 +#: systemv/lpstat.c:2135 systemv/lpstat.c:2050 systemv/lpstat.c:2163 msgid "\tConnection: remote\n" msgstr "" -#: systemv/lpstat.c:2092 systemv/lpstat.c:2205 +#: systemv/lpstat.c:2092 systemv/lpstat.c:2205 systemv/lpstat.c:2026 +#: systemv/lpstat.c:2139 systemv/lpstat.c:2054 systemv/lpstat.c:2167 #, c-format msgid "\tInterface: %s.ppd\n" msgstr "" -#: systemv/lpstat.c:2097 systemv/lpstat.c:2210 +#: systemv/lpstat.c:2097 systemv/lpstat.c:2210 systemv/lpstat.c:2031 +#: systemv/lpstat.c:2144 systemv/lpstat.c:2059 systemv/lpstat.c:2172 msgid "\tConnection: direct\n" msgstr "" -#: systemv/lpstat.c:2101 systemv/lpstat.c:2214 +#: systemv/lpstat.c:2101 systemv/lpstat.c:2214 systemv/lpstat.c:2035 +#: systemv/lpstat.c:2148 systemv/lpstat.c:2063 systemv/lpstat.c:2176 #, c-format msgid "\tInterface: %s/interfaces/%s\n" msgstr "" -#: systemv/lpstat.c:2105 systemv/lpstat.c:2218 +#: systemv/lpstat.c:2105 systemv/lpstat.c:2218 systemv/lpstat.c:2039 +#: systemv/lpstat.c:2152 systemv/lpstat.c:2067 systemv/lpstat.c:2180 #, c-format msgid "\tInterface: %s/ppd/%s.ppd\n" msgstr "" -#: systemv/lpstat.c:2107 systemv/lpstat.c:2220 +#: systemv/lpstat.c:2107 systemv/lpstat.c:2220 systemv/lpstat.c:2041 +#: systemv/lpstat.c:2154 systemv/lpstat.c:2069 systemv/lpstat.c:2182 msgid "\tOn fault: no alert\n" msgstr "" -#: systemv/lpstat.c:2108 systemv/lpstat.c:2221 +#: systemv/lpstat.c:2108 systemv/lpstat.c:2221 systemv/lpstat.c:2042 +#: systemv/lpstat.c:2155 systemv/lpstat.c:2070 systemv/lpstat.c:2183 msgid "\tAfter fault: continue\n" msgstr "" #: systemv/lpstat.c:2112 systemv/lpstat.c:2126 systemv/lpstat.c:2225 -#: systemv/lpstat.c:2239 +#: systemv/lpstat.c:2239 systemv/lpstat.c:2046 systemv/lpstat.c:2060 +#: systemv/lpstat.c:2159 systemv/lpstat.c:2173 systemv/lpstat.c:2074 +#: systemv/lpstat.c:2088 systemv/lpstat.c:2187 systemv/lpstat.c:2201 msgid "\tUsers allowed:\n" msgstr "" -#: systemv/lpstat.c:2119 systemv/lpstat.c:2232 +#: systemv/lpstat.c:2119 systemv/lpstat.c:2232 systemv/lpstat.c:2053 +#: systemv/lpstat.c:2166 systemv/lpstat.c:2081 systemv/lpstat.c:2194 msgid "\tUsers denied:\n" msgstr "" -#: systemv/lpstat.c:2127 systemv/lpstat.c:2240 +#: systemv/lpstat.c:2127 systemv/lpstat.c:2240 systemv/lpstat.c:2061 +#: systemv/lpstat.c:2174 systemv/lpstat.c:2089 systemv/lpstat.c:2202 msgid "\t\t(all)\n" msgstr "" -#: systemv/lpstat.c:2129 systemv/lpstat.c:2242 +#: systemv/lpstat.c:2129 systemv/lpstat.c:2242 systemv/lpstat.c:2063 +#: systemv/lpstat.c:2176 systemv/lpstat.c:2091 systemv/lpstat.c:2204 msgid "\tForms allowed:\n" msgstr "" #: systemv/lpstat.c:2130 systemv/lpstat.c:2133 systemv/lpstat.c:2243 -#: systemv/lpstat.c:2246 +#: systemv/lpstat.c:2246 systemv/lpstat.c:2064 systemv/lpstat.c:2067 +#: systemv/lpstat.c:2177 systemv/lpstat.c:2180 systemv/lpstat.c:2092 +#: systemv/lpstat.c:2095 systemv/lpstat.c:2205 systemv/lpstat.c:2208 msgid "\t\t(none)\n" msgstr "" -#: systemv/lpstat.c:2131 systemv/lpstat.c:2244 +#: systemv/lpstat.c:2131 systemv/lpstat.c:2244 systemv/lpstat.c:2065 +#: systemv/lpstat.c:2178 systemv/lpstat.c:2093 systemv/lpstat.c:2206 msgid "\tBanner required\n" msgstr "" -#: systemv/lpstat.c:2132 systemv/lpstat.c:2245 +#: systemv/lpstat.c:2132 systemv/lpstat.c:2245 systemv/lpstat.c:2066 +#: systemv/lpstat.c:2179 systemv/lpstat.c:2094 systemv/lpstat.c:2207 msgid "\tCharset sets:\n" msgstr "" -#: systemv/lpstat.c:2134 systemv/lpstat.c:2247 +#: systemv/lpstat.c:2134 systemv/lpstat.c:2247 systemv/lpstat.c:2068 +#: systemv/lpstat.c:2181 systemv/lpstat.c:2096 systemv/lpstat.c:2209 msgid "\tDefault pitch:\n" msgstr "" -#: systemv/lpstat.c:2135 systemv/lpstat.c:2248 +#: systemv/lpstat.c:2135 systemv/lpstat.c:2248 systemv/lpstat.c:2069 +#: systemv/lpstat.c:2182 systemv/lpstat.c:2097 systemv/lpstat.c:2210 msgid "\tDefault page size:\n" msgstr "" -#: systemv/lpstat.c:2136 systemv/lpstat.c:2249 +#: systemv/lpstat.c:2136 systemv/lpstat.c:2249 systemv/lpstat.c:2070 +#: systemv/lpstat.c:2183 systemv/lpstat.c:2098 systemv/lpstat.c:2211 msgid "\tDefault port settings:\n" msgstr "" -#: systemv/lpstat.c:2146 +#: systemv/lpstat.c:2146 systemv/lpstat.c:2080 systemv/lpstat.c:2108 #, c-format msgid "printer %s/%s is idle. enabled since %s\n" msgstr "" -#: systemv/lpstat.c:2153 +#: systemv/lpstat.c:2153 systemv/lpstat.c:2087 systemv/lpstat.c:2115 #, c-format msgid "printer %s/%s now printing %s-%d. enabled since %s\n" msgstr "" -#: systemv/lpstat.c:2160 +#: systemv/lpstat.c:2160 systemv/lpstat.c:2094 systemv/lpstat.c:2122 #, c-format msgid "printer %s/%s disabled since %s -\n" msgstr "" -#: systemv/lpstat.c:2279 +#: systemv/lpstat.c:2279 systemv/lpstat.c:2212 systemv/lpstat.c:2240 msgid "scheduler is running\n" msgstr "" -#: systemv/lpstat.c:2281 +#: systemv/lpstat.c:2281 systemv/lpstat.c:2214 systemv/lpstat.c:2242 msgid "scheduler is not running\n" msgstr "" @@ -1777,12 +1843,12 @@ msgid "" "\n" msgstr "" -#: systemv/lpadmin.c:1554 +#: systemv/lpadmin.c:1554 systemv/lpadmin.c:1440 #, c-format msgid "lpadmin: Unable to create temporary file: %s\n" msgstr "" -#: systemv/lpadmin.c:1562 +#: systemv/lpadmin.c:1562 systemv/lpadmin.c:1448 #, c-format msgid "lpadmin: Unable to open file \"%s\": %s\n" msgstr "" @@ -1802,12 +1868,12 @@ msgstr "" msgid "lpadmin: add-printer (set location) failed: %s\n" msgstr "" -#: systemv/lpadmin.c:2021 +#: systemv/lpadmin.c:2021 systemv/lpadmin.c:1814 #, c-format msgid "lpadmin: Unable to create temporary file - %s\n" msgstr "" -#: systemv/lpadmin.c:2031 +#: systemv/lpadmin.c:2031 systemv/lpadmin.c:1824 #, c-format msgid "lpadmin: Unable to open PPD file \"%s\" - %s\n" msgstr "" @@ -1944,7 +2010,7 @@ msgstr "" msgid "lp: unable to print file: %s\n" msgstr "" -#: systemv/lp.c:656 +#: systemv/lp.c:656 systemv/lp.c:653 systemv/lp.c:713 #, c-format msgid "request id is %s-%d (%d file(s))\n" msgstr "" @@ -2001,12 +2067,12 @@ msgid "" " make-and-model = %s\n" msgstr "" -#: systemv/lpmove.c:114 +#: systemv/lpmove.c:114 systemv/lpmove.c:119 #, c-format msgid "lpmove: Unknown option '%c'!\n" msgstr "" -#: systemv/lpmove.c:133 +#: systemv/lpmove.c:133 systemv/lpmove.c:138 #, c-format msgid "lpmove: Unknown argument '%s'!\n" msgstr "" @@ -2015,7 +2081,7 @@ msgstr "" msgid "Usage: lpmove job dest\n" msgstr "" -#: systemv/lpmove.c:151 +#: systemv/lpmove.c:151 systemv/lpmove.c:156 #, c-format msgid "lpmove: Unable to connect to server: %s\n" msgstr "" @@ -2125,17 +2191,808 @@ msgstr "" msgid "lppasswd: failed to rename password file: %s\n" msgstr "" -#: systemv/lppasswd.c:501 +#: systemv/lppasswd.c:501 systemv/lppasswd.c:500 msgid "Usage: lppasswd [-g groupname]\n" msgstr "" -#: systemv/lppasswd.c:506 +#: systemv/lppasswd.c:506 systemv/lppasswd.c:503 msgid "" "Usage: lppasswd [-g groupname] [username]\n" " lppasswd [-g groupname] -a [username]\n" " lppasswd [-g groupname] -x [username]\n" msgstr "" +#: cgi-bin/admin.c:125 +msgid "Start Printer" +msgstr "" + +#: cgi-bin/admin.c:127 +msgid "Stop Printer" +msgstr "" + +#: cgi-bin/admin.c:129 +msgid "Start Class" +msgstr "" + +#: cgi-bin/admin.c:131 +msgid "Stop Class" +msgstr "" + +#: cgi-bin/admin.c:133 +msgid "Accept Jobs" +msgstr "" + +#: cgi-bin/admin.c:135 +msgid "Reject Jobs" +msgstr "" + +#: cgi-bin/admin.c:137 +msgid "Purge Jobs" +msgstr "" + +#: cgi-bin/admin.c:141 +msgid "Set As Default" +msgstr "" + +#: cgi-bin/admin.c:168 cgi-bin/admin.c:179 cgi-bin/admin.c:2690 +msgid "Administration" +msgstr "" + +#: cgi-bin/admin.c:224 +msgid "Modify Class" +msgstr "" + +#: cgi-bin/admin.c:224 +msgid "Add Class" +msgstr "" + +#: cgi-bin/admin.c:385 +msgid "The class name may only contain up to 127 printable characters and may not contain spaces, slashes (/), or the pound sign (#)." +msgstr "" + +#: cgi-bin/admin.c:444 +msgid "Unable to modify class:" +msgstr "" + +#: cgi-bin/admin.c:445 +msgid "Unable to add class:" +msgstr "" + +#: cgi-bin/admin.c:514 +msgid "Modify Printer" +msgstr "" + +#: cgi-bin/admin.c:514 +msgid "Add Printer" +msgstr "" + +#: cgi-bin/admin.c:583 +msgid "The printer name may only contain up to 127 printable characters and may not contain spaces, slashes (/), or the pound sign (#)." +msgstr "" + +#: cgi-bin/admin.c:900 +msgid "Unable to get list of printer drivers:" +msgstr "" + +#: cgi-bin/admin.c:983 +msgid "Unable to modify printer:" +msgstr "" + +#: cgi-bin/admin.c:984 +msgid "Unable to add printer:" +msgstr "" + +#: cgi-bin/admin.c:1051 +msgid "Set Printer Options" +msgstr "" + +#: cgi-bin/admin.c:1062 cgi-bin/admin.c:2330 cgi-bin/admin.c:2391 +#: cgi-bin/admin.c:3112 cgi-bin/admin.c:3213 cgi-bin/admin.c:3449 +msgid "Missing form variable!" +msgstr "" + +#: cgi-bin/admin.c:1076 +msgid "Unable to get PPD file!" +msgstr "" + +#: cgi-bin/admin.c:1084 +msgid "Unable to open PPD file:" +msgstr "" + +#: cgi-bin/admin.c:1241 +msgid "Banners" +msgstr "" + +#: cgi-bin/admin.c:1255 +msgid "Starting Banner" +msgstr "" + +#: cgi-bin/admin.c:1262 +msgid "Ending Banner" +msgstr "" + +#: cgi-bin/admin.c:1280 +msgid "Policies" +msgstr "" + +#: cgi-bin/admin.c:1304 +msgid "Error Policy" +msgstr "" + +#: cgi-bin/admin.c:1331 +msgid "Operation Policy" +msgstr "" + +#: cgi-bin/admin.c:1352 cgi-bin/admin.c:1372 +msgid "PS Binary Protocol" +msgstr "" + +#: cgi-bin/admin.c:1358 +msgid "None" +msgstr "" + +#: cgi-bin/admin.c:1490 +msgid "Unable to set options:" +msgstr "" + +#: cgi-bin/admin.c:1591 cgi-bin/admin.c:1607 cgi-bin/admin.c:1620 +#: cgi-bin/admin.c:2099 cgi-bin/admin.c:2106 +msgid "Change Settings" +msgstr "" + +#: cgi-bin/admin.c:1592 cgi-bin/admin.c:1608 cgi-bin/admin.c:1621 +msgid "Unable to change server settings:" +msgstr "" + +#: cgi-bin/admin.c:2097 cgi-bin/admin.c:2190 +msgid "Unable to upload cupsd.conf file:" +msgstr "" + +#: cgi-bin/admin.c:2134 cgi-bin/admin.c:2146 cgi-bin/admin.c:2193 +#: cgi-bin/admin.c:2200 cgi-bin/admin.c:2232 cgi-bin/admin.c:2244 +#: cgi-bin/admin.c:2267 +msgid "Edit Configuration File" +msgstr "" + +#: cgi-bin/admin.c:2135 cgi-bin/admin.c:2147 +msgid "Unable to create temporary file:" +msgstr "" + +#: cgi-bin/admin.c:2233 cgi-bin/admin.c:2245 cgi-bin/admin.c:2268 +msgid "Unable to access cupsd.conf file:" +msgstr "" + +#: cgi-bin/admin.c:2247 +msgid "Unable to edit cupsd.conf files larger than 1MB!" +msgstr "" + +#: cgi-bin/admin.c:2316 +msgid "Delete Class" +msgstr "" + +#: cgi-bin/admin.c:2357 +msgid "Unable to delete class:" +msgstr "" + +#: cgi-bin/admin.c:2377 +msgid "Delete Printer" +msgstr "" + +#: cgi-bin/admin.c:2418 +msgid "Unable to delete printer:" +msgstr "" + +#: cgi-bin/admin.c:2447 +msgid "Export Printers to Samba" +msgstr "" + +#: cgi-bin/admin.c:2515 +msgid "Unable to fork process!" +msgstr "" + +#: cgi-bin/admin.c:2534 +msgid "Unable to connect to server!" +msgstr "" + +#: cgi-bin/admin.c:2538 +msgid "Unable to get printer attributes!" +msgstr "" + +#: cgi-bin/admin.c:2543 +msgid "Unable to convert PPD file!" +msgstr "" + +#: cgi-bin/admin.c:2547 +msgid "Unable to copy Windows 2000 printer driver files!" +msgstr "" + +#: cgi-bin/admin.c:2552 +msgid "Unable to install Windows 2000 printer driver files!" +msgstr "" + +#: cgi-bin/admin.c:2557 +msgid "Unable to copy Windows 9x printer driver files!" +msgstr "" + +#: cgi-bin/admin.c:2562 +msgid "Unable to install Windows 9x printer driver files!" +msgstr "" + +#: cgi-bin/admin.c:2567 +msgid "Unable to set Windows printer driver!" +msgstr "" + +#: cgi-bin/admin.c:2572 +msgid "No printer drivers found!" +msgstr "" + +#: cgi-bin/admin.c:2576 +msgid "Unable to execute cupsaddsmb command!" +msgstr "" + +#: cgi-bin/admin.c:2582 +#, c-format +msgid "cupsaddsmb failed with status %d" +msgstr "" + +#: cgi-bin/admin.c:2592 +#, c-format +msgid "cupsaddsmb crashed on signal %d" +msgstr "" + +#: cgi-bin/admin.c:2608 +msgid "A Samba username is required to export printer drivers!" +msgstr "" + +#: cgi-bin/admin.c:2612 +msgid "A Samba password is required to export printer drivers!" +msgstr "" + +#: cgi-bin/admin.c:2704 +msgid "Unable to open cupsd.conf file:" +msgstr "" + +#: cgi-bin/admin.c:3144 cgi-bin/admin.c:3400 +msgid "Unable to change printer:" +msgstr "" + +#: cgi-bin/admin.c:3214 cgi-bin/admin.c:3259 cgi-bin/admin.c:3399 +#: cgi-bin/admin.c:3417 +msgid "Set Allowed Users" +msgstr "" + +#: cgi-bin/admin.c:3262 +msgid "Unable to get printer attributes:" +msgstr "" + +#: cgi-bin/admin.c:3450 cgi-bin/admin.c:3488 cgi-bin/admin.c:3506 +msgid "Set Publishing" +msgstr "" + +#: cgi-bin/admin.c:3489 +msgid "Unable to change printer-is-shared attribute:" +msgstr "" + +#: cgi-bin/classes.c:161 cgi-bin/classes.c:208 +msgid "Classes" +msgstr "" + +#: cgi-bin/classes.c:355 +msgid "Unable to get class list:" +msgstr "" + +#: cgi-bin/classes.c:454 +msgid "Unable to get class status:" +msgstr "" + +#: cgi-bin/ipp-var.c:366 cgi-bin/ipp-var.c:419 cgi-bin/ipp-var.c:489 +msgid "Move Job" +msgstr "" + +#: cgi-bin/ipp-var.c:367 +msgid "Unable to find destination for job!" +msgstr "" + +#: cgi-bin/ipp-var.c:421 cgi-bin/ipp-var.c:491 +msgid "Move All Jobs" +msgstr "" + +#: cgi-bin/ipp-var.c:496 +msgid "Unable to move job" +msgstr "" + +#: cgi-bin/ipp-var.c:498 +msgid "Unable to move jobs" +msgstr "" + +#: cgi-bin/ipp-var.c:603 +msgid "Print Test Page" +msgstr "" + +#: cgi-bin/ipp-var.c:606 +msgid "Unable to print test page:" +msgstr "" + +#: cgi-bin/jobs.c:111 cgi-bin/jobs.c:122 cgi-bin/jobs.c:184 +msgid "Jobs" +msgstr "" + +#: cgi-bin/jobs.c:187 +msgid "Job operation failed:" +msgstr "" + +#: cgi-bin/printers.c:161 cgi-bin/printers.c:208 +msgid "Printers" +msgstr "" + +#: cgi-bin/printers.c:362 +msgid "Unable to get printer list:" +msgstr "" + +#: cgi-bin/printers.c:461 +msgid "Unable to get printer status:" +msgstr "" + +#: cups/ppd.c:319 +msgid "OK" +msgstr "" + +#: cups/ppd.c:320 +msgid "Unable to open PPD file" +msgstr "" + +#: cups/ppd.c:321 +msgid "NULL PPD file pointer" +msgstr "" + +#: cups/ppd.c:322 +msgid "Memory allocation error" +msgstr "" + +#: cups/ppd.c:323 +msgid "Missing PPD-Adobe-4.x header" +msgstr "" + +#: cups/ppd.c:324 +msgid "Missing value string" +msgstr "" + +#: cups/ppd.c:325 +msgid "Internal error" +msgstr "" + +#: cups/ppd.c:326 +msgid "Bad OpenGroup" +msgstr "" + +#: cups/ppd.c:327 +msgid "OpenGroup without a CloseGroup first" +msgstr "" + +#: cups/ppd.c:328 +msgid "Bad OpenUI/JCLOpenUI" +msgstr "" + +#: cups/ppd.c:329 +msgid "OpenUI/JCLOpenUI without a CloseUI/JCLCloseUI first" +msgstr "" + +#: cups/ppd.c:330 +msgid "Bad OrderDependency" +msgstr "" + +#: cups/ppd.c:331 +msgid "Bad UIConstraints" +msgstr "" + +#: cups/ppd.c:332 +msgid "Missing asterisk in column 1" +msgstr "" + +#: cups/ppd.c:333 +msgid "Line longer than the maximum allowed (255 characters)" +msgstr "" + +#: cups/ppd.c:334 +msgid "Illegal control character" +msgstr "" + +#: cups/ppd.c:335 +msgid "Illegal main keyword string" +msgstr "" + +#: cups/ppd.c:336 +msgid "Illegal option keyword string" +msgstr "" + +#: cups/ppd.c:337 +msgid "Illegal translation string" +msgstr "" + +#: cups/ppd.c:338 +msgid "Illegal whitespace character" +msgstr "" + +#: cups/ppd.c:339 +msgid "Bad custom parameter" +msgstr "" + +#: cups/ppd.c:344 +msgid "Unknown" +msgstr "" + +#: cups/ppd.c:1033 +msgid "Custom" +msgstr "" + +#: cups/ppd.c:1259 +msgid "JCL" +msgstr "" + +#: scheduler/ipp.c:2184 +msgid "No authentication information provided!" +msgstr "" + +#: systemv/cupsaddsmb.c:440 +#, c-format +msgid "Password for %s required to access %s via SAMBA: " +msgstr "" + +#: systemv/cupsaddsmb.c:451 +#, c-format +msgid "Running command: %s %s -N -U '%s%%%s' -c '%s'\n" +msgstr "" + +#: systemv/cupsaddsmb.c:479 +#, c-format +msgid "cupsaddsmb: Unable to run \"%s\": %s\n" +msgstr "" + +#: systemv/cupsaddsmb.c:805 +msgid "cupsaddsmb: No Windows printer drivers are installed!\n" +msgstr "" + +#: systemv/cupsaddsmb.c:810 +msgid "cupsaddsmb: Warning, no Windows 2000 printer drivers are installed!\n" +msgstr "" + +#: systemv/lpadmin.c:881 +#, c-format +msgid "lpadmin: Printer %s is already a member of class %s.\n" +msgstr "" + +#: systemv/lpadmin.c:1115 +msgid "lpadmin: No member names were seen!\n" +msgstr "" + +#: systemv/lpadmin.c:1129 +#, c-format +msgid "lpadmin: Printer %s is not a member of class %s.\n" +msgstr "" + +#: systemv/lpinfo.c:278 +#, c-format +msgid "" +"Device: uri = %s\n" +" class = %s\n" +" info = %s\n" +" make-and-model = %s\n" +" device-id = %s\n" +msgstr "" + +#: systemv/lpinfo.c:410 +#, c-format +msgid "" +"Model: name = %s\n" +" natural_language = %s\n" +" make-and-model = %s\n" +" device-id = %s\n" +msgstr "" + +#: systemv/lpmove.c:145 +msgid "Usage: lpmove job/src dest\n" +msgstr "" + +#: systemv/lpstat.c:144 systemv/lpstat.c:156 +msgid "lpstat: Need \"completed\", \"not-completed\", or \"all\" after -W!\n" +msgstr "" + +#: systemv/lpstat.c:740 systemv/lpstat.c:768 +#, c-format +msgid "%s accepting requests since %s\n" +msgstr "" + +#: systemv/lpstat.c:743 systemv/lpstat.c:771 +#, c-format +msgid "" +"%s not accepting requests since %s -\n" +"\t%s\n" +msgstr "" + +#: systemv/lpstat.c:752 systemv/lpstat.c:780 +#, c-format +msgid "%s/%s accepting requests since %s\n" +msgstr "" + +#: systemv/lpstat.c:755 systemv/lpstat.c:783 +#, c-format +msgid "" +"%s/%s not accepting requests since %s -\n" +"\t%s\n" +msgstr "" + +#: berkeley/lpc.c:88 berkeley/lpc.c:116 berkeley/lpc.c:152 +msgid "lpc> " +msgstr "" + +#: berkeley/lpq.c:93 systemv/cancel.c:250 systemv/cancel.c:332 +#, c-format +msgid "%s: Unable to contact server!\n" +msgstr "" + +#: berkeley/lpq.c:138 berkeley/lpr.c:128 berkeley/lprm.c:144 +#: systemv/accept.c:120 systemv/cancel.c:107 systemv/lp.c:150 +#: systemv/lpstat.c:144 +#, c-format +msgid "%s: Error - expected username after '-U' option!\n" +msgstr "" + +#: berkeley/lpq.c:173 +#, c-format +msgid "%s: Error - unknown destination \"%s/%s\"!\n" +msgstr "" + +#: berkeley/lpq.c:177 systemv/lpstat.c:549 +#, c-format +msgid "%s: Unknown destination \"%s\"!\n" +msgstr "" + +#: berkeley/lpq.c:201 berkeley/lprm.c:167 systemv/accept.c:146 +#: systemv/cancel.c:135 systemv/lp.c:227 systemv/lpstat.c:300 +#, c-format +msgid "%s: Error - expected hostname after '-h' option!\n" +msgstr "" + +#: berkeley/lpq.c:253 +#, c-format +msgid "%s: error - %s environment variable names non-existent destination \"%s\"!\n" +msgstr "" + +#: berkeley/lpq.c:258 +#, c-format +msgid "%s: error - no default destination available.\n" +msgstr "" + +#: berkeley/lpq.c:647 +msgid "Usage: lpq [-P dest] [-U username] [-h hostname[:port]] [-l] [+interval]\n" +msgstr "" + +#: berkeley/lpr.c:148 +#, c-format +msgid "%s: Error - expected hostname after '-H' option!\n" +msgstr "" + +#: berkeley/lpr.c:171 +#, c-format +msgid "%s: Error - expected value after '-%c' option!\n" +msgstr "" + +#: berkeley/lpr.c:185 +#, c-format +msgid "%s: Warning - '%c' format modifier not supported - output may not be correct!\n" +msgstr "" + +#: berkeley/lpr.c:199 +#, c-format +msgid "%s: error - expected option=value after '-o' option!\n" +msgstr "" + +#: berkeley/lpr.c:250 +#, c-format +msgid "%s: Error - expected destination after '-P' option!\n" +msgstr "" + +#: berkeley/lpr.c:285 +#, c-format +msgid "%s: Error - expected copy count after '-#' option!\n" +msgstr "" + +#: berkeley/lpr.c:309 +#, c-format +msgid "%s: Error - expected name after '-%c' option!\n" +msgstr "" + +#: berkeley/lpr.c:320 berkeley/lprm.c:179 systemv/accept.c:176 +#: systemv/cancel.c:169 systemv/lp.c:529 systemv/lpstat.c:461 +#, c-format +msgid "%s: Error - unknown option '%c'!\n" +msgstr "" + +#: berkeley/lpr.c:333 systemv/lp.c:554 +#, c-format +msgid "%s: Error - unable to access \"%s\" - %s\n" +msgstr "" + +#: berkeley/lpr.c:351 systemv/lp.c:571 +#, c-format +msgid "%s: Error - too many files - \"%s\"\n" +msgstr "" + +#: berkeley/lpr.c:393 systemv/lp.c:621 +#, c-format +msgid "%s: Error - %s environment variable names non-existent destination \"%s\"!\n" +msgstr "" + +#: berkeley/lpr.c:398 systemv/lp.c:626 +#, c-format +msgid "%s: Error - no default destination available.\n" +msgstr "" + +#: berkeley/lpr.c:402 systemv/lp.c:630 +#, c-format +msgid "%s: Error - scheduler not responding!\n" +msgstr "" + +#: berkeley/lpr.c:452 systemv/lp.c:670 +#, c-format +msgid "%s: Error - unable to create temporary file \"%s\" - %s\n" +msgstr "" + +#: berkeley/lpr.c:462 systemv/lp.c:679 +#, c-format +msgid "%s: Error - unable to write to temporary file \"%s\" - %s\n" +msgstr "" + +#: berkeley/lpr.c:476 systemv/lp.c:693 +#, c-format +msgid "%s: Error - stdin is empty, so no job has been sent.\n" +msgstr "" + +#: berkeley/lprm.c:127 systemv/cancel.c:227 +#, c-format +msgid "%s: Error - unknown destination \"%s\"!\n" +msgstr "" + +#: systemv/accept.c:165 +#, c-format +msgid "%s: Error - expected reason text after '-r' option!\n" +msgstr "" + +#: systemv/cancel.c:157 +#, c-format +msgid "%s: Error - expected username after '-u' option!\n" +msgstr "" + +#: systemv/cancel.c:308 systemv/cancel.c:373 +#, c-format +msgid "%s: %s failed: %s\n" +msgstr "" + +#: systemv/lp.c:173 +#, c-format +msgid "%s: Error - expected destination after '-d' option!\n" +msgstr "" + +#: systemv/lp.c:206 +#, c-format +msgid "%s: Error - expected form after '-f' option!\n" +msgstr "" + +#: systemv/lp.c:213 +#, c-format +msgid "%s: Warning - form option ignored!\n" +msgstr "" + +#: systemv/lp.c:247 +#, c-format +msgid "%s: Expected job ID after '-i' option!\n" +msgstr "" + +#: systemv/lp.c:258 +#, c-format +msgid "%s: Error - cannot print files and alter jobs simultaneously!\n" +msgstr "" + +#: systemv/lp.c:271 +#, c-format +msgid "%s: Error - bad job ID!\n" +msgstr "" + +#: systemv/lp.c:296 +#, c-format +msgid "%s: Error - expected copies after '-n' option!\n" +msgstr "" + +#: systemv/lp.c:319 +#, c-format +msgid "%s: Error - expected option string after '-o' option!\n" +msgstr "" + +#: systemv/lp.c:340 +#, c-format +msgid "%s: Error - expected priority after '-%c' option!\n" +msgstr "" + +#: systemv/lp.c:363 +#, c-format +msgid "%s: Error - priority must be between 1 and 100.\n" +msgstr "" + +#: systemv/lp.c:387 +#, c-format +msgid "%s: Error - expected title after '-t' option!\n" +msgstr "" + +#: systemv/lp.c:405 +#, c-format +msgid "%s: Error - expected mode list after '-y' option!\n" +msgstr "" + +#: systemv/lp.c:413 +#, c-format +msgid "%s: Warning - mode option ignored!\n" +msgstr "" + +#: systemv/lp.c:427 +#, c-format +msgid "%s: Error - expected hold name after '-H' option!\n" +msgstr "" + +#: systemv/lp.c:451 +#, c-format +msgid "%s: Need job ID ('-i jobid') before '-H restart'!\n" +msgstr "" + +#: systemv/lp.c:475 +#, c-format +msgid "%s: Error - expected page list after '-P' option!\n" +msgstr "" + +#: systemv/lp.c:496 +#, c-format +msgid "%s: Error - expected character set after '-S' option!\n" +msgstr "" + +#: systemv/lp.c:504 +#, c-format +msgid "%s: Warning - character set option ignored!\n" +msgstr "" + +#: systemv/lp.c:516 +#, c-format +msgid "%s: Error - expected content type after '-T' option!\n" +msgstr "" + +#: systemv/lp.c:524 +#, c-format +msgid "%s: Warning - content type option ignored!\n" +msgstr "" + +#: systemv/lp.c:538 +#, c-format +msgid "%s: Error - cannot print from stdin if files or a job ID are provided!\n" +msgstr "" + +#: systemv/lpstat.c:164 systemv/lpstat.c:178 +#, c-format +msgid "%s: Error - need \"completed\", \"not-completed\", or \"all\" after '-W' option!\n" +msgstr "" + +#: systemv/lpstat.c:237 +#, c-format +msgid "%s: Error - expected destination after '-b' option!\n" +msgstr "" + +#: systemv/lpstat.c:534 +#, c-format +msgid "%s: Invalid destination name in list \"%s\"!\n" +msgstr "" + +#: systemv/lpstat.c:571 +#, c-format +msgid "%s: Unable to connect to server\n" +msgstr "" + # # End of "$Id$". diff --git a/locale/cups_fr.po b/locale/cups_fr.po index 2f2bc28ae..e7f9a29dc 100644 --- a/locale/cups_fr.po +++ b/locale/cups_fr.po @@ -2,7 +2,7 @@ msgid "" msgstr "" "Project-Id-Version: CUPS 1.2\n" "Report-Msgid-Bugs-To: http://www.cups.org/str.php\n" -"POT-Creation-Date: 2006-01-08 18:06-0500\n" +"POT-Creation-Date: 2006-01-18 22:26-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -10,7 +10,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: cgi-bin/admin.c:1276 +#: cgi-bin/admin.c:1276 cgi-bin/admin.c:1154 msgid "Options Installed" msgstr "Options Installées" @@ -22,31 +22,32 @@ msgstr "Classe" msgid "Printer" msgstr "Imprimeur" -#: cups/ppd.c:654 cups/ppd.c:1045 +#: cups/ppd.c:654 cups/ppd.c:1045 cups/ppd.c:660 cups/ppd.c:1167 msgid "Extra" msgstr "Supplémentaire" -#: cups/ppd.c:656 cups/ppd.c:881 cups/ppd.c:1047 +#: cups/ppd.c:656 cups/ppd.c:881 cups/ppd.c:1047 cups/ppd.c:662 cups/ppd.c:996 +#: cups/ppd.c:1169 msgid "General" msgstr "Généralités" -#: cups/ppd.c:704 cups/ppd.c:1105 +#: cups/ppd.c:704 cups/ppd.c:1105 cups/ppd.c:710 cups/ppd.c:1224 msgid "Media Size" msgstr "Taille De Médias" -#: cups/ppd.c:706 cups/ppd.c:1107 +#: cups/ppd.c:706 cups/ppd.c:1107 cups/ppd.c:712 cups/ppd.c:1226 msgid "Media Type" msgstr "Type De Supports" -#: cups/ppd.c:708 cups/ppd.c:1109 +#: cups/ppd.c:708 cups/ppd.c:1109 cups/ppd.c:714 cups/ppd.c:1228 msgid "Media Source" msgstr "Source De Médias" -#: cups/ppd.c:710 cups/ppd.c:1111 +#: cups/ppd.c:710 cups/ppd.c:1111 cups/ppd.c:716 cups/ppd.c:1230 msgid "Output Mode" msgstr "Mode De Rendement" -#: cups/ppd.c:712 cups/ppd.c:1113 +#: cups/ppd.c:712 cups/ppd.c:1113 cups/ppd.c:718 cups/ppd.c:1232 msgid "Resolution" msgstr "Résolution" @@ -54,11 +55,11 @@ msgstr "Résolution" msgid "Variable" msgstr "Variable" -#: cups/ppd.c:1535 +#: cups/ppd.c:1535 cups/ppd.c:1650 msgid "Yes" msgstr "Oui" -#: cups/ppd.c:1537 +#: cups/ppd.c:1537 cups/ppd.c:1652 msgid "No" msgstr "Non" @@ -66,7 +67,7 @@ msgstr "Non" msgid "Auto" msgstr "Automobile" -#: scheduler/client.c:2247 +#: scheduler/client.c:2247 scheduler/client.c:2251 msgid "" "Enter your username and password or the root username and password to access " "this page." @@ -74,29 +75,29 @@ msgstr "" "Entrez votre username et mot de passe ou le username de racine et le mot de " "passe pour accéder à cette page." -#: scheduler/client.c:2252 +#: scheduler/client.c:2252 scheduler/client.c:2256 msgid "You must use a https: URL to access this page." msgstr "Vous devez employer des https: URL pour accéder à cette page." -#: scheduler/ipp.c:236 +#: scheduler/ipp.c:236 scheduler/ipp.c:244 #, c-format msgid "Bad request version number %d.%d!" msgstr "Mauvais nombre de version de demande %d.%d!" -#: scheduler/ipp.c:246 +#: scheduler/ipp.c:246 scheduler/ipp.c:254 msgid "No attributes in request!" msgstr "Aucuns attributs dans la demande!" -#: scheduler/ipp.c:269 +#: scheduler/ipp.c:269 scheduler/ipp.c:277 #, c-format msgid "Attribute groups are out of order (%x < %x)!" msgstr "Les groupes d'attribut sont en panne (%x < %x)!" -#: scheduler/ipp.c:379 +#: scheduler/ipp.c:379 scheduler/ipp.c:389 msgid "Missing required attributes!" msgstr "Attributs requis manquants!" -#: scheduler/ipp.c:575 +#: scheduler/ipp.c:575 scheduler/ipp.c:585 #, c-format msgid "%s not supported!" msgstr "%s non soutenu!" @@ -106,79 +107,89 @@ msgstr "%s non soutenu!" #: scheduler/ipp.c:4649 scheduler/ipp.c:5002 scheduler/ipp.c:5445 #: scheduler/ipp.c:5890 scheduler/ipp.c:6245 scheduler/ipp.c:6609 #: scheduler/ipp.c:7308 scheduler/ipp.c:8179 scheduler/ipp.c:8585 -#: scheduler/ipp.c:8663 scheduler/ipp.c:8836 +#: scheduler/ipp.c:8663 scheduler/ipp.c:8836 scheduler/ipp.c:696 +#: scheduler/ipp.c:1079 scheduler/ipp.c:2318 scheduler/ipp.c:2433 +#: scheduler/ipp.c:3901 scheduler/ipp.c:4621 scheduler/ipp.c:4855 +#: scheduler/ipp.c:5237 scheduler/ipp.c:5526 scheduler/ipp.c:5834 +#: scheduler/ipp.c:6113 scheduler/ipp.c:6155 scheduler/ipp.c:6657 +#: scheduler/ipp.c:7365 scheduler/ipp.c:8251 scheduler/ipp.c:8662 +#: scheduler/ipp.c:8742 scheduler/ipp.c:8917 msgid "The printer or class was not found." msgstr "L'imprimeur ou la classe n'a pas été trouvé." -#: scheduler/ipp.c:762 +#: scheduler/ipp.c:762 scheduler/ipp.c:777 msgid "" "The printer-uri must be of the form \"ipp://HOSTNAME/classes/CLASSNAME\"." msgstr "" "L'printer-uri doit être de la forme \"ipp://HOSTNAME/classes/CLASSNAME\"." -#: scheduler/ipp.c:778 scheduler/ipp.c:1454 +#: scheduler/ipp.c:778 scheduler/ipp.c:1454 scheduler/ipp.c:793 +#: scheduler/ipp.c:1482 #, c-format msgid "The printer-uri \"%s\" contains invalid characters." msgstr "L'printer-uri \"%s\" contient les caractères inadmissibles." -#: scheduler/ipp.c:811 +#: scheduler/ipp.c:811 scheduler/ipp.c:826 #, c-format msgid "A printer named \"%s\" already exists!" msgstr "Un imprimeur appelé \"%s\" existe déjà!" -#: scheduler/ipp.c:904 +#: scheduler/ipp.c:904 scheduler/ipp.c:924 #, c-format msgid "Attempt to set %s printer-state to bad value %d!" msgstr "Essayez de placer l'imprimeur-état de %s à la mauvaise valeur %d!" -#: scheduler/ipp.c:1000 +#: scheduler/ipp.c:1000 scheduler/ipp.c:1022 #, c-format msgid "add_class: Unknown printer-op-policy \"%s\"." msgstr "add_class: printer-op-policy inconnue \"%s\"." -#: scheduler/ipp.c:1013 +#: scheduler/ipp.c:1013 scheduler/ipp.c:1035 #, c-format msgid "add_class: Unknown printer-error-policy \"%s\"." msgstr "add_class: printer-error-policy inconnue \"%s\"." -#: scheduler/ipp.c:1144 +#: scheduler/ipp.c:1144 scheduler/ipp.c:1168 msgid "Unable to allocate memory for file types!" msgstr "Incapable d'assigner la mémoire pour des types de dossier!" -#: scheduler/ipp.c:1290 scheduler/ipp.c:4501 +#: scheduler/ipp.c:1290 scheduler/ipp.c:4501 scheduler/ipp.c:1316 +#: scheduler/ipp.c:4705 #, c-format msgid "Character set \"%s\" not supported!" msgstr "Jeu de caractères \"%s\" non soutenu!" -#: scheduler/ipp.c:1299 scheduler/ipp.c:4510 +#: scheduler/ipp.c:1299 scheduler/ipp.c:4510 scheduler/ipp.c:1325 +#: scheduler/ipp.c:4714 #, c-format msgid "Language \"%s\" not supported!" msgstr "Langue \"%s\" non soutenue!" -#: scheduler/ipp.c:1309 scheduler/ipp.c:4520 +#: scheduler/ipp.c:1309 scheduler/ipp.c:4520 scheduler/ipp.c:1335 +#: scheduler/ipp.c:4724 #, c-format msgid "The notify-user-data value is too large (%d > 63 octets)!" msgstr "La valeur de notify-user-data est trop grande (%d > 63 octets)!" -#: scheduler/ipp.c:1326 +#: scheduler/ipp.c:1326 scheduler/ipp.c:1352 msgid "" "The notify-lease-duration attribute cannot be used with job subscriptions." msgstr "" "L'attribut de notify-lease-duration ne peut pas être employé avec des " "abonnements du travail." -#: scheduler/ipp.c:1438 +#: scheduler/ipp.c:1438 scheduler/ipp.c:1466 msgid "" "The printer-uri must be of the form \"ipp://HOSTNAME/printers/PRINTERNAME\"." msgstr "" "L'printer-uri doit être de la forme \"ipp://HOSTNAME/printers/PRINTERNAME\"." -#: scheduler/ipp.c:1487 +#: scheduler/ipp.c:1487 scheduler/ipp.c:1515 #, c-format msgid "A class named \"%s\" already exists!" msgstr "Une classe appelée \"%s\" existe déjà!" -#: scheduler/ipp.c:1575 +#: scheduler/ipp.c:1575 scheduler/ipp.c:1607 #, c-format msgid "" "File device URIs have been disabled! To enable, see the FileDevice directive " @@ -187,54 +198,60 @@ msgstr "" "Le dispositif URIs de dossier ont été neutralisés! Pour permettre, voyez la " "directive de FileDevice dans \"%s/cupsd.conf\"." -#: scheduler/ipp.c:1595 +#: scheduler/ipp.c:1595 scheduler/ipp.c:1627 #, c-format msgid "Bad device-uri \"%s\"!" msgstr "Mauvais device-uri \"%s\"!" -#: scheduler/ipp.c:1626 +#: scheduler/ipp.c:1626 scheduler/ipp.c:1659 #, c-format msgid "Bad port-monitor \"%s\"!" msgstr "Mauvais port-monitor \"%s\"!" -#: scheduler/ipp.c:1669 +#: scheduler/ipp.c:1669 scheduler/ipp.c:1705 #, c-format msgid "Bad printer-state value %d!" msgstr "Mauvaise valeur %d de printer-state!" -#: scheduler/ipp.c:1762 +#: scheduler/ipp.c:1762 scheduler/ipp.c:1800 #, c-format msgid "Unknown printer-op-policy \"%s\"." msgstr "printer-op-policy inconnue \"%s\"." -#: scheduler/ipp.c:1775 +#: scheduler/ipp.c:1775 scheduler/ipp.c:1813 #, c-format msgid "Unknown printer-error-policy \"%s\"." msgstr "printer-error-policy inconnue \"%s\"." -#: scheduler/ipp.c:1837 +#: scheduler/ipp.c:1837 scheduler/ipp.c:1875 #, c-format msgid "Unable to copy interface script - %s!" msgstr "Incapable de copier le manuscrit d'interface - %s!" -#: scheduler/ipp.c:1862 +#: scheduler/ipp.c:1862 scheduler/ipp.c:1900 #, c-format msgid "Unable to copy PPD file - %s!" msgstr "Incapable de copier le dossier de PPD - %s!" -#: scheduler/ipp.c:1915 +#: scheduler/ipp.c:1915 scheduler/ipp.c:1954 msgid "Unable to copy PPD file!" msgstr "Incapable de copier le dossier de PPD!" #: scheduler/ipp.c:2076 scheduler/ipp.c:2364 scheduler/ipp.c:5188 #: scheduler/ipp.c:6008 scheduler/ipp.c:6147 scheduler/ipp.c:7394 #: scheduler/ipp.c:7538 scheduler/ipp.c:7776 scheduler/ipp.c:8261 +#: scheduler/ipp.c:2116 scheduler/ipp.c:2412 scheduler/ipp.c:5102 +#: scheduler/ipp.c:5955 scheduler/ipp.c:7452 scheduler/ipp.c:7599 +#: scheduler/ipp.c:7839 scheduler/ipp.c:8334 msgid "Got a printer-uri attribute but no job-id!" msgstr "N'a obtenu un attribut de printer-uri mais aucune job-id!" #: scheduler/ipp.c:2097 scheduler/ipp.c:2433 scheduler/ipp.c:5210 #: scheduler/ipp.c:6029 scheduler/ipp.c:6169 scheduler/ipp.c:7416 #: scheduler/ipp.c:7560 scheduler/ipp.c:7797 scheduler/ipp.c:8282 +#: scheduler/ipp.c:2138 scheduler/ipp.c:2484 scheduler/ipp.c:5125 +#: scheduler/ipp.c:5978 scheduler/ipp.c:6201 scheduler/ipp.c:7475 +#: scheduler/ipp.c:7622 scheduler/ipp.c:7862 scheduler/ipp.c:8357 #, c-format msgid "Bad job-uri attribute \"%s\"!" msgstr "Mauvais attribut \"%s\" de job-uri!" @@ -246,113 +263,118 @@ msgstr "Mauvais attribut \"%s\" de job-uri!" msgid "Job #%d doesn't exist!" msgstr "Le travail # %d n'existe pas!" -#: scheduler/ipp.c:2131 +#: scheduler/ipp.c:2131 scheduler/ipp.c:2172 #, c-format msgid "Job #%d is not held for authentication!" msgstr "Le travail # %d n'est pas tenu pour l'authentification!" -#: scheduler/ipp.c:2153 +#: scheduler/ipp.c:2153 scheduler/ipp.c:2195 #, c-format msgid "You are not authorized to authenticate job #%d owned by \"%s\"!" msgstr "" "Vous n'êtes pas autorisés à authentifier le travail # %d possédés par \"%s\"!" -#: scheduler/ipp.c:2221 +#: scheduler/ipp.c:2221 scheduler/ipp.c:2264 msgid "The printer-uri attribute is required!" msgstr "L'attribut de printer-uri est exigé!" -#: scheduler/ipp.c:2238 +#: scheduler/ipp.c:2238 scheduler/ipp.c:2283 msgid "Missing requesting-user-name attribute!" msgstr "Attribut absent de requesting-user-name!" -#: scheduler/ipp.c:2277 +#: scheduler/ipp.c:2277 scheduler/ipp.c:2324 #, c-format msgid "The printer-uri \"%s\" is not valid." msgstr "L'printer-uri \"%s\" est inadmissible." -#: scheduler/ipp.c:2410 +#: scheduler/ipp.c:2410 scheduler/ipp.c:2460 #, c-format msgid "No active jobs on %s!" msgstr "Aucuns JOBS actifs sur %s!" -#: scheduler/ipp.c:2462 +#: scheduler/ipp.c:2462 scheduler/ipp.c:2513 #, c-format msgid "You are not authorized to delete job #%d owned by \"%s\"!" msgstr "" "Vous n'êtes pas autorisés à supprimer le travail # %d possédés par \"%s\"!" -#: scheduler/ipp.c:2476 +#: scheduler/ipp.c:2476 scheduler/ipp.c:2527 #, c-format msgid "Job #%d is already %s - can't cancel." msgstr "Le travail # %d est déjà %s - ne peut pas décommander." -#: scheduler/ipp.c:3720 +#: scheduler/ipp.c:3720 scheduler/ipp.c:3914 msgid "The printer or class is not shared!" msgstr "L'imprimeur ou la classe n'est pas partagé!" -#: scheduler/ipp.c:3746 scheduler/ipp.c:6647 +#: scheduler/ipp.c:3746 scheduler/ipp.c:6647 scheduler/ipp.c:3940 +#: scheduler/ipp.c:6695 #, c-format msgid "Destination \"%s\" is not accepting jobs." msgstr "La destination \"%s\" n'accepte pas les travaux." -#: scheduler/ipp.c:3759 scheduler/ipp.c:6443 +#: scheduler/ipp.c:3759 scheduler/ipp.c:6443 scheduler/ipp.c:3954 +#: scheduler/ipp.c:6487 #, c-format msgid "Bad copies value %d." msgstr "Mauvaise valeur %d de copies." -#: scheduler/ipp.c:3775 scheduler/ipp.c:6459 +#: scheduler/ipp.c:3775 scheduler/ipp.c:6459 scheduler/ipp.c:3971 +#: scheduler/ipp.c:6504 #, c-format msgid "Bad page-ranges values %d-%d." msgstr "Mauvaises valeurs %d-%d de page-ranges." -#: scheduler/ipp.c:3795 +#: scheduler/ipp.c:3795 scheduler/ipp.c:3991 msgid "Too many active jobs." msgstr "Trop de JOBS actifs." -#: scheduler/ipp.c:3801 scheduler/ipp.c:6668 +#: scheduler/ipp.c:3801 scheduler/ipp.c:6668 scheduler/ipp.c:3997 +#: scheduler/ipp.c:6716 msgid "Quota limit reached." msgstr "La limite de quote-part a atteint." -#: scheduler/ipp.c:3824 scheduler/ipp.c:6691 +#: scheduler/ipp.c:3824 scheduler/ipp.c:6691 scheduler/ipp.c:4022 +#: scheduler/ipp.c:6741 #, c-format msgid "Unable to add job for destination \"%s\"!" msgstr "Incapable d'ajouter le travail pour la destination \"%s\"!" -#: scheduler/ipp.c:4469 +#: scheduler/ipp.c:4469 scheduler/ipp.c:4673 msgid "No subscription attributes in request!" msgstr "Aucuns attributs d'abonnement dans la demande!" -#: scheduler/ipp.c:4559 +#: scheduler/ipp.c:4559 scheduler/ipp.c:4763 msgid "notify-events not specified!" msgstr "notify-events non indiqués!" -#: scheduler/ipp.c:4577 +#: scheduler/ipp.c:4577 scheduler/ipp.c:4781 #, c-format msgid "Job %d not found!" msgstr "Le travail %d non trouvé!" -#: scheduler/ipp.c:4827 +#: scheduler/ipp.c:4827 scheduler/ipp.c:4957 msgid "No default printer" msgstr "Aucun imprimeur de défaut" -#: scheduler/ipp.c:4930 +#: scheduler/ipp.c:4930 scheduler/ipp.c:5060 msgid "cups-deviced failed to execute." msgstr "les cups-deviced ne se sont pas exécutées." -#: scheduler/ipp.c:5393 +#: scheduler/ipp.c:5393 scheduler/ipp.c:5479 msgid "cups-driverd failed to execute." msgstr "les cups-driverd ne se sont pas exécutées." -#: scheduler/ipp.c:5571 +#: scheduler/ipp.c:5571 scheduler/ipp.c:5594 msgid "No destinations added." msgstr "Aucunes destinations supplémentaires." -#: scheduler/ipp.c:5794 +#: scheduler/ipp.c:5794 scheduler/ipp.c:5736 #, c-format msgid "notify-subscription-id %d no good!" msgstr "notify-subscription-id %d aucun bon!" -#: scheduler/ipp.c:5878 +#: scheduler/ipp.c:5878 scheduler/ipp.c:5822 #, c-format msgid "Job #%s does not exist!" msgstr "Le travail # %s n'existe pas!" @@ -360,138 +382,147 @@ msgstr "Le travail # %s n'existe pas!" #: scheduler/ipp.c:5900 scheduler/ipp.c:2116 scheduler/ipp.c:2451 #: scheduler/ipp.c:5228 scheduler/ipp.c:6047 scheduler/ipp.c:6188 #: scheduler/ipp.c:7434 scheduler/ipp.c:7578 scheduler/ipp.c:7815 -#: scheduler/ipp.c:8300 +#: scheduler/ipp.c:8300 scheduler/ipp.c:2157 scheduler/ipp.c:2502 +#: scheduler/ipp.c:5143 scheduler/ipp.c:5844 scheduler/ipp.c:5996 +#: scheduler/ipp.c:6174 scheduler/ipp.c:6219 scheduler/ipp.c:7493 +#: scheduler/ipp.c:7640 scheduler/ipp.c:7880 scheduler/ipp.c:8375 #, c-format msgid "Job #%d does not exist!" msgstr "Le travail # %d n'existe pas!" -#: scheduler/ipp.c:5969 +#: scheduler/ipp.c:5969 scheduler/ipp.c:5915 msgid "No subscriptions found." msgstr "Abonnement n'a pas trouvé." -#: scheduler/ipp.c:6058 +#: scheduler/ipp.c:6058 scheduler/ipp.c:6007 #, c-format msgid "Not authorized to hold job #%d owned by \"%s\"!" msgstr "Non autorisé à juger le travail # %d possédés par \"%s\"!" -#: scheduler/ipp.c:6203 scheduler/ipp.c:8315 +#: scheduler/ipp.c:6203 scheduler/ipp.c:8315 scheduler/ipp.c:6250 +#: scheduler/ipp.c:8390 #, c-format msgid "Job #%d is finished and cannot be altered!" msgstr "Le travail # %d est fini et ne peut pas être changé!" -#: scheduler/ipp.c:6215 +#: scheduler/ipp.c:6215 scheduler/ipp.c:6262 #, c-format msgid "You are not authorized to move job #%d owned by \"%s\"!" msgstr "" "Vous n'êtes pas autorisés à déplacer le travail # %d possédés par \"%s\"!" -#: scheduler/ipp.c:6228 +#: scheduler/ipp.c:6228 scheduler/ipp.c:6098 msgid "job-printer-uri attribute missing!" msgstr "disparus d'attribut de job-printer-uri!" -#: scheduler/ipp.c:6485 scheduler/ipp.c:7847 +#: scheduler/ipp.c:6485 scheduler/ipp.c:7847 scheduler/ipp.c:6531 +#: scheduler/ipp.c:7913 #, c-format msgid "Unsupported compression \"%s\"!" msgstr "Compression non soutenue \"%s\"!" -#: scheduler/ipp.c:6504 scheduler/ipp.c:7866 +#: scheduler/ipp.c:6504 scheduler/ipp.c:7866 scheduler/ipp.c:6550 +#: scheduler/ipp.c:7932 msgid "No file!?!" msgstr "Aucun dossier!?!" -#: scheduler/ipp.c:6522 +#: scheduler/ipp.c:6522 scheduler/ipp.c:6568 #, c-format msgid "Could not scan type \"%s\"!" msgstr "N'a pas pu balayer le type \"%s\"!" -#: scheduler/ipp.c:6574 scheduler/ipp.c:7936 +#: scheduler/ipp.c:6574 scheduler/ipp.c:7936 scheduler/ipp.c:6620 +#: scheduler/ipp.c:8001 #, c-format msgid "Unsupported format '%s/%s'!" msgstr "Format non soutenu '%s/%s '!" -#: scheduler/ipp.c:6621 +#: scheduler/ipp.c:6621 scheduler/ipp.c:6669 msgid "Printer not shared!" msgstr "Imprimeur non partagé!" -#: scheduler/ipp.c:6661 +#: scheduler/ipp.c:6661 scheduler/ipp.c:6709 #, c-format msgid "Too many jobs - %d jobs, max jobs is %d." msgstr "Trop de travaux - les travaux de %d, les travaux maximum est %d." -#: scheduler/ipp.c:7448 +#: scheduler/ipp.c:7448 scheduler/ipp.c:7507 #, c-format msgid "Job #%d is not held!" msgstr "Le travail # %d n'est pas tenu!" -#: scheduler/ipp.c:7459 +#: scheduler/ipp.c:7459 scheduler/ipp.c:7518 #, c-format msgid "You are not authorized to release job id %d owned by \"%s\"!" msgstr "" "Vous n'êtes pas autorisés à libérer l'identification de travail %d possédée " "par \"%s\"!" -#: scheduler/ipp.c:7592 +#: scheduler/ipp.c:7592 scheduler/ipp.c:7654 #, c-format msgid "Job #%d is not complete!" msgstr "Le travail # %d n'est pas complet!" -#: scheduler/ipp.c:7608 +#: scheduler/ipp.c:7608 scheduler/ipp.c:7670 #, c-format msgid "Job #%d cannot be restarted - no files!" msgstr "Le travail # %d ne peuvent pas être remis en marche - aucuns dossiers!" -#: scheduler/ipp.c:7619 +#: scheduler/ipp.c:7619 scheduler/ipp.c:7681 #, c-format msgid "You are not authorized to restart job id %d owned by \"%s\"!" msgstr "" "Vous n'êtes pas autorisés à remettre en marche l'identification de travail %" "d possédée par \"%s\"!" -#: scheduler/ipp.c:7826 +#: scheduler/ipp.c:7826 scheduler/ipp.c:7891 #, c-format msgid "You are not authorized to send document for job #%d owned by \"%s\"!" msgstr "" "Vous n'êtes pas autorisés à envoyer le document pour le travail # %d " "possédés par \"%s\"!" -#: scheduler/ipp.c:7883 scheduler/ipp.c:8803 +#: scheduler/ipp.c:7883 scheduler/ipp.c:8803 scheduler/ipp.c:7949 +#: scheduler/ipp.c:8883 #, c-format msgid "Bad document-format \"%s\"!" msgstr "Mauvais document-format \"%s\"!" -#: scheduler/ipp.c:8326 +#: scheduler/ipp.c:8326 scheduler/ipp.c:8401 #, c-format msgid "You are not authorized to alter job id %d owned by \"%s\"!" msgstr "" "Vous n'êtes pas autorisés à changer l'identification de travail %d possédée " "par \"%s\"!" -#: scheduler/ipp.c:8371 +#: scheduler/ipp.c:8371 scheduler/ipp.c:8446 #, c-format msgid "%s cannot be changed." msgstr "%s ne peut pas être changé." -#: scheduler/ipp.c:8387 +#: scheduler/ipp.c:8387 scheduler/ipp.c:8462 msgid "Bad job-priority value!" msgstr "Mauvaise valeur de job-priority!" -#: scheduler/ipp.c:8395 +#: scheduler/ipp.c:8395 scheduler/ipp.c:8470 msgid "Job is completed and cannot be changed." msgstr "Le travail est accompli et ne peut pas être changé." -#: scheduler/ipp.c:8409 +#: scheduler/ipp.c:8409 scheduler/ipp.c:8484 msgid "Bad job-state value!" msgstr "Mauvaise valeur de job-state!" #: scheduler/ipp.c:8423 scheduler/ipp.c:8435 scheduler/ipp.c:8446 +#: scheduler/ipp.c:8498 scheduler/ipp.c:8510 scheduler/ipp.c:8521 msgid "Job state cannot be changed." msgstr "L'état du travail ne peut pas être changé." -#: scheduler/ipp.c:8787 +#: scheduler/ipp.c:8787 scheduler/ipp.c:8867 #, c-format msgid "Unsupported compression attribute %s!" msgstr "Attribut non soutenu %s de compression!" -#: scheduler/ipp.c:8815 +#: scheduler/ipp.c:8815 scheduler/ipp.c:8894 #, c-format msgid "Unsupported format \"%s\"!" msgstr "Format non soutenu \"%s\"!" @@ -508,49 +539,49 @@ msgid "" "exit help quit status ?\n" msgstr "" -#: berkeley/lpc.c:222 +#: berkeley/lpc.c:222 berkeley/lpc.c:221 msgid "help\t\tget help on commands\n" msgstr "" -#: berkeley/lpc.c:225 +#: berkeley/lpc.c:225 berkeley/lpc.c:223 msgid "status\t\tshow status of daemon and queue\n" msgstr "" -#: berkeley/lpc.c:228 +#: berkeley/lpc.c:228 berkeley/lpc.c:225 msgid "?Invalid help command unknown\n" msgstr "" -#: berkeley/lpc.c:478 berkeley/lpc.c:490 +#: berkeley/lpc.c:478 berkeley/lpc.c:490 berkeley/lpc.c:475 berkeley/lpc.c:487 #, c-format msgid "\tprinter is on device '%s' speed -1\n" msgstr "" -#: berkeley/lpc.c:496 +#: berkeley/lpc.c:496 berkeley/lpc.c:493 msgid "\tqueuing is enabled\n" msgstr "" -#: berkeley/lpc.c:498 +#: berkeley/lpc.c:498 berkeley/lpc.c:495 msgid "\tqueuing is disabled\n" msgstr "" -#: berkeley/lpc.c:501 +#: berkeley/lpc.c:501 berkeley/lpc.c:498 msgid "\tprinting is enabled\n" msgstr "" -#: berkeley/lpc.c:503 +#: berkeley/lpc.c:503 berkeley/lpc.c:500 msgid "\tprinting is disabled\n" msgstr "" -#: berkeley/lpc.c:506 +#: berkeley/lpc.c:506 berkeley/lpc.c:503 msgid "\tno entries\n" msgstr "" -#: berkeley/lpc.c:508 +#: berkeley/lpc.c:508 berkeley/lpc.c:505 #, c-format msgid "\t%d entries\n" msgstr "" -#: berkeley/lpc.c:510 +#: berkeley/lpc.c:510 berkeley/lpc.c:507 msgid "\tdaemon present\n" msgstr "" @@ -561,7 +592,9 @@ msgstr "" #: berkeley/lpq.c:125 berkeley/lpr.c:114 berkeley/lprm.c:107 #: systemv/accept.c:108 systemv/cancel.c:95 systemv/lpstat.c:115 #: systemv/lpadmin.c:284 systemv/lp.c:135 systemv/lpinfo.c:80 -#: systemv/lpmove.c:84 +#: systemv/lpmove.c:84 systemv/accept.c:106 systemv/cancel.c:93 +#: systemv/lpmove.c:89 berkeley/lpq.c:124 systemv/lp.c:136 +#: systemv/lpstat.c:116 #, c-format msgid "%s: Sorry, no encryption support compiled in!\n" msgstr "" @@ -591,36 +624,36 @@ msgstr "" msgid "lpq: get-jobs failed: %s\n" msgstr "" -#: berkeley/lpq.c:457 +#: berkeley/lpq.c:457 berkeley/lpq.c:444 berkeley/lpq.c:488 msgid "" "Rank Owner Pri Job Files Total Size\n" msgstr "" -#: berkeley/lpq.c:461 +#: berkeley/lpq.c:461 berkeley/lpq.c:448 berkeley/lpq.c:492 msgid "Rank Owner Job File(s) Total Size\n" msgstr "" -#: berkeley/lpq.c:498 +#: berkeley/lpq.c:498 berkeley/lpq.c:485 berkeley/lpq.c:529 #, c-format msgid "%s: %-33.33s [job %d localhost]\n" msgstr "" -#: berkeley/lpq.c:500 +#: berkeley/lpq.c:500 berkeley/lpq.c:487 berkeley/lpq.c:531 #, c-format msgid " %-39.39s %.0f bytes\n" msgstr "" -#: berkeley/lpq.c:506 +#: berkeley/lpq.c:506 berkeley/lpq.c:493 berkeley/lpq.c:537 #, c-format msgid "%-6s %-10.10s %-4d %-10d %-27.27s %.0f bytes\n" msgstr "" -#: berkeley/lpq.c:511 +#: berkeley/lpq.c:511 berkeley/lpq.c:498 berkeley/lpq.c:542 #, c-format msgid "%-7s %-7.7s %-7d %-31.31s %.0f bytes\n" msgstr "" -#: berkeley/lpq.c:529 +#: berkeley/lpq.c:529 berkeley/lpq.c:515 berkeley/lpq.c:559 msgid "no entries\n" msgstr "" @@ -629,22 +662,22 @@ msgstr "" msgid "lpq: get-printer-attributes failed: %s\n" msgstr "" -#: berkeley/lpq.c:605 +#: berkeley/lpq.c:605 berkeley/lpq.c:576 berkeley/lpq.c:621 #, c-format msgid "%s is ready\n" msgstr "" -#: berkeley/lpq.c:608 +#: berkeley/lpq.c:608 berkeley/lpq.c:579 berkeley/lpq.c:624 #, c-format msgid "%s is ready and printing\n" msgstr "" -#: berkeley/lpq.c:612 +#: berkeley/lpq.c:612 berkeley/lpq.c:583 berkeley/lpq.c:628 #, fuzzy, c-format msgid "%s is not ready\n" msgstr "Le travail # %d n'est pas tenu!" -#: berkeley/lpq.c:633 +#: berkeley/lpq.c:633 berkeley/lpq.c:601 msgid "Usage: lpq [-P dest] [-l] [+interval]\n" msgstr "" @@ -728,7 +761,7 @@ msgstr "" msgid "lpr: error - stdin is empty, so no job has been sent.\n" msgstr "" -#: berkeley/lpr.c:461 +#: berkeley/lpr.c:461 berkeley/lpr.c:460 #, c-format msgid "lpr: error - unable to print file: %s\n" msgstr "" @@ -770,85 +803,87 @@ msgstr "" msgid "lprm: Unable to cancel job(s)!\n" msgstr "" -#: systemv/accept.c:84 +#: systemv/accept.c:84 systemv/accept.c:82 #, c-format msgid "%s: Don't know what to do!\n" msgstr "" -#: systemv/accept.c:129 +#: systemv/accept.c:129 systemv/accept.c:127 #, c-format msgid "%s: Expected server name after -h!\n" msgstr "" -#: systemv/accept.c:147 +#: systemv/accept.c:147 systemv/accept.c:145 #, c-format msgid "%s: Expected reason text after -r!\n" msgstr "" -#: systemv/accept.c:157 +#: systemv/accept.c:157 systemv/accept.c:155 #, c-format msgid "%s: Unknown option '%c'!\n" msgstr "" -#: systemv/accept.c:173 +#: systemv/accept.c:173 systemv/accept.c:171 systemv/accept.c:192 #, c-format msgid "%s: Unable to connect to server: %s\n" msgstr "" #: systemv/accept.c:217 systemv/accept.c:227 systemv/accept.c:268 -#: systemv/accept.c:278 +#: systemv/accept.c:278 systemv/accept.c:206 #, c-format msgid "%s: Operation failed: %s\n" msgstr "" -#: systemv/cancel.c:118 +#: systemv/cancel.c:118 systemv/cancel.c:116 msgid "cancel: Error - expected hostname after '-h' option!\n" msgstr "" -#: systemv/cancel.c:139 +#: systemv/cancel.c:139 systemv/cancel.c:137 msgid "cancel: Error - expected username after '-u' option!\n" msgstr "" -#: systemv/cancel.c:150 +#: systemv/cancel.c:150 systemv/cancel.c:148 #, c-format msgid "cancel: Unknown option '%c'!\n" msgstr "" -#: systemv/cancel.c:207 +#: systemv/cancel.c:207 systemv/cancel.c:205 #, fuzzy, c-format msgid "cancel: Unknown destination \"%s\"!\n" msgstr "Incapable d'ajouter le travail pour la destination \"%s\"!" -#: systemv/cancel.c:229 systemv/cancel.c:319 +#: systemv/cancel.c:229 systemv/cancel.c:319 systemv/cancel.c:227 +#: systemv/cancel.c:308 msgid "cancel: Unable to contact server!\n" msgstr "" -#: systemv/cancel.c:295 systemv/cancel.c:370 +#: systemv/cancel.c:295 systemv/cancel.c:370 systemv/cancel.c:284 +#: systemv/cancel.c:348 #, c-format msgid "cancel: %s failed: %s\n" msgstr "" -#: systemv/cupsaddsmb.c:290 +#: systemv/cupsaddsmb.c:290 systemv/cupsaddsmb.c:311 #, c-format msgid "cupsaddsmb: Missing value on line %d!\n" msgstr "" -#: systemv/cupsaddsmb.c:301 +#: systemv/cupsaddsmb.c:301 systemv/cupsaddsmb.c:322 #, c-format msgid "cupsaddsmb: Missing double quote on line %d!\n" msgstr "" -#: systemv/cupsaddsmb.c:313 +#: systemv/cupsaddsmb.c:313 systemv/cupsaddsmb.c:334 #, c-format msgid "cupsaddsmb: Bad option + choice on line %d!\n" msgstr "" -#: systemv/cupsaddsmb.c:496 +#: systemv/cupsaddsmb.c:496 systemv/cupsaddsmb.c:553 #, c-format msgid "cupsaddsmb: Unable to connect to server \"%s\" for %s - %s\n" msgstr "" -#: systemv/cupsaddsmb.c:509 +#: systemv/cupsaddsmb.c:509 systemv/cupsaddsmb.c:566 #, c-format msgid "cupsaddsmb: No PPD file for printer \"%s\" - skipping!\n" msgstr "" @@ -858,42 +893,42 @@ msgstr "" msgid "cupsaddsmb: get-printer-attributes failed for \"%s\": %s\n" msgstr "" -#: systemv/cupsaddsmb.c:578 +#: systemv/cupsaddsmb.c:578 systemv/cupsaddsmb.c:620 #, fuzzy, c-format msgid "cupsaddsmb: Unable to convert PPD file for %s - %s\n" msgstr "Incapable de copier le dossier de PPD - %s!" -#: systemv/cupsaddsmb.c:633 +#: systemv/cupsaddsmb.c:633 systemv/cupsaddsmb.c:677 #, c-format msgid "cupsaddsmb: Unable to copy Windows 2000 printer driver files (%d)!\n" msgstr "" -#: systemv/cupsaddsmb.c:660 +#: systemv/cupsaddsmb.c:660 systemv/cupsaddsmb.c:704 #, c-format msgid "cupsaddsmb: Unable to copy CUPS printer driver files (%d)!\n" msgstr "" -#: systemv/cupsaddsmb.c:697 +#: systemv/cupsaddsmb.c:697 systemv/cupsaddsmb.c:739 #, c-format msgid "cupsaddsmb: Unable to install Windows 2000 printer driver files (%d)!\n" msgstr "" -#: systemv/cupsaddsmb.c:727 +#: systemv/cupsaddsmb.c:727 systemv/cupsaddsmb.c:771 #, c-format msgid "cupsaddsmb: Unable to copy Windows 9x printer driver files (%d)!\n" msgstr "" -#: systemv/cupsaddsmb.c:750 +#: systemv/cupsaddsmb.c:750 systemv/cupsaddsmb.c:792 #, c-format msgid "cupsaddsmb: Unable to install Windows 9x printer driver files (%d)!\n" msgstr "" -#: systemv/cupsaddsmb.c:771 +#: systemv/cupsaddsmb.c:771 systemv/cupsaddsmb.c:822 #, c-format msgid "cupsaddsmb: Unable to set Windows printer driver (%d)!\n" msgstr "" -#: systemv/cupsaddsmb.c:854 +#: systemv/cupsaddsmb.c:854 systemv/cupsaddsmb.c:905 msgid "" "Usage: cupsaddsmb [options] printer1 ... printerN\n" " cupsaddsmb [options] -a\n" @@ -1359,30 +1394,31 @@ msgstr "" msgid "lpstat: Need \"completed\" or \"not-completed\" after -W!\n" msgstr "" -#: systemv/lpstat.c:212 +#: systemv/lpstat.c:212 systemv/lpstat.c:213 msgid "lpstat: The -b option requires a destination argument.\n" msgstr "" #: systemv/lpstat.c:274 systemv/lpinfo.c:143 systemv/lpmove.c:105 +#: systemv/lpmove.c:110 systemv/lpstat.c:275 msgid "Error: need hostname after '-h' option!\n" msgstr "" -#: systemv/lpstat.c:433 +#: systemv/lpstat.c:433 systemv/lpstat.c:434 #, c-format msgid "lpstat: Unknown option '%c'!\n" msgstr "" -#: systemv/lpstat.c:504 +#: systemv/lpstat.c:504 systemv/lpstat.c:505 #, c-format msgid "lpstat: Invalid destination name in list \"%s\"!\n" msgstr "" -#: systemv/lpstat.c:519 +#: systemv/lpstat.c:519 systemv/lpstat.c:520 #, fuzzy, c-format msgid "lpstat: Unknown destination \"%s\"!\n" msgstr "Incapable d'ajouter le travail pour la destination \"%s\"!" -#: systemv/lpstat.c:541 +#: systemv/lpstat.c:541 systemv/lpstat.c:542 #, c-format msgid "lpstat: Unable to connect to server %s on port %d: %s\n" msgstr "" @@ -1422,58 +1458,64 @@ msgstr "" msgid "lpstat: get-classes failed: %s\n" msgstr "" -#: systemv/lpstat.c:1033 +#: systemv/lpstat.c:1033 systemv/lpstat.c:1011 systemv/lpstat.c:1039 #, c-format msgid "members of class %s:\n" msgstr "" -#: systemv/lpstat.c:1080 +#: systemv/lpstat.c:1080 systemv/lpstat.c:1057 systemv/lpstat.c:1085 #, c-format msgid "system default destination: %s/%s\n" msgstr "" -#: systemv/lpstat.c:1083 +#: systemv/lpstat.c:1083 systemv/lpstat.c:1060 systemv/lpstat.c:1088 #, c-format msgid "system default destination: %s\n" msgstr "" -#: systemv/lpstat.c:1105 +#: systemv/lpstat.c:1105 systemv/lpstat.c:1082 systemv/lpstat.c:1110 #, c-format msgid "" "lpstat: error - %s environment variable names non-existent destination \"%s" "\"!\n" msgstr "" -#: systemv/lpstat.c:1109 +#: systemv/lpstat.c:1109 systemv/lpstat.c:1086 systemv/lpstat.c:1114 msgid "no system default destination\n" msgstr "" -#: systemv/lpstat.c:1313 +#: systemv/lpstat.c:1313 systemv/lpstat.c:1281 systemv/lpstat.c:1309 #, c-format msgid "Output for printer %s is sent to remote printer %s on %s\n" msgstr "" -#: systemv/lpstat.c:1319 systemv/lpstat.c:1323 +#: systemv/lpstat.c:1319 systemv/lpstat.c:1323 systemv/lpstat.c:1287 +#: systemv/lpstat.c:1291 systemv/lpstat.c:1315 #, c-format msgid "Output for printer %s is sent to %s\n" msgstr "" -#: systemv/lpstat.c:1331 +#: systemv/lpstat.c:1331 systemv/lpstat.c:1299 systemv/lpstat.c:1327 #, c-format msgid "Output for printer %s/%s is sent to remote printer %s on %s\n" msgstr "" -#: systemv/lpstat.c:1337 systemv/lpstat.c:1341 +#: systemv/lpstat.c:1337 systemv/lpstat.c:1341 systemv/lpstat.c:1305 +#: systemv/lpstat.c:1309 systemv/lpstat.c:1333 #, c-format msgid "Output for printer %s/%s is sent to %s\n" msgstr "" #: systemv/lpstat.c:1346 systemv/lpstat.c:1349 systemv/lpstat.c:1352 +#: systemv/lpstat.c:1314 systemv/lpstat.c:1317 systemv/lpstat.c:1320 +#: systemv/lpstat.c:1342 systemv/lpstat.c:1345 systemv/lpstat.c:1348 #, c-format msgid "device for %s: %s\n" msgstr "" #: systemv/lpstat.c:1359 systemv/lpstat.c:1362 systemv/lpstat.c:1365 +#: systemv/lpstat.c:1327 systemv/lpstat.c:1330 systemv/lpstat.c:1333 +#: systemv/lpstat.c:1355 systemv/lpstat.c:1358 systemv/lpstat.c:1361 #, c-format msgid "device for %s/%s: %s\n" msgstr "" @@ -1483,144 +1525,168 @@ msgstr "" msgid "lpstat: get-jobs failed: %s\n" msgstr "" -#: systemv/lpstat.c:1681 +#: systemv/lpstat.c:1681 systemv/lpstat.c:1635 systemv/lpstat.c:1663 #, c-format msgid "\tqueued for %s\n" msgstr "" -#: systemv/lpstat.c:2037 +#: systemv/lpstat.c:2037 systemv/lpstat.c:1971 systemv/lpstat.c:1999 #, c-format msgid "printer %s is idle. enabled since %s\n" msgstr "" -#: systemv/lpstat.c:2042 +#: systemv/lpstat.c:2042 systemv/lpstat.c:1976 systemv/lpstat.c:2004 #, c-format msgid "printer %s now printing %s-%d. enabled since %s\n" msgstr "" -#: systemv/lpstat.c:2048 +#: systemv/lpstat.c:2048 systemv/lpstat.c:1982 systemv/lpstat.c:2010 #, c-format msgid "printer %s disabled since %s -\n" msgstr "" -#: systemv/lpstat.c:2056 systemv/lpstat.c:2169 +#: systemv/lpstat.c:2056 systemv/lpstat.c:2169 systemv/lpstat.c:1990 +#: systemv/lpstat.c:2103 systemv/lpstat.c:2018 systemv/lpstat.c:2131 msgid "\treason unknown\n" msgstr "" -#: systemv/lpstat.c:2063 systemv/lpstat.c:2176 +#: systemv/lpstat.c:2063 systemv/lpstat.c:2176 systemv/lpstat.c:1997 +#: systemv/lpstat.c:2110 systemv/lpstat.c:2025 systemv/lpstat.c:2138 msgid "" "\tForm mounted:\n" "\tContent types: any\n" "\tPrinter types: unknown\n" msgstr "" -#: systemv/lpstat.c:2069 systemv/lpstat.c:2182 +#: systemv/lpstat.c:2069 systemv/lpstat.c:2182 systemv/lpstat.c:2003 +#: systemv/lpstat.c:2116 systemv/lpstat.c:2031 systemv/lpstat.c:2144 #, c-format msgid "\tDescription: %s\n" msgstr "" -#: systemv/lpstat.c:2074 systemv/lpstat.c:2187 +#: systemv/lpstat.c:2074 systemv/lpstat.c:2187 systemv/lpstat.c:2008 +#: systemv/lpstat.c:2121 systemv/lpstat.c:2036 systemv/lpstat.c:2149 msgid "\tAlerts:" msgstr "" -#: systemv/lpstat.c:2083 systemv/lpstat.c:2196 +#: systemv/lpstat.c:2083 systemv/lpstat.c:2196 systemv/lpstat.c:2017 +#: systemv/lpstat.c:2130 systemv/lpstat.c:2045 systemv/lpstat.c:2158 #, c-format msgid "\tLocation: %s\n" msgstr "" -#: systemv/lpstat.c:2088 systemv/lpstat.c:2201 +#: systemv/lpstat.c:2088 systemv/lpstat.c:2201 systemv/lpstat.c:2022 +#: systemv/lpstat.c:2135 systemv/lpstat.c:2050 systemv/lpstat.c:2163 msgid "\tConnection: remote\n" msgstr "" -#: systemv/lpstat.c:2092 systemv/lpstat.c:2205 +#: systemv/lpstat.c:2092 systemv/lpstat.c:2205 systemv/lpstat.c:2026 +#: systemv/lpstat.c:2139 systemv/lpstat.c:2054 systemv/lpstat.c:2167 #, c-format msgid "\tInterface: %s.ppd\n" msgstr "" -#: systemv/lpstat.c:2097 systemv/lpstat.c:2210 +#: systemv/lpstat.c:2097 systemv/lpstat.c:2210 systemv/lpstat.c:2031 +#: systemv/lpstat.c:2144 systemv/lpstat.c:2059 systemv/lpstat.c:2172 msgid "\tConnection: direct\n" msgstr "" -#: systemv/lpstat.c:2101 systemv/lpstat.c:2214 +#: systemv/lpstat.c:2101 systemv/lpstat.c:2214 systemv/lpstat.c:2035 +#: systemv/lpstat.c:2148 systemv/lpstat.c:2063 systemv/lpstat.c:2176 #, c-format msgid "\tInterface: %s/interfaces/%s\n" msgstr "" -#: systemv/lpstat.c:2105 systemv/lpstat.c:2218 +#: systemv/lpstat.c:2105 systemv/lpstat.c:2218 systemv/lpstat.c:2039 +#: systemv/lpstat.c:2152 systemv/lpstat.c:2067 systemv/lpstat.c:2180 #, c-format msgid "\tInterface: %s/ppd/%s.ppd\n" msgstr "" -#: systemv/lpstat.c:2107 systemv/lpstat.c:2220 +#: systemv/lpstat.c:2107 systemv/lpstat.c:2220 systemv/lpstat.c:2041 +#: systemv/lpstat.c:2154 systemv/lpstat.c:2069 systemv/lpstat.c:2182 msgid "\tOn fault: no alert\n" msgstr "" -#: systemv/lpstat.c:2108 systemv/lpstat.c:2221 +#: systemv/lpstat.c:2108 systemv/lpstat.c:2221 systemv/lpstat.c:2042 +#: systemv/lpstat.c:2155 systemv/lpstat.c:2070 systemv/lpstat.c:2183 msgid "\tAfter fault: continue\n" msgstr "" #: systemv/lpstat.c:2112 systemv/lpstat.c:2126 systemv/lpstat.c:2225 -#: systemv/lpstat.c:2239 +#: systemv/lpstat.c:2239 systemv/lpstat.c:2046 systemv/lpstat.c:2060 +#: systemv/lpstat.c:2159 systemv/lpstat.c:2173 systemv/lpstat.c:2074 +#: systemv/lpstat.c:2088 systemv/lpstat.c:2187 systemv/lpstat.c:2201 msgid "\tUsers allowed:\n" msgstr "" -#: systemv/lpstat.c:2119 systemv/lpstat.c:2232 +#: systemv/lpstat.c:2119 systemv/lpstat.c:2232 systemv/lpstat.c:2053 +#: systemv/lpstat.c:2166 systemv/lpstat.c:2081 systemv/lpstat.c:2194 msgid "\tUsers denied:\n" msgstr "" -#: systemv/lpstat.c:2127 systemv/lpstat.c:2240 +#: systemv/lpstat.c:2127 systemv/lpstat.c:2240 systemv/lpstat.c:2061 +#: systemv/lpstat.c:2174 systemv/lpstat.c:2089 systemv/lpstat.c:2202 msgid "\t\t(all)\n" msgstr "" -#: systemv/lpstat.c:2129 systemv/lpstat.c:2242 +#: systemv/lpstat.c:2129 systemv/lpstat.c:2242 systemv/lpstat.c:2063 +#: systemv/lpstat.c:2176 systemv/lpstat.c:2091 systemv/lpstat.c:2204 msgid "\tForms allowed:\n" msgstr "" #: systemv/lpstat.c:2130 systemv/lpstat.c:2133 systemv/lpstat.c:2243 -#: systemv/lpstat.c:2246 +#: systemv/lpstat.c:2246 systemv/lpstat.c:2064 systemv/lpstat.c:2067 +#: systemv/lpstat.c:2177 systemv/lpstat.c:2180 systemv/lpstat.c:2092 +#: systemv/lpstat.c:2095 systemv/lpstat.c:2205 systemv/lpstat.c:2208 msgid "\t\t(none)\n" msgstr "" -#: systemv/lpstat.c:2131 systemv/lpstat.c:2244 +#: systemv/lpstat.c:2131 systemv/lpstat.c:2244 systemv/lpstat.c:2065 +#: systemv/lpstat.c:2178 systemv/lpstat.c:2093 systemv/lpstat.c:2206 msgid "\tBanner required\n" msgstr "" -#: systemv/lpstat.c:2132 systemv/lpstat.c:2245 +#: systemv/lpstat.c:2132 systemv/lpstat.c:2245 systemv/lpstat.c:2066 +#: systemv/lpstat.c:2179 systemv/lpstat.c:2094 systemv/lpstat.c:2207 msgid "\tCharset sets:\n" msgstr "" -#: systemv/lpstat.c:2134 systemv/lpstat.c:2247 +#: systemv/lpstat.c:2134 systemv/lpstat.c:2247 systemv/lpstat.c:2068 +#: systemv/lpstat.c:2181 systemv/lpstat.c:2096 systemv/lpstat.c:2209 msgid "\tDefault pitch:\n" msgstr "" -#: systemv/lpstat.c:2135 systemv/lpstat.c:2248 +#: systemv/lpstat.c:2135 systemv/lpstat.c:2248 systemv/lpstat.c:2069 +#: systemv/lpstat.c:2182 systemv/lpstat.c:2097 systemv/lpstat.c:2210 msgid "\tDefault page size:\n" msgstr "" -#: systemv/lpstat.c:2136 systemv/lpstat.c:2249 +#: systemv/lpstat.c:2136 systemv/lpstat.c:2249 systemv/lpstat.c:2070 +#: systemv/lpstat.c:2183 systemv/lpstat.c:2098 systemv/lpstat.c:2211 msgid "\tDefault port settings:\n" msgstr "" -#: systemv/lpstat.c:2146 +#: systemv/lpstat.c:2146 systemv/lpstat.c:2080 systemv/lpstat.c:2108 #, c-format msgid "printer %s/%s is idle. enabled since %s\n" msgstr "" -#: systemv/lpstat.c:2153 +#: systemv/lpstat.c:2153 systemv/lpstat.c:2087 systemv/lpstat.c:2115 #, c-format msgid "printer %s/%s now printing %s-%d. enabled since %s\n" msgstr "" -#: systemv/lpstat.c:2160 +#: systemv/lpstat.c:2160 systemv/lpstat.c:2094 systemv/lpstat.c:2122 #, c-format msgid "printer %s/%s disabled since %s -\n" msgstr "" -#: systemv/lpstat.c:2279 +#: systemv/lpstat.c:2279 systemv/lpstat.c:2212 systemv/lpstat.c:2240 msgid "scheduler is running\n" msgstr "" -#: systemv/lpstat.c:2281 +#: systemv/lpstat.c:2281 systemv/lpstat.c:2214 systemv/lpstat.c:2242 msgid "scheduler is not running\n" msgstr "" @@ -1787,12 +1853,12 @@ msgid "" "\n" msgstr "" -#: systemv/lpadmin.c:1554 +#: systemv/lpadmin.c:1554 systemv/lpadmin.c:1440 #, fuzzy, c-format msgid "lpadmin: Unable to create temporary file: %s\n" msgstr "Incapable d'assigner la mémoire pour des types de dossier!" -#: systemv/lpadmin.c:1562 +#: systemv/lpadmin.c:1562 systemv/lpadmin.c:1448 #, fuzzy, c-format msgid "lpadmin: Unable to open file \"%s\": %s\n" msgstr "Incapable de copier le dossier de PPD - %s!" @@ -1812,12 +1878,12 @@ msgstr "" msgid "lpadmin: add-printer (set location) failed: %s\n" msgstr "" -#: systemv/lpadmin.c:2021 +#: systemv/lpadmin.c:2021 systemv/lpadmin.c:1814 #, fuzzy, c-format msgid "lpadmin: Unable to create temporary file - %s\n" msgstr "Incapable de copier le dossier de PPD - %s!" -#: systemv/lpadmin.c:2031 +#: systemv/lpadmin.c:2031 systemv/lpadmin.c:1824 #, fuzzy, c-format msgid "lpadmin: Unable to open PPD file \"%s\" - %s\n" msgstr "Incapable de copier le dossier de PPD - %s!" @@ -1955,7 +2021,7 @@ msgstr "" msgid "lp: unable to print file: %s\n" msgstr "Incapable de copier le dossier de PPD - %s!" -#: systemv/lp.c:656 +#: systemv/lp.c:656 systemv/lp.c:653 systemv/lp.c:713 #, c-format msgid "request id is %s-%d (%d file(s))\n" msgstr "" @@ -2012,12 +2078,12 @@ msgid "" " make-and-model = %s\n" msgstr "" -#: systemv/lpmove.c:114 +#: systemv/lpmove.c:114 systemv/lpmove.c:119 #, fuzzy, c-format msgid "lpmove: Unknown option '%c'!\n" msgstr "Incapable d'ajouter le travail pour la destination \"%s\"!" -#: systemv/lpmove.c:133 +#: systemv/lpmove.c:133 systemv/lpmove.c:138 #, fuzzy, c-format msgid "lpmove: Unknown argument '%s'!\n" msgstr "Incapable d'ajouter le travail pour la destination \"%s\"!" @@ -2026,7 +2092,7 @@ msgstr "Incapable d'ajouter le travail pour la destination \"%s\"!" msgid "Usage: lpmove job dest\n" msgstr "" -#: systemv/lpmove.c:151 +#: systemv/lpmove.c:151 systemv/lpmove.c:156 #, c-format msgid "lpmove: Unable to connect to server: %s\n" msgstr "" @@ -2136,13 +2202,848 @@ msgstr "" msgid "lppasswd: failed to rename password file: %s\n" msgstr "" -#: systemv/lppasswd.c:501 +#: systemv/lppasswd.c:501 systemv/lppasswd.c:500 msgid "Usage: lppasswd [-g groupname]\n" msgstr "" -#: systemv/lppasswd.c:506 +#: systemv/lppasswd.c:506 systemv/lppasswd.c:503 msgid "" "Usage: lppasswd [-g groupname] [username]\n" " lppasswd [-g groupname] -a [username]\n" " lppasswd [-g groupname] -x [username]\n" msgstr "" + +#: cgi-bin/admin.c:125 +#, fuzzy +msgid "Start Printer" +msgstr "Imprimeur" + +#: cgi-bin/admin.c:127 +#, fuzzy +msgid "Stop Printer" +msgstr "Imprimeur" + +#: cgi-bin/admin.c:129 +#, fuzzy +msgid "Start Class" +msgstr "Classe" + +#: cgi-bin/admin.c:131 +#, fuzzy +msgid "Stop Class" +msgstr "Classe" + +#: cgi-bin/admin.c:133 +msgid "Accept Jobs" +msgstr "" + +#: cgi-bin/admin.c:135 +msgid "Reject Jobs" +msgstr "" + +#: cgi-bin/admin.c:137 +msgid "Purge Jobs" +msgstr "" + +#: cgi-bin/admin.c:141 +msgid "Set As Default" +msgstr "" + +#: cgi-bin/admin.c:168 cgi-bin/admin.c:179 cgi-bin/admin.c:2690 +msgid "Administration" +msgstr "" + +#: cgi-bin/admin.c:224 +msgid "Modify Class" +msgstr "" + +#: cgi-bin/admin.c:224 +#, fuzzy +msgid "Add Class" +msgstr "Classe" + +#: cgi-bin/admin.c:385 +msgid "" +"The class name may only contain up to 127 printable characters and may not " +"contain spaces, slashes (/), or the pound sign (#)." +msgstr "" + +#: cgi-bin/admin.c:444 +msgid "Unable to modify class:" +msgstr "" + +#: cgi-bin/admin.c:445 +msgid "Unable to add class:" +msgstr "" + +#: cgi-bin/admin.c:514 +#, fuzzy +msgid "Modify Printer" +msgstr "Imprimeur" + +#: cgi-bin/admin.c:514 +#, fuzzy +msgid "Add Printer" +msgstr "Imprimeur" + +#: cgi-bin/admin.c:583 +msgid "" +"The printer name may only contain up to 127 printable characters and may not " +"contain spaces, slashes (/), or the pound sign (#)." +msgstr "" + +#: cgi-bin/admin.c:900 +msgid "Unable to get list of printer drivers:" +msgstr "" + +#: cgi-bin/admin.c:983 +#, fuzzy +msgid "Unable to modify printer:" +msgstr "Incapable de copier le dossier de PPD!" + +#: cgi-bin/admin.c:984 +#, fuzzy +msgid "Unable to add printer:" +msgstr "Incapable de copier le dossier de PPD - %s!" + +#: cgi-bin/admin.c:1051 +msgid "Set Printer Options" +msgstr "" + +#: cgi-bin/admin.c:1062 cgi-bin/admin.c:2330 cgi-bin/admin.c:2391 +#: cgi-bin/admin.c:3112 cgi-bin/admin.c:3213 cgi-bin/admin.c:3449 +#, fuzzy +msgid "Missing form variable!" +msgstr "Attributs requis manquants!" + +#: cgi-bin/admin.c:1076 +#, fuzzy +msgid "Unable to get PPD file!" +msgstr "Incapable de copier le dossier de PPD!" + +#: cgi-bin/admin.c:1084 +#, fuzzy +msgid "Unable to open PPD file:" +msgstr "Incapable de copier le dossier de PPD!" + +#: cgi-bin/admin.c:1241 +msgid "Banners" +msgstr "" + +#: cgi-bin/admin.c:1255 +msgid "Starting Banner" +msgstr "" + +#: cgi-bin/admin.c:1262 +msgid "Ending Banner" +msgstr "" + +#: cgi-bin/admin.c:1280 +msgid "Policies" +msgstr "" + +#: cgi-bin/admin.c:1304 +msgid "Error Policy" +msgstr "" + +#: cgi-bin/admin.c:1331 +msgid "Operation Policy" +msgstr "" + +#: cgi-bin/admin.c:1352 cgi-bin/admin.c:1372 +msgid "PS Binary Protocol" +msgstr "" + +#: cgi-bin/admin.c:1358 +#, fuzzy +msgid "None" +msgstr "Non" + +#: cgi-bin/admin.c:1490 +msgid "Unable to set options:" +msgstr "" + +#: cgi-bin/admin.c:1591 cgi-bin/admin.c:1607 cgi-bin/admin.c:1620 +#: cgi-bin/admin.c:2099 cgi-bin/admin.c:2106 +msgid "Change Settings" +msgstr "" + +#: cgi-bin/admin.c:1592 cgi-bin/admin.c:1608 cgi-bin/admin.c:1621 +msgid "Unable to change server settings:" +msgstr "" + +#: cgi-bin/admin.c:2097 cgi-bin/admin.c:2190 +msgid "Unable to upload cupsd.conf file:" +msgstr "" + +#: cgi-bin/admin.c:2134 cgi-bin/admin.c:2146 cgi-bin/admin.c:2193 +#: cgi-bin/admin.c:2200 cgi-bin/admin.c:2232 cgi-bin/admin.c:2244 +#: cgi-bin/admin.c:2267 +msgid "Edit Configuration File" +msgstr "" + +#: cgi-bin/admin.c:2135 cgi-bin/admin.c:2147 +#, fuzzy +msgid "Unable to create temporary file:" +msgstr "Incapable d'assigner la mémoire pour des types de dossier!" + +#: cgi-bin/admin.c:2233 cgi-bin/admin.c:2245 cgi-bin/admin.c:2268 +msgid "Unable to access cupsd.conf file:" +msgstr "" + +#: cgi-bin/admin.c:2247 +msgid "Unable to edit cupsd.conf files larger than 1MB!" +msgstr "" + +#: cgi-bin/admin.c:2316 +msgid "Delete Class" +msgstr "" + +#: cgi-bin/admin.c:2357 +msgid "Unable to delete class:" +msgstr "" + +#: cgi-bin/admin.c:2377 +#, fuzzy +msgid "Delete Printer" +msgstr "Imprimeur" + +#: cgi-bin/admin.c:2418 +#, fuzzy +msgid "Unable to delete printer:" +msgstr "Aucun imprimeur de défaut" + +#: cgi-bin/admin.c:2447 +msgid "Export Printers to Samba" +msgstr "" + +#: cgi-bin/admin.c:2515 +#, fuzzy +msgid "Unable to fork process!" +msgstr "Incapable de copier le manuscrit d'interface - %s!" + +#: cgi-bin/admin.c:2534 +#, fuzzy +msgid "Unable to connect to server!" +msgstr "Incapable de copier le dossier de PPD - %s!" + +#: cgi-bin/admin.c:2538 +#, fuzzy +msgid "Unable to get printer attributes!" +msgstr "Incapable de copier le manuscrit d'interface - %s!" + +#: cgi-bin/admin.c:2543 +#, fuzzy +msgid "Unable to convert PPD file!" +msgstr "Incapable de copier le dossier de PPD!" + +#: cgi-bin/admin.c:2547 +#, fuzzy +msgid "Unable to copy Windows 2000 printer driver files!" +msgstr "Incapable de copier le manuscrit d'interface - %s!" + +#: cgi-bin/admin.c:2552 +msgid "Unable to install Windows 2000 printer driver files!" +msgstr "" + +#: cgi-bin/admin.c:2557 +#, fuzzy +msgid "Unable to copy Windows 9x printer driver files!" +msgstr "Incapable de copier le manuscrit d'interface - %s!" + +#: cgi-bin/admin.c:2562 +msgid "Unable to install Windows 9x printer driver files!" +msgstr "" + +#: cgi-bin/admin.c:2567 +msgid "Unable to set Windows printer driver!" +msgstr "" + +#: cgi-bin/admin.c:2572 +msgid "No printer drivers found!" +msgstr "" + +#: cgi-bin/admin.c:2576 +msgid "Unable to execute cupsaddsmb command!" +msgstr "" + +#: cgi-bin/admin.c:2582 +#, c-format +msgid "cupsaddsmb failed with status %d" +msgstr "" + +#: cgi-bin/admin.c:2592 +#, c-format +msgid "cupsaddsmb crashed on signal %d" +msgstr "" + +#: cgi-bin/admin.c:2608 +msgid "A Samba username is required to export printer drivers!" +msgstr "" + +#: cgi-bin/admin.c:2612 +msgid "A Samba password is required to export printer drivers!" +msgstr "" + +#: cgi-bin/admin.c:2704 +#, fuzzy +msgid "Unable to open cupsd.conf file:" +msgstr "Incapable de copier le dossier de PPD!" + +#: cgi-bin/admin.c:3144 cgi-bin/admin.c:3400 +msgid "Unable to change printer:" +msgstr "" + +#: cgi-bin/admin.c:3214 cgi-bin/admin.c:3259 cgi-bin/admin.c:3399 +#: cgi-bin/admin.c:3417 +msgid "Set Allowed Users" +msgstr "" + +#: cgi-bin/admin.c:3262 +#, fuzzy +msgid "Unable to get printer attributes:" +msgstr "Incapable de copier le manuscrit d'interface - %s!" + +#: cgi-bin/admin.c:3450 cgi-bin/admin.c:3488 cgi-bin/admin.c:3506 +msgid "Set Publishing" +msgstr "" + +#: cgi-bin/admin.c:3489 +msgid "Unable to change printer-is-shared attribute:" +msgstr "" + +#: cgi-bin/classes.c:161 cgi-bin/classes.c:208 +#, fuzzy +msgid "Classes" +msgstr "Classe" + +#: cgi-bin/classes.c:355 +msgid "Unable to get class list:" +msgstr "" + +#: cgi-bin/classes.c:454 +msgid "Unable to get class status:" +msgstr "" + +#: cgi-bin/ipp-var.c:366 cgi-bin/ipp-var.c:419 cgi-bin/ipp-var.c:489 +msgid "Move Job" +msgstr "" + +#: cgi-bin/ipp-var.c:367 +#, fuzzy +msgid "Unable to find destination for job!" +msgstr "Incapable d'ajouter le travail pour la destination \"%s\"!" + +#: cgi-bin/ipp-var.c:421 cgi-bin/ipp-var.c:491 +msgid "Move All Jobs" +msgstr "" + +#: cgi-bin/ipp-var.c:496 +msgid "Unable to move job" +msgstr "" + +#: cgi-bin/ipp-var.c:498 +msgid "Unable to move jobs" +msgstr "" + +#: cgi-bin/ipp-var.c:603 +msgid "Print Test Page" +msgstr "" + +#: cgi-bin/ipp-var.c:606 +#, fuzzy +msgid "Unable to print test page:" +msgstr "Incapable de copier le dossier de PPD - %s!" + +#: cgi-bin/jobs.c:111 cgi-bin/jobs.c:122 cgi-bin/jobs.c:184 +msgid "Jobs" +msgstr "" + +#: cgi-bin/jobs.c:187 +msgid "Job operation failed:" +msgstr "" + +#: cgi-bin/printers.c:161 cgi-bin/printers.c:208 +#, fuzzy +msgid "Printers" +msgstr "Imprimeur" + +#: cgi-bin/printers.c:362 +#, fuzzy +msgid "Unable to get printer list:" +msgstr "Incapable de copier le dossier de PPD - %s!" + +#: cgi-bin/printers.c:461 +#, fuzzy +msgid "Unable to get printer status:" +msgstr "Incapable de copier le manuscrit d'interface - %s!" + +#: cups/ppd.c:319 +msgid "OK" +msgstr "" + +#: cups/ppd.c:320 +#, fuzzy +msgid "Unable to open PPD file" +msgstr "Incapable de copier le dossier de PPD!" + +#: cups/ppd.c:321 +msgid "NULL PPD file pointer" +msgstr "" + +#: cups/ppd.c:322 +msgid "Memory allocation error" +msgstr "" + +#: cups/ppd.c:323 +msgid "Missing PPD-Adobe-4.x header" +msgstr "" + +#: cups/ppd.c:324 +msgid "Missing value string" +msgstr "" + +#: cups/ppd.c:325 +msgid "Internal error" +msgstr "" + +#: cups/ppd.c:326 +msgid "Bad OpenGroup" +msgstr "" + +#: cups/ppd.c:327 +msgid "OpenGroup without a CloseGroup first" +msgstr "" + +#: cups/ppd.c:328 +msgid "Bad OpenUI/JCLOpenUI" +msgstr "" + +#: cups/ppd.c:329 +msgid "OpenUI/JCLOpenUI without a CloseUI/JCLCloseUI first" +msgstr "" + +#: cups/ppd.c:330 +msgid "Bad OrderDependency" +msgstr "" + +#: cups/ppd.c:331 +msgid "Bad UIConstraints" +msgstr "" + +#: cups/ppd.c:332 +msgid "Missing asterisk in column 1" +msgstr "" + +#: cups/ppd.c:333 +msgid "Line longer than the maximum allowed (255 characters)" +msgstr "" + +#: cups/ppd.c:334 +msgid "Illegal control character" +msgstr "" + +#: cups/ppd.c:335 +msgid "Illegal main keyword string" +msgstr "" + +#: cups/ppd.c:336 +msgid "Illegal option keyword string" +msgstr "" + +#: cups/ppd.c:337 +msgid "Illegal translation string" +msgstr "" + +#: cups/ppd.c:338 +msgid "Illegal whitespace character" +msgstr "" + +#: cups/ppd.c:339 +msgid "Bad custom parameter" +msgstr "" + +#: cups/ppd.c:344 +msgid "Unknown" +msgstr "" + +#: cups/ppd.c:1033 +#, fuzzy +msgid "Custom" +msgstr "Automobile" + +#: cups/ppd.c:1259 +msgid "JCL" +msgstr "" + +#: scheduler/ipp.c:2184 +msgid "No authentication information provided!" +msgstr "" + +#: systemv/cupsaddsmb.c:440 +#, c-format +msgid "Password for %s required to access %s via SAMBA: " +msgstr "" + +#: systemv/cupsaddsmb.c:451 +#, c-format +msgid "Running command: %s %s -N -U '%s%%%s' -c '%s'\n" +msgstr "" + +#: systemv/cupsaddsmb.c:479 +#, fuzzy, c-format +msgid "cupsaddsmb: Unable to run \"%s\": %s\n" +msgstr "Incapable de copier le dossier de PPD - %s!" + +#: systemv/cupsaddsmb.c:805 +msgid "cupsaddsmb: No Windows printer drivers are installed!\n" +msgstr "" + +#: systemv/cupsaddsmb.c:810 +msgid "cupsaddsmb: Warning, no Windows 2000 printer drivers are installed!\n" +msgstr "" + +#: systemv/lpadmin.c:881 +#, c-format +msgid "lpadmin: Printer %s is already a member of class %s.\n" +msgstr "" + +#: systemv/lpadmin.c:1115 +msgid "lpadmin: No member names were seen!\n" +msgstr "" + +#: systemv/lpadmin.c:1129 +#, c-format +msgid "lpadmin: Printer %s is not a member of class %s.\n" +msgstr "" + +#: systemv/lpinfo.c:278 +#, c-format +msgid "" +"Device: uri = %s\n" +" class = %s\n" +" info = %s\n" +" make-and-model = %s\n" +" device-id = %s\n" +msgstr "" + +#: systemv/lpinfo.c:410 +#, c-format +msgid "" +"Model: name = %s\n" +" natural_language = %s\n" +" make-and-model = %s\n" +" device-id = %s\n" +msgstr "" + +#: systemv/lpmove.c:145 +msgid "Usage: lpmove job/src dest\n" +msgstr "" + +#: systemv/lpstat.c:144 systemv/lpstat.c:156 +msgid "lpstat: Need \"completed\", \"not-completed\", or \"all\" after -W!\n" +msgstr "" + +#: systemv/lpstat.c:740 systemv/lpstat.c:768 +#, c-format +msgid "%s accepting requests since %s\n" +msgstr "" + +#: systemv/lpstat.c:743 systemv/lpstat.c:771 +#, c-format +msgid "" +"%s not accepting requests since %s -\n" +"\t%s\n" +msgstr "" + +#: systemv/lpstat.c:752 systemv/lpstat.c:780 +#, c-format +msgid "%s/%s accepting requests since %s\n" +msgstr "" + +#: systemv/lpstat.c:755 systemv/lpstat.c:783 +#, c-format +msgid "" +"%s/%s not accepting requests since %s -\n" +"\t%s\n" +msgstr "" + +#: berkeley/lpc.c:88 berkeley/lpc.c:116 berkeley/lpc.c:152 +msgid "lpc> " +msgstr "" + +#: berkeley/lpq.c:93 systemv/cancel.c:250 systemv/cancel.c:332 +#, fuzzy, c-format +msgid "%s: Unable to contact server!\n" +msgstr "Incapable de copier le dossier de PPD - %s!" + +#: berkeley/lpq.c:138 berkeley/lpr.c:128 berkeley/lprm.c:144 +#: systemv/accept.c:120 systemv/cancel.c:107 systemv/lp.c:150 +#: systemv/lpstat.c:144 +#, c-format +msgid "%s: Error - expected username after '-U' option!\n" +msgstr "" + +#: berkeley/lpq.c:173 +#, fuzzy, c-format +msgid "%s: Error - unknown destination \"%s/%s\"!\n" +msgstr "Incapable d'ajouter le travail pour la destination \"%s\"!" + +#: berkeley/lpq.c:177 systemv/lpstat.c:549 +#, fuzzy, c-format +msgid "%s: Unknown destination \"%s\"!\n" +msgstr "Incapable d'ajouter le travail pour la destination \"%s\"!" + +#: berkeley/lpq.c:201 berkeley/lprm.c:167 systemv/accept.c:146 +#: systemv/cancel.c:135 systemv/lp.c:227 systemv/lpstat.c:300 +#, c-format +msgid "%s: Error - expected hostname after '-h' option!\n" +msgstr "" + +#: berkeley/lpq.c:253 +#, c-format +msgid "" +"%s: error - %s environment variable names non-existent destination \"%s\"!\n" +msgstr "" + +#: berkeley/lpq.c:258 +#, c-format +msgid "%s: error - no default destination available.\n" +msgstr "" + +#: berkeley/lpq.c:647 +msgid "" +"Usage: lpq [-P dest] [-U username] [-h hostname[:port]] [-l] [+interval]\n" +msgstr "" + +#: berkeley/lpr.c:148 +#, c-format +msgid "%s: Error - expected hostname after '-H' option!\n" +msgstr "" + +#: berkeley/lpr.c:171 +#, c-format +msgid "%s: Error - expected value after '-%c' option!\n" +msgstr "" + +#: berkeley/lpr.c:185 +#, c-format +msgid "" +"%s: Warning - '%c' format modifier not supported - output may not be " +"correct!\n" +msgstr "" + +#: berkeley/lpr.c:199 +#, c-format +msgid "%s: error - expected option=value after '-o' option!\n" +msgstr "" + +#: berkeley/lpr.c:250 +#, c-format +msgid "%s: Error - expected destination after '-P' option!\n" +msgstr "" + +#: berkeley/lpr.c:285 +#, c-format +msgid "%s: Error - expected copy count after '-#' option!\n" +msgstr "" + +#: berkeley/lpr.c:309 +#, c-format +msgid "%s: Error - expected name after '-%c' option!\n" +msgstr "" + +#: berkeley/lpr.c:320 berkeley/lprm.c:179 systemv/accept.c:176 +#: systemv/cancel.c:169 systemv/lp.c:529 systemv/lpstat.c:461 +#, fuzzy, c-format +msgid "%s: Error - unknown option '%c'!\n" +msgstr "Incapable d'ajouter le travail pour la destination \"%s\"!" + +#: berkeley/lpr.c:333 systemv/lp.c:554 +#, c-format +msgid "%s: Error - unable to access \"%s\" - %s\n" +msgstr "" + +#: berkeley/lpr.c:351 systemv/lp.c:571 +#, c-format +msgid "%s: Error - too many files - \"%s\"\n" +msgstr "" + +#: berkeley/lpr.c:393 systemv/lp.c:621 +#, c-format +msgid "" +"%s: Error - %s environment variable names non-existent destination \"%s\"!\n" +msgstr "" + +#: berkeley/lpr.c:398 systemv/lp.c:626 +#, c-format +msgid "%s: Error - no default destination available.\n" +msgstr "" + +#: berkeley/lpr.c:402 systemv/lp.c:630 +#, c-format +msgid "%s: Error - scheduler not responding!\n" +msgstr "" + +#: berkeley/lpr.c:452 systemv/lp.c:670 +#, fuzzy, c-format +msgid "%s: Error - unable to create temporary file \"%s\" - %s\n" +msgstr "Incapable de copier le dossier de PPD - %s!" + +#: berkeley/lpr.c:462 systemv/lp.c:679 +#, fuzzy, c-format +msgid "%s: Error - unable to write to temporary file \"%s\" - %s\n" +msgstr "Incapable de copier le dossier de PPD - %s!" + +#: berkeley/lpr.c:476 systemv/lp.c:693 +#, c-format +msgid "%s: Error - stdin is empty, so no job has been sent.\n" +msgstr "" + +#: berkeley/lprm.c:127 systemv/cancel.c:227 +#, fuzzy, c-format +msgid "%s: Error - unknown destination \"%s\"!\n" +msgstr "Incapable d'ajouter le travail pour la destination \"%s\"!" + +#: systemv/accept.c:165 +#, c-format +msgid "%s: Error - expected reason text after '-r' option!\n" +msgstr "" + +#: systemv/cancel.c:157 +#, c-format +msgid "%s: Error - expected username after '-u' option!\n" +msgstr "" + +#: systemv/cancel.c:308 systemv/cancel.c:373 +#, c-format +msgid "%s: %s failed: %s\n" +msgstr "" + +#: systemv/lp.c:173 +#, c-format +msgid "%s: Error - expected destination after '-d' option!\n" +msgstr "" + +#: systemv/lp.c:206 +#, c-format +msgid "%s: Error - expected form after '-f' option!\n" +msgstr "" + +#: systemv/lp.c:213 +#, c-format +msgid "%s: Warning - form option ignored!\n" +msgstr "" + +#: systemv/lp.c:247 +#, c-format +msgid "%s: Expected job ID after '-i' option!\n" +msgstr "" + +#: systemv/lp.c:258 +#, c-format +msgid "%s: Error - cannot print files and alter jobs simultaneously!\n" +msgstr "" + +#: systemv/lp.c:271 +#, c-format +msgid "%s: Error - bad job ID!\n" +msgstr "" + +#: systemv/lp.c:296 +#, c-format +msgid "%s: Error - expected copies after '-n' option!\n" +msgstr "" + +#: systemv/lp.c:319 +#, c-format +msgid "%s: Error - expected option string after '-o' option!\n" +msgstr "" + +#: systemv/lp.c:340 +#, c-format +msgid "%s: Error - expected priority after '-%c' option!\n" +msgstr "" + +#: systemv/lp.c:363 +#, c-format +msgid "%s: Error - priority must be between 1 and 100.\n" +msgstr "" + +#: systemv/lp.c:387 +#, c-format +msgid "%s: Error - expected title after '-t' option!\n" +msgstr "" + +#: systemv/lp.c:405 +#, c-format +msgid "%s: Error - expected mode list after '-y' option!\n" +msgstr "" + +#: systemv/lp.c:413 +#, c-format +msgid "%s: Warning - mode option ignored!\n" +msgstr "" + +#: systemv/lp.c:427 +#, c-format +msgid "%s: Error - expected hold name after '-H' option!\n" +msgstr "" + +#: systemv/lp.c:451 +#, c-format +msgid "%s: Need job ID ('-i jobid') before '-H restart'!\n" +msgstr "" + +#: systemv/lp.c:475 +#, c-format +msgid "%s: Error - expected page list after '-P' option!\n" +msgstr "" + +#: systemv/lp.c:496 +#, c-format +msgid "%s: Error - expected character set after '-S' option!\n" +msgstr "" + +#: systemv/lp.c:504 +#, c-format +msgid "%s: Warning - character set option ignored!\n" +msgstr "" + +#: systemv/lp.c:516 +#, c-format +msgid "%s: Error - expected content type after '-T' option!\n" +msgstr "" + +#: systemv/lp.c:524 +#, c-format +msgid "%s: Warning - content type option ignored!\n" +msgstr "" + +#: systemv/lp.c:538 +#, c-format +msgid "" +"%s: Error - cannot print from stdin if files or a job ID are provided!\n" +msgstr "" + +#: systemv/lpstat.c:164 systemv/lpstat.c:178 +#, c-format +msgid "" +"%s: Error - need \"completed\", \"not-completed\", or \"all\" after '-W' " +"option!\n" +msgstr "" + +#: systemv/lpstat.c:237 +#, c-format +msgid "%s: Error - expected destination after '-b' option!\n" +msgstr "" + +#: systemv/lpstat.c:534 +#, c-format +msgid "%s: Invalid destination name in list \"%s\"!\n" +msgstr "" + +#: systemv/lpstat.c:571 +#, fuzzy, c-format +msgid "%s: Unable to connect to server\n" +msgstr "Incapable de copier le dossier de PPD - %s!" diff --git a/locale/cups_ja.po b/locale/cups_ja.po new file mode 100644 index 000000000..d7d78e5c4 --- /dev/null +++ b/locale/cups_ja.po @@ -0,0 +1,3167 @@ +# +# "$Id$" +# +# Message catalog template for the Common UNIX Printing System (CUPS). +# +# Copyright 2005-2006 by Easy Software Products. +# +# These coded instructions, statements, and computer programs are the +# property of Easy Software Products and are protected by Federal +# copyright law. Distribution and use rights are outlined in the file +# "LICENSE.txt" which should have been included with this file. If this +# file is missing or damaged please contact Easy Software Products +# at: +# +# Attn: CUPS Licensing Information +# Easy Software Products +# 44141 Airport View Drive, Suite 204 +# Hollywood, Maryland 20636 USA +# +# Voice: (301) 373-9600 +# EMail: cups-info@cups.org +# WWW: http://www.cups.org +# + + + +msgid "" +msgstr "" +"Project-Id-Version: CUPS 1.2\n" +"Report-Msgid-Bugs-To: http://www.cups.org/str.php\n" +"POT-Creation-Date: 2006-01-18 22:26-0500\n" +"PO-Revision-Date: 2006-01-21 11:31+0900\n" +"Last-Translator: Kenshi Muto <kmuto@debian.org>\n" +"Language-Team: Japanese <LL@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: cgi-bin/admin.c:1276 cgi-bin/admin.c:1154 +msgid "Options Installed" +msgstr "インストールされたオプション" + +#: cgi-bin/classes.c:103 +msgid "Class" +msgstr "クラス" + +#: cgi-bin/printers.c:104 +msgid "Printer" +msgstr "プリンタ" + +#: cups/ppd.c:654 cups/ppd.c:1045 cups/ppd.c:660 cups/ppd.c:1167 +msgid "Extra" +msgstr "補助" + +#: cups/ppd.c:656 cups/ppd.c:881 cups/ppd.c:1047 cups/ppd.c:662 cups/ppd.c:996 +#: cups/ppd.c:1169 +msgid "General" +msgstr "一般" + +#: cups/ppd.c:704 cups/ppd.c:1105 cups/ppd.c:710 cups/ppd.c:1224 +msgid "Media Size" +msgstr "用紙サイズ" + +#: cups/ppd.c:706 cups/ppd.c:1107 cups/ppd.c:712 cups/ppd.c:1226 +msgid "Media Type" +msgstr "用紙形式" + +#: cups/ppd.c:708 cups/ppd.c:1109 cups/ppd.c:714 cups/ppd.c:1228 +msgid "Media Source" +msgstr "給紙" + +#: cups/ppd.c:710 cups/ppd.c:1111 cups/ppd.c:716 cups/ppd.c:1230 +msgid "Output Mode" +msgstr "出力モード" + +#: cups/ppd.c:712 cups/ppd.c:1113 cups/ppd.c:718 cups/ppd.c:1232 +msgid "Resolution" +msgstr "解像度" + +#: cups/ppd.c:907 +msgid "Variable" +msgstr "可変" + +#: cups/ppd.c:1535 cups/ppd.c:1650 +msgid "Yes" +msgstr "はい" + +#: cups/ppd.c:1537 cups/ppd.c:1652 +msgid "No" +msgstr "いいえ" + +#: cups/ppd.c:1824 +msgid "Auto" +msgstr "自動" + +#: scheduler/client.c:2247 scheduler/client.c:2251 +msgid "Enter your username and password or the root username and password to access this page." +msgstr "このページにアクセスするために、あなたのユーザ名とパスワード、あるいは root のユーザ名とパスワードを入力してください。" + +#: scheduler/client.c:2252 scheduler/client.c:2256 +msgid "You must use a https: URL to access this page." +msgstr "このページにアクセスするためには、https: URL を使う必要があります。" + +#: scheduler/ipp.c:236 scheduler/ipp.c:244 +#, c-format +msgid "Bad request version number %d.%d!" +msgstr "バージョン番号 %d.%d は無効なリクエストです!" + +#: scheduler/ipp.c:246 scheduler/ipp.c:254 +msgid "No attributes in request!" +msgstr "リクエストに属性がありません!" + +#: scheduler/ipp.c:269 scheduler/ipp.c:277 +#, c-format +msgid "Attribute groups are out of order (%x < %x)!" +msgstr "属性グループは範囲外です (%x < %x)!" + +#: scheduler/ipp.c:379 scheduler/ipp.c:389 +msgid "Missing required attributes!" +msgstr "必須の属性が設定されていません!" + +#: scheduler/ipp.c:575 scheduler/ipp.c:585 +#, c-format +msgid "%s not supported!" +msgstr "%s はサポートされていません!" + +#: scheduler/ipp.c:684 scheduler/ipp.c:1055 scheduler/ipp.c:2271 +#: scheduler/ipp.c:2383 scheduler/ipp.c:3707 scheduler/ipp.c:4417 +#: scheduler/ipp.c:4649 scheduler/ipp.c:5002 scheduler/ipp.c:5445 +#: scheduler/ipp.c:5890 scheduler/ipp.c:6245 scheduler/ipp.c:6609 +#: scheduler/ipp.c:7308 scheduler/ipp.c:8179 scheduler/ipp.c:8585 +#: scheduler/ipp.c:8663 scheduler/ipp.c:8836 scheduler/ipp.c:696 +#: scheduler/ipp.c:1079 scheduler/ipp.c:2318 scheduler/ipp.c:2433 +#: scheduler/ipp.c:3901 scheduler/ipp.c:4621 scheduler/ipp.c:4855 +#: scheduler/ipp.c:5237 scheduler/ipp.c:5526 scheduler/ipp.c:5834 +#: scheduler/ipp.c:6113 scheduler/ipp.c:6155 scheduler/ipp.c:6657 +#: scheduler/ipp.c:7365 scheduler/ipp.c:8251 scheduler/ipp.c:8662 +#: scheduler/ipp.c:8742 scheduler/ipp.c:8917 +msgid "The printer or class was not found." +msgstr "プリンタまたはクラスが見つかりませんでした。" + +#: scheduler/ipp.c:762 scheduler/ipp.c:777 +msgid "The printer-uri must be of the form \"ipp://HOSTNAME/classes/CLASSNAME\"." +msgstr "printer-uri は、\"ipp://ホスト名/classes/クラス名\" 形式でなければなりません。" + +#: scheduler/ipp.c:778 scheduler/ipp.c:1454 scheduler/ipp.c:793 +#: scheduler/ipp.c:1482 +#, c-format +msgid "The printer-uri \"%s\" contains invalid characters." +msgstr "printer-uri \"%s\" には、無効な文字が含まれています。" + +#: scheduler/ipp.c:811 scheduler/ipp.c:826 +#, c-format +msgid "A printer named \"%s\" already exists!" +msgstr "プリンタ名 \"%s\" はすでに存在します!" + +#: scheduler/ipp.c:904 scheduler/ipp.c:924 +#, c-format +msgid "Attempt to set %s printer-state to bad value %d!" +msgstr "%s printer-state に 不正な値 %d を設定しようとしています!" + +#: scheduler/ipp.c:1000 scheduler/ipp.c:1022 +#, c-format +msgid "add_class: Unknown printer-op-policy \"%s\"." +msgstr "add_class: \"%s\" は未知の printer-op-policy です。" + +#: scheduler/ipp.c:1013 scheduler/ipp.c:1035 +#, c-format +msgid "add_class: Unknown printer-error-policy \"%s\"." +msgstr "add_class: \"%s\" は未知の printer-error-policy です。" + +#: scheduler/ipp.c:1144 scheduler/ipp.c:1168 +msgid "Unable to allocate memory for file types!" +msgstr "ファイルタイプ用にメモリを割り当てられません!" + +#: scheduler/ipp.c:1290 scheduler/ipp.c:4501 scheduler/ipp.c:1316 +#: scheduler/ipp.c:4705 +#, c-format +msgid "Character set \"%s\" not supported!" +msgstr "文字セット \"%s\" はサポートされていません!" + +#: scheduler/ipp.c:1299 scheduler/ipp.c:4510 scheduler/ipp.c:1325 +#: scheduler/ipp.c:4714 +#, c-format +msgid "Language \"%s\" not supported!" +msgstr "言語 \"%s\" はサポートされていません!" + +#: scheduler/ipp.c:1309 scheduler/ipp.c:4520 scheduler/ipp.c:1335 +#: scheduler/ipp.c:4724 +#, c-format +msgid "The notify-user-data value is too large (%d > 63 octets)!" +msgstr "notify-user-data 値が大きすぎます (%d > 63 オクテット)!" + +#: scheduler/ipp.c:1326 scheduler/ipp.c:1352 +msgid "The notify-lease-duration attribute cannot be used with job subscriptions." +msgstr "notify-lease-duration 属性は、ジョブサブスクリプションと一緒に使うことはできません。" + +#: scheduler/ipp.c:1438 scheduler/ipp.c:1466 +msgid "The printer-uri must be of the form \"ipp://HOSTNAME/printers/PRINTERNAME\"." +msgstr "printer-uri は \"ipp://ホスト名/printers/プリンタ名\" 形式でなければなりません。" + +#: scheduler/ipp.c:1487 scheduler/ipp.c:1515 +#, c-format +msgid "A class named \"%s\" already exists!" +msgstr "クラス名 \"%s\" はすでに存在します!" + +#: scheduler/ipp.c:1575 scheduler/ipp.c:1607 +#, c-format +msgid "File device URIs have been disabled! To enable, see the FileDevice directive in \"%s/cupsd.conf\"." +msgstr "ファイルデバイス URI は無効になっています! 有効にするために、\"%s/cupsd.conf\" の FileDevice ディレクティブを確認してください。" + +#: scheduler/ipp.c:1595 scheduler/ipp.c:1627 +#, c-format +msgid "Bad device-uri \"%s\"!" +msgstr "\"%s\" は無効な device-uri です!" + +#: scheduler/ipp.c:1626 scheduler/ipp.c:1659 +#, c-format +msgid "Bad port-monitor \"%s\"!" +msgstr "\"%s\" は無効な port-monitor です!" + +#: scheduler/ipp.c:1669 scheduler/ipp.c:1705 +#, c-format +msgid "Bad printer-state value %d!" +msgstr "%d は無効な printer-state 値です!" + +#: scheduler/ipp.c:1762 scheduler/ipp.c:1800 +#, c-format +msgid "Unknown printer-op-policy \"%s\"." +msgstr "\"%s\" は未知の printer-op-policy です。" + +#: scheduler/ipp.c:1775 scheduler/ipp.c:1813 +#, c-format +msgid "Unknown printer-error-policy \"%s\"." +msgstr "\"%s\" は未知の printer-error-policy です。" + +#: scheduler/ipp.c:1837 scheduler/ipp.c:1875 +#, c-format +msgid "Unable to copy interface script - %s!" +msgstr "インターフェイススクリプトをコピーできません - %s!" + +#: scheduler/ipp.c:1862 scheduler/ipp.c:1900 +#, c-format +msgid "Unable to copy PPD file - %s!" +msgstr " PPD ファイルをコピーできません - %s!" + +#: scheduler/ipp.c:1915 scheduler/ipp.c:1954 +msgid "Unable to copy PPD file!" +msgstr "PPD ファイルをコピーできません!" + +#: scheduler/ipp.c:2076 scheduler/ipp.c:2364 scheduler/ipp.c:5188 +#: scheduler/ipp.c:6008 scheduler/ipp.c:6147 scheduler/ipp.c:7394 +#: scheduler/ipp.c:7538 scheduler/ipp.c:7776 scheduler/ipp.c:8261 +#: scheduler/ipp.c:2116 scheduler/ipp.c:2412 scheduler/ipp.c:5102 +#: scheduler/ipp.c:5955 scheduler/ipp.c:7452 scheduler/ipp.c:7599 +#: scheduler/ipp.c:7839 scheduler/ipp.c:8334 +msgid "Got a printer-uri attribute but no job-id!" +msgstr "printer-uri 属性を取得しましたが、job-id を取得できませんでした!" + +#: scheduler/ipp.c:2097 scheduler/ipp.c:2433 scheduler/ipp.c:5210 +#: scheduler/ipp.c:6029 scheduler/ipp.c:6169 scheduler/ipp.c:7416 +#: scheduler/ipp.c:7560 scheduler/ipp.c:7797 scheduler/ipp.c:8282 +#: scheduler/ipp.c:2138 scheduler/ipp.c:2484 scheduler/ipp.c:5125 +#: scheduler/ipp.c:5978 scheduler/ipp.c:6201 scheduler/ipp.c:7475 +#: scheduler/ipp.c:7622 scheduler/ipp.c:7862 scheduler/ipp.c:8357 +#, c-format +msgid "Bad job-uri attribute \"%s\"!" +msgstr "\"%s\" は無効な job-uri 属性です!" + +#: scheduler/ipp.c:2116 scheduler/ipp.c:2451 scheduler/ipp.c:5228 +#: scheduler/ipp.c:6047 scheduler/ipp.c:6188 scheduler/ipp.c:7434 +#: scheduler/ipp.c:7578 scheduler/ipp.c:7815 scheduler/ipp.c:8300 +#, c-format +msgid "Job #%d doesn't exist!" +msgstr "ジョブ #%d は存在しません!" + +#: scheduler/ipp.c:2131 scheduler/ipp.c:2172 +#, c-format +msgid "Job #%d is not held for authentication!" +msgstr "ジョブ #%d は認証が行われていません!" + +#: scheduler/ipp.c:2153 scheduler/ipp.c:2195 +#, c-format +msgid "You are not authorized to authenticate job #%d owned by \"%s\"!" +msgstr "あなたは \"%2$s\" の所有しているジョブ #%1$d を証明することを許可されていません!" + +#: scheduler/ipp.c:2221 scheduler/ipp.c:2264 +msgid "The printer-uri attribute is required!" +msgstr "printer-uri 属性は必須です!" + +#: scheduler/ipp.c:2238 scheduler/ipp.c:2283 +msgid "Missing requesting-user-name attribute!" +msgstr "requesting-user-name 属性が設定されていません!" + +#: scheduler/ipp.c:2277 scheduler/ipp.c:2324 +#, c-format +msgid "The printer-uri \"%s\" is not valid." +msgstr "printer-uri \"%s\" は有効ではありません。" + +#: scheduler/ipp.c:2410 scheduler/ipp.c:2460 +#, c-format +msgid "No active jobs on %s!" +msgstr "%s にはアクティブなジョブはありません!" + +#: scheduler/ipp.c:2462 scheduler/ipp.c:2513 +#, c-format +msgid "You are not authorized to delete job #%d owned by \"%s\"!" +msgstr "あなたは \"%2$s\" の所有しているジョブ #%1$d を削除することを許可されていません!" + +#: scheduler/ipp.c:2476 scheduler/ipp.c:2527 +#, c-format +msgid "Job #%d is already %s - can't cancel." +msgstr "ジョブ #%d はすでに %s です - キャンセルできません。" + +#: scheduler/ipp.c:3720 scheduler/ipp.c:3914 +msgid "The printer or class is not shared!" +msgstr "プリンタまたはクラスは共有できません!" + +#: scheduler/ipp.c:3746 scheduler/ipp.c:6647 scheduler/ipp.c:3940 +#: scheduler/ipp.c:6695 +#, c-format +msgid "Destination \"%s\" is not accepting jobs." +msgstr "宛先 \"%s\" はジョブを受け付けていません。" + +#: scheduler/ipp.c:3759 scheduler/ipp.c:6443 scheduler/ipp.c:3954 +#: scheduler/ipp.c:6487 +#, c-format +msgid "Bad copies value %d." +msgstr "%d は不正なコピー値です。" + +#: scheduler/ipp.c:3775 scheduler/ipp.c:6459 scheduler/ipp.c:3971 +#: scheduler/ipp.c:6504 +#, c-format +msgid "Bad page-ranges values %d-%d." +msgstr "%d-%d は不正な page-ranges 値です。" + +#: scheduler/ipp.c:3795 scheduler/ipp.c:3991 +msgid "Too many active jobs." +msgstr "アクティブなジョブが多すぎます。" + +#: scheduler/ipp.c:3801 scheduler/ipp.c:6668 scheduler/ipp.c:3997 +#: scheduler/ipp.c:6716 +msgid "Quota limit reached." +msgstr "Quota の制限に達しました。" + +#: scheduler/ipp.c:3824 scheduler/ipp.c:6691 scheduler/ipp.c:4022 +#: scheduler/ipp.c:6741 +#, c-format +msgid "Unable to add job for destination \"%s\"!" +msgstr "宛先 \"%s\" にジョブを追加できません!" + +#: scheduler/ipp.c:4469 scheduler/ipp.c:4673 +msgid "No subscription attributes in request!" +msgstr "リクエストにサブスクリプション属性がありません!" + +#: scheduler/ipp.c:4559 scheduler/ipp.c:4763 +msgid "notify-events not specified!" +msgstr "notify-events が指定されていません!" + +#: scheduler/ipp.c:4577 scheduler/ipp.c:4781 +#, c-format +msgid "Job %d not found!" +msgstr "ジョブ %d は見つかりません!" + +#: scheduler/ipp.c:4827 scheduler/ipp.c:4957 +msgid "No default printer" +msgstr "デフォルトプリンタはありません" + +#: scheduler/ipp.c:4930 scheduler/ipp.c:5060 +msgid "cups-deviced failed to execute." +msgstr "cups-deviced の実行に失敗しました。" + +#: scheduler/ipp.c:5393 scheduler/ipp.c:5479 +msgid "cups-driverd failed to execute." +msgstr "cups-driverd の実行に失敗しました。" + +#: scheduler/ipp.c:5571 scheduler/ipp.c:5594 +msgid "No destinations added." +msgstr "追加された宛先はありません。" + +#: scheduler/ipp.c:5794 scheduler/ipp.c:5736 +#, c-format +msgid "notify-subscription-id %d no good!" +msgstr "notify-subscription-id %d は良くありません!" + +#: scheduler/ipp.c:5878 scheduler/ipp.c:5822 +#, c-format +msgid "Job #%s does not exist!" +msgstr "ジョブ #%s は存在しません!" + +#: scheduler/ipp.c:5900 scheduler/ipp.c:2116 scheduler/ipp.c:2451 +#: scheduler/ipp.c:5228 scheduler/ipp.c:6047 scheduler/ipp.c:6188 +#: scheduler/ipp.c:7434 scheduler/ipp.c:7578 scheduler/ipp.c:7815 +#: scheduler/ipp.c:8300 scheduler/ipp.c:2157 scheduler/ipp.c:2502 +#: scheduler/ipp.c:5143 scheduler/ipp.c:5844 scheduler/ipp.c:5996 +#: scheduler/ipp.c:6174 scheduler/ipp.c:6219 scheduler/ipp.c:7493 +#: scheduler/ipp.c:7640 scheduler/ipp.c:7880 scheduler/ipp.c:8375 +#, c-format +msgid "Job #%d does not exist!" +msgstr "ジョブ #%d は存在しません!" + +#: scheduler/ipp.c:5969 scheduler/ipp.c:5915 +msgid "No subscriptions found." +msgstr "サブスクリプションが見つかりません。" + +#: scheduler/ipp.c:6058 scheduler/ipp.c:6007 +#, c-format +msgid "Not authorized to hold job #%d owned by \"%s\"!" +msgstr "\"%2$s\" の所有しているジョブ #%1$d をホールドすることを許可されていません!" + +#: scheduler/ipp.c:6203 scheduler/ipp.c:8315 scheduler/ipp.c:6250 +#: scheduler/ipp.c:8390 +#, c-format +msgid "Job #%d is finished and cannot be altered!" +msgstr "ジョブ #%d は完了し、変更することはできません!" + +#: scheduler/ipp.c:6215 scheduler/ipp.c:6262 +#, c-format +msgid "You are not authorized to move job #%d owned by \"%s\"!" +msgstr "あなたは \"%2$s\" の所有しているジョブ #%1$d を移動することを許可されていません!" + +#: scheduler/ipp.c:6228 scheduler/ipp.c:6098 +msgid "job-printer-uri attribute missing!" +msgstr "job-printer-uri 属性がありません!" + +#: scheduler/ipp.c:6485 scheduler/ipp.c:7847 scheduler/ipp.c:6531 +#: scheduler/ipp.c:7913 +#, c-format +msgid "Unsupported compression \"%s\"!" +msgstr "\"%s\" はサポートされていない圧縮です!" + +#: scheduler/ipp.c:6504 scheduler/ipp.c:7866 scheduler/ipp.c:6550 +#: scheduler/ipp.c:7932 +msgid "No file!?!" +msgstr "ファイルがありません!?!" + +#: scheduler/ipp.c:6522 scheduler/ipp.c:6568 +#, c-format +msgid "Could not scan type \"%s\"!" +msgstr "タイプ \"%s\" を検査できませんでした!" + +#: scheduler/ipp.c:6574 scheduler/ipp.c:7936 scheduler/ipp.c:6620 +#: scheduler/ipp.c:8001 +#, c-format +msgid "Unsupported format '%s/%s'!" +msgstr "'%s/%s' はサポートされていない形式です!" + +#: scheduler/ipp.c:6621 scheduler/ipp.c:6669 +msgid "Printer not shared!" +msgstr "プリンタは共有されていません!" + +#: scheduler/ipp.c:6661 scheduler/ipp.c:6709 +#, c-format +msgid "Too many jobs - %d jobs, max jobs is %d." +msgstr "ジョブが多すぎます - %d ジョブ。最大ジョブ数は %d です。" + +#: scheduler/ipp.c:7448 scheduler/ipp.c:7507 +#, c-format +msgid "Job #%d is not held!" +msgstr "ジョブ #%d はホールドされていません!" + +#: scheduler/ipp.c:7459 scheduler/ipp.c:7518 +#, c-format +msgid "You are not authorized to release job id %d owned by \"%s\"!" +msgstr "あなたは \"%2$s\" の所有しているジョブ ID %1$d を解放することを許可されていません!" + +#: scheduler/ipp.c:7592 scheduler/ipp.c:7654 +#, c-format +msgid "Job #%d is not complete!" +msgstr "ジョブ #%d は完結していません!" + +#: scheduler/ipp.c:7608 scheduler/ipp.c:7670 +#, c-format +msgid "Job #%d cannot be restarted - no files!" +msgstr "ジョブ #%d は再起動できません - ファイルがありません!" + +#: scheduler/ipp.c:7619 scheduler/ipp.c:7681 +#, c-format +msgid "You are not authorized to restart job id %d owned by \"%s\"!" +msgstr "あなたは \"%2$s\" の所有しているジョブ ID %1$d を再開することを許可されていません!" + +#: scheduler/ipp.c:7826 scheduler/ipp.c:7891 +#, c-format +msgid "You are not authorized to send document for job #%d owned by \"%s\"!" +msgstr "あなたは \"%2$s\" の所有しているジョブ #%1$d にドキュメントを送信することを許可されていません!" + +#: scheduler/ipp.c:7883 scheduler/ipp.c:8803 scheduler/ipp.c:7949 +#: scheduler/ipp.c:8883 +#, c-format +msgid "Bad document-format \"%s\"!" +msgstr "\"%s\" は不正な document-format です!" + +#: scheduler/ipp.c:8326 scheduler/ipp.c:8401 +#, c-format +msgid "You are not authorized to alter job id %d owned by \"%s\"!" +msgstr "あなたは \"%2$s\" の所有しているジョブ ID %1$d を変更することを許可されていません!" + +#: scheduler/ipp.c:8371 scheduler/ipp.c:8446 +#, c-format +msgid "%s cannot be changed." +msgstr "%s は変更できません。" + +#: scheduler/ipp.c:8387 scheduler/ipp.c:8462 +msgid "Bad job-priority value!" +msgstr "不正な job-priority 値です!" + +#: scheduler/ipp.c:8395 scheduler/ipp.c:8470 +msgid "Job is completed and cannot be changed." +msgstr "ジョブは完結し、変更できません。" + +#: scheduler/ipp.c:8409 scheduler/ipp.c:8484 +msgid "Bad job-state value!" +msgstr "不正な job-state 値です!" + +#: scheduler/ipp.c:8423 scheduler/ipp.c:8435 scheduler/ipp.c:8446 +#: scheduler/ipp.c:8498 scheduler/ipp.c:8510 scheduler/ipp.c:8521 +msgid "Job state cannot be changed." +msgstr "ジョブの状態を変更できません。" + +#: scheduler/ipp.c:8787 scheduler/ipp.c:8867 +#, c-format +msgid "Unsupported compression attribute %s!" +msgstr "%s はサポートされていない圧縮属性です!" + +#: scheduler/ipp.c:8815 scheduler/ipp.c:8894 +#, c-format +msgid "Unsupported format \"%s\"!" +msgstr "\"%s\" はサポートされていない形式です!" + +#: berkeley/lpc.c:201 +#, c-format +msgid "%s is not implemented by the CUPS version of lpc.\n" +msgstr "%s は lpc の CUPS バージョンでは実装されていません。\n" + +#: berkeley/lpc.c:216 +msgid "" +"Commands may be abbreviated. Commands are:\n" +"\n" +"exit help quit status ?\n" +msgstr "" +"コマンドは短縮できます。 コマンド:\n" +"\n" +"exit help quit status ?\n" + +#: berkeley/lpc.c:222 berkeley/lpc.c:221 +msgid "help\t\tget help on commands\n" +msgstr "help\t\tコマンドのヘルプを取得\n" + +#: berkeley/lpc.c:225 berkeley/lpc.c:223 +msgid "status\t\tshow status of daemon and queue\n" +msgstr "status\t\tデーモンとキューの状態を表示\n" + +#: berkeley/lpc.c:228 berkeley/lpc.c:225 +msgid "?Invalid help command unknown\n" +msgstr "?無効なヘルプコマンドです\n" + +#: berkeley/lpc.c:478 berkeley/lpc.c:490 berkeley/lpc.c:475 berkeley/lpc.c:487 +#, c-format +msgid "\tprinter is on device '%s' speed -1\n" +msgstr "\tプリンタはデバイス '%s'上。速度 -1\n" + +#: berkeley/lpc.c:496 berkeley/lpc.c:493 +msgid "\tqueuing is enabled\n" +msgstr "\tキューは有効です\n" + +#: berkeley/lpc.c:498 berkeley/lpc.c:495 +msgid "\tqueuing is disabled\n" +msgstr "\tキューは無効です\n" + +#: berkeley/lpc.c:501 berkeley/lpc.c:498 +msgid "\tprinting is enabled\n" +msgstr "\t印刷は有効です\n" + +#: berkeley/lpc.c:503 berkeley/lpc.c:500 +msgid "\tprinting is disabled\n" +msgstr "\t印刷は無効です\n" + +#: berkeley/lpc.c:506 berkeley/lpc.c:503 +msgid "\tno entries\n" +msgstr "\tエントリがありません\n" + +#: berkeley/lpc.c:508 berkeley/lpc.c:505 +#, c-format +msgid "\t%d entries\n" +msgstr "\t%d エントリ\n" + +#: berkeley/lpc.c:510 berkeley/lpc.c:507 +msgid "\tdaemon present\n" +msgstr "\tデーモンは提供されています\n" + +#: berkeley/lpq.c:94 +msgid "lpq: Unable to contact server!\n" +msgstr "lpq: サーバに連絡できません!\n" + +#: berkeley/lpq.c:125 berkeley/lpr.c:114 berkeley/lprm.c:107 +#: systemv/accept.c:108 systemv/cancel.c:95 systemv/lpstat.c:115 +#: systemv/lpadmin.c:284 systemv/lp.c:135 systemv/lpinfo.c:80 +#: systemv/lpmove.c:84 systemv/accept.c:106 systemv/cancel.c:93 +#: systemv/lpmove.c:89 berkeley/lpq.c:124 systemv/lp.c:136 +#: systemv/lpstat.c:116 +#, c-format +msgid "%s: Sorry, no encryption support compiled in!\n" +msgstr "%s: すみません、暗号化サポートはコンパイル時に組み込まれていません!\n" + +#: berkeley/lpq.c:155 +#, c-format +msgid "lpq: Unknown destination \"%s/%s\"!\n" +msgstr "lpq: \"%s/%s\" は未知の宛先です!\n" + +#: berkeley/lpq.c:159 +#, c-format +msgid "lpq: Unknown destination \"%s\"!\n" +msgstr "lpq: \"%s\" は未知の宛先です!\n" + +#: berkeley/lpq.c:211 systemv/lp.c:564 +#, c-format +msgid "lp: error - %s environment variable names non-existent destination \"%s\"!\n" +msgstr "lp: エラー - 環境変数 %s が存在しない宛先 \"%s\" を指しています!\n" + +#: berkeley/lpq.c:216 +msgid "lpq: error - no default destination available.\n" +msgstr "lpq: エラー - 利用可能なデフォルトの宛先がありません。\n" + +#: berkeley/lpq.c:363 berkeley/lpq.c:523 +#, c-format +msgid "lpq: get-jobs failed: %s\n" +msgstr "lpq: get-jobs に失敗しました: %s\n" + +#: berkeley/lpq.c:457 berkeley/lpq.c:444 berkeley/lpq.c:488 +msgid "Rank Owner Pri Job Files Total Size\n" +msgstr "ランク 所有者 優先 ジョブ ファイル 合計サイズ\n" + +#: berkeley/lpq.c:461 berkeley/lpq.c:448 berkeley/lpq.c:492 +msgid "Rank Owner Job File(s) Total Size\n" +msgstr "" +"Rank Owner Job File(s) Total Size\n" +"ランク 所有者 ジョブ ファイル 合計サイズ\n" + +#: berkeley/lpq.c:498 berkeley/lpq.c:485 berkeley/lpq.c:529 +#, c-format +msgid "%s: %-33.33s [job %d localhost]\n" +msgstr "%s: %-33.33s [ジョブ %d localhost]\n" + +#: berkeley/lpq.c:500 berkeley/lpq.c:487 berkeley/lpq.c:531 +#, c-format +msgid " %-39.39s %.0f bytes\n" +msgstr " %-39.39s %.0f バイト\n" + +#: berkeley/lpq.c:506 berkeley/lpq.c:493 berkeley/lpq.c:537 +#, c-format +msgid "%-6s %-10.10s %-4d %-10d %-27.27s %.0f bytes\n" +msgstr "%-6s %-10.10s %-4d %-10d %-27.27s %.0f バイト\n" + +#: berkeley/lpq.c:511 berkeley/lpq.c:498 berkeley/lpq.c:542 +#, c-format +msgid "%-7s %-7.7s %-7d %-31.31s %.0f bytes\n" +msgstr "%-7s %-7.7s %-7d %-31.31s %.0f バイト\n" + +#: berkeley/lpq.c:529 berkeley/lpq.c:515 berkeley/lpq.c:559 +msgid "no entries\n" +msgstr "エントリがありません\n" + +#: berkeley/lpq.c:591 berkeley/lpq.c:620 +#, c-format +msgid "lpq: get-printer-attributes failed: %s\n" +msgstr "lpq: get-printer-attributes に失敗しました: %s\n" + +#: berkeley/lpq.c:605 berkeley/lpq.c:576 berkeley/lpq.c:621 +#, c-format +msgid "%s is ready\n" +msgstr "%s は準備ができています\n" + +#: berkeley/lpq.c:608 berkeley/lpq.c:579 berkeley/lpq.c:624 +#, c-format +msgid "%s is ready and printing\n" +msgstr "%s は準備ができており印刷しています\n" + +#: berkeley/lpq.c:612 berkeley/lpq.c:583 berkeley/lpq.c:628 +#, c-format +msgid "%s is not ready\n" +msgstr "%s は準備ができていません\n" + +#: berkeley/lpq.c:633 berkeley/lpq.c:601 +msgid "Usage: lpq [-P dest] [-l] [+interval]\n" +msgstr "使い方: lpq [-P 宛先] [-l] [+インターバル]\n" + +#: berkeley/lpr.c:132 +#, c-format +msgid "lpr: error - expected value after -%c option!\n" +msgstr "lpr: エラー - -%c オプションのあとには値が必要です!\n" + +#: berkeley/lpr.c:146 +#, c-format +msgid "lpr: warning - '%c' format modifier not supported - output may not be correct!\n" +msgstr "lpr: 警告 - '%c' 形式修飾子はサポートされていません - 出力は正しくないものになるかもしれません!\n" + +#: berkeley/lpr.c:159 +msgid "lpr: error - expected option=value after -o option!\n" +msgstr "lpr: エラー - -o オプションのあとには オプション=値 が必要です!\n" + +#: berkeley/lpr.c:185 +msgid "lpr: warning - email notification is not currently supported!\n" +msgstr "lpr: 警告 - メール通知は現在サポートされていません!\n" + +#: berkeley/lpr.c:207 +msgid "lpr: error - expected destination after -P option!\n" +msgstr "lpr: エラー - -P オプションのあとには宛先が必要です!\n" + +#: berkeley/lpr.c:240 +msgid "lpr: error - expected copy count after -# option!\n" +msgstr "lpr: エラー - -# オプションのあとにはコピー数が必要です!\n" + +#: berkeley/lpr.c:263 +#, c-format +msgid "lpr: error - expected name after -%c option!\n" +msgstr "lpr: エラー - -%c オプションのあとには名前が必要です!\n" + +#: berkeley/lpr.c:281 +msgid "lpr: error - expected username after -U option!\n" +msgstr "lpr: エラー - -U オプションのあとにはユーザ名が必要です!\n" + +#: berkeley/lpr.c:292 +#, c-format +msgid "lpr: error - unknown option '%c'!\n" +msgstr "lpr: エラー - '%c' は未知のオプションです!\n" + +#: berkeley/lpr.c:305 +#, c-format +msgid "lpr: error - unable to access \"%s\" - %s\n" +msgstr "lpr: エラー - \"%s\" にアクセスできません - %s\n" + +#: berkeley/lpr.c:323 +#, c-format +msgid "lpr: error - too many files - \"%s\"\n" +msgstr "lpr: エラー - ファイルが多すぎます - \"%s\"\n" + +#: berkeley/lpr.c:364 +#, c-format +msgid "lpr: error - %s environment variable names non-existent destination \"%s\"!\n" +msgstr "lpr: エラー - 環境変数 %s が存在しない宛先 \"%s\" を指しています!\n" + +#: berkeley/lpr.c:369 +msgid "lpr: error - no default destination available.\n" +msgstr "lpr: エラー - 利用可能なデフォルトの宛先がありません。\n" + +#: berkeley/lpr.c:372 +msgid "lpr: error - scheduler not responding!\n" +msgstr "lpr: エラー - スケジューラが応答していません!\n" + +#: berkeley/lpr.c:421 +#, c-format +msgid "lpr: error - unable to create temporary file \"%s\" - %s\n" +msgstr "lpr: エラー - テンポラリファイル \"%s\" を作成できません - %s\n" + +#: berkeley/lpr.c:431 +#, c-format +msgid "lpr: error - unable to write to temporary file \"%s\" - %s\n" +msgstr "lpr: エラー - テンポラリファイル \"%s\" に書き込めません - %s\n" + +#: berkeley/lpr.c:445 +msgid "lpr: error - stdin is empty, so no job has been sent.\n" +msgstr "lpr: エラー - 標準入力が空なので、ジョブは送られていません。\n" + +#: berkeley/lpr.c:461 berkeley/lpr.c:460 +#, c-format +msgid "lpr: error - unable to print file: %s\n" +msgstr "lpr: エラー - ファイルを印刷できません: %s\n" + +#: berkeley/lprm.c:87 +msgid "lprm: Unable to contact server!\n" +msgstr "lprm: サーバに連絡できません!\n" + +#: berkeley/lprm.c:127 +#, c-format +msgid "lprm: Unknown destination \"%s\"!\n" +msgstr "lprm: \"%s\" は未知の宛先です!\n" + +#: berkeley/lprm.c:136 +#, c-format +msgid "lprm: Unknown option '%c'!\n" +msgstr "lprm: '%c' は未知のオプションです!\n" + +#: berkeley/lprm.c:223 +msgid "lprm: Job or printer not found!\n" +msgstr "lprm: ジョブまたはプリンタが見つかりません!\n" + +#: berkeley/lprm.c:227 +msgid "lprm: Not authorized to lprm job(s)!\n" +msgstr "lprm: lprm ジョブ の実行は許可されていません!\n" + +#: berkeley/lprm.c:231 +#, c-format +msgid "lprm: You don't own job ID %d!\n" +msgstr "lprm: あなたはジョブ ID %d の所有者ではありません!\n" + +#: berkeley/lprm.c:236 +msgid "lprm: Unable to lprm job(s)!\n" +msgstr "lprm: lprm ジョブ ができません!\n" + +#: berkeley/lprm.c:253 berkeley/lprm.c:269 +msgid "lprm: Unable to cancel job(s)!\n" +msgstr "lprm: ジョブをキャンセルできません!\n" + +#: systemv/accept.c:84 systemv/accept.c:82 +#, c-format +msgid "%s: Don't know what to do!\n" +msgstr "%s: 何が起きているか不明です!\n" + +#: systemv/accept.c:129 systemv/accept.c:127 +#, c-format +msgid "%s: Expected server name after -h!\n" +msgstr "%s: -h のあとにはサーバ名が必要です!\n" + +#: systemv/accept.c:147 systemv/accept.c:145 +#, c-format +msgid "%s: Expected reason text after -r!\n" +msgstr "%s: -r のあとには理由のテキストが必要です!\n" + +#: systemv/accept.c:157 systemv/accept.c:155 +#, c-format +msgid "%s: Unknown option '%c'!\n" +msgstr "%s: '%c' は未知のオプションです!\n" + +#: systemv/accept.c:173 systemv/accept.c:171 systemv/accept.c:192 +#, c-format +msgid "%s: Unable to connect to server: %s\n" +msgstr "%s: サーバに接続できません: %s\n" + +#: systemv/accept.c:217 systemv/accept.c:227 systemv/accept.c:268 +#: systemv/accept.c:278 systemv/accept.c:206 +#, c-format +msgid "%s: Operation failed: %s\n" +msgstr "%s: 操作に失敗しました: %s\n" + +#: systemv/cancel.c:118 systemv/cancel.c:116 +msgid "cancel: Error - expected hostname after '-h' option!\n" +msgstr "cancel: エラー - '-h' オプションのあとにはホスト名が必要です!\n" + +#: systemv/cancel.c:139 systemv/cancel.c:137 +msgid "cancel: Error - expected username after '-u' option!\n" +msgstr "cancel: エラー - '-u' オプションのあとにはユーザ名が必要です!\n" + +#: systemv/cancel.c:150 systemv/cancel.c:148 +#, c-format +msgid "cancel: Unknown option '%c'!\n" +msgstr "cancel: '%c' は未知のオプションです!\n" + +#: systemv/cancel.c:207 systemv/cancel.c:205 +#, c-format +msgid "cancel: Unknown destination \"%s\"!\n" +msgstr "cancel: \"%s\" は未知の宛先です!\n" + +#: systemv/cancel.c:229 systemv/cancel.c:319 systemv/cancel.c:227 +#: systemv/cancel.c:308 +msgid "cancel: Unable to contact server!\n" +msgstr "cancel: サーバに連絡できません!\n" + +#: systemv/cancel.c:295 systemv/cancel.c:370 systemv/cancel.c:284 +#: systemv/cancel.c:348 +#, c-format +msgid "cancel: %s failed: %s\n" +msgstr "cancel: %s 失敗しました: %s\n" + +#: systemv/cupsaddsmb.c:290 systemv/cupsaddsmb.c:311 +#, c-format +msgid "cupsaddsmb: Missing value on line %d!\n" +msgstr "cupsaddsmb: %d 行に値がありません!\n" + +#: systemv/cupsaddsmb.c:301 systemv/cupsaddsmb.c:322 +#, c-format +msgid "cupsaddsmb: Missing double quote on line %d!\n" +msgstr "cupsaddsmb: %d 行に二重引用符がありません!\n" + +#: systemv/cupsaddsmb.c:313 systemv/cupsaddsmb.c:334 +#, c-format +msgid "cupsaddsmb: Bad option + choice on line %d!\n" +msgstr "cupsaddsmb: %d 行に不正なオプションと選択があります!\n" + +#: systemv/cupsaddsmb.c:496 systemv/cupsaddsmb.c:553 +#, c-format +msgid "cupsaddsmb: Unable to connect to server \"%s\" for %s - %s\n" +msgstr "cupsaddsmb: %1$s のサーバ \"%2$s\" に接続できません - %s\n" + +#: systemv/cupsaddsmb.c:509 systemv/cupsaddsmb.c:566 +#, c-format +msgid "cupsaddsmb: No PPD file for printer \"%s\" - skipping!\n" +msgstr "cupsaddsmb: プリンタ \"%s\" の PPD ファイルがありません - スキップします!\n" + +#: systemv/cupsaddsmb.c:548 systemv/cupsaddsmb.c:562 +#, c-format +msgid "cupsaddsmb: get-printer-attributes failed for \"%s\": %s\n" +msgstr "cupsaddsmb: \"%s\" の get-printer-attributes に失敗しました: %s\n" + +#: systemv/cupsaddsmb.c:578 systemv/cupsaddsmb.c:620 +#, c-format +msgid "cupsaddsmb: Unable to convert PPD file for %s - %s\n" +msgstr "cupsaddsmb: %s の PPD ファイルを変換できません - %s\n" + +#: systemv/cupsaddsmb.c:633 systemv/cupsaddsmb.c:677 +#, c-format +msgid "cupsaddsmb: Unable to copy Windows 2000 printer driver files (%d)!\n" +msgstr "cupsaddsmb: Windows 2000 プリンタドライバファイルをコピーできません (%d)!\n" + +#: systemv/cupsaddsmb.c:660 systemv/cupsaddsmb.c:704 +#, c-format +msgid "cupsaddsmb: Unable to copy CUPS printer driver files (%d)!\n" +msgstr "cupsaddsmb: CUPS プリンタドライバファイルをコピーできません (%d)!\n" + +#: systemv/cupsaddsmb.c:697 systemv/cupsaddsmb.c:739 +#, c-format +msgid "cupsaddsmb: Unable to install Windows 2000 printer driver files (%d)!\n" +msgstr "cupsaddsmb: Windows 2000 プリンタドライバファイルをインストールできません (%d)!\n" + +#: systemv/cupsaddsmb.c:727 systemv/cupsaddsmb.c:771 +#, c-format +msgid "cupsaddsmb: Unable to copy Windows 9x printer driver files (%d)!\n" +msgstr "cupsaddsmb: Windows 9x プリンタドライバファイルをコピーできません (%d)!\n" + +#: systemv/cupsaddsmb.c:750 systemv/cupsaddsmb.c:792 +#, c-format +msgid "cupsaddsmb: Unable to install Windows 9x printer driver files (%d)!\n" +msgstr "cupsaddsmb: Windows 9x プリンタドライバファイルをインストールできません (%d)!\n" + +#: systemv/cupsaddsmb.c:771 systemv/cupsaddsmb.c:822 +#, c-format +msgid "cupsaddsmb: Unable to set Windows printer driver (%d)!\n" +msgstr "cupsaddsmb: Windows プリンタドライバを設定できません (%d)!\n" + +#: systemv/cupsaddsmb.c:854 systemv/cupsaddsmb.c:905 +msgid "" +"Usage: cupsaddsmb [options] printer1 ... printerN\n" +" cupsaddsmb [options] -a\n" +"\n" +"Options:\n" +" -H samba-server Use the named SAMBA server\n" +" -U samba-user Authenticate using the named SAMBA user\n" +" -a Export all printers\n" +" -h cups-server Use the named CUPS server\n" +" -v Be verbose (show commands)\n" +msgstr "" +"Usage: cupsaddsmb [オプション] プリンタ1 ... プリンタN\n" +" cupsaddsmb [オプション] -a\n" +"\n" +"Options:\n" +" -H sambaサーバ 指定の SAMBA サーバを使う\n" +" -U sambaユーザ 指定の SAMBA ユーザ名で認証する\n" +" -a すべてのプリンタをエキスポートする\n" +" -h cupsサーバ 指定の CUPS サーバを使う\n" +" -v 冗長にする (コマンドを表示する)\n" + +#: systemv/cupstestppd.c:120 +msgid "cupstestppd: The -q option is incompatible with the -v option.\n" +msgstr "cupstestppd: -q オプションは -v オプションと両立できません。\n" + +#: systemv/cupstestppd.c:136 +msgid "cupstestppd: The -v option is incompatible with the -q option.\n" +msgstr "cupstestppd: -v オプションは -q オプションと両立できません。" + +#: systemv/cupstestppd.c:193 +#, c-format +msgid "" +" FAIL\n" +" **FAIL** Unable to open PPD file - %s\n" +msgstr "" +" 失敗\n" +" **失敗** PPD ファイルを開くことができません - %s\n" + +#: systemv/cupstestppd.c:204 +#, c-format +msgid "" +" FAIL\n" +" **FAIL** Unable to open PPD file - %s on line %d.\n" +msgstr "" +" 失敗\n" +" **失敗** PPD ファイルを開くことができません - %2$d 行の %1$s。\n" + +#: systemv/cupstestppd.c:213 +msgid " REF: Page 42, section 5.2.\n" +msgstr " REF: 42 ページ、セクション 5.2。\n" + +#: systemv/cupstestppd.c:217 +msgid " REF: Page 20, section 3.4.\n" +msgstr " REF: 20 ページ、セクション 3.4。\n" + +#: systemv/cupstestppd.c:222 +msgid " REF: Pages 45-46, section 5.2.\n" +msgstr " REF: 45-46 ページ、セクション 5.2。\n" + +#: systemv/cupstestppd.c:227 +msgid " REF: Pages 42-45, section 5.2.\n" +msgstr " REF: 42-45 ページ、セクション 5.2。\n" + +#: systemv/cupstestppd.c:231 +msgid " REF: Pages 48-49, section 5.2.\n" +msgstr " REF: 48-49 ページ、セクション 5.2。\n" + +#: systemv/cupstestppd.c:235 +msgid " REF: Pages 52-54, section 5.2.\n" +msgstr " REF: 52-54 ページ、セクション 5.2。\n" + +#: systemv/cupstestppd.c:239 +msgid " REF: Page 15, section 3.2.\n" +msgstr " REF: 15 ページ、セクション 3.2。\n" + +#: systemv/cupstestppd.c:243 systemv/cupstestppd.c:247 +msgid " REF: Page 15, section 3.1.\n" +msgstr " REF: 15 ページ、セクション 3.1。\n" + +#: systemv/cupstestppd.c:251 +msgid " REF: Pages 16-17, section 3.2.\n" +msgstr " REF: 16-17 ページ、セクション 3.2。\n" + +#: systemv/cupstestppd.c:255 +msgid " REF: Page 19, section 3.3.\n" +msgstr " REF: 19 ページ、セクション 3.3。\n" + +#: systemv/cupstestppd.c:259 +msgid " REF: Page 27, section 3.5.\n" +msgstr " REF: 27 ページ、セクション 3.5。\n" + +#: systemv/cupstestppd.c:280 +msgid "" +"\n" +" DETAILED CONFORMANCE TEST RESULTS\n" +msgstr "\n 適合テスト結果詳細\n" + +#: systemv/cupstestppd.c:307 +#, c-format +msgid " WARN %s has no corresponding options!\n" +msgstr " 警告 %s は相当するオプションがありません!\n" + +#: systemv/cupstestppd.c:318 systemv/cupstestppd.c:333 +#: systemv/cupstestppd.c:354 systemv/cupstestppd.c:369 +#: systemv/cupstestppd.c:397 systemv/cupstestppd.c:417 +#: systemv/cupstestppd.c:439 systemv/cupstestppd.c:459 +#: systemv/cupstestppd.c:479 systemv/cupstestppd.c:499 +#: systemv/cupstestppd.c:517 systemv/cupstestppd.c:535 +#: systemv/cupstestppd.c:556 systemv/cupstestppd.c:575 +#: systemv/cupstestppd.c:595 systemv/cupstestppd.c:615 +#: systemv/cupstestppd.c:635 systemv/cupstestppd.c:655 +#: systemv/cupstestppd.c:673 systemv/cupstestppd.c:690 +#: systemv/cupstestppd.c:712 systemv/cupstestppd.c:730 +#: systemv/cupstestppd.c:747 systemv/cupstestppd.c:765 +#: systemv/cupstestppd.c:781 systemv/cupstestppd.c:801 +#: systemv/cupstestppd.c:832 systemv/cupstestppd.c:854 +#: systemv/cupstestppd.c:902 systemv/cupstestppd.c:931 +#: systemv/cupstestppd.c:952 +msgid " FAIL\n" +msgstr " 失敗\n" + +#: systemv/cupstestppd.c:321 +msgid "" +" **FAIL** REQUIRED DefaultImageableArea\n" +" REF: Page 102, section 5.15.\n" +msgstr "" +" **失敗** DefaultImageableArea が必須\n" +" REF: 102 ページ、セクション 5.15。\n" + +#: systemv/cupstestppd.c:336 +#, c-format +msgid "" +" **FAIL** BAD DefaultImageableArea %s!\n" +" REF: Page 102, section 5.15.\n" +msgstr "" +" **失敗** %s は不正な DefaultImageableArea です!\n" +" REF: 102 ページ、セクション 5.15。\n" + +#: systemv/cupstestppd.c:346 +msgid " PASS DefaultImageableArea\n" +msgstr " 合格 DefaultImageableArea\n" + +#: systemv/cupstestppd.c:357 +msgid "" +" **FAIL** REQUIRED DefaultPaperDimension\n" +" REF: Page 103, section 5.15.\n" +msgstr "" +" **失敗** DefaultPaperDimension は必須\n" +" REF: 103 ページ、セクション 5.15。\n" + +#: systemv/cupstestppd.c:372 +#, c-format +msgid "" +" **FAIL** BAD DefaultPaperDimension %s!\n" +" REF: Page 103, section 5.15.\n" +msgstr "" +" **失敗** %s は不正な DefaultPaperDimension です!\n" +" REF: 103 ページ、セクション 5.15。\n" + +#: systemv/cupstestppd.c:380 +msgid " PASS DefaultPaperDimension\n" +msgstr " 合格 DefaultPaperDimension\n" + +#: systemv/cupstestppd.c:400 +#, c-format +msgid "" +" **FAIL** BAD Default%s %s\n" +" REF: Page 40, section 4.5.\n" +msgstr "" +" **失敗** %2$s は不正な Default%1$s\n" +" REF: 40 ページ、セクション 4.5。\n" + +#: systemv/cupstestppd.c:409 +#, c-format +msgid " PASS Default%s\n" +msgstr " 合格 Default%s\n" + +#: systemv/cupstestppd.c:420 +#, c-format +msgid "" +" **FAIL** REQUIRED Default%s\n" +" REF: Page 40, section 4.5.\n" +msgstr "" +" **失敗** Default%s は必須\n" +" REF: 40 ページ、セクション 4.5。\n" + +#: systemv/cupstestppd.c:432 +msgid " PASS FileVersion\n" +msgstr " 合格 FileVersion\n" + +#: systemv/cupstestppd.c:442 +msgid "" +" **FAIL** REQUIRED FileVersion\n" +" REF: Page 56, section 5.3.\n" +msgstr "" +" **失敗** FileVersion は必須\n" +" REF: 56 ページ、セクション 5.3。\n" + +#: systemv/cupstestppd.c:452 +msgid " PASS FormatVersion\n" +msgstr " 合格 FormatVersion\n" + +#: systemv/cupstestppd.c:462 +msgid "" +" **FAIL** REQUIRED FormatVersion\n" +" REF: Page 56, section 5.3.\n" +msgstr "" +" **失敗** FormatVersion は必須\n" +" REF: 56 ページ、セクション 5.3。\n" + +#: systemv/cupstestppd.c:472 +msgid " PASS LanguageEncoding\n" +msgstr " 合格 LanguageEncoding\n" + +#: systemv/cupstestppd.c:482 +msgid "" +" **FAIL** REQUIRED LanguageEncoding\n" +" REF: Pages 56-57, section 5.3.\n" +msgstr "" +" **失敗** LanguageEncoding は必須\n" +" REF: 56-57 ページ、セクション 5.3。\n" + +#: systemv/cupstestppd.c:492 +msgid " PASS LanguageVersion\n" +msgstr " 合格 LanguageVersion\n" + +#: systemv/cupstestppd.c:502 +msgid "" +" **FAIL** REQUIRED LanguageVersion\n" +" REF: Pages 57-58, section 5.3.\n" +msgstr "" +" **失敗** LanguageVersion は必須\n" +" REF: 57-58 ページ、セクション 5.3。\n" + +#: systemv/cupstestppd.c:520 +msgid "" +" **FAIL** BAD Manufacturer (should be \"HP\")\n" +" REF: Page 211, table D.1.\n" +msgstr "" +" **失敗** 不正な Manufacturer (\"HP\" でなければなりません)\n" +" REF: 211 ページ、表 D.1。\n" + +#: systemv/cupstestppd.c:528 +msgid " PASS Manufacturer\n" +msgstr " 合格 Manufacturer\n" + +#: systemv/cupstestppd.c:538 +msgid "" +" **FAIL** REQUIRED Manufacturer\n" +" REF: Pages 58-59, section 5.3.\n" +msgstr "" +" **失敗** Manufacturer は必須\n" +" REF: 58-59 ページ、セクション 5.3。\n" + +#: systemv/cupstestppd.c:559 +#, c-format +msgid "" +" **FAIL** BAD ModelName - \"%c\" not allowed in string.\n" +" REF: Pages 59-60, section 5.3.\n" +msgstr "" +" **失敗** 不正な ModelName - 文字列に \"%c\" は許可されていません。\n" +" REF: 59-60 ページ、セクション 5.3。\n" + +#: systemv/cupstestppd.c:568 +msgid " PASS ModelName\n" +msgstr " 合格 ModelName\n" + +#: systemv/cupstestppd.c:578 +msgid "" +" **FAIL** REQUIRED ModelName\n" +" REF: Pages 59-60, section 5.3.\n" +msgstr "" +" **失敗** ModelName は必須\n" +" REF: 59-60 ページ、セクション 5.3。\n" + +#: systemv/cupstestppd.c:588 +msgid " PASS NickName\n" +msgstr " 合格 NickName\n" + +#: systemv/cupstestppd.c:598 +msgid "" +" **FAIL** REQUIRED NickName\n" +" REF: Page 60, section 5.3.\n" +msgstr "" +" **失敗** NickName は必須\n" +" REF: 60 ページ、セクション 5.3。\n" + +#: systemv/cupstestppd.c:608 +msgid " PASS PageSize\n" +msgstr " 合格 PageSize\n" + +#: systemv/cupstestppd.c:618 +msgid "" +" **FAIL** REQUIRED PageSize\n" +" REF: Pages 99-100, section 5.14.\n" +msgstr "" +" **失敗** PageSize は必須\n" +" REF: 99-100 ページ、セクション 5.14。\n" + +#: systemv/cupstestppd.c:628 +msgid " PASS PageRegion\n" +msgstr " 合格 PageRegion\n" + +#: systemv/cupstestppd.c:638 +msgid "" +" **FAIL** REQUIRED PageRegion\n" +" REF: Page 100, section 5.14.\n" +msgstr "" +" **失敗** PageRegion は必須\n" +" REF: 100 ページ、セクション 5.14。\n" + +#: systemv/cupstestppd.c:648 +msgid " PASS PCFileName\n" +msgstr " 合格 PCFileName\n" + +#: systemv/cupstestppd.c:658 +msgid "" +" **FAIL** REQUIRED PCFileName\n" +" REF: Pages 61-62, section 5.3.\n" +msgstr "" +" **失敗** PCFileName は必須\n" +" REF: 61-62 ページ、セクション 5.3。\n" + +#: systemv/cupstestppd.c:676 +msgid "" +" **FAIL** BAD Product - not \"(string)\".\n" +" REF: Page 62, section 5.3.\n" +msgstr "" +" **失敗** 不正な Product - \"(文字列)\" ではありません。\n" +" REF: 62 ページ、セクション 5.3。\n" + +#: systemv/cupstestppd.c:683 +msgid " PASS Product\n" +msgstr " 合格 Product\n" + +#: systemv/cupstestppd.c:693 +msgid "" +" **FAIL** REQUIRED Product\n" +" REF: Page 62, section 5.3.\n" +msgstr "" +" **失敗** Product は必須\n" +" REF: 62 ページ、セクション 5.3。\n" + +#: systemv/cupstestppd.c:715 +msgid "" +" **FAIL** BAD PSVersion - not \"(string) int\".\n" +" REF: Pages 62-64, section 5.3.\n" +msgstr "" +" **失敗** 不正な PSVersion - \"(文字列) 整数\" ではありません。\n" +" REF: 62-64 ページ、セクション 5.3。\n" + +#: systemv/cupstestppd.c:723 +msgid " PASS PSVersion\n" +msgstr " 合格 PSVersion\n" + +#: systemv/cupstestppd.c:733 +msgid "" +" **FAIL** REQUIRED PSVersion\n" +" REF: Pages 62-64, section 5.3.\n" +msgstr "" +" **失敗** PSVersion は必須\n" +" REF: 62-64 ページ、セクション 5.3。\n" + +#: systemv/cupstestppd.c:750 +msgid "" +" **FAIL** BAD ShortNickName - longer than 31 chars.\n" +" REF: Pages 64-65, section 5.3.\n" +msgstr "" +" **失敗** 不正な ShortNickName - 31 文字を超えています。\n" +" REF: 64-65 ページ、セクション 5.3。\n" + +#: systemv/cupstestppd.c:758 +msgid " PASS ShortNickName\n" +msgstr " 合格 ShortNickName\n" + +#: systemv/cupstestppd.c:768 +msgid "" +" **FAIL** REQUIRED ShortNickName\n" +" REF: Page 64-65, section 5.3.\n" +msgstr "" +" **失敗** ShortNickName は必須\n" +" REF: 64-65 ページ、セクション 5.3。\n" + +#: systemv/cupstestppd.c:784 +msgid "" +" **FAIL** BAD JobPatchFile attribute in file\n" +" REF: Page 24, section 3.4.\n" +msgstr "" +" **失敗** ファイルに不正な JobPatchFile 属性があります\n" +" REF: 24 ページ、セクション 3.4。\n" + +#: systemv/cupstestppd.c:804 +msgid "" +" **FAIL** REQUIRED PageSize\n" +" REF: Page 41, section 5.\n" +" REF: Page 99, section 5.14.\n" +msgstr "" +" **失敗** PageSize は必須\n" +" REF: 41 ページ、セクション 5。\n" +" REF: 99 ページ、セクション 5.14。\n" + +#: systemv/cupstestppd.c:835 +#, c-format +msgid "" +" **FAIL** REQUIRED ImageableArea for PageSize %s\n" +" REF: Page 41, section 5.\n" +" REF: Page 102, section 5.15.\n" +msgstr "" +" **失敗** PageSize %s に ImageableArea は必須\n" +" REF: 41 ページ、セクション 5。\n" +" REF: 102 ページ、セクション 5.15。\n" + +#: systemv/cupstestppd.c:857 +#, c-format +msgid "" +" **FAIL** REQUIRED PaperDimension for PageSize %s\n" +" REF: Page 41, section 5.\n" +" REF: Page 103, section 5.15.\n" +msgstr "" +" **失敗** PageSize %s に PaperDimension は必須\n" +" REF: 41 ページ、セクション 5。\n" +" REF: 103 ページ、セクション 5.15。\n" + +#: systemv/cupstestppd.c:905 +#, c-format +msgid "" +" **FAIL** Bad %s choice %s!\n" +" REF: Page 84, section 5.9\n" +msgstr "" +" **失敗** 不正な %s が %s を選んでいます!\n" +" REF: 84 ページ、セクション 5.9\n" + +#: systemv/cupstestppd.c:934 +#, c-format +msgid "" +" **FAIL** REQUIRED %s does not define choice None!\n" +" REF: Page 122, section 5.17\n" +msgstr "" +" **失敗** 必須の %s が選択肢 None を定義していません!\n" +" REF: 122 ページ、セクション 5.17\n" + +#: systemv/cupstestppd.c:955 +#, c-format +msgid "" +" **FAIL** Bad %s choice %s!\n" +" REF: Page 122, section 5.17\n" +msgstr "" +" **FAIL** 不正な %s が %s を選んでいます!\n" +" REF: 122 ページ、セクション 5.17\n" + +#: systemv/cupstestppd.c:967 +msgid " PASS\n" +msgstr " 合格\n" + +#: systemv/cupstestppd.c:976 +#, c-format +msgid "" +" WARN Duplex option keyword %s should be named Duplex or JCLDuplex!\n" +" REF: Page 122, section 5.17\n" +msgstr "" +" 警告 複式オプションキーワード %s は Duplex あるいは JCLDuplex という名前であるべきです!\n" +" REF: 122 ページ、セクション 5.17\n" + +#: systemv/cupstestppd.c:986 +msgid " WARN Default choices conflicting!\n" +msgstr " 警告 デフォルトの選択肢が衝突しています!\n" + +#: systemv/cupstestppd.c:994 +#, c-format +msgid "" +" WARN Obsolete PPD version %.1f!\n" +" REF: Page 42, section 5.2.\n" +msgstr "" +" 警告 PPD バージョン %.1f は時代遅れです!\n" +" REF: 42 ページ、セクション 5.2。\n" + +#: systemv/cupstestppd.c:1002 +msgid "" +" WARN LanguageEncoding required by PPD 4.3 spec.\n" +" REF: Pages 56-57, section 5.3.\n" +msgstr "" +" 警告 LanguageEncoding は PPD 4.3 仕様で必須です。\n" +" REF: 56-57 ページ、セクション 5.3。\n" + +#: systemv/cupstestppd.c:1010 +msgid "" +" WARN Manufacturer required by PPD 4.3 spec.\n" +" REF: Pages 58-59, section 5.3.\n" +msgstr "" +" 警告 Manufacturer は PPD 4.3 仕様で必須です。\n" +" REF: 58-59 ページ、セクション 5.3。\n" + +#: systemv/cupstestppd.c:1023 +msgid "" +" WARN PCFileName longer than 8.3 in violation of PPD spec.\n" +" REF: Pages 61-62, section 5.3.\n" +msgstr "" +" 警告 8.3 文字より長い PCFileName は PPD 仕様違反です。\n" +" REF: 61-62 ページ、セクション 5.3。\n" + +#: systemv/cupstestppd.c:1031 +msgid "" +" WARN ShortNickName required by PPD 4.3 spec.\n" +" REF: Pages 64-65, section 5.3.\n" +msgstr "" +" 警告 ShortNickName は PPD 4.3 仕様で必須です。\n" +" REF: 64-65 ページ、セクション 5.3。\n" + +#: systemv/cupstestppd.c:1048 +msgid "" +" WARN Protocols contains both PJL and BCP; expected TBCP.\n" +" REF: Pages 78-79, section 5.7.\n" +msgstr "" +" 警告 プロトコルが PJL と BCP の両方を含んでいます; TBCP を予測します。\n" +" REF: 78-79 ページ、セクション 5.7。\n" + +#: systemv/cupstestppd.c:1057 +msgid "" +" WARN Protocols contains PJL but JCL attributes are not set.\n" +" REF: Pages 78-79, section 5.7.\n" +msgstr "" +" 警告 プロトコルが PJL を含んでいますが JCL 属性が設定されていません。\n" +" REF: 78-79 ページ、セクション 5.7。\n" + +#: systemv/cupstestppd.c:1085 +#, c-format +msgid "" +" WARN %s shares a common prefix with %s\n" +" REF: Page 15, section 3.2.\n" +msgstr "" +" 警告 %s は %s と一般プリフィクスを共有します。\n" +" REF: 15 ページ、セクション 3.2。\n" + +#: systemv/cupstestppd.c:1097 +#, c-format +msgid " %d ERROR%s FOUND\n" +msgstr " %d 個のエラー%s が見つかりました\n" + +#: systemv/cupstestppd.c:1100 +msgid " NO ERRORS FOUND\n" +msgstr " エラーは見つかりませんでした\n" + +#: systemv/cupstestppd.c:1360 +#, c-format +msgid "" +" WARN \"%s %s\" conflicts with \"%s %s\"\n" +" (constraint=\"%s %s %s %s\")\n" +msgstr "" +" 警告 \"%s %s\" は \"%s %s\" と衝突します\n" +" (constraint=\"%s %s %s %s\")\n" + +#: systemv/cupstestppd.c:1376 +msgid "" +"Usage: cupstestppd [-q] [-r] [-v[v]] filename1.ppd[.gz] [... filenameN.ppd[.gz]]\n" +" program | cupstestppd [-q] [-r] [-v[v]] -\n" +msgstr "" +"使い方: cupstestppd [-q] [-r] [-v[v]] ファイル名1.ppd[.gz] [... ファイル名N.ppd[.gz]]\n" +" プログラム | cupstestppd [-q] [-r] [-v[v]] -\n" + +#: systemv/lpstat.c:144 systemv/lpstat.c:155 +msgid "lpstat: Need \"completed\" or \"not-completed\" after -W!\n" +msgstr "lpstat: -W のあとには \"completed\" または \"not-completed\" が必要です!\n" + +#: systemv/lpstat.c:212 systemv/lpstat.c:213 +msgid "lpstat: The -b option requires a destination argument.\n" +msgstr "lpstat: -b オプションには宛先の引数が必須です。\n" + +#: systemv/lpstat.c:274 systemv/lpinfo.c:143 systemv/lpmove.c:105 +#: systemv/lpmove.c:110 systemv/lpstat.c:275 +msgid "Error: need hostname after '-h' option!\n" +msgstr "エラー:'-h' オプションのあとにはホスト名が必要です!\n" + +#: systemv/lpstat.c:433 systemv/lpstat.c:434 +#, c-format +msgid "lpstat: Unknown option '%c'!\n" +msgstr "lpstat: '%c' は未知のオプションです!\n" + +#: systemv/lpstat.c:504 systemv/lpstat.c:505 +#, c-format +msgid "lpstat: Invalid destination name in list \"%s\"!\n" +msgstr "lpstat: リスト \"%s\" に不正な宛先名があります!\n" + +#: systemv/lpstat.c:519 systemv/lpstat.c:520 +#, c-format +msgid "lpstat: Unknown destination \"%s\"!\n" +msgstr "lpstat: \"%s\" は未知の宛先です!\n" + +#: systemv/lpstat.c:541 systemv/lpstat.c:542 +#, c-format +msgid "lpstat: Unable to connect to server %s on port %d: %s\n" +msgstr "lpstat: ポート %2$d: %3$s にあるサーバ %1$s に接続できません\n" + +#: systemv/lpstat.c:625 systemv/lpstat.c:773 systemv/lpstat.c:1187 +#: systemv/lpstat.c:1379 systemv/lpstat.c:1809 systemv/lpstat.c:2262 +#, c-format +msgid "lpstat: get-printers failed: %s\n" +msgstr "lpstat: get-printers に失敗しました: %s\n" + +#: systemv/lpstat.c:741 +#, c-format +msgid "%s accepting requests since Jan 01 00:00\n" +msgstr "%s は Jan 01 00:00 以来リクエストを受け付けています\n" + +#: systemv/lpstat.c:745 +#, c-format +msgid "" +"%s not accepting requests since Jan 01 00:00 -\n" +"\t%s\n" +msgstr "" +"%s は Jan 01 00:00 以来リクエストを受け付けていません -\n" +"\t%s\n" + +#: systemv/lpstat.c:754 +#, c-format +msgid "%s/%s accepting requests since Jan 01 00:00\n" +msgstr "%s/%s は Jan 01 00:00 以来リクエストを受け付けています\n" + +#: systemv/lpstat.c:758 +#, c-format +msgid "" +"%s/%s not accepting requests since Jan 01 00:00 -\n" +"\t%s\n" +msgstr "" +"%s/%s は Jan 01 00:00 以来リクエストを受け付けていません -\n" +"\t%s\n" + +#: systemv/lpstat.c:861 systemv/lpstat.c:1056 +#, c-format +msgid "lpstat: get-classes failed: %s\n" +msgstr "lpstat: get-classes に失敗しました: %s\n" + +#: systemv/lpstat.c:1033 systemv/lpstat.c:1011 systemv/lpstat.c:1039 +#, c-format +msgid "members of class %s:\n" +msgstr "クラス %s のメンバー:\n" + +#: systemv/lpstat.c:1080 systemv/lpstat.c:1057 systemv/lpstat.c:1085 +#, c-format +msgid "system default destination: %s/%s\n" +msgstr "システムのデフォルトの宛先: %s/%s\n" + +#: systemv/lpstat.c:1083 systemv/lpstat.c:1060 systemv/lpstat.c:1088 +#, c-format +msgid "system default destination: %s\n" +msgstr "システムのデフォルトの宛先: %s\n" + +#: systemv/lpstat.c:1105 systemv/lpstat.c:1082 systemv/lpstat.c:1110 +#, c-format +msgid "lpstat: error - %s environment variable names non-existent destination \"%s\"!\n" +msgstr "lpstat: エラー - 環境変数 %s が存在しない宛先 \"%s\" を指しています!\n" + +#: systemv/lpstat.c:1109 systemv/lpstat.c:1086 systemv/lpstat.c:1114 +msgid "no system default destination\n" +msgstr "システムのデフォルトの宛先がありません\n" + +#: systemv/lpstat.c:1313 systemv/lpstat.c:1281 systemv/lpstat.c:1309 +#, c-format +msgid "Output for printer %s is sent to remote printer %s on %s\n" +msgstr "プリンタ %1$s の出力は、%3$s のリモートプリンタ %2$s に送られます\n" + +#: systemv/lpstat.c:1319 systemv/lpstat.c:1323 systemv/lpstat.c:1287 +#: systemv/lpstat.c:1291 systemv/lpstat.c:1315 +#, c-format +msgid "Output for printer %s is sent to %s\n" +msgstr "プリンタ %s の出力は %s に送られます\n" + +#: systemv/lpstat.c:1331 systemv/lpstat.c:1299 systemv/lpstat.c:1327 +#, c-format +msgid "Output for printer %s/%s is sent to remote printer %s on %s\n" +msgstr "プリンタ %1$s/%2$s の出力は、%4$s のリモートプリンタ %3$s に送られます\n" + +#: systemv/lpstat.c:1337 systemv/lpstat.c:1341 systemv/lpstat.c:1305 +#: systemv/lpstat.c:1309 systemv/lpstat.c:1333 +#, c-format +msgid "Output for printer %s/%s is sent to %s\n" +msgstr "プリンタ %s/%s の出力は %s に送られます\n" + +#: systemv/lpstat.c:1346 systemv/lpstat.c:1349 systemv/lpstat.c:1352 +#: systemv/lpstat.c:1314 systemv/lpstat.c:1317 systemv/lpstat.c:1320 +#: systemv/lpstat.c:1342 systemv/lpstat.c:1345 systemv/lpstat.c:1348 +#, c-format +msgid "device for %s: %s\n" +msgstr "%s のデバイス: %s\n" + +#: systemv/lpstat.c:1359 systemv/lpstat.c:1362 systemv/lpstat.c:1365 +#: systemv/lpstat.c:1327 systemv/lpstat.c:1330 systemv/lpstat.c:1333 +#: systemv/lpstat.c:1355 systemv/lpstat.c:1358 systemv/lpstat.c:1361 +#, c-format +msgid "device for %s/%s: %s\n" +msgstr "%s/%s のデバイス: %s\n" + +#: systemv/lpstat.c:1481 systemv/lpstat.c:1693 +#, c-format +msgid "lpstat: get-jobs failed: %s\n" +msgstr "lpstat: get-jobs に失敗しました: %s\n" + +#: systemv/lpstat.c:1681 systemv/lpstat.c:1635 systemv/lpstat.c:1663 +#, c-format +msgid "\tqueued for %s\n" +msgstr "\t%s にキューしました\n" + +#: systemv/lpstat.c:2037 systemv/lpstat.c:1971 systemv/lpstat.c:1999 +#, c-format +msgid "printer %s is idle. enabled since %s\n" +msgstr "プリンタ %s は待機中です。%s 以来有効です\n" + +#: systemv/lpstat.c:2042 systemv/lpstat.c:1976 systemv/lpstat.c:2004 +#, c-format +msgid "printer %s now printing %s-%d. enabled since %s\n" +msgstr "プリンタ %s は %s-%d を印刷しています。%s 以来有効です\n" + +#: systemv/lpstat.c:2048 systemv/lpstat.c:1982 systemv/lpstat.c:2010 +#, c-format +msgid "printer %s disabled since %s -\n" +msgstr "プリンタ %s は %s 以来無効です -\n" + +#: systemv/lpstat.c:2056 systemv/lpstat.c:2169 systemv/lpstat.c:1990 +#: systemv/lpstat.c:2103 systemv/lpstat.c:2018 systemv/lpstat.c:2131 +msgid "\treason unknown\n" +msgstr "\t未知の理由\n" + +#: systemv/lpstat.c:2063 systemv/lpstat.c:2176 systemv/lpstat.c:1997 +#: systemv/lpstat.c:2110 systemv/lpstat.c:2025 systemv/lpstat.c:2138 +msgid "" +"\tForm mounted:\n" +"\tContent types: any\n" +"\tPrinter types: unknown\n" +msgstr "" +"\t用紙台:\n" +"\t内容形式: すべて\n" +"\tプリンタ形式: 未知\n" + +#: systemv/lpstat.c:2069 systemv/lpstat.c:2182 systemv/lpstat.c:2003 +#: systemv/lpstat.c:2116 systemv/lpstat.c:2031 systemv/lpstat.c:2144 +#, c-format +msgid "\tDescription: %s\n" +msgstr "\t説明: %s\n" + +#: systemv/lpstat.c:2074 systemv/lpstat.c:2187 systemv/lpstat.c:2008 +#: systemv/lpstat.c:2121 systemv/lpstat.c:2036 systemv/lpstat.c:2149 +msgid "\tAlerts:" +msgstr "\t警報:" + +#: systemv/lpstat.c:2083 systemv/lpstat.c:2196 systemv/lpstat.c:2017 +#: systemv/lpstat.c:2130 systemv/lpstat.c:2045 systemv/lpstat.c:2158 +#, c-format +msgid "\tLocation: %s\n" +msgstr "\t場所: %s\n" + +#: systemv/lpstat.c:2088 systemv/lpstat.c:2201 systemv/lpstat.c:2022 +#: systemv/lpstat.c:2135 systemv/lpstat.c:2050 systemv/lpstat.c:2163 +msgid "\tConnection: remote\n" +msgstr "\t接続: リモート\n" + +#: systemv/lpstat.c:2092 systemv/lpstat.c:2205 systemv/lpstat.c:2026 +#: systemv/lpstat.c:2139 systemv/lpstat.c:2054 systemv/lpstat.c:2167 +#, c-format +msgid "\tInterface: %s.ppd\n" +msgstr "\tインターフェイス: %s.ppd\n" + +#: systemv/lpstat.c:2097 systemv/lpstat.c:2210 systemv/lpstat.c:2031 +#: systemv/lpstat.c:2144 systemv/lpstat.c:2059 systemv/lpstat.c:2172 +msgid "\tConnection: direct\n" +msgstr "\t接続: 直結\n" + +#: systemv/lpstat.c:2101 systemv/lpstat.c:2214 systemv/lpstat.c:2035 +#: systemv/lpstat.c:2148 systemv/lpstat.c:2063 systemv/lpstat.c:2176 +#, c-format +msgid "\tInterface: %s/interfaces/%s\n" +msgstr "\tインターフェイス: %s/interfaces/%s\n" + +#: systemv/lpstat.c:2105 systemv/lpstat.c:2218 systemv/lpstat.c:2039 +#: systemv/lpstat.c:2152 systemv/lpstat.c:2067 systemv/lpstat.c:2180 +#, c-format +msgid "\tInterface: %s/ppd/%s.ppd\n" +msgstr "\tインターフェイス: %s/ppd/%s.ppd\n" + +#: systemv/lpstat.c:2107 systemv/lpstat.c:2220 systemv/lpstat.c:2041 +#: systemv/lpstat.c:2154 systemv/lpstat.c:2069 systemv/lpstat.c:2182 +msgid "\tOn fault: no alert\n" +msgstr "\t失敗時: 警告なし\n" + +#: systemv/lpstat.c:2108 systemv/lpstat.c:2221 systemv/lpstat.c:2042 +#: systemv/lpstat.c:2155 systemv/lpstat.c:2070 systemv/lpstat.c:2183 +msgid "\tAfter fault: continue\n" +msgstr "\t失敗後: 継続\n" + +#: systemv/lpstat.c:2112 systemv/lpstat.c:2126 systemv/lpstat.c:2225 +#: systemv/lpstat.c:2239 systemv/lpstat.c:2046 systemv/lpstat.c:2060 +#: systemv/lpstat.c:2159 systemv/lpstat.c:2173 systemv/lpstat.c:2074 +#: systemv/lpstat.c:2088 systemv/lpstat.c:2187 systemv/lpstat.c:2201 +msgid "\tUsers allowed:\n" +msgstr "\t許可されているユーザ:\n" + +#: systemv/lpstat.c:2119 systemv/lpstat.c:2232 systemv/lpstat.c:2053 +#: systemv/lpstat.c:2166 systemv/lpstat.c:2081 systemv/lpstat.c:2194 +msgid "\tUsers denied:\n" +msgstr "\t拒否されているユーザ:\n" + +#: systemv/lpstat.c:2127 systemv/lpstat.c:2240 systemv/lpstat.c:2061 +#: systemv/lpstat.c:2174 systemv/lpstat.c:2089 systemv/lpstat.c:2202 +msgid "\t\t(all)\n" +msgstr "\t\t(すべて)\n" + +#: systemv/lpstat.c:2129 systemv/lpstat.c:2242 systemv/lpstat.c:2063 +#: systemv/lpstat.c:2176 systemv/lpstat.c:2091 systemv/lpstat.c:2204 +msgid "\tForms allowed:\n" +msgstr "\t許可されている用紙:\n" + +#: systemv/lpstat.c:2130 systemv/lpstat.c:2133 systemv/lpstat.c:2243 +#: systemv/lpstat.c:2246 systemv/lpstat.c:2064 systemv/lpstat.c:2067 +#: systemv/lpstat.c:2177 systemv/lpstat.c:2180 systemv/lpstat.c:2092 +#: systemv/lpstat.c:2095 systemv/lpstat.c:2205 systemv/lpstat.c:2208 +msgid "\t\t(none)\n" +msgstr "\t\t(なし)\n" + +#: systemv/lpstat.c:2131 systemv/lpstat.c:2244 systemv/lpstat.c:2065 +#: systemv/lpstat.c:2178 systemv/lpstat.c:2093 systemv/lpstat.c:2206 +msgid "\tBanner required\n" +msgstr "\tバナーが必要\n" + +#: systemv/lpstat.c:2132 systemv/lpstat.c:2245 systemv/lpstat.c:2066 +#: systemv/lpstat.c:2179 systemv/lpstat.c:2094 systemv/lpstat.c:2207 +msgid "\tCharset sets:\n" +msgstr "\t文字セット:\n" + +#: systemv/lpstat.c:2134 systemv/lpstat.c:2247 systemv/lpstat.c:2068 +#: systemv/lpstat.c:2181 systemv/lpstat.c:2096 systemv/lpstat.c:2209 +msgid "\tDefault pitch:\n" +msgstr "\tデフォルトピッチ:\n" + +#: systemv/lpstat.c:2135 systemv/lpstat.c:2248 systemv/lpstat.c:2069 +#: systemv/lpstat.c:2182 systemv/lpstat.c:2097 systemv/lpstat.c:2210 +msgid "\tDefault page size:\n" +msgstr "\tデフォルト用紙サイズ:\n" + +#: systemv/lpstat.c:2136 systemv/lpstat.c:2249 systemv/lpstat.c:2070 +#: systemv/lpstat.c:2183 systemv/lpstat.c:2098 systemv/lpstat.c:2211 +msgid "\tDefault port settings:\n" +msgstr "\tデフォルトポート設定:\n" + +#: systemv/lpstat.c:2146 systemv/lpstat.c:2080 systemv/lpstat.c:2108 +#, c-format +msgid "printer %s/%s is idle. enabled since %s\n" +msgstr "プリンタ %s/%s は待機中です。%s 以来有効です\n" + +#: systemv/lpstat.c:2153 systemv/lpstat.c:2087 systemv/lpstat.c:2115 +#, c-format +msgid "printer %s/%s now printing %s-%d. enabled since %s\n" +msgstr "プリンタ %s/%s は %s-%d を印刷しています。%s 以来有効です\n" + +#: systemv/lpstat.c:2160 systemv/lpstat.c:2094 systemv/lpstat.c:2122 +#, c-format +msgid "printer %s/%s disabled since %s -\n" +msgstr "プリンタ %s/%s は %s 以来無効です -\n" + +#: systemv/lpstat.c:2279 systemv/lpstat.c:2212 systemv/lpstat.c:2240 +msgid "scheduler is running\n" +msgstr "スケジューラは動作中です\n" + +#: systemv/lpstat.c:2281 systemv/lpstat.c:2214 systemv/lpstat.c:2242 +msgid "scheduler is not running\n" +msgstr "スケジューラは動作していません\n" + +#: systemv/lpadmin.c:113 systemv/lpadmin.c:166 systemv/lpadmin.c:237 +#: systemv/lpadmin.c:298 systemv/lpadmin.c:317 systemv/lpadmin.c:383 +#: systemv/lpadmin.c:424 systemv/lpadmin.c:511 systemv/lpadmin.c:557 +#: systemv/lpadmin.c:603 systemv/lpadmin.c:665 systemv/lpadmin.c:711 +#: systemv/lpadmin.c:772 +#, c-format +msgid "lpadmin: Unable to connect to server: %s\n" +msgstr "lpadmin: サーバに接続できません: %s\n" + +#: systemv/lpadmin.c:122 +msgid "" +"lpadmin: Unable to add a printer to the class:\n" +" You must specify a printer name first!\n" +msgstr "" +"lpadmin: クラスにプリンタを追加できません:\n" +" 先にプリンタ名を指定する必要があります!\n" + +#: systemv/lpadmin.c:137 +msgid "lpadmin: Expected class name after '-c' option!\n" +msgstr "lpadmin: '-c' オプションのあとにはクラス名が必要です!\n" + +#: systemv/lpadmin.c:148 systemv/lpadmin.c:460 +msgid "lpadmin: Class name can only contain printable characters!\n" +msgstr "lpadmin: クラス名は表示可能文字のみで構成されなければなりません!\n" + +#: systemv/lpadmin.c:181 +msgid "lpadmin: Expected printer name after '-d' option!\n" +msgstr "lpadmin: '-d' オプションのあとにはプリンタ名が必要です!\n" + +#: systemv/lpadmin.c:192 systemv/lpadmin.c:409 systemv/lpadmin.c:583 +msgid "lpadmin: Printer name can only contain printable characters!\n" +msgstr "lpadmin: プリンタ名は表示可能文字のみで構成されなければなりません!\n" + +#: systemv/lpadmin.c:219 +msgid "lpadmin: Expected hostname after '-h' option!\n" +msgstr "lpadmin: '-h' オプションのあとにはホスト名が必要です!\n" + +#: systemv/lpadmin.c:246 +msgid "" +"lpadmin: Unable to set the interface script:\n" +" You must specify a printer name first!\n" +msgstr "" +"lpadmin: インターフェイススクリプトを設定できません:\n" +" 先にプリンタ名を指定する必要があります!\n" + +#: systemv/lpadmin.c:264 +msgid "lpadmin: Expected interface after '-i' option!\n" +msgstr "lpadmin: '-i' オプションのあとにはインターフェイス名が必要です!\n" + +#: systemv/lpadmin.c:326 +msgid "" +"lpadmin: Unable to set the interface script or PPD file:\n" +" You must specify a printer name first!\n" +msgstr "" +"lpadmin: インターフェイススクリプトまたは PPD ファイルを設定できません:\n" +" 先にプリンタ名を指定する必要があります!\n" + +#: systemv/lpadmin.c:345 +msgid "lpadmin: Expected model after '-m' option!\n" +msgstr "lpadmin: '-m' オプションのあとにはモデル名が必要です!\n" + +#: systemv/lpadmin.c:365 +msgid "lpadmin: Expected name=value after '-o' option!\n" +msgstr "lpadmin: '-o' オプションのあとには 名前=値 が必要です!\n" + +#: systemv/lpadmin.c:398 +msgid "lpadmin: Expected printer after '-p' option!\n" +msgstr "lpadmin: '-p' オプションのあとにはプリンタ名が必要です!\n" + +#: systemv/lpadmin.c:433 +msgid "" +"lpadmin: Unable to remove a printer from the class:\n" +" You must specify a printer name first!\n" +msgstr "" +"lpadmin: クラスからプリンタを削除できません:\n" +" 先にプリンタ名を指定する必要があります!\n" + +#: systemv/lpadmin.c:449 +msgid "lpadmin: Expected class after '-r' option!\n" +msgstr "lpadmin: '-r' オプションのあとにはクラス名が必要です!\n" + +#: systemv/lpadmin.c:479 +msgid "lpadmin: Expected allow/deny:userlist after '-u' option!\n" +msgstr "lpadmin: '-u' オプションのあとには allow/deny:ユーザリスト が必要です!\n" + +#: systemv/lpadmin.c:496 +#, c-format +msgid "lpadmin: Unknown allow/deny option \"%s\"!\n" +msgstr "lpadmin: \"%s\" は未知の allow/deny オプションです!\n" + +#: systemv/lpadmin.c:520 +msgid "" +"lpadmin: Unable to set the device URI:\n" +" You must specify a printer name first!\n" +msgstr "" +"lpadmin: デバイス URI を設定できません:\n" +" 先にプリンタ名を指定する必要があります!\n" + +#: systemv/lpadmin.c:538 +msgid "lpadmin: Expected device URI after '-v' option!\n" +msgstr "lpadmin: '-v' オプションのあとにはデバイス URI が必要です!\n" + +#: systemv/lpadmin.c:572 +msgid "lpadmin: Expected printer or class after '-x' option!\n" +msgstr "lpadmin: '-x' オプションのあとにはプリンタ名またはクラス名が必要です!\n" + +#: systemv/lpadmin.c:612 +msgid "" +"lpadmin: Unable to set the printer description:\n" +" You must specify a printer name first!\n" +msgstr "" +"lpadmin: プリンタ説明を設定できません:\n" +" 先にプリンタ名を指定する必要があります!\n" + +#: systemv/lpadmin.c:631 +msgid "lpadmin: Expected description after '-D' option!\n" +msgstr "lpadmin: '-D' オプションのあとに説明が必要です!\n" + +#: systemv/lpadmin.c:647 +msgid "lpadmin: Expected file type(s) after '-I' option!\n" +msgstr "lpadmin: '-I' オプションのあとにファイル形式が必要です!\n" + +#: systemv/lpadmin.c:653 +msgid "lpadmin: Warning - content type list ignored!\n" +msgstr "lpadmin: 警告 - コンテンツタイプリストは無視されます!\n" + +#: systemv/lpadmin.c:674 +msgid "" +"lpadmin: Unable to set the printer location:\n" +" You must specify a printer name first!\n" +msgstr "" +"lpadmin: プリンタの場所が設定できません:\n" +" 先にプリンタ名を指定する必要があります!\n" + +#: systemv/lpadmin.c:692 +msgid "lpadmin: Expected location after '-L' option!\n" +msgstr "lpadmin: '-L' オプションのあとに場所が必要です!\n" + +#: systemv/lpadmin.c:720 +msgid "" +"lpadmin: Unable to set the PPD file:\n" +" You must specify a printer name first!\n" +msgstr "" +"lpadmin: PPD ファイルを設定できません:\n" +" 先にプリンタ名を指定する必要があります!\n" + +#: systemv/lpadmin.c:738 +msgid "lpadmin: Expected PPD after '-P' option!\n" +msgstr "lpadmin: '-P' オプションのあとに PPD が必要です!\n" + +#: systemv/lpadmin.c:749 +#, c-format +msgid "lpadmin: Unknown option '%c'!\n" +msgstr "lpadmin: '%c' は未知のオプションです!\n" + +#: systemv/lpadmin.c:754 +#, c-format +msgid "lpadmin: Unknown argument '%s'!\n" +msgstr "lpadmin: '%s' は未知の引数です!\n" + +#: systemv/lpadmin.c:781 +msgid "" +"lpadmin: Unable to set the printer options:\n" +" You must specify a printer name first!\n" +msgstr "" +"lpadmin: プリンタオプションを設定できません:\n" +" 先にプリンタ名を指定する必要があります!\n" + +#: systemv/lpadmin.c:793 +msgid "" +"Usage:\n" +"\n" +" lpadmin [-h server] -d destination\n" +" lpadmin [-h server] -x destination\n" +" lpadmin [-h server] -p printer [-c add-class] [-i interface] [-m model]\n" +" [-r remove-class] [-v device] [-D description]\n" +" [-P ppd-file] [-o name=value]\n" +" [-u allow:user,user] [-u deny:user,user]\n" +"\n" +msgstr "" +"Usage:\n" +"\n" +" lpadmin [-h サーバ] -d 宛先\n" +" lpadmin [-h サーバ] -x 宛先\n" +" lpadmin [-h サーバ] -p プリンタ [-c 追加クラス] [-i インターフェイス] [-m モデル]\n" +" [-r 削除クラス] [-v デバイス] [-D 説明]\n" +" [-P PPDファイル] [-o 名前=値]\n" +" [-u allow:ユーザ,ユーザ] [-u deny:ユーザ,ユーザ]\n" +"\n" + +#: systemv/lpadmin.c:1554 systemv/lpadmin.c:1440 +#, c-format +msgid "lpadmin: Unable to create temporary file: %s\n" +msgstr "lpadmin: テンポラリファイルを作成できません: %s\n" + +#: systemv/lpadmin.c:1562 systemv/lpadmin.c:1448 +#, c-format +msgid "lpadmin: Unable to open file \"%s\": %s\n" +msgstr "lpadmin: ファイル \"%s\" を開くことができません: %s\n" + +#: systemv/lpadmin.c:1631 systemv/lpadmin.c:1862 systemv/lpadmin.c:1870 +#, c-format +msgid "lpadmin: add-printer (set model) failed: %s\n" +msgstr "lpadmin: add-printer (モデルの設定) に失敗しました: %s\n" + +#: systemv/lpadmin.c:1701 systemv/lpadmin.c:1708 +#, c-format +msgid "lpadmin: add-printer (set description) failed: %s\n" +msgstr "lpadmin: add-printer (説明の設定) に失敗しました: %s\n" + +#: systemv/lpadmin.c:1784 systemv/lpadmin.c:1792 +#, c-format +msgid "lpadmin: add-printer (set location) failed: %s\n" +msgstr "lpadmin: add-printer (場所の設定) に失敗しました: %s\n" + +#: systemv/lpadmin.c:2021 systemv/lpadmin.c:1814 +#, c-format +msgid "lpadmin: Unable to create temporary file - %s\n" +msgstr "lpadmin: テンポラリファイルを作成できません - %s\n" + +#: systemv/lpadmin.c:2031 systemv/lpadmin.c:1824 +#, c-format +msgid "lpadmin: Unable to open PPD file \"%s\" - %s\n" +msgstr "lpadmin: PPD ファイル \"%s\" を開くことができません - %s\n" + +#: systemv/lpadmin.c:2117 systemv/lpadmin.c:2125 +#, c-format +msgid "lpadmin: %s failed: %s\n" +msgstr "lpadmin: %s 失敗しました: %s\n" + +#: systemv/lp.c:153 +msgid "lp: Expected destination after -d option!\n" +msgstr "lp: -d オプションのあとには宛先が必要です!\n" + +#: systemv/lp.c:184 +msgid "lp: Expected form after -f option!\n" +msgstr "lp: -f オプションのあとには用紙名が必要です!\n" + +#: systemv/lp.c:202 +msgid "lp: Expected hostname after -h option!\n" +msgstr "lp: -h オプションのあとにはホスト名が必要です!\n" + +#: systemv/lp.c:220 +msgid "lp: Expected job ID after -i option!\n" +msgstr "lp: -i オプションのあとにはジョブ ID が必要です!\n" + +#: systemv/lp.c:230 +msgid "lp: Error - cannot print files and alter jobs simultaneously!\n" +msgstr "lp: エラー - ファイルを印刷できず、ジョブを同時に変えることができません!\n" + +#: systemv/lp.c:242 +msgid "lp: Error - bad job ID!\n" +msgstr "lp: エラー - 不正なジョブ ID です!\n" + +#: systemv/lp.c:264 +msgid "lp: Expected copies after -n option!\n" +msgstr "lp: -n オプションのあとにはコピー数が必要です!\n" + +#: systemv/lp.c:285 +msgid "lp: Expected option string after -o option!\n" +msgstr "lp: -o オプションのあとには文字列が必要です!\n" + +#: systemv/lp.c:304 +#, c-format +msgid "lp: Expected priority after -%c option!\n" +msgstr "lp: -%c オプションのあとには優先度が必要です!\n" + +#: systemv/lp.c:326 +msgid "lp: Priority must be between 1 and 100.\n" +msgstr "lp: 優先度は 1 から 100 の間である必要があります。\n" + +#: systemv/lp.c:348 +msgid "lp: Expected title after -t option!\n" +msgstr "lp: -t オプションのあとにはタイトルが必要です!\n" + +#: systemv/lp.c:364 +msgid "lp: Expected mode list after -y option!\n" +msgstr "lp: -y オプションのあとにはモードリストが必要です!\n" + +#: systemv/lp.c:370 +msgid "lp: Warning - mode option ignored!\n" +msgstr "lp: 警告 - モードオプションは無視されます!\n" + +#: systemv/lp.c:383 +msgid "lp: Expected hold name after -H option!\n" +msgstr "lp: -H オプションのあとにはホールド名が必要です!\n" + +#: systemv/lp.c:405 +msgid "lp: Need job ID (-i) before \"-H restart\"!\n" +msgstr "\"-H restart\" の前にはジョブ ID (-i) が必要です!\n" + +#: systemv/lp.c:427 +msgid "lp: Expected page list after -P option!\n" +msgstr "lp: -P オプションのあとにはページリストが必要です!\n" + +#: systemv/lp.c:446 +msgid "lp: Expected character set after -S option!\n" +msgstr "lp: -S オプションのあとには文字セットが必要です!\n" + +#: systemv/lp.c:452 +msgid "lp: Warning - character set option ignored!\n" +msgstr "lp: 警告 - 文字セットオプションは無視されます!\n" + +#: systemv/lp.c:463 +msgid "lp: Expected content type after -T option!\n" +msgstr "lp: -T オプションのあとにはコンテンツタイプが必要です!\n" + +#: systemv/lp.c:469 +msgid "lp: Warning - content type option ignored!\n" +msgstr "lp: 警告 - コンテンツタイプオプションは無視されます!\n" + +#: systemv/lp.c:473 +#, c-format +msgid "lp: Unknown option '%c'!\n" +msgstr "lp: '%c' は未知のオプションです!\n" + +#: systemv/lp.c:482 +msgid "lp: Error - cannot print from stdin if files or a job ID are provided!\n" +msgstr "lp: エラー - ファイルまたはジョブ ID が提供されている場合、標準入力から印刷できません!\n" + +#: systemv/lp.c:497 +#, c-format +msgid "lp: Unable to access \"%s\" - %s\n" +msgstr "lp: \"%s\" にアクセスできません - %s\n" + +#: systemv/lp.c:514 +#, c-format +msgid "lp: Too many files - \"%s\"\n" +msgstr "lp: ファイルが多すぎます - \"%s\"\n" + +#: systemv/lp.c:569 +msgid "lp: error - no default destination available.\n" +msgstr "lp: エラー - 利用可能なデフォルトの宛先がありません。\n" + +#: systemv/lp.c:572 +msgid "lp: error - scheduler not responding!\n" +msgstr "lp: エラー - スケジューラが応答していません!\n" + +#: systemv/lp.c:611 +#, c-format +msgid "lp: unable to create temporary file \"%s\" - %s\n" +msgstr "lp: テンポラリファイル \"%s\" を作成できません - %s\n" + +#: systemv/lp.c:620 +#, c-format +msgid "lp: error - unable to write to temporary file \"%s\" - %s\n" +msgstr "lp: エラー - テンポラリファイル \"%s\" に書き込めません - %s\n" + +#: systemv/lp.c:634 +msgid "lp: stdin is empty, so no job has been sent.\n" +msgstr "lp: 標準入力が空なので、ジョブは送られていません。\n" + +#: systemv/lp.c:650 +#, c-format +msgid "lp: unable to print file: %s\n" +msgstr "lp: ファイルを印刷できません: %s\n" + +#: systemv/lp.c:656 systemv/lp.c:653 systemv/lp.c:713 +#, c-format +msgid "request id is %s-%d (%d file(s))\n" +msgstr "リクエスト ID は %s-%d です (%d 個のファイル)\n" + +#: systemv/lp.c:703 systemv/lp.c:713 +#, c-format +msgid "lp: restart-job failed: %s\n" +msgstr "lp: restart-job に失敗しました: %s\n" + +#: systemv/lp.c:769 systemv/lp.c:779 +#, c-format +msgid "lp: set-job-attributes failed: %s\n" +msgstr "lp: set-job-attributes に失敗しました: %s\n" + +#: systemv/lpinfo.c:98 systemv/lpinfo.c:117 +#, c-format +msgid "lpinfo: Unable to connect to server: %s\n" +msgstr "lpinfo: サーバに接続できません: %s\n" + +#: systemv/lpinfo.c:152 +#, c-format +msgid "lpinfo: Unknown option '%c'!\n" +msgstr "lpinfo: '%c' は未知のオプションです!\n" + +#: systemv/lpinfo.c:158 +#, c-format +msgid "lpinfo: Unknown argument '%s'!\n" +msgstr "lpinfo: '%s' は未知の引数です!\n" + +#: systemv/lpinfo.c:225 systemv/lpinfo.c:310 +#, c-format +msgid "lpinfo: cups-get-devices failed: %s\n" +msgstr "lpinfo: cups-get-devices に失敗しました: %s\n" + +#: systemv/lpinfo.c:293 +#, c-format +msgid "" +"Device: uri = %s\n" +" class = %s\n" +" info = %s\n" +" make-and-model = %s\n" +msgstr "" +"デバイス: uri = %s\n" +" class = %s\n" +" info = %s\n" +" make-and-model = %s\n" + +#: systemv/lpinfo.c:376 systemv/lpinfo.c:454 +#, c-format +msgid "lpinfo: cups-get-ppds failed: %s\n" +msgstr "lpinfo: cups-get-ppds に失敗しました: %s\n" + +#: systemv/lpinfo.c:438 +#, c-format +msgid "" +"Model: name = %s\n" +" natural_language = %s\n" +" make-and-model = %s\n" +msgstr "" +"モデル: name = %s\n" +" natural_language = %s\n" +" make-and-model = %s\n" + +#: systemv/lpmove.c:114 systemv/lpmove.c:119 +#, c-format +msgid "lpmove: Unknown option '%c'!\n" +msgstr "lpmove: '%c' は未知のオプションです!\n" + +#: systemv/lpmove.c:133 systemv/lpmove.c:138 +#, c-format +msgid "lpmove: Unknown argument '%s'!\n" +msgstr "lpmove: '%s' は未知の引数です!\n" + +#: systemv/lpmove.c:140 +msgid "Usage: lpmove job dest\n" +msgstr "使い方: lpmove ジョブ 宛先\n" + +#: systemv/lpmove.c:151 systemv/lpmove.c:156 +#, c-format +msgid "lpmove: Unable to connect to server: %s\n" +msgstr "lpmove: サーバに接続できません: %s\n" + +#: systemv/lpmove.c:225 systemv/lpmove.c:234 +#, c-format +msgid "lpmove: move-job failed: %s\n" +msgstr "lpmove: move-job に失敗しました: %s\n" + +#: systemv/lpoptions.c:109 +msgid "lpoptions: Unknown printer or class!\n" +msgstr "lpoptions: 未知のプリンタまたはクラスです!\n" + +#: systemv/lpoptions.c:159 +msgid "lpoptions: No printers!?!\n" +msgstr "lpoptions: プリンタがありません!?!\n" + +#: systemv/lpoptions.c:207 +#, c-format +msgid "lpoptions: Unable to add printer or instance: %s\n" +msgstr "lpoptions: プリンタまたはインスタンスを追加できません: %s\n" + +#: systemv/lpoptions.c:411 +#, c-format +msgid "lpoptions: Destination %s has no PPD file!\n" +msgstr "lpoptions: 宛先 %s は PPD ファイルを持っていません!\n" + +#: systemv/lpoptions.c:420 +#, c-format +msgid "lpoptions: Unable to open PPD file for %s!\n" +msgstr "lpoptions: %s の PPD ファイルを開くことができません!\n" + +#: systemv/lpoptions.c:444 +msgid "" +"Usage: lpoptions [-h server] [-E] -d printer\n" +" lpoptions [-h server] [-E] [-p printer] -l\n" +" lpoptions [-h server] [-E] -p printer -o option[=value] ...\n" +" lpoptions [-h server] [-E] -x printer\n" +msgstr "" +"使い方: lpoptions [-h サーバ] [-E] -d プリンタ\n" +" lpoptions [-h サーバ] [-E] [-p プリンタ] -l\n" +" lpoptions [-h サーバ] [-E] -p プリンタ -o オプション[=値] ...\n" +" lpoptions [-h サーバ] [-E] -x プリンタ\n" + +#: systemv/lppasswd.c:192 +msgid "lppasswd: Only root can add or delete passwords!\n" +msgstr "lppasswd: root だけがパスワードの追加と削除を行えます!\n" + +#: systemv/lppasswd.c:212 +msgid "Enter old password:" +msgstr "古いパスワードを入力:" + +#: systemv/lppasswd.c:218 systemv/lppasswd.c:236 +#, c-format +msgid "lppasswd: Unable to copy password string: %s\n" +msgstr "lppasswd: パスワード文字列をコピーできません: %s\n" + +#: systemv/lppasswd.c:230 +msgid "Enter password:" +msgstr "パスワードを入力:" + +#: systemv/lppasswd.c:241 +msgid "Enter password again:" +msgstr "パスワードを再度入力:" + +#: systemv/lppasswd.c:247 +msgid "lppasswd: Sorry, passwords don't match!\n" +msgstr "lppasswd: すみませんが、パスワードがマッチしません!\n" + +#: systemv/lppasswd.c:271 +msgid "" +"lppasswd: Sorry, password rejected.\n" +"Your password must be at least 6 characters long, cannot contain\n" +"your username, and must contain at least one letter and number.\n" +msgstr "" +"lppasswd: すみませんが、パスワードは拒否されました。\n" +"パスワードは少なくとも 6 文字以上で、あなたのユーザ名を含んではならず、\n" +"少なくとも 1 つの英字および数値を含んでなければなりません。\n" + +#: systemv/lppasswd.c:321 +msgid "lppasswd: Password file busy!\n" +msgstr "lppasswd: パスワードファイルがビジー状態です!\n" + +#: systemv/lppasswd.c:324 systemv/lppasswd.c:333 systemv/lppasswd.c:351 +#, c-format +msgid "lppasswd: Unable to open password file: %s\n" +msgstr "lppasswd: パスワードファイルを開くことができません: %s\n" + +#: systemv/lppasswd.c:386 systemv/lppasswd.c:399 systemv/lppasswd.c:431 +#, c-format +msgid "lppasswd: Unable to write to password file: %s\n" +msgstr "lppasswd: パスワードファイルに書き込むことができません: %s\n" + +#: systemv/lppasswd.c:411 +#, c-format +msgid "lppasswd: user \"%s\" and group \"%s\" do not exist.\n" +msgstr "lppasswd: ユーザ \"%s\" およびグループ \"%s\" は存在しません。\n" + +#: systemv/lppasswd.c:421 +msgid "lppasswd: Sorry, password doesn't match!\n" +msgstr "lppasswd: すみませんが、パスワードがマッチしません!\n" + +#: systemv/lppasswd.c:454 +msgid "lppasswd: Password file not updated!\n" +msgstr "lppasswd: パスワードファイルは更新されません!\n" + +#: systemv/lppasswd.c:469 +#, c-format +msgid "lppasswd: failed to backup old password file: %s\n" +msgstr "lppasswd: 古いパスワードファイルをバックアップするのに失敗しました: %s\n" + +#: systemv/lppasswd.c:482 +#, c-format +msgid "lppasswd: failed to rename password file: %s\n" +msgstr "lppasswd: パスワードファイルを名前変更するのに失敗しました: %s\n" + +#: systemv/lppasswd.c:501 systemv/lppasswd.c:500 +msgid "Usage: lppasswd [-g groupname]\n" +msgstr "使い方: lppasswd [-g グループ名]\n" + +#: systemv/lppasswd.c:506 systemv/lppasswd.c:503 +msgid "" +"Usage: lppasswd [-g groupname] [username]\n" +" lppasswd [-g groupname] -a [username]\n" +" lppasswd [-g groupname] -x [username]\n" +msgstr "" +"Usage: lppasswd [-g グループ名] [ユーザ名]\n" +" lppasswd [-g グループ名] -a [ユーザ名]\n" +" lppasswd [-g グループ名] -x [ユーザ名]\n" + +#: cgi-bin/admin.c:125 +msgid "Start Printer" +msgstr "プリンタの開始" + +#: cgi-bin/admin.c:127 +msgid "Stop Printer" +msgstr "プリンタの停止" + +#: cgi-bin/admin.c:129 +msgid "Start Class" +msgstr "クラスの開始" + +#: cgi-bin/admin.c:131 +msgid "Stop Class" +msgstr "クラスの停止" + +#: cgi-bin/admin.c:133 +msgid "Accept Jobs" +msgstr "ジョブの受け付け" + +#: cgi-bin/admin.c:135 +msgid "Reject Jobs" +msgstr "ジョブの拒否" + +#: cgi-bin/admin.c:137 +msgid "Purge Jobs" +msgstr "ジョブの削除" + +#: cgi-bin/admin.c:141 +msgid "Set As Default" +msgstr "デフォルトに設定" + +#: cgi-bin/admin.c:168 cgi-bin/admin.c:179 cgi-bin/admin.c:2690 +msgid "Administration" +msgstr "管理" + +#: cgi-bin/admin.c:224 +msgid "Modify Class" +msgstr "クラスの変更" + +#: cgi-bin/admin.c:224 +msgid "Add Class" +msgstr "クラスの追加" + +#: cgi-bin/admin.c:385 +msgid "The class name may only contain up to 127 printable characters and may not contain spaces, slashes (/), or the pound sign (#)." +msgstr "クラス名は 127 文字以内の表示可能文字から成り、空白、スラッシュ (/)、ポンド記号 (#) を含んではなりません。" + +#: cgi-bin/admin.c:444 +msgid "Unable to modify class:" +msgstr "クラスを変更できません:" + +#: cgi-bin/admin.c:445 +msgid "Unable to add class:" +msgstr "クラスを追加できません:" + +#: cgi-bin/admin.c:514 +msgid "Modify Printer" +msgstr "プリンタの変更" + +#: cgi-bin/admin.c:514 +msgid "Add Printer" +msgstr "プリンタの追加" + +#: cgi-bin/admin.c:583 +msgid "The printer name may only contain up to 127 printable characters and may not contain spaces, slashes (/), or the pound sign (#)." +msgstr "プリンタ名は 127 文字以内の表示可能文字から成り、空白、スラッシュ (/)、ポンド記号 (#) を含んではなりません。" + +#: cgi-bin/admin.c:900 +msgid "Unable to get list of printer drivers:" +msgstr "プリンタドライバのリストを取得できません:" + +#: cgi-bin/admin.c:983 +msgid "Unable to modify printer:" +msgstr "プリンタを変更できません:" + +#: cgi-bin/admin.c:984 +msgid "Unable to add printer:" +msgstr "プリンタを追加できません:" + +#: cgi-bin/admin.c:1051 +msgid "Set Printer Options" +msgstr "プリンタオプションの設定" + +#: cgi-bin/admin.c:1062 cgi-bin/admin.c:2330 cgi-bin/admin.c:2391 +#: cgi-bin/admin.c:3112 cgi-bin/admin.c:3213 cgi-bin/admin.c:3449 +msgid "Missing form variable!" +msgstr "フォームの値がありません!" + +#: cgi-bin/admin.c:1076 +msgid "Unable to get PPD file!" +msgstr "PPD ファイルを取得できません!" + +#: cgi-bin/admin.c:1084 +msgid "Unable to open PPD file:" +msgstr "PPD ファイルを取得できません:" + +#: cgi-bin/admin.c:1241 +msgid "Banners" +msgstr "バナー" + +#: cgi-bin/admin.c:1255 +msgid "Starting Banner" +msgstr "開始バナー" + +#: cgi-bin/admin.c:1262 +msgid "Ending Banner" +msgstr "終了バナー" + +#: cgi-bin/admin.c:1280 +msgid "Policies" +msgstr "ポリシー" + +#: cgi-bin/admin.c:1304 +msgid "Error Policy" +msgstr "エラーポリシー" + +#: cgi-bin/admin.c:1331 +msgid "Operation Policy" +msgstr "操作ポリシー" + +#: cgi-bin/admin.c:1352 cgi-bin/admin.c:1372 +msgid "PS Binary Protocol" +msgstr "PS バイナリプロトコル" + +#: cgi-bin/admin.c:1358 +msgid "None" +msgstr "なし" + +#: cgi-bin/admin.c:1490 +msgid "Unable to set options:" +msgstr "オプションを設定できません:" + +#: cgi-bin/admin.c:1591 cgi-bin/admin.c:1607 cgi-bin/admin.c:1620 +#: cgi-bin/admin.c:2099 cgi-bin/admin.c:2106 +msgid "Change Settings" +msgstr "設定の変更" + +#: cgi-bin/admin.c:1592 cgi-bin/admin.c:1608 cgi-bin/admin.c:1621 +msgid "Unable to change server settings:" +msgstr "サーバの設定を変更できません:" + +#: cgi-bin/admin.c:2097 cgi-bin/admin.c:2190 +msgid "Unable to upload cupsd.conf file:" +msgstr "cupsd.conf ファイルをアップロードできません:" + +#: cgi-bin/admin.c:2134 cgi-bin/admin.c:2146 cgi-bin/admin.c:2193 +#: cgi-bin/admin.c:2200 cgi-bin/admin.c:2232 cgi-bin/admin.c:2244 +#: cgi-bin/admin.c:2267 +msgid "Edit Configuration File" +msgstr "設定ファイルの編集" + +#: cgi-bin/admin.c:2135 cgi-bin/admin.c:2147 +msgid "Unable to create temporary file:" +msgstr "テンポラリファイルを作成できません:" + +#: cgi-bin/admin.c:2233 cgi-bin/admin.c:2245 cgi-bin/admin.c:2268 +msgid "Unable to access cupsd.conf file:" +msgstr "cupsd.conf ファイルにアクセスできません:" + +#: cgi-bin/admin.c:2247 +msgid "Unable to edit cupsd.conf files larger than 1MB!" +msgstr "1MB 以上の cupsd.conf ファイルは編集できません!" + +#: cgi-bin/admin.c:2316 +msgid "Delete Class" +msgstr "クラスの削除" + +#: cgi-bin/admin.c:2357 +msgid "Unable to delete class:" +msgstr "クラスを削除できません:" + +#: cgi-bin/admin.c:2377 +msgid "Delete Printer" +msgstr "プリンタの削除" + +#: cgi-bin/admin.c:2418 +msgid "Unable to delete printer:" +msgstr "プリンタを削除できません:" + +#: cgi-bin/admin.c:2447 +msgid "Export Printers to Samba" +msgstr "プリンタを Samba にエキスポート" + +#: cgi-bin/admin.c:2515 +msgid "Unable to fork process!" +msgstr "プロセスをフォークできません!" + +#: cgi-bin/admin.c:2534 +msgid "Unable to connect to server!" +msgstr "サーバに接続できません!" + +#: cgi-bin/admin.c:2538 +msgid "Unable to get printer attributes!" +msgstr "プリンタ属性を取得できません!" + +#: cgi-bin/admin.c:2543 +msgid "Unable to convert PPD file!" +msgstr "PPD ファイルを変換できません!" + +#: cgi-bin/admin.c:2547 +msgid "Unable to copy Windows 2000 printer driver files!" +msgstr "Windows 2000 プリンタドライバファイルをコピーできません!" + +#: cgi-bin/admin.c:2552 +msgid "Unable to install Windows 2000 printer driver files!" +msgstr "Windows 2000 プリンタドライバファイルをインストールできません!" + +#: cgi-bin/admin.c:2557 +msgid "Unable to copy Windows 9x printer driver files!" +msgstr "Windows 9x プリンタドライバファイルをコピーできません!" + +#: cgi-bin/admin.c:2562 +msgid "Unable to install Windows 9x printer driver files!" +msgstr "Windows 9x プリンタドライバファイルをインストールできません!" + +#: cgi-bin/admin.c:2567 +msgid "Unable to set Windows printer driver!" +msgstr "Windows プリンタドライバを設定できません!" + +#: cgi-bin/admin.c:2572 +msgid "No printer drivers found!" +msgstr "プリンタドライバが見つかりません!" + +#: cgi-bin/admin.c:2576 +msgid "Unable to execute cupsaddsmb command!" +msgstr "cupsaddsmb コマンドを実行できません!" + +#: cgi-bin/admin.c:2582 +#, c-format +msgid "cupsaddsmb failed with status %d" +msgstr "cupsaddsmb は状態 %d で失敗しました" + +#: cgi-bin/admin.c:2592 +#, c-format +msgid "cupsaddsmb crashed on signal %d" +msgstr "cupsaddsmb はシグナル %d でクラッシュしました" + +#: cgi-bin/admin.c:2608 +msgid "A Samba username is required to export printer drivers!" +msgstr "プリンタドライバをエキスポートするには、Samba のユーザ名が必要です!" + +#: cgi-bin/admin.c:2612 +msgid "A Samba password is required to export printer drivers!" +msgstr "プリンタドライバをエキスポートするには Samba のパスワードが必要です!" + +#: cgi-bin/admin.c:2704 +msgid "Unable to open cupsd.conf file:" +msgstr "cupsd.conf ファイルを開くことができません:" + +#: cgi-bin/admin.c:3144 cgi-bin/admin.c:3400 +msgid "Unable to change printer:" +msgstr "プリンタを変更できません:" + +#: cgi-bin/admin.c:3214 cgi-bin/admin.c:3259 cgi-bin/admin.c:3399 +#: cgi-bin/admin.c:3417 +msgid "Set Allowed Users" +msgstr "許可するユーザの設定" + +#: cgi-bin/admin.c:3262 +msgid "Unable to get printer attributes:" +msgstr "プリンタ属性を取得できません:" + +#: cgi-bin/admin.c:3450 cgi-bin/admin.c:3488 cgi-bin/admin.c:3506 +msgid "Set Publishing" +msgstr "公開の設定" + +#: cgi-bin/admin.c:3489 +msgid "Unable to change printer-is-shared attribute:" +msgstr "printer-is-shared 属性を変更できません:" + +#: cgi-bin/classes.c:161 cgi-bin/classes.c:208 +msgid "Classes" +msgstr "クラス" + +#: cgi-bin/classes.c:355 +msgid "Unable to get class list:" +msgstr "クラスリストを取得できません:" + +#: cgi-bin/classes.c:454 +msgid "Unable to get class status:" +msgstr "クラスの状態を取得できません:" + +#: cgi-bin/ipp-var.c:366 cgi-bin/ipp-var.c:419 cgi-bin/ipp-var.c:489 +msgid "Move Job" +msgstr "ジョブの移動" + +#: cgi-bin/ipp-var.c:367 +msgid "Unable to find destination for job!" +msgstr "ジョブの宛先が見つかりません!" + +#: cgi-bin/ipp-var.c:421 cgi-bin/ipp-var.c:491 +msgid "Move All Jobs" +msgstr "すべてのジョブの移動" + +#: cgi-bin/ipp-var.c:496 +msgid "Unable to move job" +msgstr "ジョブを移動できません" + +#: cgi-bin/ipp-var.c:498 +msgid "Unable to move jobs" +msgstr "ジョブを移動できません" + +#: cgi-bin/ipp-var.c:603 +msgid "Print Test Page" +msgstr "テストページの印刷" + +#: cgi-bin/ipp-var.c:606 +msgid "Unable to print test page:" +msgstr "テストページを印刷できません:" + +#: cgi-bin/jobs.c:111 cgi-bin/jobs.c:122 cgi-bin/jobs.c:184 +msgid "Jobs" +msgstr "ジョブ" + +#: cgi-bin/jobs.c:187 +msgid "Job operation failed:" +msgstr "ジョブ操作に失敗しました:" + +#: cgi-bin/printers.c:161 cgi-bin/printers.c:208 +msgid "Printers" +msgstr "プリンタ" + +#: cgi-bin/printers.c:362 +msgid "Unable to get printer list:" +msgstr "プリンタリストを取得できません:" + +#: cgi-bin/printers.c:461 +msgid "Unable to get printer status:" +msgstr "プリンタの状態を取得できません:" + +#: cups/ppd.c:319 +msgid "OK" +msgstr "OK" + +#: cups/ppd.c:320 +msgid "Unable to open PPD file" +msgstr "PPD ファイルを開くことができません" + +#: cups/ppd.c:321 +msgid "NULL PPD file pointer" +msgstr "NULL PPD ファイルポインタ" + +#: cups/ppd.c:322 +msgid "Memory allocation error" +msgstr "メモリ割り当てエラー" + +#: cups/ppd.c:323 +msgid "Missing PPD-Adobe-4.x header" +msgstr "PPD-Adobe-4.x ヘッダがありません" + +#: cups/ppd.c:324 +msgid "Missing value string" +msgstr "値文字列がありません" + +#: cups/ppd.c:325 +msgid "Internal error" +msgstr "内部エラー" + +#: cups/ppd.c:326 +msgid "Bad OpenGroup" +msgstr "不正な OpenGroup" + +#: cups/ppd.c:327 +msgid "OpenGroup without a CloseGroup first" +msgstr "最初の CloseGroup なしの OpenGroup" + +#: cups/ppd.c:328 +msgid "Bad OpenUI/JCLOpenUI" +msgstr "不正な OpenUI/JCLOpenUI" + +#: cups/ppd.c:329 +msgid "OpenUI/JCLOpenUI without a CloseUI/JCLCloseUI first" +msgstr "最初の CloseUI/JCLCloseUI なしの OpenUI/JCLOpenUI" + +#: cups/ppd.c:330 +msgid "Bad OrderDependency" +msgstr "不正な OrderDependency" + +#: cups/ppd.c:331 +msgid "Bad UIConstraints" +msgstr "不正な UIConstraints" + +#: cups/ppd.c:332 +msgid "Missing asterisk in column 1" +msgstr "1 列目にアスタリスクがありません" + +#: cups/ppd.c:333 +msgid "Line longer than the maximum allowed (255 characters)" +msgstr "1 行が最大許可値 (255 文字) を超えています" + +#: cups/ppd.c:334 +msgid "Illegal control character" +msgstr "不正な制御文字" + +#: cups/ppd.c:335 +msgid "Illegal main keyword string" +msgstr "不正なメインキーワード文字列" + +#: cups/ppd.c:336 +msgid "Illegal option keyword string" +msgstr "不正なオプションキーワード文字列" + +#: cups/ppd.c:337 +msgid "Illegal translation string" +msgstr "不正な翻訳文字列" + +#: cups/ppd.c:338 +msgid "Illegal whitespace character" +msgstr "不正な空白文字" + +#: cups/ppd.c:339 +msgid "Bad custom parameter" +msgstr "不正なカスタムパラメータ" + +#: cups/ppd.c:344 +msgid "Unknown" +msgstr "未知" + +#: cups/ppd.c:1033 +msgid "Custom" +msgstr "カスタム" + +#: cups/ppd.c:1259 +msgid "JCL" +msgstr "JCL" + +#: scheduler/ipp.c:2184 +msgid "No authentication information provided!" +msgstr "認証情報が提供されていません!" + +#: systemv/cupsaddsmb.c:440 +#, c-format +msgid "Password for %s required to access %s via SAMBA: " +msgstr "SAMBA 経由で %2$s にアクセスするのに必要な %1$s のパスワード: " + +#: systemv/cupsaddsmb.c:451 +#, c-format +msgid "Running command: %s %s -N -U '%s%%%s' -c '%s'\n" +msgstr "コマンドを実行中: %s %s -N -U '%s%%%s' -c '%s'\n" + +#: systemv/cupsaddsmb.c:479 +#, c-format +msgid "cupsaddsmb: Unable to run \"%s\": %s\n" +msgstr "cupsaddsmb: \"%s\" を実行できません: %s\n" + +#: systemv/cupsaddsmb.c:805 +msgid "cupsaddsmb: No Windows printer drivers are installed!\n" +msgstr "cupsaddsmb: Windows プリンタドライバがインストールされていません!\n" + +#: systemv/cupsaddsmb.c:810 +msgid "cupsaddsmb: Warning, no Windows 2000 printer drivers are installed!\n" +msgstr "cupsaddsmb: 警告: Windows 2000 プリンタドライバがインストールされていません!\n" + +#: systemv/lpadmin.c:881 +#, c-format +msgid "lpadmin: Printer %s is already a member of class %s.\n" +msgstr "lpadmin: プリンタ %s はすでにクラス %s のメンバーです。\n" + +#: systemv/lpadmin.c:1115 +msgid "lpadmin: No member names were seen!\n" +msgstr "lpadmin: メンバー名が見当たりません!\n" + +#: systemv/lpadmin.c:1129 +#, c-format +msgid "lpadmin: Printer %s is not a member of class %s.\n" +msgstr "lpadmin: プリンタ %s はクラス %s のメンバーではありません。\n" + +#: systemv/lpinfo.c:278 +#, c-format +msgid "" +"Device: uri = %s\n" +" class = %s\n" +" info = %s\n" +" make-and-model = %s\n" +" device-id = %s\n" +msgstr "" +"デバイス: uri = %s\n" +" class = %s\n" +" info = %s\n" +" make-and-model = %s\n" +" device-id = %s\n" + +#: systemv/lpinfo.c:410 +#, c-format +msgid "" +"Model: name = %s\n" +" natural_language = %s\n" +" make-and-model = %s\n" +" device-id = %s\n" +msgstr "" +"モデル: name = %s\n" +" natural_language = %s\n" +" make-and-model = %s\n" +" device-id = %s\n" + +#: systemv/lpmove.c:145 +msgid "Usage: lpmove job/src dest\n" +msgstr "使い方: lpmove ジョブまたはソース 宛先\n" + +#: systemv/lpstat.c:144 systemv/lpstat.c:156 +msgid "lpstat: Need \"completed\", \"not-completed\", or \"all\" after -W!\n" +msgstr "lpstat: -W のあとには \"completed\"、\"not-completed\"、\"all\" のいずれかが必要です!\n" + +#: systemv/lpstat.c:740 systemv/lpstat.c:768 +#, c-format +msgid "%s accepting requests since %s\n" +msgstr "%s は %s 以来リクエストを受け付けています\n" + +#: systemv/lpstat.c:743 systemv/lpstat.c:771 +#, c-format +msgid "" +"%s not accepting requests since %s -\n" +"\t%s\n" +msgstr "" +"%s は %s 以来リクエストを受け付けていません -\n" +"\t%s\n" + +#: systemv/lpstat.c:752 systemv/lpstat.c:780 +#, c-format +msgid "%s/%s accepting requests since %s\n" +msgstr "%s/%s は %s 以来リクエストを受け付けています\n" + +#: systemv/lpstat.c:755 systemv/lpstat.c:783 +#, c-format +msgid "" +"%s/%s not accepting requests since %s -\n" +"\t%s\n" +msgstr "" +"%s/%s は %s 以来リクエストを受け付けていません -\n" +"\t%s\n" + +#: berkeley/lpc.c:88 berkeley/lpc.c:116 berkeley/lpc.c:152 +msgid "lpc> " +msgstr "lpc> " + +#: berkeley/lpq.c:93 systemv/cancel.c:250 systemv/cancel.c:332 +#, c-format +msgid "%s: Unable to contact server!\n" +msgstr "%s: サーバに連絡できません!\n" + +#: berkeley/lpq.c:138 berkeley/lpr.c:128 berkeley/lprm.c:144 +#: systemv/accept.c:120 systemv/cancel.c:107 systemv/lp.c:150 +#: systemv/lpstat.c:144 +#, c-format +msgid "%s: Error - expected username after '-U' option!\n" +msgstr "%s: エラー - '-U' オプションのあとにはユーザ名が必要です!\n" + +#: berkeley/lpq.c:173 +#, c-format +msgid "%s: Error - unknown destination \"%s/%s\"!\n" +msgstr "%s: エラー - \"%s/%s\" は未知の宛先です!\n" + +#: berkeley/lpq.c:177 systemv/lpstat.c:549 +#, c-format +msgid "%s: Unknown destination \"%s\"!\n" +msgstr "%s: \"%s\" は未知の宛先です!\n" + +#: berkeley/lpq.c:201 berkeley/lprm.c:167 systemv/accept.c:146 +#: systemv/cancel.c:135 systemv/lp.c:227 systemv/lpstat.c:300 +#, c-format +msgid "%s: Error - expected hostname after '-h' option!\n" +msgstr "%s: エラー - '-h' オプションのあとにはホスト名が必要です!\n" + +#: berkeley/lpq.c:253 +#, c-format +msgid "%s: error - %s environment variable names non-existent destination \"%s\"!\n" +msgstr "%s: エラー - 環境変数 %s が存在しない宛先 \"%s\" を指しています!\n" + +#: berkeley/lpq.c:258 +#, c-format +msgid "%s: error - no default destination available.\n" +msgstr "%s: エラー - 利用可能なデフォルトの宛先がありません。\n" + +#: berkeley/lpq.c:647 +msgid "Usage: lpq [-P dest] [-U username] [-h hostname[:port]] [-l] [+interval]\n" +msgstr "使い方: lpq [-P 宛先] [-U ユーザ名] [-h ホスト名[:ポート]] [-l] [+インターバル]\n" + +#: berkeley/lpr.c:148 +#, c-format +msgid "%s: Error - expected hostname after '-H' option!\n" +msgstr "%s: エラー - '-H' オプションのあとにはホスト名が必要です!\n" + +#: berkeley/lpr.c:171 +#, c-format +msgid "%s: Error - expected value after '-%c' option!\n" +msgstr "%s: エラー - '-%c' オプションのあとには値が必要です!\n" + +#: berkeley/lpr.c:185 +#, c-format +msgid "%s: Warning - '%c' format modifier not supported - output may not be correct!\n" +msgstr "%s: 警告 - '%c' 形式修飾子はサポートされていません - 出力は正しくないものになるかもしれません!\n" + +#: berkeley/lpr.c:199 +#, c-format +msgid "%s: error - expected option=value after '-o' option!\n" +msgstr "%s: '-o' オプションのあとには オプション=値 が必要です!\n" + +#: berkeley/lpr.c:250 +#, c-format +msgid "%s: Error - expected destination after '-P' option!\n" +msgstr "%s: エラー - '-P' オプションのあとには宛先が必要です!\n" + +#: berkeley/lpr.c:285 +#, c-format +msgid "%s: Error - expected copy count after '-#' option!\n" +msgstr "%s: エラー - '-#' オプションのあとにはコピー数が必要です!\n" + +#: berkeley/lpr.c:309 +#, c-format +msgid "%s: Error - expected name after '-%c' option!\n" +msgstr "%s: エラー - '-%c' オプションのあとには名前が必要です!\n" + +#: berkeley/lpr.c:320 berkeley/lprm.c:179 systemv/accept.c:176 +#: systemv/cancel.c:169 systemv/lp.c:529 systemv/lpstat.c:461 +#, c-format +msgid "%s: Error - unknown option '%c'!\n" +msgstr "%s: エラー - '%c' は未知のオプションです!\n" + +#: berkeley/lpr.c:333 systemv/lp.c:554 +#, c-format +msgid "%s: Error - unable to access \"%s\" - %s\n" +msgstr "%s: エラー - \"%s\" にアクセスできません - %s\n" + +#: berkeley/lpr.c:351 systemv/lp.c:571 +#, c-format +msgid "%s: Error - too many files - \"%s\"\n" +msgstr "%s: エラー - ファイルが多すぎます - \"%s\"\n" + +#: berkeley/lpr.c:393 systemv/lp.c:621 +#, c-format +msgid "%s: Error - %s environment variable names non-existent destination \"%s\"!\n" +msgstr "%s: エラー - 環境変数 %s が存在しない宛先 \"%s\" を指しています!\n" + +#: berkeley/lpr.c:398 systemv/lp.c:626 +#, c-format +msgid "%s: Error - no default destination available.\n" +msgstr "%s: エラー - 利用可能なデフォルトの宛先がありません。\n" + +#: berkeley/lpr.c:402 systemv/lp.c:630 +#, c-format +msgid "%s: Error - scheduler not responding!\n" +msgstr "%s: エラー - スケジューラが応答していません!\n" + +#: berkeley/lpr.c:452 systemv/lp.c:670 +#, c-format +msgid "%s: Error - unable to create temporary file \"%s\" - %s\n" +msgstr "%s: エラー - テンポラリファイル \"%s\" を作成できません - %s\n" + +#: berkeley/lpr.c:462 systemv/lp.c:679 +#, c-format +msgid "%s: Error - unable to write to temporary file \"%s\" - %s\n" +msgstr "%s: エラー - テンポラリファイル \"%s\" に書き込みできません - %s\n" + +#: berkeley/lpr.c:476 systemv/lp.c:693 +#, c-format +msgid "%s: Error - stdin is empty, so no job has been sent.\n" +msgstr "%s: エラー - 標準入力が空なので、ジョブは送られていません。\n" + +#: berkeley/lprm.c:127 systemv/cancel.c:227 +#, c-format +msgid "%s: Error - unknown destination \"%s\"!\n" +msgstr "%s: エラー - \"%s\" は未知の宛先です!\n" + +#: systemv/accept.c:165 +#, c-format +msgid "%s: Error - expected reason text after '-r' option!\n" +msgstr "%s: -r のあとには理由のテキストが必要です!\n" + +#: systemv/cancel.c:157 +#, c-format +msgid "%s: Error - expected username after '-u' option!\n" +msgstr "%s: エラー - '-u' オプションのあとにはユーザ名が必要です!\n" + +#: systemv/cancel.c:308 systemv/cancel.c:373 +#, c-format +msgid "%s: %s failed: %s\n" +msgstr "%s: %s 失敗しました: %s\n" + +#: systemv/lp.c:173 +#, c-format +msgid "%s: Error - expected destination after '-d' option!\n" +msgstr "%s: '-d' オプションのあとにはプリンタ名が必要です!\n" + +#: systemv/lp.c:206 +#, c-format +msgid "%s: Error - expected form after '-f' option!\n" +msgstr "%s: エラー - '-f' オプションのあとには用紙名が必要です!\n" + +#: systemv/lp.c:213 +#, c-format +msgid "%s: Warning - form option ignored!\n" +msgstr "%s: 警告 - 用紙オプションは無視されます!\n" + +#: systemv/lp.c:247 +#, c-format +msgid "%s: Expected job ID after '-i' option!\n" +msgstr "%s: '-i' オプションのあとにはジョブ ID が必要です!\n" + +#: systemv/lp.c:258 +#, c-format +msgid "%s: Error - cannot print files and alter jobs simultaneously!\n" +msgstr "%s: エラー - ファイルを印刷できず、ジョブを同時に変えることができません!\n" + +#: systemv/lp.c:271 +#, c-format +msgid "%s: Error - bad job ID!\n" +msgstr "%s: エラー - 不正なジョブ ID です!\n" + +#: systemv/lp.c:296 +#, c-format +msgid "%s: Error - expected copies after '-n' option!\n" +msgstr "%s: エラー - '-n' オプションのあとにはコピー数が必要です!\n" + +#: systemv/lp.c:319 +#, c-format +msgid "%s: Error - expected option string after '-o' option!\n" +msgstr "%s: エラー - '-o' オプションのあとには文字列が必要です!\n" + +#: systemv/lp.c:340 +#, c-format +msgid "%s: Error - expected priority after '-%c' option!\n" +msgstr "%s: エラー - '-%c' オプションのあとには優先度が必要です!\n" + +#: systemv/lp.c:363 +#, c-format +msgid "%s: Error - priority must be between 1 and 100.\n" +msgstr "%s: エラー - 優先度は 1 から 100 の間である必要があります。\n" + +#: systemv/lp.c:387 +#, c-format +msgid "%s: Error - expected title after '-t' option!\n" +msgstr "%s: エラー - '-t' オプションのあとにはタイトルが必要です!\n" + +#: systemv/lp.c:405 +#, c-format +msgid "%s: Error - expected mode list after '-y' option!\n" +msgstr "%s: エラー - '-y' オプションのあとにはモードリストが必要です!\n" + +#: systemv/lp.c:413 +#, c-format +msgid "%s: Warning - mode option ignored!\n" +msgstr "%s: 警告 - モードオプションは無視されます!\n" + +#: systemv/lp.c:427 +#, c-format +msgid "%s: Error - expected hold name after '-H' option!\n" +msgstr "%s: エラー - '-H' オプションのあとにはホールド名が必要です!\n" + +#: systemv/lp.c:451 +#, c-format +msgid "%s: Need job ID ('-i jobid') before '-H restart'!\n" +msgstr "%s: '-H restart' の前にはジョブ ID ('-i ジョブID') が必要です!\n" + +#: systemv/lp.c:475 +#, c-format +msgid "%s: Error - expected page list after '-P' option!\n" +msgstr "%s: '-P' オプションのあとにはページリストが必要です!\n" + +#: systemv/lp.c:496 +#, c-format +msgid "%s: Error - expected character set after '-S' option!\n" +msgstr "%s: エラー - '-S' オプションのあとには文字セットが必要です!\n" + +#: systemv/lp.c:504 +#, c-format +msgid "%s: Warning - character set option ignored!\n" +msgstr "%s: 警告 - 文字セットオプションは無視されます!\n" + +#: systemv/lp.c:516 +#, c-format +msgid "%s: Error - expected content type after '-T' option!\n" +msgstr "%s: エラー - '-T' オプションのあとにはコンテンツタイプが必要です!\n" + +#: systemv/lp.c:524 +#, c-format +msgid "%s: Warning - content type option ignored!\n" +msgstr "%s: 警告 - コンテンツタイプオプションは無視されます!\n" + +#: systemv/lp.c:538 +#, c-format +msgid "%s: Error - cannot print from stdin if files or a job ID are provided!\n" +msgstr "%s: エラー - ファイルまたはジョブ ID が提供されている場合、標準入力から印刷できません。 \n" + +#: systemv/lpstat.c:164 systemv/lpstat.c:178 +#, c-format +msgid "%s: Error - need \"completed\", \"not-completed\", or \"all\" after '-W' option!\n" +msgstr "%s: エラー - '-W' オプションのあとには、\"completed\"、\"not-completed\"、\"all\" のいずれかが必要です!\n" + +#: systemv/lpstat.c:237 +#, c-format +msgid "%s: Error - expected destination after '-b' option!\n" +msgstr "%s: エラー - '-b' オプションのあとに宛先を指定する必要があります!\n" + +#: systemv/lpstat.c:534 +#, c-format +msgid "%s: Invalid destination name in list \"%s\"!\n" +msgstr "%s: リスト \"%s\" に無効な宛先名があります!\n" + +#: systemv/lpstat.c:571 +#, c-format +msgid "%s: Unable to connect to server\n" +msgstr "%s: サーバに接続できません\n" + + +# +# End of "$Id$". +# diff --git a/man/Makefile b/man/Makefile index 0e93a080e..fbd5715cb 100644 --- a/man/Makefile +++ b/man/Makefile @@ -1,5 +1,5 @@ # -# "$Id: Makefile 4868 2005-12-05 16:59:11Z mike $" +# "$Id: Makefile 4950 2006-01-19 16:07:57Z mike $" # # Man page makefile for the Common UNIX Printing System (CUPS). # @@ -69,7 +69,14 @@ all: $(MAN1) $(MAN5) $(MAN8) html # clean: + $(RM) mantohtml mantohtml.o $(RM) $(MAN1) $(MAN5) $(MAN8) + for file in $(MAN1); do \ + $(RM) ../doc/help/man-`basename $$file .$(MAN1EXT)`.html; \ + done + for file in $(MAN8); do \ + $(RM) ../doc/help/man-`basename $$file .$(MAN8EXT)`.html; \ + done # @@ -127,5 +134,5 @@ mantohtml: mantohtml.o # -# End of "$Id: Makefile 4868 2005-12-05 16:59:11Z mike $". +# End of "$Id: Makefile 4950 2006-01-19 16:07:57Z mike $". # diff --git a/man/accept.man b/man/accept.man index fa28a6d06..999199dde 100644 --- a/man/accept.man +++ b/man/accept.man @@ -1,9 +1,9 @@ .\" -.\" "$Id: accept.man 4493 2005-02-18 02:09:53Z mike $" +.\" "$Id: accept.man 4948 2006-01-19 03:23:41Z mike $" .\" .\" accept/reject man page for the Common UNIX Printing System (CUPS). .\" -.\" Copyright 1997-2005 by Easy Software Products. +.\" Copyright 1997-2006 by Easy Software Products. .\" .\" These coded instructions, statements, and computer programs are the .\" property of Easy Software Products and are protected by Federal @@ -21,7 +21,7 @@ .\" EMail: cups-info@cups.org .\" WWW: http://www.cups.org .\" -.TH accept 8 "Common UNIX Printing System" "23 January 2001" "Easy Software Products" +.TH accept 8 "Common UNIX Printing System" "18 January 2006" "Easy Software Products" .SH NAME accept/reject \- accept/reject jobs sent to a destination .SH SYNOPSIS @@ -29,8 +29,10 @@ accept/reject \- accept/reject jobs sent to a destination destination(s) .br .B reject -[ -E ] [ -h -.I server +[ -E ] [ -U +.I username +] [ -h +.I hostname[:port] ] [ -r .I reason ] @@ -51,10 +53,10 @@ from the System V versions which require the root user to execute these commands. .SH SEE ALSO cancel(1), disable(8), enable(8), lp(1), lpadmin(8), lpstat(1), -CUPS Software Administrators Manual, -http://localhost:631/documentation.html +.br +http://localhost:631/help .SH COPYRIGHT -Copyright 1993-2005 by Easy Software Products, All Rights Reserved. +Copyright 1993-2006 by Easy Software Products, All Rights Reserved. .\" -.\" End of "$Id: accept.man 4493 2005-02-18 02:09:53Z mike $". +.\" End of "$Id: accept.man 4948 2006-01-19 03:23:41Z mike $". .\" diff --git a/man/lp.man b/man/lp.man index 65562ee5a..f8faf3f82 100644 --- a/man/lp.man +++ b/man/lp.man @@ -1,9 +1,9 @@ .\" -.\" "$Id: lp.man 4493 2005-02-18 02:09:53Z mike $" +.\" "$Id: lp.man 4948 2006-01-19 03:23:41Z mike $" .\" .\" lp/cancel man page for the Common UNIX Printing System (CUPS). .\" -.\" Copyright 1997-2005 by Easy Software Products. +.\" Copyright 1997-2006 by Easy Software Products. .\" .\" These coded instructions, statements, and computer programs are the .\" property of Easy Software Products and are protected by Federal @@ -21,17 +21,19 @@ .\" EMail: cups-info@cups.org .\" WWW: http://www.cups.org .\" -.TH lp 1 "Common UNIX Printing System" "1 May 2003" "Easy Software Products" +.TH lp 1 "Common UNIX Printing System" "18 January 2006" "Easy Software Products" .SH NAME lp \- print files .br cancel \- cancel jobs .SH SYNOPSIS .B lp -[ -E ] [ \-c ] [ \-d +[ -E ] [ -U +.I username +] [ \-c ] [ \-d .I destination ] [ \-h -.I server +.I hostname[:port] ] [ \-m ] [ \-n .I num-copies [ \-o @@ -49,8 +51,10 @@ cancel \- cancel jobs ] .br .B lp -[ -E ] [ \-c ] [ \-h -.I server +[ -E ] [ -U +.I username +] [ \-c ] [ \-h +.I hostname[:port] ] [ \-i .I job-id ] [ \-n @@ -68,8 +72,10 @@ cancel \- cancel jobs ] .br .B cancel -[ \-a ] [ -h -.I server +[ -E ] [ -U +.I username +] [ \-a ] [ -h +.I hostname:port ] [ -u .I username ] [ @@ -172,10 +178,10 @@ jobs via the \fI-u\fR option should password-protect the /jobs location in \fIcupsd.conf(5)\fR. .SH SEE ALSO lpstat(1), -CUPS Software Users Manual, -http://localhost:631/documentation.html +.br +http://localhost:631/help .SH COPYRIGHT -Copyright 1993-2005 by Easy Software Products, All Rights Reserved. +Copyright 1993-2006 by Easy Software Products, All Rights Reserved. .\" -.\" End of "$Id: lp.man 4493 2005-02-18 02:09:53Z mike $". +.\" End of "$Id: lp.man 4948 2006-01-19 03:23:41Z mike $". .\" diff --git a/man/lpmove.man b/man/lpmove.man index 30bd1d52c..2c462c027 100644 --- a/man/lpmove.man +++ b/man/lpmove.man @@ -1,9 +1,9 @@ .\" -.\" "$Id: lpmove.man 4493 2005-02-18 02:09:53Z mike $" +.\" "$Id: lpmove.man 4948 2006-01-19 03:23:41Z mike $" .\" .\" lpmove man page for the Common UNIX Printing System (CUPS). .\" -.\" Copyright 1997-2005 by Easy Software Products. +.\" Copyright 1997-2006 by Easy Software Products. .\" .\" These coded instructions, statements, and computer programs are the .\" property of Easy Software Products and are protected by Federal @@ -21,33 +21,47 @@ .\" EMail: cups-info@cups.org .\" WWW: http://www.cups.org .\" -.TH lpmove 8 "Common UNIX Printing System" "23 January 2001" "Easy Software Products" +.TH lpmove 8 "Common UNIX Printing System" "18 January 2006" "Easy Software Products" .SH NAME -lpmove \- move a job to a new destination +lpmove \- move a job or all jobs to a new destination .SH SYNOPSIS .B lpmove -[ -E ] +[ -E ] [ -h +.I hostname[:port] +] [ -U +.I username +] .I job destination +.br +.B lpmove +[ -E ] [ -h +.I hostname[:port] +] [ -U +.I username +] +.I source destination .SH DESCRIPTION -\fBlpmove\fR moves the specified \fIjob\fR to \fIdestination\fR. \fIjob\fR -can be the job ID number or the old destination and job ID: +\fBlpmove\fR moves the specified \fIjob\fR or all jobs from +\fIsource\fR to \fIdestination\fR. \fIjob\fR can be the job ID +number or the old destination and job ID: .br .nf lpmove 123 newprinter lpmove oldprinter-123 newprinter .fi -.LP +.SH OPTIONS The \fI-E\fR option forces encryption when connecting to the server. -.SH COMPATIBILITY -The System V version of this command also allows moving of all jobs from one -queue to another. This functionality is currently not supported by CUPS. +.LP +The \fI-U\fR option specifies an alternate username. +.LP +The \fI-h\fR option specifies an alternate server. .SH SEE ALSO -cancel(1), lp(1), -CUPS Software Users Manual, -http://localhost:631/documentation.html +cancel(1), lp(1) +.br +http://localhost:631/help .SH COPYRIGHT -Copyright 1993-2005 by Easy Software Products, All Rights Reserved. +Copyright 1993-2006 by Easy Software Products, All Rights Reserved. .\" -.\" End of "$Id: lpmove.man 4493 2005-02-18 02:09:53Z mike $". +.\" End of "$Id: lpmove.man 4948 2006-01-19 03:23:41Z mike $". .\" diff --git a/man/lpq.man b/man/lpq.man index 2c668fed1..812faf4c5 100644 --- a/man/lpq.man +++ b/man/lpq.man @@ -1,9 +1,9 @@ .\" -.\" "$Id: lpq.man 4493 2005-02-18 02:09:53Z mike $" +.\" "$Id: lpq.man 4948 2006-01-19 03:23:41Z mike $" .\" .\" lpq man page for the Common UNIX Printing System (CUPS). .\" -.\" Copyright 1997-2005 by Easy Software Products. +.\" Copyright 1997-2006 by Easy Software Products. .\" .\" These coded instructions, statements, and computer programs are the .\" property of Easy Software Products and are protected by Federal @@ -21,12 +21,16 @@ .\" EMail: cups-info@cups.org .\" WWW: http://www.cups.org .\" -.TH lpq 1 "Common UNIX Printing System" "13 February 2001" "Easy Software Products" +.TH lpq 1 "Common UNIX Printing System" "18 January 2006" "Easy Software Products" .SH NAME lpq \- show printer queue status .SH SYNOPSIS .B lpq -[ -E ] [ \-P +[ -E ] [ -U +.I username +] [ -h +.I hostname[:port] +] [ \-P .I dest ] [ \-a ] [ \-l ] [ .I +interval @@ -48,10 +52,9 @@ The \fI-l\fR option requests a more verbose (long) reporting format. .SH SEE ALSO cancel(1), lp(1), lpr(1), lprm(1), lpstat(1) .br -CUPS Software Users Manual, -http://localhost:631/documentation.html +http://localhost:631/help .SH COPYRIGHT -Copyright 1993-2005 by Easy Software Products, All Rights Reserved. +Copyright 1993-2006 by Easy Software Products, All Rights Reserved. .\" -.\" End of "$Id: lpq.man 4493 2005-02-18 02:09:53Z mike $". +.\" End of "$Id: lpq.man 4948 2006-01-19 03:23:41Z mike $". .\" diff --git a/man/lpr.man b/man/lpr.man index a66cdfe4d..e6c14ea0e 100644 --- a/man/lpr.man +++ b/man/lpr.man @@ -1,9 +1,9 @@ .\" -.\" "$Id: lpr.man 4493 2005-02-18 02:09:53Z mike $" +.\" "$Id: lpr.man 4948 2006-01-19 03:23:41Z mike $" .\" .\" lpr man page for the Common UNIX Printing System (CUPS). .\" -.\" Copyright 1997-2005 by Easy Software Products. +.\" Copyright 1997-2006 by Easy Software Products. .\" .\" These coded instructions, statements, and computer programs are the .\" property of Easy Software Products and are protected by Federal @@ -21,15 +21,17 @@ .\" EMail: cups-info@cups.org .\" WWW: http://www.cups.org .\" -.TH lpr 1 "Common UNIX Printing System" "16 December 2004" "Easy Software Products" +.TH lpr 1 "Common UNIX Printing System" "18 January 2006" "Easy Software Products" .SH NAME lpr \- print files .SH SYNOPSIS .B lpr -[ -E ] [ \-P -.I destination +[ -E ] [ -H +.I hostname[:port] ] [ \-U .I username +] [ \-P +.I destination ] [ \-# .I num-copies [ \-l ] [ \-o @@ -98,10 +100,10 @@ The "c", "d", "f", "g", "i", "m", "n", "t", "v", and "w" options are not supported by CUPS and will produce a warning message if used. .SH SEE ALSO cancel(1), lp(1), lpstat(1), -CUPS Software Users Manual, -http://localhost:631/documentation.html +.br +http://localhost:631/help .SH COPYRIGHT -Copyright 1993-2005 by Easy Software Products, All Rights Reserved. +Copyright 1993-2006 by Easy Software Products, All Rights Reserved. .\" -.\" End of "$Id: lpr.man 4493 2005-02-18 02:09:53Z mike $". +.\" End of "$Id: lpr.man 4948 2006-01-19 03:23:41Z mike $". .\" diff --git a/man/lprm.man b/man/lprm.man index b4b02cfe5..92d05b5e6 100644 --- a/man/lprm.man +++ b/man/lprm.man @@ -1,9 +1,9 @@ .\" -.\" "$Id: lprm.man 4493 2005-02-18 02:09:53Z mike $" +.\" "$Id: lprm.man 4948 2006-01-19 03:23:41Z mike $" .\" .\" lprm man page for the Common UNIX Printing System (CUPS). .\" -.\" Copyright 1997-2005 by Easy Software Products. +.\" Copyright 1997-2006 by Easy Software Products. .\" .\" These coded instructions, statements, and computer programs are the .\" property of Easy Software Products and are protected by Federal @@ -21,12 +21,16 @@ .\" EMail: cups-info@cups.org .\" WWW: http://www.cups.org .\" -.TH lprm 1 "Common UNIX Printing System" "16 December 2004" "Easy Software Products" +.TH lprm 1 "Common UNIX Printing System" "18 January 2006" "Easy Software Products" .SH NAME lprm \- cancel print jobs .SH SYNOPSIS .B lprm -[ -E ] [ -P +[ -E ] [ -U +.I username +] [ -h +.I hostname[:port] +] [ -P .I destination ] [ - ] [ .I job ID(s) @@ -45,10 +49,10 @@ The CUPS version of \fIlprm\fR is compatible with the standard Berkeley \fIlprm\fR command. .SH SEE ALSO cancel(1), lp(1), lpstat(1), lpr(1), -CUPS Software Users Manual, -http://localhost:631/documentation.html +.br +http://localhost:631/help .SH COPYRIGHT -Copyright 1993-2005 by Easy Software Products, All Rights Reserved. +Copyright 1993-2006 by Easy Software Products, All Rights Reserved. .\" -.\" End of "$Id: lprm.man 4493 2005-02-18 02:09:53Z mike $". +.\" End of "$Id: lprm.man 4948 2006-01-19 03:23:41Z mike $". .\" diff --git a/man/lpstat.man b/man/lpstat.man index 6170c012e..45934918e 100644 --- a/man/lpstat.man +++ b/man/lpstat.man @@ -1,9 +1,9 @@ .\" -.\" "$Id: lpstat.man 4493 2005-02-18 02:09:53Z mike $" +.\" "$Id: lpstat.man 4948 2006-01-19 03:23:41Z mike $" .\" .\" lpstat man page for the Common UNIX Printing System (CUPS). .\" -.\" Copyright 1997-2005 by Easy Software Products. +.\" Copyright 1997-2006 by Easy Software Products. .\" .\" These coded instructions, statements, and computer programs are the .\" property of Easy Software Products and are protected by Federal @@ -21,13 +21,15 @@ .\" EMail: cups-info@cups.org .\" WWW: http://www.cups.org .\" -.TH lpstat 1 "Common UNIX Printing System" "3 January 2005" "Easy Software Products" +.TH lpstat 1 "Common UNIX Printing System" "18 January 2006" "Easy Software Products" .SH NAME lpstat \- print cups status information .SH SYNOPSIS .B lpstat -[ -E ] [ -h -.I server +[ -E ] [ -U +.I username +] [ -h +.I hostname[:port] ] [ -l ] [ -W .I which-jobs ] [ -a [ @@ -131,10 +133,10 @@ The "-h" and "-W" options are unique to CUPS. The Solaris "-f", "-P", and "-S" options are silently ignored. .SH SEE ALSO cancel(1), lp(1), -CUPS Software Users Manual, -http://localhost:631/documentation.html +.br +http://localhost:631/help .SH COPYRIGHT -Copyright 1993-2005 by Easy Software Products, All Rights Reserved. +Copyright 1993-2006 by Easy Software Products, All Rights Reserved. .\" -.\" End of "$Id: lpstat.man 4493 2005-02-18 02:09:53Z mike $". +.\" End of "$Id: lpstat.man 4948 2006-01-19 03:23:41Z mike $". .\" diff --git a/notifier/Makefile b/notifier/Makefile index f7c139f44..73c35680f 100644 --- a/notifier/Makefile +++ b/notifier/Makefile @@ -1,5 +1,5 @@ # -# "$Id: Makefile 4834 2005-11-12 21:55:57Z mike $" +# "$Id: Makefile 4950 2006-01-19 16:07:57Z mike $" # # Notifier makefile for the Common UNIX Printing System (CUPS). # @@ -48,7 +48,7 @@ clean: # Install all targets... # -install: +install: all $(INSTALL_DIR) $(SERVERBIN)/notifier for file in $(TARGETS); do \ $(INSTALL_BIN) $$file $(SERVERBIN)/notifier; \ @@ -87,5 +87,5 @@ include Dependencies # -# End of "$Id: Makefile 4834 2005-11-12 21:55:57Z mike $". +# End of "$Id: Makefile 4950 2006-01-19 16:07:57Z mike $". # diff --git a/notifier/mailto.c b/notifier/mailto.c index 33ec692e9..e90a9eeca 100644 --- a/notifier/mailto.c +++ b/notifier/mailto.c @@ -1,5 +1,5 @@ /* - * "$Id: mailto.c 4829 2005-11-12 03:15:10Z mike $" + * "$Id: mailto.c 4961 2006-01-20 22:19:13Z mike $" * * "mailto" notifier for the Common UNIX Printing System (CUPS). * @@ -23,6 +23,11 @@ * * Contents: * + * main() - Main entry for the mailto notifier. + * email_message() - Email a notification message. + * load_configuration() - Load the mailto.conf file. + * pipe_sendmail() - Open a pipe to sendmail... + * print_attributes() - Print the attributes in a request... */ /* @@ -30,8 +35,34 @@ */ #include <cups/cups.h> -#include <cups/language.h> +#include <cups/i18n.h> #include <cups/string.h> +#include <errno.h> +#include <sys/wait.h> +#include <signal.h> + + +/* + * Globals... + */ + +char mailtoCc[1024]; /* Cc email address */ +char mailtoFrom[1024]; /* From email address */ +char mailtoReplyTo[1024]; /* Reply-To email address */ +char mailtoSubject[1024]; /* Subject prefix */ +char mailtoSMTPServer[1024]; /* SMTP server to use */ +char mailtoSendmail[1024]; /* Sendmail program to use */ + + +/* + * Local functions... + */ + +void email_message(const char *to, const char *subject, + const char *text); +int load_configuration(void); +cups_file_t *pipe_sendmail(const char *to); +void print_attributes(ipp_t *ipp, int indent); /* @@ -42,9 +73,726 @@ int /* O - Exit status */ main(int argc, /* I - Number of command-line arguments */ char *argv[]) /* I - Command-line arguments */ { + int i; /* Looping var */ + ipp_t *msg; /* Event message from scheduler */ + ipp_state_t state; /* IPP event state */ + char *subject, /* Subject for notification message */ + *text; /* Text for notification message */ + cups_lang_t *lang; /* Language info */ + char temp[1024]; /* Temporary string */ + int templen; /* Length of temporary string */ +#if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET) + struct sigaction action; /* POSIX sigaction data */ +#endif /* HAVE_SIGACTION && !HAVE_SIGSET */ + + + /* + * Don't buffer stderr... + */ + + setbuf(stderr, NULL); + + /* + * Ignore SIGPIPE signals... + */ + +#ifdef HAVE_SIGSET + sigset(SIGPIPE, SIG_IGN); +#elif defined(HAVE_SIGACTION) + memset(&action, 0, sizeof(action)); + action.sa_handler = SIG_IGN; + sigaction(SIGPIPE, &action, NULL); +#else + signal(SIGPIPE, SIG_IGN); +#endif /* HAVE_SIGSET */ + + /* + * Validate command-line options... + */ + + if (argc != 3) + { + fputs("Usage: mailto mailto:user@domain.com notify-user-data\n", stderr); + return (1); + } + + if (strncmp(argv[1], "mailto:", 7)) + { + fprintf(stderr, "ERROR: Bad recipient \"%s\"!\n", argv[1]); + return (1); + } + + fprintf(stderr, "DEBUG: argc=%d\n", argc); + for (i = 0; i < argc; i ++) + fprintf(stderr, "DEBUG: argv[%d]=\"%s\"\n", i, argv[i]); + + /* + * Load configuration data... + */ + + if ((lang = cupsLangDefault()) == NULL) + return (1); + + if (!load_configuration()) + return (1); + + /* + * Get the reply-to address... + */ + + templen = sizeof(temp); + httpDecode64_2(temp, &templen, argv[2]); + + if (!strncmp(temp, "mailto:", 7)) + strlcpy(mailtoReplyTo, temp + 7, sizeof(mailtoReplyTo)); + else if (temp[0]) + fprintf(stderr, "WARNING: Bad notify-user-data value (%d bytes) ignored!\n", + templen); + + /* + * Loop forever until we run out of events... + */ + + for (;;) + { + /* + * Get the next event... + */ + + msg = ippNew(); + while ((state = ippReadFile(0, msg)) != IPP_DATA) + { + if (state <= IPP_IDLE) + break; + } + + fprintf(stderr, "DEBUG: state=%d\n", state); + + if (state == IPP_ERROR) + fputs("DEBUG: ippReadFile() returned IPP_ERROR!\n", stderr); + + if (state <= IPP_IDLE) + { + /* + * Out of messages, free memory and then exit... + */ + + ippDelete(msg); + return (0); + } + + /* + * Get the subject and text for the message, then email it... + */ + + subject = cupsNotifySubject(lang, msg); + text = cupsNotifyText(lang, msg); + + fprintf(stderr, "DEBUG: subject=\"%s\"\n", subject); + fprintf(stderr, "DEBUG: text=\"%s\"\n", text); + + if (subject && text) + email_message(argv[1] + 7, subject, text); + else + { + fputs("ERROR: Missing attributes in event notification!\n", stderr); + print_attributes(msg, 4); + } + + /* + * Free the memory used for this event... + */ + + if (subject) + free(subject); + + if (text) + free(text); + + ippDelete(msg); + } +} + + +/* + * 'email_message()' - Email a notification message. + */ + +void +email_message(const char *to, /* I - Recipient of message */ + const char *subject, /* I - Subject of message */ + const char *text) /* I - Text of message */ +{ + cups_file_t *fp; /* Pipe/socket to mail server */ + const char *nl; /* Newline to use */ + char response[1024]; /* SMTP response buffer */ + + + /* + * Connect to the mail server... + */ + + if (mailtoSendmail[0]) + { + /* + * Use the sendmail command... + */ + + fp = pipe_sendmail(to); + + if (!fp) + return; + + nl = "\n"; + } + else + { + /* + * Use an SMTP server... + */ + + char hostbuf[1024]; /* Local hostname */ + + + if (strchr(mailtoSMTPServer, ':')) + fp = cupsFileOpen(mailtoSMTPServer, "s"); + else + { + char spec[1024]; /* Host:service spec */ + + + snprintf(spec, sizeof(spec), "%s:smtp", mailtoSMTPServer); + fp = cupsFileOpen(spec, "s"); + } + + if (!fp) + { + fprintf(stderr, "ERROR: Unable to connect to SMTP server \"%s\"!\n", + mailtoSMTPServer); + return; + } + + fprintf(stderr, "DEBUG: Connected to \"%s\"...\n", mailtoSMTPServer); + + cupsFilePrintf(fp, "HELO %s\r\n", httpGetHostname(hostbuf, sizeof(hostbuf))); + fprintf(stderr, "DEBUG: >>> HELO %s\n", hostbuf); + + if (!cupsFileGets(fp, response, sizeof(response)) || atoi(response) >= 500) + goto smtp_error; + fprintf(stderr, "DEBUG: <<< %s\n", response); + + cupsFilePrintf(fp, "MAIL FROM:%s\r\n", mailtoFrom); + fprintf(stderr, "DEBUG: >>> MAIL FROM:%s\n", mailtoFrom); + + if (!cupsFileGets(fp, response, sizeof(response)) || atoi(response) >= 500) + goto smtp_error; + fprintf(stderr, "DEBUG: <<< %s\n", response); + + cupsFilePrintf(fp, "RCPT TO:%s\r\n", to); + fprintf(stderr, "DEBUG: >>> RCPT TO:%s\n", to); + + if (!cupsFileGets(fp, response, sizeof(response)) || atoi(response) >= 500) + goto smtp_error; + fprintf(stderr, "DEBUG: <<< %s\n", response); + + cupsFilePuts(fp, "DATA\r\n"); + fputs("DEBUG: DATA\n", stderr); + + if (!cupsFileGets(fp, response, sizeof(response)) || atoi(response) >= 500) + goto smtp_error; + fprintf(stderr, "DEBUG: <<< %s\n", response); + + nl = "\r\n"; + } + + /* + * Send the message... + */ + + cupsFilePrintf(fp, "Date: %s%s", httpGetDateString(time(NULL)), nl); + cupsFilePrintf(fp, "From: %s%s", mailtoFrom, nl); + cupsFilePrintf(fp, "Subject: %s %s%s", mailtoSubject, subject, nl); + if (mailtoReplyTo[0]) + { + cupsFilePrintf(fp, "Sender: %s%s", mailtoReplyTo, nl); + cupsFilePrintf(fp, "Reply-To: %s%s", mailtoReplyTo, nl); + } + cupsFilePrintf(fp, "To: %s%s", to, nl); + if (mailtoCc[0]) + cupsFilePrintf(fp, "Cc: %s%s", mailtoCc, nl); + cupsFilePrintf(fp, "Content-Type: text/plain%s", nl); + cupsFilePuts(fp, nl); + cupsFilePrintf(fp, "%s%s", text, nl); + cupsFilePrintf(fp, ".\n", nl); + + /* + * Close the connection to the mail server... + */ + + if (mailtoSendmail[0]) + { + /* + * Close the pipe and wait for the sendmail command to finish... + */ + + int status; /* Exit status */ + + + cupsFileClose(fp); + + if (wait(&status)) + status = errno << 8; + + /* + * Report any non-zero status... + */ + + if (status) + { + if (WIFEXITED(status)) + fprintf(stderr, "ERROR: Sendmail command returned status %d!\n", + WEXITSTATUS(status)); + else + fprintf(stderr, "ERROR: Sendmail command crashed on signal %d!\n", + WTERMSIG(status)); + } + } + else + { + /* + * Finish up the SMTP submission and close the connection... + */ + + if (!cupsFileGets(fp, response, sizeof(response)) || atoi(response) >= 500) + goto smtp_error; + fprintf(stderr, "DEBUG: <<< %s\n", response); + + /* + * Process SMTP errors here... + */ + + smtp_error: + + cupsFilePuts(fp, "QUIT\r\n"); + fputs("DEBUG: QUIT\n", stderr); + + if (!cupsFileGets(fp, response, sizeof(response)) || atoi(response) >= 500) + goto smtp_error; + fprintf(stderr, "DEBUG: <<< %s\n", response); + + cupsFileClose(fp); + + fprintf(stderr, "DEBUG: Closed connection to \"%s\"...\n", + mailtoSMTPServer); + } +} + + +/* + * 'load_configuration()' - Load the mailto.conf file. + */ + +int /* I - 1 on success, 0 on failure */ +load_configuration(void) +{ + cups_file_t *fp; /* mailto.conf file */ + const char *server_root, /* CUPS_SERVERROOT environment variable */ + *server_admin; /* SERVER_ADMIN environment variable */ + char line[1024], /* Line from file */ + *value; /* Value for directive */ + int linenum; /* Line number in file */ + + + /* + * Initialize defaults... + */ + + mailtoCc[0] = '\0'; + + if ((server_admin = getenv("SERVER_ADMIN")) != NULL) + strlcpy(mailtoFrom, server_admin, sizeof(mailtoFrom)); + else + snprintf(mailtoFrom, sizeof(mailtoFrom), "root@%s", + httpGetHostname(line, sizeof(line))); + + strlcpy(mailtoSendmail, "/usr/sbin/sendmail", sizeof(mailtoSendmail)); + + mailtoSMTPServer[0] = '\0'; + + mailtoSubject[0] = '\0'; + + /* + * Try loading the config file... + */ + + if ((server_root = getenv("CUPS_SERVERROOT")) == NULL) + server_root = CUPS_SERVERROOT; + + snprintf(line, sizeof(line), "%s/mailto.conf", server_root); + + if ((fp = cupsFileOpen(line, "r")) == NULL) + { + fprintf(stderr, "ERROR: Unable to open \"%s\" - %s\n", line, + strerror(errno)); + return (1); + } + + linenum = 0; + + while (cupsFileGetConf(fp, line, sizeof(line), &value, &linenum)) + { + if (!value) + { + fprintf(stderr, "ERROR: No value found for %s directive on line %d!\n", + line, linenum); + cupsFileClose(fp); + return (0); + } + + if (!strcasecmp(line, "Cc")) + strlcpy(mailtoCc, value, sizeof(mailtoCc)); + else if (!strcasecmp(line, "From")) + strlcpy(mailtoFrom, value, sizeof(mailtoFrom)); + else if (!strcasecmp(line, "Sendmail")) + { + strlcpy(mailtoSendmail, value, sizeof(mailtoSendmail)); + mailtoSMTPServer[0] = '\0'; + } + else if (!strcasecmp(line, "SMTPServer")) + { + mailtoSendmail[0] = '\0'; + strlcpy(mailtoSMTPServer, value, sizeof(mailtoSMTPServer)); + } + else if (!strcasecmp(line, "Subject")) + strlcpy(mailtoSubject, value, sizeof(mailtoSubject)); + else + { + fprintf(stderr, + "ERROR: Unknown configuration directive \"%s\" on line %d!\n", + line, linenum); + } + } + + /* + * Close file and return... + */ + + cupsFileClose(fp); + + return (1); +} + + +/* + * 'pipe_sendmail()' - Open a pipe to sendmail... + */ + +cups_file_t * /* O - CUPS file */ +pipe_sendmail(const char *to) /* I - To: address */ +{ + cups_file_t *fp; /* CUPS file */ + int pid; /* Process ID */ + int pipefds[2]; /* Pipe file descriptors */ + int argc; /* Number of arguments */ + char *argv[100], /* Argument array */ + line[1024], /* Sendmail command + args */ + *lineptr; /* Pointer into line */ + + + /* + * First break the mailtoSendmail string into arguments... + */ + + strlcpy(line, mailtoSendmail, sizeof(line)); + argv[0] = line; + argc = 1; + + for (lineptr = strchr(line, ' '); lineptr; lineptr = strchr(lineptr, ' ')) + { + while (*lineptr == ' ') + *lineptr++ = '\0'; + + if (*lineptr) + { + /* + * Point to the next argument... + */ + + argv[argc ++] = lineptr; + + /* + * Stop if we have too many... + */ + + if (argc >= (int)(sizeof(argv) / sizeof(argv[0]) - 2)) + break; + } + } + + argv[argc ++] = (char *)to; + argv[argc] = NULL; + + /* + * Create the pipe... + */ + + if (pipe(pipefds)) + { + perror("ERROR: Unable to create pipe"); + return (NULL); + } + + /* + * Then run the command... + */ + + if ((pid = fork()) == 0) + { + /* + * Child goes here - redirect stdin to the input side of the pipe, + * redirect stdout to stderr, and exec... + */ + + close(0); + dup(pipefds[0]); + + close(1); + dup(2); + + close(pipefds[0]); + close(pipefds[1]); + + execvp(argv[0], argv); + exit(errno); + } + else if (pid < 0) + { + /* + * Unable to fork - error out... + */ + + perror("ERROR: Unable to fork command"); + + close(pipefds[0]); + close(pipefds[1]); + + return (NULL); + } + + /* + * Create a CUPS file using the output side of the pipe and close the + * input side... + */ + + close(pipefds[0]); + + if ((fp = cupsFileOpenFd(pipefds[1], "w")) == NULL) + { + int status; /* Status of command */ + + + close(pipefds[1]); + wait(&status); + } + + return (fp); +} + + +/* + * 'print_attributes()' - Print the attributes in a request... + */ + +void +print_attributes(ipp_t *ipp, /* I - IPP request */ + int indent) /* I - Indentation */ +{ + int i; /* Looping var */ + ipp_tag_t group; /* Current group */ + ipp_attribute_t *attr; /* Current attribute */ + ipp_value_t *val; /* Current value */ + static const char * const tags[] = /* Value/group tag strings */ + { + "reserved-00", + "operation-attributes-tag", + "job-attributes-tag", + "end-of-attributes-tag", + "printer-attributes-tag", + "unsupported-attributes-tag", + "subscription-attributes-tag", + "event-attributes-tag", + "reserved-08", + "reserved-09", + "reserved-0A", + "reserved-0B", + "reserved-0C", + "reserved-0D", + "reserved-0E", + "reserved-0F", + "unsupported", + "default", + "unknown", + "no-value", + "reserved-14", + "not-settable", + "delete-attr", + "admin-define", + "reserved-18", + "reserved-19", + "reserved-1A", + "reserved-1B", + "reserved-1C", + "reserved-1D", + "reserved-1E", + "reserved-1F", + "reserved-20", + "integer", + "boolean", + "enum", + "reserved-24", + "reserved-25", + "reserved-26", + "reserved-27", + "reserved-28", + "reserved-29", + "reserved-2a", + "reserved-2b", + "reserved-2c", + "reserved-2d", + "reserved-2e", + "reserved-2f", + "octetString", + "dateTime", + "resolution", + "rangeOfInteger", + "begCollection", + "textWithLanguage", + "nameWithLanguage", + "endCollection", + "reserved-38", + "reserved-39", + "reserved-3a", + "reserved-3b", + "reserved-3c", + "reserved-3d", + "reserved-3e", + "reserved-3f", + "reserved-40", + "textWithoutLanguage", + "nameWithoutLanguage", + "reserved-43", + "keyword", + "uri", + "uriScheme", + "charset", + "naturalLanguage", + "mimeMediaType", + "memberName" + }; + + + for (group = IPP_TAG_ZERO, attr = ipp->attrs; attr; attr = attr->next) + { + if ((attr->group_tag == IPP_TAG_ZERO && indent <= 8) || !attr->name) + { + group = IPP_TAG_ZERO; + fputc('\n', stderr); + continue; + } + + if (group != attr->group_tag) + { + group = attr->group_tag; + + fprintf(stderr, "DEBUG: %*s%s:\n\n", indent - 4, "", tags[group]); + } + + fprintf(stderr, "DEBUG: %*s%s (", indent, "", attr->name); + if (attr->num_values > 1) + fputs("1setOf ", stderr); + fprintf(stderr, "%s):", tags[attr->value_tag]); + + switch (attr->value_tag) + { + case IPP_TAG_ENUM : + case IPP_TAG_INTEGER : + for (i = 0, val = attr->values; i < attr->num_values; i ++, val ++) + fprintf(stderr, " %d", val->integer); + fputc('\n', stderr); + break; + + case IPP_TAG_BOOLEAN : + for (i = 0, val = attr->values; i < attr->num_values; i ++, val ++) + fprintf(stderr, " %s", val->boolean ? "true" : "false"); + fputc('\n', stderr); + break; + + case IPP_TAG_RANGE : + for (i = 0, val = attr->values; i < attr->num_values; i ++, val ++) + fprintf(stderr, " %d-%d", val->range.lower, val->range.upper); + fputc('\n', stderr); + break; + + case IPP_TAG_DATE : + { + time_t vtime; /* Date/Time value */ + struct tm *vdate; /* Date info */ + char vstring[256]; /* Formatted time */ + + for (i = 0, val = attr->values; i < attr->num_values; i ++, val ++) + { + vtime = ippDateToTime(val->date); + vdate = localtime(&vtime); + strftime(vstring, sizeof(vstring), "%c", vdate); + fprintf(stderr, " (%s)", vstring); + } + } + fputc('\n', stderr); + break; + + case IPP_TAG_RESOLUTION : + for (i = 0, val = attr->values; i < attr->num_values; i ++, val ++) + fprintf(stderr, " %dx%d%s", val->resolution.xres, + val->resolution.yres, + val->resolution.units == IPP_RES_PER_INCH ? "dpi" : "dpc"); + fputc('\n', stderr); + break; + + case IPP_TAG_STRING : + case IPP_TAG_TEXTLANG : + case IPP_TAG_NAMELANG : + case IPP_TAG_TEXT : + case IPP_TAG_NAME : + case IPP_TAG_KEYWORD : + case IPP_TAG_URI : + case IPP_TAG_URISCHEME : + case IPP_TAG_CHARSET : + case IPP_TAG_LANGUAGE : + case IPP_TAG_MIMETYPE : + for (i = 0, val = attr->values; i < attr->num_values; i ++, val ++) + fprintf(stderr, " \"%s\"", val->string.text); + fputc('\n', stderr); + break; + + case IPP_TAG_BEGIN_COLLECTION : + fputc('\n', stderr); + + for (i = 0, val = attr->values; i < attr->num_values; i ++, val ++) + { + if (i) + fputc('\n', stderr); + print_attributes(val->collection, indent + 4); + } + break; + + default : + fprintf(stderr, "UNKNOWN (%d values)\n", attr->num_values); + break; + } + } } /* - * End of "$Id: mailto.c 4829 2005-11-12 03:15:10Z mike $". + * End of "$Id: mailto.c 4961 2006-01-20 22:19:13Z mike $". */ diff --git a/packaging/cups.list.in b/packaging/cups.list.in index c2d3656bf..5769b964a 100644 --- a/packaging/cups.list.in +++ b/packaging/cups.list.in @@ -1,5 +1,5 @@ # -# "$Id: cups.list.in 4903 2006-01-10 20:02:46Z mike $" +# "$Id: cups.list.in 4972 2006-01-24 14:48:12Z mike $" # # ESP Package Manager (EPM) file list for the Common UNIX Printing # System (CUPS). @@ -281,28 +281,15 @@ l 0755 root sys $LIBDIR/libcupsimage.so libcupsimage.so.2 # Directories d 0755 root sys $LOGDIR - -d 0755 root sys $REQUESTS - -d 0755 root sys $REQUESTS/tmp - +d 0750 root sys $REQUESTS - +d 0750 root sys $REQUESTS/tmp - d 0755 root sys $CACHEDIR - d 0755 root sys $CACHEDIR/ppd - d 0755 root sys $STATEDIR - -d 0755 root sys $STATEDIR/certs - +d 0750 root sys $STATEDIR/certs - # Data files -f 0644 root sys $LOCALEDIR/C/cups_C locale/C/cups_C -f 0644 root sys $LOCALEDIR/be/cups_be locale/be/cups_be -f 0644 root sys $LOCALEDIR/cs/cups_cs locale/cs/cups_cs -f 0644 root sys $LOCALEDIR/de/cups_de locale/de/cups_de -f 0644 root sys $LOCALEDIR/en/cups_en locale/en/cups_en -f 0644 root sys $LOCALEDIR/en_US/cups_en_US locale/en_US/cups_en_US -f 0644 root sys $LOCALEDIR/es/cups_es locale/es/cups_es -f 0644 root sys $LOCALEDIR/fr/cups_fr locale/fr/cups_fr -f 0644 root sys $LOCALEDIR/it/cups_it locale/it/cups_it -f 0644 root sys $LOCALEDIR/ru_RU/cups_ru_RU locale/ru_RU/cups_ru_RU -f 0644 root sys $LOCALEDIR/sv/cups_sv locale/sv/cups_sv -f 0644 root sys $LOCALEDIR/uk/cups_uk locale/uk/cups_uk -f 0644 root sys $LOCALEDIR/uk_UA/cups_uk_UA locale/uk_UA/cups_uk_UA -f 0644 root sys $LOCALEDIR/zh_CN/cups_zh_CN locale/zh_CN/cups_zh_CN +f 0644 root sys $LOCALEDIR/ja/cups_ja locale/cups_ja.po d 0755 root sys $DATADIR - @@ -357,12 +344,11 @@ c 0644 root sys $DATADIR/templates templates/*.tmpl # Config files d 0755 root sys $SERVERROOT - -d 0711 $CUPS_USER $CUPS_GROUP $SERVERROOT/certs - d 0755 root sys $SERVERROOT/interfaces - d 0755 root sys $SERVERROOT/ppd - -c 0600 root sys $SERVERROOT conf/*.conf -c 0600 root sys $SERVERROOT/mime.convs conf/mime.convs -c 0600 root sys $SERVERROOT/mime.types conf/mime.types +c 0640 root sys $SERVERROOT conf/*.conf +c 0640 root sys $SERVERROOT/mime.convs conf/mime.convs +c 0640 root sys $SERVERROOT/mime.types conf/mime.types %if PAMDIR d 0755 root sys $PAMDIR - @@ -446,8 +432,8 @@ f 0644 root sys $AMANDIR/man$MAN8DIR/cups-lpd.$MAN8EXT man/cups-lpd.$MAN8EXT # Startup script %system all -i 0755 root sys cups cups.sh +i 0755 root sys cups init/cups.sh # -# End of "$Id: cups.list.in 4903 2006-01-10 20:02:46Z mike $". +# End of "$Id: cups.list.in 4972 2006-01-24 14:48:12Z mike $". # diff --git a/packaging/cups.spec.in b/packaging/cups.spec.in index 07c65a1f8..21cbb1fe8 100644 --- a/packaging/cups.spec.in +++ b/packaging/cups.spec.in @@ -135,6 +135,7 @@ rm -rf $RPM_BUILD_ROOT %defattr(-,root,root) %dir /etc/cups %config(noreplace) /etc/cups/*.conf +/etc/cups/cupsd.conf.default %dir /etc/cups/interfaces /etc/cups/mime.types /etc/cups/mime.convs diff --git a/pdftops/Dependencies b/pdftops/Dependencies index 4a983f076..1f83e73de 100644 --- a/pdftops/Dependencies +++ b/pdftops/Dependencies @@ -4,7 +4,7 @@ pdftops.o: ../cups/string.h ../config.h parseargs.h gtypes.h GString.h gmem.h pdftops.o: Object.h Array.h Dict.h Stream.h XRef.h Catalog.h Page.h PDFDoc.h pdftops.o: PSOutputDev.h GlobalParams.h CharTypes.h OutputDev.h Error.h pdftops.o: ../cups/cups.h ../cups/ipp.h ../cups/http.h ../cups/md5.h -pdftops.o: ../cups/ppd.h ../cups/file.h +pdftops.o: ../cups/ppd.h ../cups/array.h ../cups/file.h Annot.o: ../config.h gmem.h Object.h gtypes.h GString.h Array.h Dict.h Annot.o: Stream.h Catalog.h Gfx.h Lexer.h Annot.h Array.o: ../config.h gmem.h Object.h gtypes.h GString.h Array.h Dict.h diff --git a/pdftops/Stream.cxx b/pdftops/Stream.cxx index 492e7a9be..2e9dfb7d1 100644 --- a/pdftops/Stream.cxx +++ b/pdftops/Stream.cxx @@ -7,6 +7,7 @@ //======================================================================== #include <config.h> +#include <limits.h> #ifdef USE_GCC_PRAGMAS #pragma implementation @@ -411,6 +412,11 @@ StreamPredictor::StreamPredictor(Stream *strA, int predictorA, predLine = NULL; ok = gFalse; + if (width <= 0 || nComps <= 0 || nBits <= 0 || + nComps >= INT_MAX/nBits || + width >= INT_MAX/nComps/nBits) { + return; + } nVals = width * nComps; totalBits = nVals * nBits; if (totalBits == 0 || @@ -1275,8 +1281,9 @@ CCITTFaxStream::CCITTFaxStream(Stream *strA, int encodingA, GBool endOfLineA, endOfLine = endOfLineA; byteAlign = byteAlignA; columns = columnsA; - if (columns < 1) { - columns = 1; + if (columns < 1 || columns >= (INT_MAX / sizeof(short))) { + error(getPos(), "Bad number of columns: %d in CCITTFaxStream", columns); + exit(1); } rows = rowsA; endOfBlock = endOfBlockA; @@ -2919,10 +2926,7 @@ GBool DCTStream::readBaselineSOF() { width = read16(); numComps = str->getChar(); if (numComps <= 0 || numComps > 4) { - error(getPos(), "Bad number of components in DCT stream", prec); - return gFalse; - } - if (numComps <= 0 || numComps > 4) { + numComps = 0; error(getPos(), "Bad number of components in DCT stream", prec); return gFalse; } @@ -3058,7 +3062,7 @@ GBool DCTStream::readHuffmanTables() { while (length > 0) { index = str->getChar(); --length; - if ((index & 0x0f) >= 4) { + if ((index & 0x0f) >= 4 || (index & ~0x1f)) { error(getPos(), "Bad DCT Huffman table"); return gFalse; } @@ -3184,6 +3188,7 @@ int DCTStream::readMarker() { } while (c != 0xff && c != EOF); do { c = str->getChar(); + if (c == EOF) return EOF; } while (c == 0xff); } while (c == 0x00); return c; diff --git a/ppd/Makefile b/ppd/Makefile index 0c5262574..051fc8c45 100644 --- a/ppd/Makefile +++ b/ppd/Makefile @@ -1,5 +1,5 @@ # -# "$Id: Makefile 4905 2006-01-10 20:07:15Z mike $" +# "$Id: Makefile 4950 2006-01-19 16:07:57Z mike $" # # PPD file makefile for the Common UNIX Printing System (CUPS). # @@ -52,7 +52,7 @@ clean: # Install files... # -install: +install: all $(INSTALL_DIR) $(DATADIR)/model for file in $(FILES); do \ $(INSTALL_DATA) $$file $(DATADIR)/model; \ @@ -60,5 +60,5 @@ install: # -# End of "$Id: Makefile 4905 2006-01-10 20:07:15Z mike $". +# End of "$Id: Makefile 4950 2006-01-19 16:07:57Z mike $". # diff --git a/ppd/zebra.ppd b/ppd/zebra.ppd index 23883e2e9..f70b7c47b 100644 --- a/ppd/zebra.ppd +++ b/ppd/zebra.ppd @@ -1,6 +1,6 @@ *PPD-Adobe: "4.3" *% -*% "$Id: zebra.ppd 4920 2006-01-12 15:12:12Z mike $" +*% "$Id: zebra.ppd 4923 2006-01-13 01:28:40Z mike $" *% *% Sample Zebra label printer driver PPD file for the Common UNIX Printing *% System (CUPS). @@ -47,30 +47,181 @@ *FileSystem: False *Throughput: "8" *LandscapeOrientation: Plus90 -*VariablePaperSize: False *TTRasterizer: Type42 *OpenUI *PageSize/Media Size: PickOne *OrderDependency: 10 AnySetup *PageSize *DefaultPageSize: w288h360 -*PageSize w288h360/Label - 4 x 5": "<</PageSize[288 360]/ImagingBBox null>>setpagedevice" -*PageSize w288h432/Label - 4 x 6": "<</PageSize[288 432]/ImagingBBox null>>setpagedevice" +*PageSize w90h18/Label - 1.25x0.25": "<</PageSize[90 18]/ImagingBBox null>>setpagedevice" +*PageSize w90h162/Label - 1.25x2.25": "<</PageSize[90 162]/ImagingBBox null>>setpagedevice" +*PageSize w108h18/Label - 1.50x0.25": "<</PageSize[108 18]/ImagingBBox null>>setpagedevice" +*PageSize w108h36/Label - 1.50x0.50": "<</PageSize[108 36]/ImagingBBox null>>setpagedevice" +*PageSize w108h72/Label - 1.50x1.00": "<</PageSize[108 72]/ImagingBBox null>>setpagedevice" +*PageSize w108h144/Label - 1.50x2.00": "<</PageSize[108 144]/ImagingBBox null>>setpagedevice" +*PageSize w144h26/Label - 2.00x0.37": "<</PageSize[144 26]/ImagingBBox null>>setpagedevice" +*PageSize w144h36/Label - 2.00x0.50": "<</PageSize[144 36]/ImagingBBox null>>setpagedevice" +*PageSize w144h72/Label - 2.00x1.00": "<</PageSize[144 72]/ImagingBBox null>>setpagedevice" +*PageSize w144h90/Label - 2.00x1.25": "<</PageSize[144 90]/ImagingBBox null>>setpagedevice" +*PageSize w144h288/Label - 2.00x4.00": "<</PageSize[144 288]/ImagingBBox null>>setpagedevice" +*PageSize w144h396/Label - 2.00x5.50": "<</PageSize[144 396]/ImagingBBox null>>setpagedevice" +*PageSize w162h36/Label - 2.25x0.50": "<</PageSize[162 36]/ImagingBBox null>>setpagedevice" +*PageSize w162h90/Label - 2.25x1.25": "<</PageSize[162 90]/ImagingBBox null>>setpagedevice" +*PageSize w162h288/Label - 2.25x4.00": "<</PageSize[162 288]/ImagingBBox null>>setpagedevice" +*PageSize w162h396/Label - 2.25x5.50": "<</PageSize[162 396]/ImagingBBox null>>setpagedevice" +*PageSize w171h396/Label - 2.38x5.50": "<</PageSize[171 396]/ImagingBBox null>>setpagedevice" +*PageSize w180h72/Label - 2.50x1.00": "<</PageSize[180 72]/ImagingBBox null>>setpagedevice" +*PageSize w180h144/Label - 2.50x2.00": "<</PageSize[180 144]/ImagingBBox null>>setpagedevice" +*PageSize w198h90/Label - 2.75x1.25": "<</PageSize[198 90]/ImagingBBox null>>setpagedevice" +*PageSize w216h72/Label - 3.00x1.00": "<</PageSize[216 72]/ImagingBBox null>>setpagedevice" +*PageSize w216h90/Label - 3.00x1.25": "<</PageSize[216 90]/ImagingBBox null>>setpagedevice" +*PageSize w216h144/Label - 3.00x2.00": "<</PageSize[216 144]/ImagingBBox null>>setpagedevice" +*PageSize w216h216/Label - 3.00x3.00": "<</PageSize[216 216]/ImagingBBox null>>setpagedevice" +*PageSize w216h360/Label - 3.00x5.00": "<</PageSize[216 360]/ImagingBBox null>>setpagedevice" +*PageSize w234h144/Label - 3.25x2.00": "<</PageSize[234 144]/ImagingBBox null>>setpagedevice" +*PageSize w234h360/Label - 3.25x5.00": "<</PageSize[234 360]/ImagingBBox null>>setpagedevice" +*PageSize w234h396/Label - 3.25x5.50": "<</PageSize[234 396]/ImagingBBox null>>setpagedevice" +*PageSize w234h419/Label - 3.25x5.83": "<</PageSize[234 419]/ImagingBBox null>>setpagedevice" +*PageSize w234h563/Label - 3.25x7.83": "<</PageSize[234 563]/ImagingBBox null>>setpagedevice" +*PageSize w252h72/Label - 3.50x1.00": "<</PageSize[252 72]/ImagingBBox null>>setpagedevice" +*PageSize w288h72/Label - 4.00x1.00": "<</PageSize[288 72]/ImagingBBox null>>setpagedevice" +*PageSize w288h144/Label - 4.00x2.00": "<</PageSize[288 144]/ImagingBBox null>>setpagedevice" +*PageSize w288h180/Label - 4.00x2.50": "<</PageSize[288 180]/ImagingBBox null>>setpagedevice" +*PageSize w288h216/Label - 4.00x3.00": "<</PageSize[288 216]/ImagingBBox null>>setpagedevice" +*PageSize w288h288/Label - 4.00x4.00": "<</PageSize[288 288]/ImagingBBox null>>setpagedevice" +*PageSize w288h360/Label - 4.00x5.00": "<</PageSize[288 360]/ImagingBBox null>>setpagedevice" +*PageSize w288h432/Label - 4.00x6.00": "<</PageSize[288 432]/ImagingBBox null>>setpagedevice" +*PageSize w288h468/Label - 4.00x6.50": "<</PageSize[288 468]/ImagingBBox null>>setpagedevice" +*PageSize w288h936/Label - 4.00x13.00": "<</PageSize[288 936]/ImagingBBox null>>setpagedevice" *CloseUI: *PageSize *OpenUI *PageRegion: PickOne *OrderDependency: 10 AnySetup *PageRegion *DefaultPageRegion: w288h360 -*PageRegion w288h360/Label - 4 x 5": "<</PageSize[288 360]/ImagingBBox null>>setpagedevice" -*PageRegion w288h432/Label - 4 x 6": "<</PageSize[288 432]/ImagingBBox null>>setpagedevice" +*PageRegion w90h18/Label - 1.25x0.25": "<</PageSize[90 18]/ImagingBBox null>>setpagedevice" +*PageRegion w90h162/Label - 1.25x2.25": "<</PageSize[90 162]/ImagingBBox null>>setpagedevice" +*PageRegion w108h18/Label - 1.50x0.25": "<</PageSize[108 18]/ImagingBBox null>>setpagedevice" +*PageRegion w108h36/Label - 1.50x0.50": "<</PageSize[108 36]/ImagingBBox null>>setpagedevice" +*PageRegion w108h72/Label - 1.50x1.00": "<</PageSize[108 72]/ImagingBBox null>>setpagedevice" +*PageRegion w108h144/Label - 1.50x2.00": "<</PageSize[108 144]/ImagingBBox null>>setpagedevice" +*PageRegion w144h26/Label - 2.00x0.37": "<</PageSize[144 26]/ImagingBBox null>>setpagedevice" +*PageRegion w144h36/Label - 2.00x0.50": "<</PageSize[144 36]/ImagingBBox null>>setpagedevice" +*PageRegion w144h72/Label - 2.00x1.00": "<</PageSize[144 72]/ImagingBBox null>>setpagedevice" +*PageRegion w144h90/Label - 2.00x1.25": "<</PageSize[144 90]/ImagingBBox null>>setpagedevice" +*PageRegion w144h288/Label - 2.00x4.00": "<</PageSize[144 288]/ImagingBBox null>>setpagedevice" +*PageRegion w144h396/Label - 2.00x5.50": "<</PageSize[144 396]/ImagingBBox null>>setpagedevice" +*PageRegion w162h36/Label - 2.25x0.50": "<</PageSize[162 36]/ImagingBBox null>>setpagedevice" +*PageRegion w162h90/Label - 2.25x1.25": "<</PageSize[162 90]/ImagingBBox null>>setpagedevice" +*PageRegion w162h288/Label - 2.25x4.00": "<</PageSize[162 288]/ImagingBBox null>>setpagedevice" +*PageRegion w162h396/Label - 2.25x5.50": "<</PageSize[162 396]/ImagingBBox null>>setpagedevice" +*PageRegion w171h396/Label - 2.38x5.50": "<</PageSize[171 396]/ImagingBBox null>>setpagedevice" +*PageRegion w180h72/Label - 2.50x1.00": "<</PageSize[180 72]/ImagingBBox null>>setpagedevice" +*PageRegion w180h144/Label - 2.50x2.00": "<</PageSize[180 144]/ImagingBBox null>>setpagedevice" +*PageRegion w198h90/Label - 2.75x1.25": "<</PageSize[198 90]/ImagingBBox null>>setpagedevice" +*PageRegion w216h72/Label - 3.00x1.00": "<</PageSize[216 72]/ImagingBBox null>>setpagedevice" +*PageRegion w216h90/Label - 3.00x1.25": "<</PageSize[216 90]/ImagingBBox null>>setpagedevice" +*PageRegion w216h144/Label - 3.00x2.00": "<</PageSize[216 144]/ImagingBBox null>>setpagedevice" +*PageRegion w216h216/Label - 3.00x3.00": "<</PageSize[216 216]/ImagingBBox null>>setpagedevice" +*PageRegion w216h360/Label - 3.00x5.00": "<</PageSize[216 360]/ImagingBBox null>>setpagedevice" +*PageRegion w234h144/Label - 3.25x2.00": "<</PageSize[234 144]/ImagingBBox null>>setpagedevice" +*PageRegion w234h360/Label - 3.25x5.00": "<</PageSize[234 360]/ImagingBBox null>>setpagedevice" +*PageRegion w234h396/Label - 3.25x5.50": "<</PageSize[234 396]/ImagingBBox null>>setpagedevice" +*PageRegion w234h419/Label - 3.25x5.83": "<</PageSize[234 419]/ImagingBBox null>>setpagedevice" +*PageRegion w234h563/Label - 3.25x7.83": "<</PageSize[234 563]/ImagingBBox null>>setpagedevice" +*PageRegion w252h72/Label - 3.50x1.00": "<</PageSize[252 72]/ImagingBBox null>>setpagedevice" +*PageRegion w288h72/Label - 4.00x1.00": "<</PageSize[288 72]/ImagingBBox null>>setpagedevice" +*PageRegion w288h144/Label - 4.00x2.00": "<</PageSize[288 144]/ImagingBBox null>>setpagedevice" +*PageRegion w288h180/Label - 4.00x2.50": "<</PageSize[288 180]/ImagingBBox null>>setpagedevice" +*PageRegion w288h216/Label - 4.00x3.00": "<</PageSize[288 216]/ImagingBBox null>>setpagedevice" +*PageRegion w288h288/Label - 4.00x4.00": "<</PageSize[288 288]/ImagingBBox null>>setpagedevice" +*PageRegion w288h360/Label - 4.00x5.00": "<</PageSize[288 360]/ImagingBBox null>>setpagedevice" +*PageRegion w288h432/Label - 4.00x6.00": "<</PageSize[288 432]/ImagingBBox null>>setpagedevice" +*PageRegion w288h468/Label - 4.00x6.50": "<</PageSize[288 468]/ImagingBBox null>>setpagedevice" +*PageRegion w288h936/Label - 4.00x13.00": "<</PageSize[288 936]/ImagingBBox null>>setpagedevice" *CloseUI: *PageRegion *DefaultImageableArea: w288h360 -*ImageableArea w288h360/Label - 4 x 5": "0 0 288 360" -*ImageableArea w288h432/Label - 4 x 6": "0 0 288 432" +*ImageableArea w90h18/Label - 1.25x0.25": "0 0 90 18" +*ImageableArea w90h162/Label - 1.25x2.25": "0 0 90 162" +*ImageableArea w108h18/Label - 1.50x0.25": "0 0 108 18" +*ImageableArea w108h36/Label - 1.50x0.50": "0 0 108 36" +*ImageableArea w108h72/Label - 1.50x1.00": "0 0 108 72" +*ImageableArea w108h144/Label - 1.50x2.00": "0 0 108 144" +*ImageableArea w144h26/Label - 2.00x0.37": "0 0 144 26" +*ImageableArea w144h36/Label - 2.00x0.50": "0 0 144 36" +*ImageableArea w144h72/Label - 2.00x1.00": "0 0 144 72" +*ImageableArea w144h90/Label - 2.00x1.25": "0 0 144 90" +*ImageableArea w144h288/Label - 2.00x4.00": "0 0 144 288" +*ImageableArea w144h396/Label - 2.00x5.50": "0 0 144 396" +*ImageableArea w162h36/Label - 2.25x0.50": "0 0 162 36" +*ImageableArea w162h90/Label - 2.25x1.25": "0 0 162 90" +*ImageableArea w162h288/Label - 2.25x4.00": "0 0 162 288" +*ImageableArea w162h396/Label - 2.25x5.50": "0 0 162 396" +*ImageableArea w171h396/Label - 2.38x5.50": "0 0 171 396" +*ImageableArea w180h72/Label - 2.50x1.00": "0 0 180 72" +*ImageableArea w180h144/Label - 2.50x2.00": "0 0 180 144" +*ImageableArea w198h90/Label - 2.75x1.25": "0 0 198 90" +*ImageableArea w216h72/Label - 3.00x1.00": "0 0 216 72" +*ImageableArea w216h90/Label - 3.00x1.25": "0 0 216 90" +*ImageableArea w216h144/Label - 3.00x2.00": "0 0 216 144" +*ImageableArea w216h216/Label - 3.00x3.00": "0 0 216 216" +*ImageableArea w216h360/Label - 3.00x5.00": "0 0 216 360" +*ImageableArea w234h144/Label - 3.25x2.00": "0 0 234 144" +*ImageableArea w234h360/Label - 3.25x5.00": "0 0 234 360" +*ImageableArea w234h396/Label - 3.25x5.50": "0 0 234 396" +*ImageableArea w234h419/Label - 3.25x5.83": "0 0 234 419" +*ImageableArea w234h563/Label - 3.25x7.83": "0 0 234 563" +*ImageableArea w252h72/Label - 3.50x1.00": "0 0 252 72" +*ImageableArea w288h72/Label - 4.00x1.00": "0 0 288 72" +*ImageableArea w288h144/Label - 4.00x2.00": "0 0 288 144" +*ImageableArea w288h180/Label - 4.00x2.50": "0 0 288 180" +*ImageableArea w288h216/Label - 4.00x3.00": "0 0 288 216" +*ImageableArea w288h288/Label - 4.00x4.00": "0 0 288 288" +*ImageableArea w288h360/Label - 4.00x5.00": "0 0 288 360" +*ImageableArea w288h432/Label - 4.00x6.00": "0 0 288 432" +*ImageableArea w288h468/Label - 4.00x6.50": "0 0 288 468" +*ImageableArea w288h936/Label - 4.00x13.00": "0 0 288 936" *DefaultPaperDimension: w288h360 -*PaperDimension w288h360/Label - 4 x 5": "288 360" -*PaperDimension w288h432/Label - 4 x 6": "288 432" +*PaperDimension w90h18/Label - 1.25x0.25": "90 18" +*PaperDimension w90h162/Label - 1.25x2.25": "90 162" +*PaperDimension w108h18/Label - 1.50x0.25": "108 18" +*PaperDimension w108h36/Label - 1.50x0.50": "108 36" +*PaperDimension w108h72/Label - 1.50x1.00": "108 72" +*PaperDimension w108h144/Label - 1.50x2.00": "108 144" +*PaperDimension w144h26/Label - 2.00x0.37": "144 26" +*PaperDimension w144h36/Label - 2.00x0.50": "144 36" +*PaperDimension w144h72/Label - 2.00x1.00": "144 72" +*PaperDimension w144h90/Label - 2.00x1.25": "144 90" +*PaperDimension w144h288/Label - 2.00x4.00": "144 288" +*PaperDimension w144h396/Label - 2.00x5.50": "144 396" +*PaperDimension w162h36/Label - 2.25x0.50": "162 36" +*PaperDimension w162h90/Label - 2.25x1.25": "162 90" +*PaperDimension w162h288/Label - 2.25x4.00": "162 288" +*PaperDimension w162h396/Label - 2.25x5.50": "162 396" +*PaperDimension w171h396/Label - 2.38x5.50": "171 396" +*PaperDimension w180h72/Label - 2.50x1.00": "180 72" +*PaperDimension w180h144/Label - 2.50x2.00": "180 144" +*PaperDimension w198h90/Label - 2.75x1.25": "198 90" +*PaperDimension w216h72/Label - 3.00x1.00": "216 72" +*PaperDimension w216h90/Label - 3.00x1.25": "216 90" +*PaperDimension w216h144/Label - 3.00x2.00": "216 144" +*PaperDimension w216h216/Label - 3.00x3.00": "216 216" +*PaperDimension w216h360/Label - 3.00x5.00": "216 360" +*PaperDimension w234h144/Label - 3.25x2.00": "234 144" +*PaperDimension w234h360/Label - 3.25x5.00": "234 360" +*PaperDimension w234h396/Label - 3.25x5.50": "234 396" +*PaperDimension w234h419/Label - 3.25x5.83": "234 419" +*PaperDimension w234h563/Label - 3.25x7.83": "234 563" +*PaperDimension w252h72/Label - 3.50x1.00": "252 72" +*PaperDimension w288h72/Label - 4.00x1.00": "288 72" +*PaperDimension w288h144/Label - 4.00x2.00": "288 144" +*PaperDimension w288h180/Label - 4.00x2.50": "288 180" +*PaperDimension w288h216/Label - 4.00x3.00": "288 216" +*PaperDimension w288h288/Label - 4.00x4.00": "288 288" +*PaperDimension w288h360/Label - 4.00x5.00": "288 360" +*PaperDimension w288h432/Label - 4.00x6.00": "288 432" +*PaperDimension w288h468/Label - 4.00x6.50": "288 468" +*PaperDimension w288h936/Label - 4.00x13.00": "288 936" *MaxMediaWidth: "288" *MaxMediaHeight: "3600" @@ -328,5 +479,5 @@ *Font ZapfChancery-MediumItalic: Standard "(001.007S)" Standard ROM *Font ZapfDingbats: Special "(001.004S)" Standard ROM *% -*% End of "$Id: zebra.ppd 4920 2006-01-12 15:12:12Z mike $". +*% End of "$Id: zebra.ppd 4923 2006-01-13 01:28:40Z mike $". *% diff --git a/ppd/zebraep1.ppd b/ppd/zebraep1.ppd index fd50bc7e8..35053cb31 100644 --- a/ppd/zebraep1.ppd +++ b/ppd/zebraep1.ppd @@ -47,30 +47,181 @@ *FileSystem: False *Throughput: "8" *LandscapeOrientation: Plus90 -*VariablePaperSize: False *TTRasterizer: Type42 *OpenUI *PageSize/Media Size: PickOne *OrderDependency: 10 AnySetup *PageSize *DefaultPageSize: w288h360 -*PageSize w288h360/Label - 4 x 5": "<</PageSize[288 360]/ImagingBBox null>>setpagedevice" -*PageSize w288h432/Label - 4 x 6": "<</PageSize[288 432]/ImagingBBox null>>setpagedevice" +*PageSize w90h18/Label - 1.25x0.25": "<</PageSize[90 18]/ImagingBBox null>>setpagedevice" +*PageSize w90h162/Label - 1.25x2.25": "<</PageSize[90 162]/ImagingBBox null>>setpagedevice" +*PageSize w108h18/Label - 1.50x0.25": "<</PageSize[108 18]/ImagingBBox null>>setpagedevice" +*PageSize w108h36/Label - 1.50x0.50": "<</PageSize[108 36]/ImagingBBox null>>setpagedevice" +*PageSize w108h72/Label - 1.50x1.00": "<</PageSize[108 72]/ImagingBBox null>>setpagedevice" +*PageSize w108h144/Label - 1.50x2.00": "<</PageSize[108 144]/ImagingBBox null>>setpagedevice" +*PageSize w144h26/Label - 2.00x0.37": "<</PageSize[144 26]/ImagingBBox null>>setpagedevice" +*PageSize w144h36/Label - 2.00x0.50": "<</PageSize[144 36]/ImagingBBox null>>setpagedevice" +*PageSize w144h72/Label - 2.00x1.00": "<</PageSize[144 72]/ImagingBBox null>>setpagedevice" +*PageSize w144h90/Label - 2.00x1.25": "<</PageSize[144 90]/ImagingBBox null>>setpagedevice" +*PageSize w144h288/Label - 2.00x4.00": "<</PageSize[144 288]/ImagingBBox null>>setpagedevice" +*PageSize w144h396/Label - 2.00x5.50": "<</PageSize[144 396]/ImagingBBox null>>setpagedevice" +*PageSize w162h36/Label - 2.25x0.50": "<</PageSize[162 36]/ImagingBBox null>>setpagedevice" +*PageSize w162h90/Label - 2.25x1.25": "<</PageSize[162 90]/ImagingBBox null>>setpagedevice" +*PageSize w162h288/Label - 2.25x4.00": "<</PageSize[162 288]/ImagingBBox null>>setpagedevice" +*PageSize w162h396/Label - 2.25x5.50": "<</PageSize[162 396]/ImagingBBox null>>setpagedevice" +*PageSize w171h396/Label - 2.38x5.50": "<</PageSize[171 396]/ImagingBBox null>>setpagedevice" +*PageSize w180h72/Label - 2.50x1.00": "<</PageSize[180 72]/ImagingBBox null>>setpagedevice" +*PageSize w180h144/Label - 2.50x2.00": "<</PageSize[180 144]/ImagingBBox null>>setpagedevice" +*PageSize w198h90/Label - 2.75x1.25": "<</PageSize[198 90]/ImagingBBox null>>setpagedevice" +*PageSize w216h72/Label - 3.00x1.00": "<</PageSize[216 72]/ImagingBBox null>>setpagedevice" +*PageSize w216h90/Label - 3.00x1.25": "<</PageSize[216 90]/ImagingBBox null>>setpagedevice" +*PageSize w216h144/Label - 3.00x2.00": "<</PageSize[216 144]/ImagingBBox null>>setpagedevice" +*PageSize w216h216/Label - 3.00x3.00": "<</PageSize[216 216]/ImagingBBox null>>setpagedevice" +*PageSize w216h360/Label - 3.00x5.00": "<</PageSize[216 360]/ImagingBBox null>>setpagedevice" +*PageSize w234h144/Label - 3.25x2.00": "<</PageSize[234 144]/ImagingBBox null>>setpagedevice" +*PageSize w234h360/Label - 3.25x5.00": "<</PageSize[234 360]/ImagingBBox null>>setpagedevice" +*PageSize w234h396/Label - 3.25x5.50": "<</PageSize[234 396]/ImagingBBox null>>setpagedevice" +*PageSize w234h419/Label - 3.25x5.83": "<</PageSize[234 419]/ImagingBBox null>>setpagedevice" +*PageSize w234h563/Label - 3.25x7.83": "<</PageSize[234 563]/ImagingBBox null>>setpagedevice" +*PageSize w252h72/Label - 3.50x1.00": "<</PageSize[252 72]/ImagingBBox null>>setpagedevice" +*PageSize w288h72/Label - 4.00x1.00": "<</PageSize[288 72]/ImagingBBox null>>setpagedevice" +*PageSize w288h144/Label - 4.00x2.00": "<</PageSize[288 144]/ImagingBBox null>>setpagedevice" +*PageSize w288h180/Label - 4.00x2.50": "<</PageSize[288 180]/ImagingBBox null>>setpagedevice" +*PageSize w288h216/Label - 4.00x3.00": "<</PageSize[288 216]/ImagingBBox null>>setpagedevice" +*PageSize w288h288/Label - 4.00x4.00": "<</PageSize[288 288]/ImagingBBox null>>setpagedevice" +*PageSize w288h360/Label - 4.00x5.00": "<</PageSize[288 360]/ImagingBBox null>>setpagedevice" +*PageSize w288h432/Label - 4.00x6.00": "<</PageSize[288 432]/ImagingBBox null>>setpagedevice" +*PageSize w288h468/Label - 4.00x6.50": "<</PageSize[288 468]/ImagingBBox null>>setpagedevice" +*PageSize w288h936/Label - 4.00x13.00": "<</PageSize[288 936]/ImagingBBox null>>setpagedevice" *CloseUI: *PageSize *OpenUI *PageRegion: PickOne *OrderDependency: 10 AnySetup *PageRegion *DefaultPageRegion: w288h360 -*PageRegion w288h360/Label - 4 x 5": "<</PageSize[288 360]/ImagingBBox null>>setpagedevice" -*PageRegion w288h432/Label - 4 x 6": "<</PageSize[288 432]/ImagingBBox null>>setpagedevice" +*PageRegion w90h18/Label - 1.25x0.25": "<</PageSize[90 18]/ImagingBBox null>>setpagedevice" +*PageRegion w90h162/Label - 1.25x2.25": "<</PageSize[90 162]/ImagingBBox null>>setpagedevice" +*PageRegion w108h18/Label - 1.50x0.25": "<</PageSize[108 18]/ImagingBBox null>>setpagedevice" +*PageRegion w108h36/Label - 1.50x0.50": "<</PageSize[108 36]/ImagingBBox null>>setpagedevice" +*PageRegion w108h72/Label - 1.50x1.00": "<</PageSize[108 72]/ImagingBBox null>>setpagedevice" +*PageRegion w108h144/Label - 1.50x2.00": "<</PageSize[108 144]/ImagingBBox null>>setpagedevice" +*PageRegion w144h26/Label - 2.00x0.37": "<</PageSize[144 26]/ImagingBBox null>>setpagedevice" +*PageRegion w144h36/Label - 2.00x0.50": "<</PageSize[144 36]/ImagingBBox null>>setpagedevice" +*PageRegion w144h72/Label - 2.00x1.00": "<</PageSize[144 72]/ImagingBBox null>>setpagedevice" +*PageRegion w144h90/Label - 2.00x1.25": "<</PageSize[144 90]/ImagingBBox null>>setpagedevice" +*PageRegion w144h288/Label - 2.00x4.00": "<</PageSize[144 288]/ImagingBBox null>>setpagedevice" +*PageRegion w144h396/Label - 2.00x5.50": "<</PageSize[144 396]/ImagingBBox null>>setpagedevice" +*PageRegion w162h36/Label - 2.25x0.50": "<</PageSize[162 36]/ImagingBBox null>>setpagedevice" +*PageRegion w162h90/Label - 2.25x1.25": "<</PageSize[162 90]/ImagingBBox null>>setpagedevice" +*PageRegion w162h288/Label - 2.25x4.00": "<</PageSize[162 288]/ImagingBBox null>>setpagedevice" +*PageRegion w162h396/Label - 2.25x5.50": "<</PageSize[162 396]/ImagingBBox null>>setpagedevice" +*PageRegion w171h396/Label - 2.38x5.50": "<</PageSize[171 396]/ImagingBBox null>>setpagedevice" +*PageRegion w180h72/Label - 2.50x1.00": "<</PageSize[180 72]/ImagingBBox null>>setpagedevice" +*PageRegion w180h144/Label - 2.50x2.00": "<</PageSize[180 144]/ImagingBBox null>>setpagedevice" +*PageRegion w198h90/Label - 2.75x1.25": "<</PageSize[198 90]/ImagingBBox null>>setpagedevice" +*PageRegion w216h72/Label - 3.00x1.00": "<</PageSize[216 72]/ImagingBBox null>>setpagedevice" +*PageRegion w216h90/Label - 3.00x1.25": "<</PageSize[216 90]/ImagingBBox null>>setpagedevice" +*PageRegion w216h144/Label - 3.00x2.00": "<</PageSize[216 144]/ImagingBBox null>>setpagedevice" +*PageRegion w216h216/Label - 3.00x3.00": "<</PageSize[216 216]/ImagingBBox null>>setpagedevice" +*PageRegion w216h360/Label - 3.00x5.00": "<</PageSize[216 360]/ImagingBBox null>>setpagedevice" +*PageRegion w234h144/Label - 3.25x2.00": "<</PageSize[234 144]/ImagingBBox null>>setpagedevice" +*PageRegion w234h360/Label - 3.25x5.00": "<</PageSize[234 360]/ImagingBBox null>>setpagedevice" +*PageRegion w234h396/Label - 3.25x5.50": "<</PageSize[234 396]/ImagingBBox null>>setpagedevice" +*PageRegion w234h419/Label - 3.25x5.83": "<</PageSize[234 419]/ImagingBBox null>>setpagedevice" +*PageRegion w234h563/Label - 3.25x7.83": "<</PageSize[234 563]/ImagingBBox null>>setpagedevice" +*PageRegion w252h72/Label - 3.50x1.00": "<</PageSize[252 72]/ImagingBBox null>>setpagedevice" +*PageRegion w288h72/Label - 4.00x1.00": "<</PageSize[288 72]/ImagingBBox null>>setpagedevice" +*PageRegion w288h144/Label - 4.00x2.00": "<</PageSize[288 144]/ImagingBBox null>>setpagedevice" +*PageRegion w288h180/Label - 4.00x2.50": "<</PageSize[288 180]/ImagingBBox null>>setpagedevice" +*PageRegion w288h216/Label - 4.00x3.00": "<</PageSize[288 216]/ImagingBBox null>>setpagedevice" +*PageRegion w288h288/Label - 4.00x4.00": "<</PageSize[288 288]/ImagingBBox null>>setpagedevice" +*PageRegion w288h360/Label - 4.00x5.00": "<</PageSize[288 360]/ImagingBBox null>>setpagedevice" +*PageRegion w288h432/Label - 4.00x6.00": "<</PageSize[288 432]/ImagingBBox null>>setpagedevice" +*PageRegion w288h468/Label - 4.00x6.50": "<</PageSize[288 468]/ImagingBBox null>>setpagedevice" +*PageRegion w288h936/Label - 4.00x13.00": "<</PageSize[288 936]/ImagingBBox null>>setpagedevice" *CloseUI: *PageRegion *DefaultImageableArea: w288h360 -*ImageableArea w288h360/Label - 4 x 5": "0 0 288 360" -*ImageableArea w288h432/Label - 4 x 6": "0 0 288 432" +*ImageableArea w90h18/Label - 1.25x0.25": "0 0 90 18" +*ImageableArea w90h162/Label - 1.25x2.25": "0 0 90 162" +*ImageableArea w108h18/Label - 1.50x0.25": "0 0 108 18" +*ImageableArea w108h36/Label - 1.50x0.50": "0 0 108 36" +*ImageableArea w108h72/Label - 1.50x1.00": "0 0 108 72" +*ImageableArea w108h144/Label - 1.50x2.00": "0 0 108 144" +*ImageableArea w144h26/Label - 2.00x0.37": "0 0 144 26" +*ImageableArea w144h36/Label - 2.00x0.50": "0 0 144 36" +*ImageableArea w144h72/Label - 2.00x1.00": "0 0 144 72" +*ImageableArea w144h90/Label - 2.00x1.25": "0 0 144 90" +*ImageableArea w144h288/Label - 2.00x4.00": "0 0 144 288" +*ImageableArea w144h396/Label - 2.00x5.50": "0 0 144 396" +*ImageableArea w162h36/Label - 2.25x0.50": "0 0 162 36" +*ImageableArea w162h90/Label - 2.25x1.25": "0 0 162 90" +*ImageableArea w162h288/Label - 2.25x4.00": "0 0 162 288" +*ImageableArea w162h396/Label - 2.25x5.50": "0 0 162 396" +*ImageableArea w171h396/Label - 2.38x5.50": "0 0 171 396" +*ImageableArea w180h72/Label - 2.50x1.00": "0 0 180 72" +*ImageableArea w180h144/Label - 2.50x2.00": "0 0 180 144" +*ImageableArea w198h90/Label - 2.75x1.25": "0 0 198 90" +*ImageableArea w216h72/Label - 3.00x1.00": "0 0 216 72" +*ImageableArea w216h90/Label - 3.00x1.25": "0 0 216 90" +*ImageableArea w216h144/Label - 3.00x2.00": "0 0 216 144" +*ImageableArea w216h216/Label - 3.00x3.00": "0 0 216 216" +*ImageableArea w216h360/Label - 3.00x5.00": "0 0 216 360" +*ImageableArea w234h144/Label - 3.25x2.00": "0 0 234 144" +*ImageableArea w234h360/Label - 3.25x5.00": "0 0 234 360" +*ImageableArea w234h396/Label - 3.25x5.50": "0 0 234 396" +*ImageableArea w234h419/Label - 3.25x5.83": "0 0 234 419" +*ImageableArea w234h563/Label - 3.25x7.83": "0 0 234 563" +*ImageableArea w252h72/Label - 3.50x1.00": "0 0 252 72" +*ImageableArea w288h72/Label - 4.00x1.00": "0 0 288 72" +*ImageableArea w288h144/Label - 4.00x2.00": "0 0 288 144" +*ImageableArea w288h180/Label - 4.00x2.50": "0 0 288 180" +*ImageableArea w288h216/Label - 4.00x3.00": "0 0 288 216" +*ImageableArea w288h288/Label - 4.00x4.00": "0 0 288 288" +*ImageableArea w288h360/Label - 4.00x5.00": "0 0 288 360" +*ImageableArea w288h432/Label - 4.00x6.00": "0 0 288 432" +*ImageableArea w288h468/Label - 4.00x6.50": "0 0 288 468" +*ImageableArea w288h936/Label - 4.00x13.00": "0 0 288 936" *DefaultPaperDimension: w288h360 -*PaperDimension w288h360/Label - 4 x 5": "288 360" -*PaperDimension w288h432/Label - 4 x 6": "288 432" +*PaperDimension w90h18/Label - 1.25x0.25": "90 18" +*PaperDimension w90h162/Label - 1.25x2.25": "90 162" +*PaperDimension w108h18/Label - 1.50x0.25": "108 18" +*PaperDimension w108h36/Label - 1.50x0.50": "108 36" +*PaperDimension w108h72/Label - 1.50x1.00": "108 72" +*PaperDimension w108h144/Label - 1.50x2.00": "108 144" +*PaperDimension w144h26/Label - 2.00x0.37": "144 26" +*PaperDimension w144h36/Label - 2.00x0.50": "144 36" +*PaperDimension w144h72/Label - 2.00x1.00": "144 72" +*PaperDimension w144h90/Label - 2.00x1.25": "144 90" +*PaperDimension w144h288/Label - 2.00x4.00": "144 288" +*PaperDimension w144h396/Label - 2.00x5.50": "144 396" +*PaperDimension w162h36/Label - 2.25x0.50": "162 36" +*PaperDimension w162h90/Label - 2.25x1.25": "162 90" +*PaperDimension w162h288/Label - 2.25x4.00": "162 288" +*PaperDimension w162h396/Label - 2.25x5.50": "162 396" +*PaperDimension w171h396/Label - 2.38x5.50": "171 396" +*PaperDimension w180h72/Label - 2.50x1.00": "180 72" +*PaperDimension w180h144/Label - 2.50x2.00": "180 144" +*PaperDimension w198h90/Label - 2.75x1.25": "198 90" +*PaperDimension w216h72/Label - 3.00x1.00": "216 72" +*PaperDimension w216h90/Label - 3.00x1.25": "216 90" +*PaperDimension w216h144/Label - 3.00x2.00": "216 144" +*PaperDimension w216h216/Label - 3.00x3.00": "216 216" +*PaperDimension w216h360/Label - 3.00x5.00": "216 360" +*PaperDimension w234h144/Label - 3.25x2.00": "234 144" +*PaperDimension w234h360/Label - 3.25x5.00": "234 360" +*PaperDimension w234h396/Label - 3.25x5.50": "234 396" +*PaperDimension w234h419/Label - 3.25x5.83": "234 419" +*PaperDimension w234h563/Label - 3.25x7.83": "234 563" +*PaperDimension w252h72/Label - 3.50x1.00": "252 72" +*PaperDimension w288h72/Label - 4.00x1.00": "288 72" +*PaperDimension w288h144/Label - 4.00x2.00": "288 144" +*PaperDimension w288h180/Label - 4.00x2.50": "288 180" +*PaperDimension w288h216/Label - 4.00x3.00": "288 216" +*PaperDimension w288h288/Label - 4.00x4.00": "288 288" +*PaperDimension w288h360/Label - 4.00x5.00": "288 360" +*PaperDimension w288h432/Label - 4.00x6.00": "288 432" +*PaperDimension w288h468/Label - 4.00x6.50": "288 468" +*PaperDimension w288h936/Label - 4.00x13.00": "288 936" *MaxMediaWidth: "288" *MaxMediaHeight: "3600" diff --git a/ppd/zebraep2.ppd b/ppd/zebraep2.ppd index bd9433dd0..0f1f1940b 100644 --- a/ppd/zebraep2.ppd +++ b/ppd/zebraep2.ppd @@ -47,30 +47,181 @@ *FileSystem: False *Throughput: "8" *LandscapeOrientation: Plus90 -*VariablePaperSize: False *TTRasterizer: Type42 *OpenUI *PageSize/Media Size: PickOne *OrderDependency: 10 AnySetup *PageSize *DefaultPageSize: w288h360 -*PageSize w288h360/Label - 4 x 5": "<</PageSize[288 360]/ImagingBBox null>>setpagedevice" -*PageSize w288h432/Label - 4 x 6": "<</PageSize[288 432]/ImagingBBox null>>setpagedevice" +*PageSize w90h18/Label - 1.25x0.25": "<</PageSize[90 18]/ImagingBBox null>>setpagedevice" +*PageSize w90h162/Label - 1.25x2.25": "<</PageSize[90 162]/ImagingBBox null>>setpagedevice" +*PageSize w108h18/Label - 1.50x0.25": "<</PageSize[108 18]/ImagingBBox null>>setpagedevice" +*PageSize w108h36/Label - 1.50x0.50": "<</PageSize[108 36]/ImagingBBox null>>setpagedevice" +*PageSize w108h72/Label - 1.50x1.00": "<</PageSize[108 72]/ImagingBBox null>>setpagedevice" +*PageSize w108h144/Label - 1.50x2.00": "<</PageSize[108 144]/ImagingBBox null>>setpagedevice" +*PageSize w144h26/Label - 2.00x0.37": "<</PageSize[144 26]/ImagingBBox null>>setpagedevice" +*PageSize w144h36/Label - 2.00x0.50": "<</PageSize[144 36]/ImagingBBox null>>setpagedevice" +*PageSize w144h72/Label - 2.00x1.00": "<</PageSize[144 72]/ImagingBBox null>>setpagedevice" +*PageSize w144h90/Label - 2.00x1.25": "<</PageSize[144 90]/ImagingBBox null>>setpagedevice" +*PageSize w144h288/Label - 2.00x4.00": "<</PageSize[144 288]/ImagingBBox null>>setpagedevice" +*PageSize w144h396/Label - 2.00x5.50": "<</PageSize[144 396]/ImagingBBox null>>setpagedevice" +*PageSize w162h36/Label - 2.25x0.50": "<</PageSize[162 36]/ImagingBBox null>>setpagedevice" +*PageSize w162h90/Label - 2.25x1.25": "<</PageSize[162 90]/ImagingBBox null>>setpagedevice" +*PageSize w162h288/Label - 2.25x4.00": "<</PageSize[162 288]/ImagingBBox null>>setpagedevice" +*PageSize w162h396/Label - 2.25x5.50": "<</PageSize[162 396]/ImagingBBox null>>setpagedevice" +*PageSize w171h396/Label - 2.38x5.50": "<</PageSize[171 396]/ImagingBBox null>>setpagedevice" +*PageSize w180h72/Label - 2.50x1.00": "<</PageSize[180 72]/ImagingBBox null>>setpagedevice" +*PageSize w180h144/Label - 2.50x2.00": "<</PageSize[180 144]/ImagingBBox null>>setpagedevice" +*PageSize w198h90/Label - 2.75x1.25": "<</PageSize[198 90]/ImagingBBox null>>setpagedevice" +*PageSize w216h72/Label - 3.00x1.00": "<</PageSize[216 72]/ImagingBBox null>>setpagedevice" +*PageSize w216h90/Label - 3.00x1.25": "<</PageSize[216 90]/ImagingBBox null>>setpagedevice" +*PageSize w216h144/Label - 3.00x2.00": "<</PageSize[216 144]/ImagingBBox null>>setpagedevice" +*PageSize w216h216/Label - 3.00x3.00": "<</PageSize[216 216]/ImagingBBox null>>setpagedevice" +*PageSize w216h360/Label - 3.00x5.00": "<</PageSize[216 360]/ImagingBBox null>>setpagedevice" +*PageSize w234h144/Label - 3.25x2.00": "<</PageSize[234 144]/ImagingBBox null>>setpagedevice" +*PageSize w234h360/Label - 3.25x5.00": "<</PageSize[234 360]/ImagingBBox null>>setpagedevice" +*PageSize w234h396/Label - 3.25x5.50": "<</PageSize[234 396]/ImagingBBox null>>setpagedevice" +*PageSize w234h419/Label - 3.25x5.83": "<</PageSize[234 419]/ImagingBBox null>>setpagedevice" +*PageSize w234h563/Label - 3.25x7.83": "<</PageSize[234 563]/ImagingBBox null>>setpagedevice" +*PageSize w252h72/Label - 3.50x1.00": "<</PageSize[252 72]/ImagingBBox null>>setpagedevice" +*PageSize w288h72/Label - 4.00x1.00": "<</PageSize[288 72]/ImagingBBox null>>setpagedevice" +*PageSize w288h144/Label - 4.00x2.00": "<</PageSize[288 144]/ImagingBBox null>>setpagedevice" +*PageSize w288h180/Label - 4.00x2.50": "<</PageSize[288 180]/ImagingBBox null>>setpagedevice" +*PageSize w288h216/Label - 4.00x3.00": "<</PageSize[288 216]/ImagingBBox null>>setpagedevice" +*PageSize w288h288/Label - 4.00x4.00": "<</PageSize[288 288]/ImagingBBox null>>setpagedevice" +*PageSize w288h360/Label - 4.00x5.00": "<</PageSize[288 360]/ImagingBBox null>>setpagedevice" +*PageSize w288h432/Label - 4.00x6.00": "<</PageSize[288 432]/ImagingBBox null>>setpagedevice" +*PageSize w288h468/Label - 4.00x6.50": "<</PageSize[288 468]/ImagingBBox null>>setpagedevice" +*PageSize w288h936/Label - 4.00x13.00": "<</PageSize[288 936]/ImagingBBox null>>setpagedevice" *CloseUI: *PageSize *OpenUI *PageRegion: PickOne *OrderDependency: 10 AnySetup *PageRegion *DefaultPageRegion: w288h360 -*PageRegion w288h360/Label - 4 x 5": "<</PageSize[288 360]/ImagingBBox null>>setpagedevice" -*PageRegion w288h432/Label - 4 x 6": "<</PageSize[288 432]/ImagingBBox null>>setpagedevice" +*PageRegion w90h18/Label - 1.25x0.25": "<</PageSize[90 18]/ImagingBBox null>>setpagedevice" +*PageRegion w90h162/Label - 1.25x2.25": "<</PageSize[90 162]/ImagingBBox null>>setpagedevice" +*PageRegion w108h18/Label - 1.50x0.25": "<</PageSize[108 18]/ImagingBBox null>>setpagedevice" +*PageRegion w108h36/Label - 1.50x0.50": "<</PageSize[108 36]/ImagingBBox null>>setpagedevice" +*PageRegion w108h72/Label - 1.50x1.00": "<</PageSize[108 72]/ImagingBBox null>>setpagedevice" +*PageRegion w108h144/Label - 1.50x2.00": "<</PageSize[108 144]/ImagingBBox null>>setpagedevice" +*PageRegion w144h26/Label - 2.00x0.37": "<</PageSize[144 26]/ImagingBBox null>>setpagedevice" +*PageRegion w144h36/Label - 2.00x0.50": "<</PageSize[144 36]/ImagingBBox null>>setpagedevice" +*PageRegion w144h72/Label - 2.00x1.00": "<</PageSize[144 72]/ImagingBBox null>>setpagedevice" +*PageRegion w144h90/Label - 2.00x1.25": "<</PageSize[144 90]/ImagingBBox null>>setpagedevice" +*PageRegion w144h288/Label - 2.00x4.00": "<</PageSize[144 288]/ImagingBBox null>>setpagedevice" +*PageRegion w144h396/Label - 2.00x5.50": "<</PageSize[144 396]/ImagingBBox null>>setpagedevice" +*PageRegion w162h36/Label - 2.25x0.50": "<</PageSize[162 36]/ImagingBBox null>>setpagedevice" +*PageRegion w162h90/Label - 2.25x1.25": "<</PageSize[162 90]/ImagingBBox null>>setpagedevice" +*PageRegion w162h288/Label - 2.25x4.00": "<</PageSize[162 288]/ImagingBBox null>>setpagedevice" +*PageRegion w162h396/Label - 2.25x5.50": "<</PageSize[162 396]/ImagingBBox null>>setpagedevice" +*PageRegion w171h396/Label - 2.38x5.50": "<</PageSize[171 396]/ImagingBBox null>>setpagedevice" +*PageRegion w180h72/Label - 2.50x1.00": "<</PageSize[180 72]/ImagingBBox null>>setpagedevice" +*PageRegion w180h144/Label - 2.50x2.00": "<</PageSize[180 144]/ImagingBBox null>>setpagedevice" +*PageRegion w198h90/Label - 2.75x1.25": "<</PageSize[198 90]/ImagingBBox null>>setpagedevice" +*PageRegion w216h72/Label - 3.00x1.00": "<</PageSize[216 72]/ImagingBBox null>>setpagedevice" +*PageRegion w216h90/Label - 3.00x1.25": "<</PageSize[216 90]/ImagingBBox null>>setpagedevice" +*PageRegion w216h144/Label - 3.00x2.00": "<</PageSize[216 144]/ImagingBBox null>>setpagedevice" +*PageRegion w216h216/Label - 3.00x3.00": "<</PageSize[216 216]/ImagingBBox null>>setpagedevice" +*PageRegion w216h360/Label - 3.00x5.00": "<</PageSize[216 360]/ImagingBBox null>>setpagedevice" +*PageRegion w234h144/Label - 3.25x2.00": "<</PageSize[234 144]/ImagingBBox null>>setpagedevice" +*PageRegion w234h360/Label - 3.25x5.00": "<</PageSize[234 360]/ImagingBBox null>>setpagedevice" +*PageRegion w234h396/Label - 3.25x5.50": "<</PageSize[234 396]/ImagingBBox null>>setpagedevice" +*PageRegion w234h419/Label - 3.25x5.83": "<</PageSize[234 419]/ImagingBBox null>>setpagedevice" +*PageRegion w234h563/Label - 3.25x7.83": "<</PageSize[234 563]/ImagingBBox null>>setpagedevice" +*PageRegion w252h72/Label - 3.50x1.00": "<</PageSize[252 72]/ImagingBBox null>>setpagedevice" +*PageRegion w288h72/Label - 4.00x1.00": "<</PageSize[288 72]/ImagingBBox null>>setpagedevice" +*PageRegion w288h144/Label - 4.00x2.00": "<</PageSize[288 144]/ImagingBBox null>>setpagedevice" +*PageRegion w288h180/Label - 4.00x2.50": "<</PageSize[288 180]/ImagingBBox null>>setpagedevice" +*PageRegion w288h216/Label - 4.00x3.00": "<</PageSize[288 216]/ImagingBBox null>>setpagedevice" +*PageRegion w288h288/Label - 4.00x4.00": "<</PageSize[288 288]/ImagingBBox null>>setpagedevice" +*PageRegion w288h360/Label - 4.00x5.00": "<</PageSize[288 360]/ImagingBBox null>>setpagedevice" +*PageRegion w288h432/Label - 4.00x6.00": "<</PageSize[288 432]/ImagingBBox null>>setpagedevice" +*PageRegion w288h468/Label - 4.00x6.50": "<</PageSize[288 468]/ImagingBBox null>>setpagedevice" +*PageRegion w288h936/Label - 4.00x13.00": "<</PageSize[288 936]/ImagingBBox null>>setpagedevice" *CloseUI: *PageRegion *DefaultImageableArea: w288h360 -*ImageableArea w288h360/Label - 4 x 5": "0 0 288 360" -*ImageableArea w288h432/Label - 4 x 6": "0 0 288 432" +*ImageableArea w90h18/Label - 1.25x0.25": "0 0 90 18" +*ImageableArea w90h162/Label - 1.25x2.25": "0 0 90 162" +*ImageableArea w108h18/Label - 1.50x0.25": "0 0 108 18" +*ImageableArea w108h36/Label - 1.50x0.50": "0 0 108 36" +*ImageableArea w108h72/Label - 1.50x1.00": "0 0 108 72" +*ImageableArea w108h144/Label - 1.50x2.00": "0 0 108 144" +*ImageableArea w144h26/Label - 2.00x0.37": "0 0 144 26" +*ImageableArea w144h36/Label - 2.00x0.50": "0 0 144 36" +*ImageableArea w144h72/Label - 2.00x1.00": "0 0 144 72" +*ImageableArea w144h90/Label - 2.00x1.25": "0 0 144 90" +*ImageableArea w144h288/Label - 2.00x4.00": "0 0 144 288" +*ImageableArea w144h396/Label - 2.00x5.50": "0 0 144 396" +*ImageableArea w162h36/Label - 2.25x0.50": "0 0 162 36" +*ImageableArea w162h90/Label - 2.25x1.25": "0 0 162 90" +*ImageableArea w162h288/Label - 2.25x4.00": "0 0 162 288" +*ImageableArea w162h396/Label - 2.25x5.50": "0 0 162 396" +*ImageableArea w171h396/Label - 2.38x5.50": "0 0 171 396" +*ImageableArea w180h72/Label - 2.50x1.00": "0 0 180 72" +*ImageableArea w180h144/Label - 2.50x2.00": "0 0 180 144" +*ImageableArea w198h90/Label - 2.75x1.25": "0 0 198 90" +*ImageableArea w216h72/Label - 3.00x1.00": "0 0 216 72" +*ImageableArea w216h90/Label - 3.00x1.25": "0 0 216 90" +*ImageableArea w216h144/Label - 3.00x2.00": "0 0 216 144" +*ImageableArea w216h216/Label - 3.00x3.00": "0 0 216 216" +*ImageableArea w216h360/Label - 3.00x5.00": "0 0 216 360" +*ImageableArea w234h144/Label - 3.25x2.00": "0 0 234 144" +*ImageableArea w234h360/Label - 3.25x5.00": "0 0 234 360" +*ImageableArea w234h396/Label - 3.25x5.50": "0 0 234 396" +*ImageableArea w234h419/Label - 3.25x5.83": "0 0 234 419" +*ImageableArea w234h563/Label - 3.25x7.83": "0 0 234 563" +*ImageableArea w252h72/Label - 3.50x1.00": "0 0 252 72" +*ImageableArea w288h72/Label - 4.00x1.00": "0 0 288 72" +*ImageableArea w288h144/Label - 4.00x2.00": "0 0 288 144" +*ImageableArea w288h180/Label - 4.00x2.50": "0 0 288 180" +*ImageableArea w288h216/Label - 4.00x3.00": "0 0 288 216" +*ImageableArea w288h288/Label - 4.00x4.00": "0 0 288 288" +*ImageableArea w288h360/Label - 4.00x5.00": "0 0 288 360" +*ImageableArea w288h432/Label - 4.00x6.00": "0 0 288 432" +*ImageableArea w288h468/Label - 4.00x6.50": "0 0 288 468" +*ImageableArea w288h936/Label - 4.00x13.00": "0 0 288 936" *DefaultPaperDimension: w288h360 -*PaperDimension w288h360/Label - 4 x 5": "288 360" -*PaperDimension w288h432/Label - 4 x 6": "288 432" +*PaperDimension w90h18/Label - 1.25x0.25": "90 18" +*PaperDimension w90h162/Label - 1.25x2.25": "90 162" +*PaperDimension w108h18/Label - 1.50x0.25": "108 18" +*PaperDimension w108h36/Label - 1.50x0.50": "108 36" +*PaperDimension w108h72/Label - 1.50x1.00": "108 72" +*PaperDimension w108h144/Label - 1.50x2.00": "108 144" +*PaperDimension w144h26/Label - 2.00x0.37": "144 26" +*PaperDimension w144h36/Label - 2.00x0.50": "144 36" +*PaperDimension w144h72/Label - 2.00x1.00": "144 72" +*PaperDimension w144h90/Label - 2.00x1.25": "144 90" +*PaperDimension w144h288/Label - 2.00x4.00": "144 288" +*PaperDimension w144h396/Label - 2.00x5.50": "144 396" +*PaperDimension w162h36/Label - 2.25x0.50": "162 36" +*PaperDimension w162h90/Label - 2.25x1.25": "162 90" +*PaperDimension w162h288/Label - 2.25x4.00": "162 288" +*PaperDimension w162h396/Label - 2.25x5.50": "162 396" +*PaperDimension w171h396/Label - 2.38x5.50": "171 396" +*PaperDimension w180h72/Label - 2.50x1.00": "180 72" +*PaperDimension w180h144/Label - 2.50x2.00": "180 144" +*PaperDimension w198h90/Label - 2.75x1.25": "198 90" +*PaperDimension w216h72/Label - 3.00x1.00": "216 72" +*PaperDimension w216h90/Label - 3.00x1.25": "216 90" +*PaperDimension w216h144/Label - 3.00x2.00": "216 144" +*PaperDimension w216h216/Label - 3.00x3.00": "216 216" +*PaperDimension w216h360/Label - 3.00x5.00": "216 360" +*PaperDimension w234h144/Label - 3.25x2.00": "234 144" +*PaperDimension w234h360/Label - 3.25x5.00": "234 360" +*PaperDimension w234h396/Label - 3.25x5.50": "234 396" +*PaperDimension w234h419/Label - 3.25x5.83": "234 419" +*PaperDimension w234h563/Label - 3.25x7.83": "234 563" +*PaperDimension w252h72/Label - 3.50x1.00": "252 72" +*PaperDimension w288h72/Label - 4.00x1.00": "288 72" +*PaperDimension w288h144/Label - 4.00x2.00": "288 144" +*PaperDimension w288h180/Label - 4.00x2.50": "288 180" +*PaperDimension w288h216/Label - 4.00x3.00": "288 216" +*PaperDimension w288h288/Label - 4.00x4.00": "288 288" +*PaperDimension w288h360/Label - 4.00x5.00": "288 360" +*PaperDimension w288h432/Label - 4.00x6.00": "288 432" +*PaperDimension w288h468/Label - 4.00x6.50": "288 468" +*PaperDimension w288h936/Label - 4.00x13.00": "288 936" *MaxMediaWidth: "288" *MaxMediaHeight: "3600" diff --git a/scheduler/Makefile b/scheduler/Makefile index ecbe0f96f..ac15d4fde 100644 --- a/scheduler/Makefile +++ b/scheduler/Makefile @@ -1,5 +1,5 @@ # -# "$Id: Makefile 4801 2005-10-18 21:09:12Z mike $" +# "$Id: Makefile 4970 2006-01-24 14:05:45Z mike $" # # Scheduler Makefile for the Common UNIX Printing System (CUPS). # @@ -120,9 +120,9 @@ install: all echo Creating $(SERVERROOT)... $(INSTALL_DIR) $(SERVERROOT) echo Creating $(SERVERROOT)/interfaces... - $(INSTALL_DIR) $(SERVERROOT)/interfaces + $(INSTALL_DIR) -g $(CUPS_GROUP) $(SERVERROOT)/interfaces echo Creating $(SERVERROOT)/ppd... - $(INSTALL_DIR) $(SERVERROOT)/ppd + $(INSTALL_DIR) -g $(CUPS_GROUP) $(SERVERROOT)/ppd echo Creating $(STATEDIR)... $(INSTALL_DIR) $(STATEDIR) echo Creating $(STATEDIR)/certs... @@ -130,8 +130,8 @@ install: all echo Creating $(LOGDIR)... $(INSTALL_DIR) $(LOGDIR) echo Creating $(REQUESTS)... - $(INSTALL_DIR) $(REQUESTS) - echo Creating $(REQUESTS)/tmp... + $(INSTALL_DIR) -g $(CUPS_GROUP) $(REQUESTS) + echo Creating -g $(CUPS_GROUP) $(REQUESTS)/tmp... $(INSTALL_DIR) $(REQUESTS)/tmp echo Creating $(CACHEDIR)... $(INSTALL_DIR) $(CACHEDIR) @@ -216,10 +216,10 @@ testdirsvc: testdirsvc.o # testmime # -testmime: testmime.o libmime.a +testmime: testmime.o libmime.a ../cups/libcups.a echo Linking $@... $(CC) $(LDFLAGS) -o $@ testmime.o libmime.a ../cups/libcups.a \ - $(COMMONLIBS) $(LIBZ) + $(COMMONLIBS) $(LIBZ) $(SSLLIBS) # @@ -239,5 +239,5 @@ include Dependencies # -# End of "$Id: Makefile 4801 2005-10-18 21:09:12Z mike $". +# End of "$Id: Makefile 4970 2006-01-24 14:05:45Z mike $". # diff --git a/scheduler/auth.c b/scheduler/auth.c index 405c064a2..0c6cd85d9 100644 --- a/scheduler/auth.c +++ b/scheduler/auth.c @@ -1,5 +1,5 @@ ;/* - * "$Id: auth.c 4906 2006-01-10 20:53:28Z mike $" + * "$Id: auth.c 4929 2006-01-13 16:38:43Z mike $" * * Authorization routines for the Common UNIX Printing System (CUPS). * @@ -1513,6 +1513,7 @@ cupsdIsAuthorized(cupsd_client_t *con, /* I - Connection */ unsigned address[4]; /* Authorization address */ cupsd_location_t *best; /* Best match for location so far */ int hostlen; /* Length of hostname */ + const char *username; /* Username to authorize */ struct passwd *pw; /* User password data */ static const char * const levels[] = /* Auth levels */ { @@ -1532,6 +1533,9 @@ cupsdIsAuthorized(cupsd_client_t *con, /* I - Connection */ cupsdLogMessage(CUPSD_LOG_DEBUG2, "cupsdIsAuthorized: con->uri=\"%s\", con->best=%p(%s)", con->uri, con->best, con->best ? con->best->location : ""); + if (owner) + cupsdLogMessage(CUPSD_LOG_DEBUG2, + "cupsdIsAuthorized: owner=\"%s\"", owner); /* * If there is no "best" authentication rule for this request, then @@ -1666,7 +1670,8 @@ cupsdIsAuthorized(cupsd_client_t *con, /* I - Connection */ (best->type == AUTH_NONE && best->num_names == 0)) return (HTTP_OK); - if (best->type == AUTH_NONE && best->limit == AUTH_LIMIT_IPP) + if (!con->username[0] && best->type == AUTH_NONE && + best->limit == AUTH_LIMIT_IPP) { /* * Check for unauthenticated username... @@ -1681,34 +1686,42 @@ cupsdIsAuthorized(cupsd_client_t *con, /* I - Connection */ cupsdLogMessage(CUPSD_LOG_DEBUG2, "cupsdIsAuthorized: requesting-user-name=\"%s\"", attr->values[0].string.text); - return (HTTP_OK); + username = attr->values[0].string.text; } - } - - cupsdLogMessage(CUPSD_LOG_DEBUG2, "cupsdIsAuthorized: username=\"%s\"", - con->username); - - if (!con->username[0]) - { - if (best->satisfy == AUTH_SATISFY_ALL || auth == AUTH_DENY) + else if (best->satisfy == AUTH_SATISFY_ALL || auth == AUTH_DENY) return (HTTP_UNAUTHORIZED); /* Non-anonymous needs user/pass */ else return (HTTP_OK); /* unless overridden with Satisfy */ } + else + { + cupsdLogMessage(CUPSD_LOG_DEBUG2, "cupsdIsAuthorized: username=\"%s\"", + con->username); + + if (!con->username[0]) + { + if (best->satisfy == AUTH_SATISFY_ALL || auth == AUTH_DENY) + return (HTTP_UNAUTHORIZED); /* Non-anonymous needs user/pass */ + else + return (HTTP_OK); /* unless overridden with Satisfy */ + } + + username = con->username; + } /* - * OK, the password is good. See if we need normal user access, or group + * OK, got a username. See if we need normal user access, or group * access... (root always matches) */ - if (!strcmp(con->username, "root")) + if (!strcmp(username, "root")) return (HTTP_OK); /* * Get the user info... */ - pw = getpwnam(con->username); + pw = getpwnam(username); endpwent(); if (best->level == AUTH_USER) @@ -1732,20 +1745,20 @@ cupsdIsAuthorized(cupsd_client_t *con, /* I - Connection */ for (i = 0; i < best->num_names; i ++) { if (!strcasecmp(best->names[i], "@OWNER") && owner && - !strcasecmp(con->username, owner)) + !strcasecmp(username, owner)) return (HTTP_OK); else if (!strcasecmp(best->names[i], "@SYSTEM")) { for (j = 0; j < NumSystemGroups; j ++) - if (cupsdCheckGroup(con->username, pw, SystemGroups[j])) + if (cupsdCheckGroup(username, pw, SystemGroups[j])) return (HTTP_OK); } else if (best->names[i][0] == '@') { - if (cupsdCheckGroup(con->username, pw, best->names[i] + 1)) + if (cupsdCheckGroup(username, pw, best->names[i] + 1)) return (HTTP_OK); } - else if (!strcasecmp(con->username, best->names[i])) + else if (!strcasecmp(username, best->names[i])) return (HTTP_OK); } @@ -1772,10 +1785,10 @@ cupsdIsAuthorized(cupsd_client_t *con, /* I - Connection */ if (!strcasecmp(best->names[i], "@SYSTEM")) { for (j = 0; j < NumSystemGroups; j ++) - if (cupsdCheckGroup(con->username, pw, SystemGroups[j])) + if (cupsdCheckGroup(username, pw, SystemGroups[j])) return (HTTP_OK); } - else if (cupsdCheckGroup(con->username, pw, best->names[i])) + else if (cupsdCheckGroup(username, pw, best->names[i])) return (HTTP_OK); } @@ -2112,5 +2125,5 @@ to64(char *s, /* O - Output string */ /* - * End of "$Id: auth.c 4906 2006-01-10 20:53:28Z mike $". + * End of "$Id: auth.c 4929 2006-01-13 16:38:43Z mike $". */ diff --git a/scheduler/banners.c b/scheduler/banners.c index 98c3364ea..71cb9d4f0 100644 --- a/scheduler/banners.c +++ b/scheduler/banners.c @@ -1,9 +1,9 @@ /* - * "$Id: banners.c 4719 2005-09-28 21:12:44Z mike $" + * "$Id: banners.c 4968 2006-01-24 03:56:31Z mike $" * * Banner routines for the Common UNIX Printing System (CUPS). * - * Copyright 1997-2005 by Easy Software Products. + * Copyright 1997-2006 by Easy Software Products. * * These coded instructions, statements, and computer programs are the * property of Easy Software Products and are protected by Federal @@ -26,7 +26,7 @@ * cupsdAddBanner() - Add a banner to the array. * cupsdFindBanner() - Find a named banner. * cupsdLoadBanners() - Load all available banner files... - * compare() - Compare two banners. + * compare_banners() - Compare two banners. */ /* @@ -41,7 +41,8 @@ * Local functions... */ -static int compare(const cupsd_banner_t *b0, const cupsd_banner_t *b1); +static int compare_banners(const cupsd_banner_t *b0, + const cupsd_banner_t *b1); /* @@ -72,29 +73,16 @@ cupsdAddBanner(const char *name, /* I - Name of banner */ * Allocate memory... */ - if (NumBanners == 0) - temp = malloc(sizeof(cupsd_banner_t)); - else - temp = realloc(Banners, sizeof(cupsd_banner_t) * (NumBanners + 1)); - - if (temp == NULL) - { - cupsdLogMessage(CUPSD_LOG_ERROR, - "cupsdAddBanner: Ran out of memory adding a banner!"); - return; - } + temp = calloc(1, sizeof(cupsd_banner_t)); /* * Copy the new banner data over... */ - Banners = temp; - temp += NumBanners; - NumBanners ++; - - memset(temp, 0, sizeof(cupsd_banner_t)); strlcpy(temp->name, name, sizeof(temp->name)); temp->filetype = filetype; + + cupsArrayAdd(Banners, temp); } @@ -110,8 +98,27 @@ cupsdFindBanner(const char *name) /* I - Name of banner */ strlcpy(key.name, name, sizeof(key.name)); - return ((cupsd_banner_t *)bsearch(&key, Banners, NumBanners, sizeof(cupsd_banner_t), - (int (*)(const void *, const void *))compare)); + return ((cupsd_banner_t *)cupsArrayFind(Banners, &key)); +} + + +/* + * 'cupsdFreeBanners()' - Free all banners. + */ + +void +cupsdFreeBanners(void) +{ + cupsd_banner_t *temp; /* Current banner */ + + + for (temp = (cupsd_banner_t *)cupsArrayFirst(Banners); + temp; + temp = (cupsd_banner_t *)cupsArrayNext(Banners)) + free(temp); + + cupsArrayDelete(Banners); + Banners = NULL; } @@ -132,11 +139,7 @@ cupsdLoadBanners(const char *d) /* I - Directory to search */ * Free old banner info... */ - if (NumBanners) - { - free(Banners); - NumBanners = 0; - } + cupsdFreeBanners(); /* * Try opening the banner directory... @@ -153,6 +156,8 @@ cupsdLoadBanners(const char *d) /* I - Directory to search */ * Read entries, skipping directories and backup files. */ + Banners = cupsArrayNew((cups_array_func_t)compare_banners, NULL); + while ((dent = cupsDirRead(dir)) != NULL) { /* @@ -182,29 +187,26 @@ cupsdLoadBanners(const char *d) /* I - Directory to search */ } /* - * Close the directory and sort as needed... + * Close the directory... */ cupsDirClose(dir); - - if (NumBanners > 1) - qsort(Banners, NumBanners, sizeof(cupsd_banner_t), - (int (*)(const void *, const void *))compare); } /* - * 'compare()' - Compare two banners. + * 'compare_banners()' - Compare two banners. */ static int /* O - -1 if name0 < name1, etc. */ -compare(const cupsd_banner_t *b0, /* I - First banner */ - const cupsd_banner_t *b1) /* I - Second banner */ +compare_banners( + const cupsd_banner_t *b0, /* I - First banner */ + const cupsd_banner_t *b1) /* I - Second banner */ { return (strcasecmp(b0->name, b1->name)); } /* - * End of "$Id: banners.c 4719 2005-09-28 21:12:44Z mike $". + * End of "$Id: banners.c 4968 2006-01-24 03:56:31Z mike $". */ diff --git a/scheduler/banners.h b/scheduler/banners.h index dff951df7..668c5ade8 100644 --- a/scheduler/banners.h +++ b/scheduler/banners.h @@ -1,9 +1,9 @@ /* - * "$Id: banners.h 4719 2005-09-28 21:12:44Z mike $" + * "$Id: banners.h 4968 2006-01-24 03:56:31Z mike $" * * Banner definitions for the Common UNIX Printing System (CUPS). * - * Copyright 1997-2005 by Easy Software Products. + * Copyright 1997-2006 by Easy Software Products. * * These coded instructions, statements, and computer programs are the * property of Easy Software Products and are protected by Federal @@ -37,9 +37,7 @@ typedef struct * Globals... */ -VAR int NumBanners VALUE(0); - /* Number of banner files available */ -VAR cupsd_banner_t *Banners VALUE(NULL); +VAR cups_array_t *Banners VALUE(NULL); /* Available banner files */ @@ -49,9 +47,10 @@ VAR cupsd_banner_t *Banners VALUE(NULL); extern void cupsdAddBanner(const char *name, const char *filename); extern cupsd_banner_t *cupsdFindBanner(const char *name); +extern void cupsdFreeBanners(void); extern void cupsdLoadBanners(const char *d); /* - * End of "$Id: banners.h 4719 2005-09-28 21:12:44Z mike $". + * End of "$Id: banners.h 4968 2006-01-24 03:56:31Z mike $". */ diff --git a/scheduler/cert.c b/scheduler/cert.c index 4255dd8c4..aa8b6ca50 100644 --- a/scheduler/cert.c +++ b/scheduler/cert.c @@ -1,5 +1,5 @@ /* - * "$Id: cert.c 4719 2005-09-28 21:12:44Z mike $" + * "$Id: cert.c 4966 2006-01-23 00:41:22Z mike $" * * Authentication certificate routines for the Common UNIX * Printing System (CUPS). @@ -37,6 +37,10 @@ */ #include "cupsd.h" +#ifdef HAVE_ACL_INIT +# include <sys/acl.h> +# include <membership.h> +#endif /* HAVE_ACL_INIT */ /* @@ -94,6 +98,14 @@ cupsdAddCert(int pid, /* I - Process ID */ if (pid == 0) { +#ifdef HAVE_ACL_INIT + acl_t acl; /* ACL information */ + acl_entry_t entry; /* ACL entry */ + acl_permset_t permset; /* Permissions */ + uuid_t group; /* Group ID */ +#endif /* HAVE_ACL_INIT */ + + /* * Root certificate... */ @@ -101,6 +113,39 @@ cupsdAddCert(int pid, /* I - Process ID */ fchmod(fd, 0440); fchown(fd, RunUser, SystemGroupIDs[0]); +#ifdef HAVE_ACL_INIT + if (NumSystemGroups > 1) + { + /* + * Set POSIX ACLs for the root certificate so that all system + * groups can access it... + */ + + acl = acl_init(NumSystemGroups - 1); + + for (i = 1; i < NumSystemGroups; i ++) + { + /* + * Add each group ID to the ACL... + */ + + acl_create_entry(&acl, &entry); + acl_get_permset(entry, &permset); + acl_add_perm(permset, ACL_READ_DATA); + acl_set_tag_type(entry, ACL_EXTENDED_ALLOW); + mbr_gid_to_uuid((gid_t)SystemGroupIDs[i], group); + acl_set_qualifier(entry, &group); + acl_set_permset(entry, permset); + } + + if (acl_set_fd(fd, acl)) + cupsdLogMessage(CUPSD_LOG_ERROR, + "Unable to set ACLs on root certificate \"%s\" - %s", + filename, strerror(errno)); + acl_free(acl); + } +#endif /* HAVE_ACL_INIT */ + RootCertTime = time(NULL); } else @@ -292,5 +337,5 @@ cupsdInitCerts(void) /* - * End of "$Id: cert.c 4719 2005-09-28 21:12:44Z mike $". + * End of "$Id: cert.c 4966 2006-01-23 00:41:22Z mike $". */ diff --git a/scheduler/classes.c b/scheduler/classes.c index 5b0d8d5ce..9c098f74f 100644 --- a/scheduler/classes.c +++ b/scheduler/classes.c @@ -1,5 +1,5 @@ /* - * "$Id: classes.c 4848 2005-11-22 04:14:43Z mike $" + * "$Id: classes.c 4988 2006-01-26 00:53:00Z mike $" * * Printer class routines for the Common UNIX Printing System (CUPS). * @@ -336,9 +336,10 @@ cupsdLoadAllClasses(void) snprintf(line, sizeof(line), "%s/classes.conf", ServerRoot); if ((fp = cupsFileOpen(line, "r")) == NULL) { - cupsdLogMessage(CUPSD_LOG_ERROR, - "cupsdLoadAllClasses: Unable to open %s - %s", line, - strerror(errno)); + if (errno != ENOENT) + cupsdLogMessage(CUPSD_LOG_ERROR, + "cupsdLoadAllClasses: Unable to open %s - %s", line, + strerror(errno)); return; } @@ -718,7 +719,7 @@ cupsdSaveAllClasses(void) */ fchown(cupsFileNumber(fp), RunUser, Group); - fchmod(cupsFileNumber(fp), ConfigFilePerm); + fchmod(cupsFileNumber(fp), 0600); /* * Write a small header to the file... @@ -840,5 +841,5 @@ cupsdUpdateImplicitClasses(void) /* - * End of "$Id: classes.c 4848 2005-11-22 04:14:43Z mike $". + * End of "$Id: classes.c 4988 2006-01-26 00:53:00Z mike $". */ diff --git a/scheduler/client.c b/scheduler/client.c index dc68d4549..b550ec448 100644 --- a/scheduler/client.c +++ b/scheduler/client.c @@ -1,5 +1,5 @@ /* - * "$Id: client.c 4912 2006-01-10 21:43:56Z mike $" + * "$Id: client.c 4950 2006-01-19 16:07:57Z mike $" * * Client routines for the Common UNIX Printing System (CUPS) scheduler. * @@ -778,17 +778,22 @@ cupsdEncryptClient(cupsd_client_t *con) /* I - Client to encrypt */ error = SSLSetAllowsAnyRoot(conn, true); if (!error && ServerCertificatesArray) + { error = SSLSetCertificate(conn, ServerCertificatesArray); - /* - * Perform SSL/TLS handshake - */ - - do - { - error = SSLHandshake(conn); + /* + * Perform SSL/TLS handshake + */ + + if (!error) + { + do + { + error = SSLHandshake(conn); + } + while (error == errSSLWouldBlock); + } } - while (error == errSSLWouldBlock); if (error) { @@ -3480,5 +3485,5 @@ pipe_command(cupsd_client_t *con, /* I - Client connection */ /* - * End of "$Id: client.c 4912 2006-01-10 21:43:56Z mike $". + * End of "$Id: client.c 4950 2006-01-19 16:07:57Z mike $". */ diff --git a/scheduler/conf.c b/scheduler/conf.c index 0963e5fec..9dfe9360a 100644 --- a/scheduler/conf.c +++ b/scheduler/conf.c @@ -1,5 +1,5 @@ /* - * "$Id: conf.c 4903 2006-01-10 20:02:46Z mike $" + * "$Id: conf.c 4993 2006-01-26 19:27:40Z mike $" * * Configuration routines for the Common UNIX Printing System (CUPS). * @@ -24,6 +24,8 @@ * Contents: * * cupsdReadConfiguration() - Read the cupsd.conf file. + * check_permissions() - Fix the mode and ownership of a file or + * directory. * get_address() - Get an address + port number from a line. * get_addr_and_mask() - Get an IP address and netmask. * parse_aaa() - Parse authentication, authorization, and @@ -100,6 +102,7 @@ static cupsd_var_t variables[] = { "DefaultLanguage", &DefaultLanguage, CUPSD_VARTYPE_STRING }, { "DefaultLeaseDuration", &DefaultLeaseDuration, CUPSD_VARTYPE_INTEGER }, { "DefaultPolicy", &DefaultPolicy, CUPSD_VARTYPE_STRING }, + { "DefaultShared", &DefaultShared, CUPSD_VARTYPE_BOOLEAN }, { "DocumentRoot", &DocumentRoot, CUPSD_VARTYPE_STRING }, { "ErrorLog", &ErrorLog, CUPSD_VARTYPE_STRING }, { "FileDevice", &FileDevice, CUPSD_VARTYPE_BOOLEAN }, @@ -173,7 +176,10 @@ static unsigned zeros[4] = /* * Local functions... */ - +static int check_permissions(const char *filename, + const char *suffix, int mode, + int user, int group, int is_dir, + int create_dir); static http_addrlist_t *get_address(const char *value, int defport); static int get_addr_and_mask(const char *value, unsigned *ip, unsigned *mask); @@ -196,8 +202,6 @@ cupsdReadConfiguration(void) int status; /* Return status */ char temp[1024], /* Temporary buffer */ *slash; /* Directory separator */ - char type[MIME_MAX_SUPER + MIME_MAX_TYPE]; - /* MIME type name */ cups_lang_t *language; /* Language */ struct passwd *user; /* Default user */ struct group *group; /* Default group */ @@ -288,7 +292,7 @@ cupsdReadConfiguration(void) #ifdef HAVE_SSL # ifdef HAVE_CDSASSL - cupsdSetString(&ServerCertificate, "/var/root/Library/Keychains/CUPS"); + cupsdSetString(&ServerCertificate, "/Library/Keychains/System.keychain"); # else cupsdSetString(&ServerCertificate, "ssl/server.crt"); cupsdSetString(&ServerKey, "ssl/server.key"); @@ -388,7 +392,7 @@ cupsdReadConfiguration(void) * Numeric options... */ - ConfigFilePerm = 0640; + ConfigFilePerm = 0640; /* TODO: Add configure option */ DefaultAuthType = AUTH_BASIC; JobRetryLimit = 5; JobRetryInterval = 300; @@ -422,6 +426,7 @@ cupsdReadConfiguration(void) BrowseShortNames = TRUE; BrowseTimeout = DEFAULT_TIMEOUT; Browsing = TRUE; + DefaultShared = TRUE; /* TODO: Add configure option */ cupsdClearString(&BrowseLocalOptions); cupsdClearString(&BrowseRemoteOptions); @@ -587,7 +592,7 @@ cupsdReadConfiguration(void) if (!strncmp(ServerRoot, ServerCertificate, strlen(ServerRoot))) { chown(ServerCertificate, RunUser, Group); - chmod(ServerCertificate, ConfigFilePerm); + chmod(ServerCertificate, 0600); } # if defined(HAVE_LIBSSL) || defined(HAVE_GNUTLS) @@ -597,7 +602,7 @@ cupsdReadConfiguration(void) if (!strncmp(ServerRoot, ServerKey, strlen(ServerRoot))) { chown(ServerKey, RunUser, Group); - chmod(ServerKey, ConfigFilePerm); + chmod(ServerKey, 0600); } # endif /* HAVE_LIBSSL || HAVE_GNUTLS */ #endif /* HAVE_SSL */ @@ -607,65 +612,28 @@ cupsdReadConfiguration(void) * writable by the user and group in the cupsd.conf file... */ - chown(CacheDir, RunUser, Group); - chmod(CacheDir, 0775); - - snprintf(temp, sizeof(temp), "%s/ppd", CacheDir); - if (access(temp, 0)) - mkdir(temp, 0755); - chown(temp, RunUser, Group); - chmod(temp, 0755); - - chown(StateDir, RunUser, Group); - chmod(StateDir, 0775); - - snprintf(temp, sizeof(temp), "%s/certs", StateDir); - if (access(temp, 0)) - mkdir(temp, 0510); - chown(temp, User, SystemGroupIDs[0]); - if (RunUser) - chmod(temp, 0710); - else - chmod(temp, 0510); - - chown(ServerRoot, RunUser, Group); - chmod(ServerRoot, 0755); - - snprintf(temp, sizeof(temp), "%s/ppd", ServerRoot); - if (access(temp, 0)) - mkdir(temp, 0755); - chown(temp, RunUser, Group); - chmod(temp, 0755); - - snprintf(temp, sizeof(temp), "%s/ssl", ServerRoot); - if (access(temp, 0)) - mkdir(temp, 0700); - chown(temp, RunUser, Group); - chmod(temp, 0700); - - snprintf(temp, sizeof(temp), "%s/cupsd.conf", ServerRoot); - chown(temp, RunUser, Group); - chmod(temp, ConfigFilePerm); + check_permissions(CacheDir, NULL, 0775, RunUser, Group, 1, 1); + check_permissions(CacheDir, "ppd", 0755, RunUser, Group, 1, 1); - snprintf(temp, sizeof(temp), "%s/classes.conf", ServerRoot); - chown(temp, RunUser, Group); - chmod(temp, 0600); + check_permissions(StateDir, NULL, 0775, RunUser, Group, 1, 1); + check_permissions(StateDir, "certs", RunUser ? 0711 : 0511, User, + SystemGroupIDs[0], 1, 1); - snprintf(temp, sizeof(temp), "%s/printers.conf", ServerRoot); - chown(temp, RunUser, Group); - chmod(temp, 0600); - - snprintf(temp, sizeof(temp), "%s/passwd.md5", ServerRoot); - chown(temp, User, Group); - chmod(temp, 0600); + check_permissions(ServerRoot, NULL, 0755, RunUser, Group, 1, 0); + check_permissions(ServerRoot, "ppd", 0755, RunUser, Group, 1, 1); + check_permissions(ServerRoot, "ssl", 0700, RunUser, Group, 1, 0); + check_permissions(ServerRoot, "cupsd.conf", ConfigFilePerm, RunUser, Group, + 0, 0); + check_permissions(ServerRoot, "classes.conf", 0600, RunUser, Group, 0, 0); + check_permissions(ServerRoot, "printers.conf", 0600, RunUser, Group, 0, 0); + check_permissions(ServerRoot, "passwd.md5", 0600, User, Group, 0, 0); /* * Make sure the request and temporary directories have the right * permissions... */ - chown(RequestRoot, RunUser, Group); - chmod(RequestRoot, 0710); + check_permissions(RequestRoot, NULL, 0710, RunUser, Group, 1, 1); if (!strncmp(TempDir, RequestRoot, strlen(RequestRoot)) || access(TempDir, 0)) @@ -675,11 +643,7 @@ cupsdReadConfiguration(void) * is under the spool directory or does not exist... */ - if (access(TempDir, 0)) - mkdir(TempDir, 01770); - - chown(TempDir, RunUser, Group); - chmod(TempDir, 01770); + check_permissions(TempDir, NULL, 01770, RunUser, Group, 1, 1); } if (!strncmp(TempDir, RequestRoot, strlen(RequestRoot))) @@ -915,6 +879,11 @@ cupsdReadConfiguration(void) !old_serverroot || !ServerRoot || strcmp(old_serverroot, ServerRoot) || !old_requestroot || !RequestRoot || strcmp(old_requestroot, RequestRoot)) { + mime_type_t *type; /* Current type */ + char mimetype[MIME_MAX_SUPER + MIME_MAX_TYPE]; + /* MIME type name */ + + cupsdLogMessage(CUPSD_LOG_INFO, "Full reload is required."); /* @@ -956,25 +925,27 @@ cupsdReadConfiguration(void) cupsdLogMessage(CUPSD_LOG_INFO, "Loaded MIME database from \'%s\': %d types, %d filters...", - ServerRoot, MimeDatabase->num_types, MimeDatabase->num_filters); + ServerRoot, mimeNumTypes(MimeDatabase), + mimeNumFilters(MimeDatabase)); /* * Create a list of MIME types for the document-format-supported * attribute... */ - NumMimeTypes = MimeDatabase->num_types; + NumMimeTypes = mimeNumTypes(MimeDatabase); if (!mimeType(MimeDatabase, "application", "octet-stream")) NumMimeTypes ++; MimeTypes = calloc(NumMimeTypes, sizeof(const char *)); - for (i = 0; i < MimeDatabase->num_types; i ++) + for (i = 0, type = mimeFirstType(MimeDatabase); + type; + i ++, type = mimeNextType(MimeDatabase)) { - snprintf(type, sizeof(type), "%s/%s", MimeDatabase->types[i]->super, - MimeDatabase->types[i]->type); + snprintf(mimetype, sizeof(mimetype), "%s/%s", type->super, type->type); - MimeTypes[i] = strdup(type); + MimeTypes[i] = strdup(mimetype); } if (i < NumMimeTypes) @@ -1050,6 +1021,113 @@ cupsdReadConfiguration(void) /* + * 'check_permissions()' - Fix the mode and ownership of a file or directory. + */ + +static int /* O - 0 on success, -1 on error */ +check_permissions(const char *filename, /* I - File/directory name */ + const char *suffix, /* I - Additional file/directory name */ + int mode, /* I - Permissions */ + int user, /* I - Owner */ + int group, /* I - Group */ + int is_dir, /* I - 1 = directory, 0 = file */ + int create_dir)/* I - 1 = create directory, 0 = not */ +{ + int dir_created = 0; /* Did we create a directory? */ + char pathname[1024]; /* File name with prefix */ + struct stat fileinfo; /* Stat buffer */ + + + /* + * Prepend the given root to the filename before testing it... + */ + + if (suffix) + { + snprintf(pathname, sizeof(pathname), "%s/%s", filename, suffix); + filename = pathname; + } + + /* + * See if we can stat the file/directory... + */ + + if (stat(filename, &fileinfo)) + { + if (errno == ENOENT && create_dir) + { + cupsdLogMessage(CUPSD_LOG_ERROR, "Creating missing directory \"%s\"", + filename); + + if (mkdir(filename, mode)) + { + cupsdLogMessage(CUPSD_LOG_ERROR, + "Unable to create directory \"%s\" - %s", filename, + strerror(errno)); + return (-1); + } + + dir_created = 1; + } + else + return (-1); + } + + /* + * Make sure it's a regular file... + */ + + if (!dir_created && !is_dir && !S_ISREG(fileinfo.st_mode)) + { + cupsdLogMessage(CUPSD_LOG_ERROR, "\"%s\" is not a regular file!", filename); + return (-1); + } + + if (!dir_created && is_dir && !S_ISDIR(fileinfo.st_mode)) + { + cupsdLogMessage(CUPSD_LOG_ERROR, "\"%s\" is not a directory!", filename); + return (-1); + } + + /* + * Fix owner, group, and mode as needed... + */ + + if (dir_created || fileinfo.st_uid != user || fileinfo.st_gid != group) + { + cupsdLogMessage(CUPSD_LOG_WARN, "Repairing ownership of \"%s\"", filename); + + if (chown(filename, user, group)) + { + cupsdLogMessage(CUPSD_LOG_ERROR, + "Unable to change ownership of \"%s\" - %s", filename, + strerror(errno)); + return (-1); + } + } + + if (dir_created || (fileinfo.st_mode & 0777) != mode) + { + cupsdLogMessage(CUPSD_LOG_WARN, "Repairing access permissions of \"%s\"", filename); + + if (chmod(filename, mode)) + { + cupsdLogMessage(CUPSD_LOG_ERROR, + "Unable to change permissions of \"%s\" - %s", filename, + strerror(errno)); + return (-1); + } + } + + /* + * Everything is OK... + */ + + return (0); +} + + +/* * 'get_address()' - Get an address + port number from a line. */ @@ -3044,5 +3122,5 @@ read_policy(cups_file_t *fp, /* I - Configuration file */ /* - * End of "$Id: conf.c 4903 2006-01-10 20:02:46Z mike $". + * End of "$Id: conf.c 4993 2006-01-26 19:27:40Z mike $". */ diff --git a/scheduler/conf.h b/scheduler/conf.h index 314a0d7c6..7f83f80da 100644 --- a/scheduler/conf.h +++ b/scheduler/conf.h @@ -1,5 +1,5 @@ /* - * "$Id: conf.h 4719 2005-09-28 21:12:44Z mike $" + * "$Id: conf.h 4988 2006-01-26 00:53:00Z mike $" * * Configuration file definitions for the Common UNIX Printing System (CUPS) * scheduler. @@ -163,8 +163,10 @@ VAR int ClassifyOverride VALUE(0), RunAsUser VALUE(FALSE), /* Run as unpriviledged user? */ RunUser, /* User to run as, used for files */ - PrintcapFormat VALUE(PRINTCAP_BSD); + PrintcapFormat VALUE(PRINTCAP_BSD), /* Format of printcap file? */ + DefaultShared VALUE(TRUE); + /* Share printers by default? */ VAR cups_file_t *AccessFile VALUE(NULL), /* Access log file */ *ErrorFile VALUE(NULL), @@ -207,5 +209,5 @@ extern int cupsdLogPage(cupsd_job_t *job, const char *page); /* - * End of "$Id: conf.h 4719 2005-09-28 21:12:44Z mike $". + * End of "$Id: conf.h 4988 2006-01-26 00:53:00Z mike $". */ diff --git a/scheduler/env.c b/scheduler/env.c index df13dab18..39a0c6ccb 100644 --- a/scheduler/env.c +++ b/scheduler/env.c @@ -1,5 +1,5 @@ /* - * "$Id: env.c 4719 2005-09-28 21:12:44Z mike $" + * "$Id: env.c 4961 2006-01-20 22:19:13Z mike $" * * Environment management routines for the Common UNIX Printing System (CUPS). * @@ -103,7 +103,9 @@ cupsdInitEnv(void) cupsdSetEnv("LD_LIBRARY_PATH", NULL); cupsdSetEnv("LD_PRELOAD", NULL); cupsdSetEnv("NLSPATH", NULL); - cupsdSetEnvf("PATH", "%s/filter:/bin:/usr/bin", ServerBin); + cupsdSetEnvf("PATH", "%s/filter:" CUPS_BINDIR ":" CUPS_SBINDIR + ":/bin:/usr/bin", ServerBin); + cupsdSetEnv("SERVER_ADMIN", ServerAdmin); cupsdSetEnv("SHLIB_PATH", NULL); cupsdSetEnv("SOFTWARE", CUPS_MINIMAL); cupsdSetEnv("TMPDIR", TempDir); @@ -220,5 +222,5 @@ cupsdSetEnvf(const char *name, /* I - Name of variable */ /* - * End of "$Id: env.c 4719 2005-09-28 21:12:44Z mike $". + * End of "$Id: env.c 4961 2006-01-20 22:19:13Z mike $". */ diff --git a/scheduler/filter.c b/scheduler/filter.c index dbf19a0de..c783b5db7 100644 --- a/scheduler/filter.c +++ b/scheduler/filter.c @@ -1,9 +1,9 @@ /* - * "$Id: filter.c 4833 2005-11-12 21:46:52Z mike $" + * "$Id: filter.c 4970 2006-01-24 14:05:45Z mike $" * * File type conversion routines for the Common UNIX Printing System (CUPS). * - * Copyright 1997-2005 by Easy Software Products, all rights reserved. + * Copyright 1997-2006 by Easy Software Products, all rights reserved. * * These coded instructions, statements, and computer programs are the * property of Easy Software Products and are protected by Federal @@ -23,10 +23,10 @@ * * Contents: * - * mimeAddFilter() - Add a filter to the current MIME database. - * mimeFilter() - Find the fastest way to convert from one type to another. - * compare() - Compare two filter types... - * lookup() - Lookup a filter... + * mimeAddFilter() - Add a filter to the current MIME database. + * mimeFilter() - Find the fastest way to convert from one type to another. + * compare_filters() - Compare two filters... + * lookup() - Lookup a filter... */ /* @@ -46,7 +46,7 @@ * Local functions... */ -static int compare(mime_filter_t *, mime_filter_t *); +static int compare_filters(mime_filter_t *, mime_filter_t *); static mime_filter_t *lookup(mime_t *, mime_type_t *, mime_type_t *); @@ -68,10 +68,7 @@ mimeAddFilter(mime_t *mime, /* I - MIME database */ * Range-check the input... */ - if (mime == NULL || src == NULL || dst == NULL || filter == NULL) - return (NULL); - - if (strlen(filter) > (MIME_MAX_FILTER - 1)) + if (!mime || !src || !dst || !filter) return (NULL); /* @@ -98,17 +95,14 @@ mimeAddFilter(mime_t *mime, /* I - MIME database */ * Nope, add a new one... */ - if (mime->num_filters == 0) - temp = malloc(sizeof(mime_filter_t)); - else - temp = realloc(mime->filters, sizeof(mime_filter_t) * (mime->num_filters + 1)); + if (!mime->filters) + mime->filters = cupsArrayNew((cups_array_func_t)compare_filters, NULL); - if (temp == NULL) + if (!mime->filters) return (NULL); - mime->filters = temp; - temp += mime->num_filters; - mime->num_filters ++; + if ((temp = calloc(1, sizeof(mime_filter_t))) == NULL) + return (NULL); /* * Copy the information over and sort if necessary... @@ -119,9 +113,7 @@ mimeAddFilter(mime_t *mime, /* I - MIME database */ temp->cost = cost; strlcpy(temp->filter, filter, sizeof(temp->filter)); - if (mime->num_filters > 1) - qsort(mime->filters, mime->num_filters, sizeof(mime_filter_t), - (int (*)(const void *, const void *))compare); + cupsArrayAdd(mime->filters, temp); } /* @@ -136,54 +128,52 @@ mimeAddFilter(mime_t *mime, /* I - MIME database */ * 'mimeFilter()' - Find the fastest way to convert from one type to another. */ -mime_filter_t * /* O - Array of filters to run */ +cups_array_t * /* O - Array of filters to run */ mimeFilter(mime_t *mime, /* I - MIME database */ mime_type_t *src, /* I - Source file type */ mime_type_t *dst, /* I - Destination file type */ - int *num_filters, /* O - Number of filters to run */ + int *cost, /* O - Cost of filters */ int max_depth) /* I - Maximum depth of search */ { - int i, j, /* Looping vars */ - num_temp, /* Number of temporary filters */ - num_mintemp, /* Number of filters in the minimum */ - cost, /* Current cost */ + int tempcost, /* Temporary cost */ mincost; /* Current minimum */ - mime_filter_t *temp, /* Temporary filter */ - *mintemp, /* Current minimum */ - *current; /* Current filter */ + cups_array_t *temp, /* Temporary filter */ + *mintemp; /* Current minimum */ + mime_filter_t *current; /* Current filter */ /* * Range-check the input... */ - DEBUG_printf(("mimeFilter(mime=%p, src=%p(%s/%s), dst=%p(%s/%s), num_filters=%p(%d))\n", + DEBUG_printf(("mimeFilter(mime=%p, src=%p(%s/%s), dst=%p(%s/%s), " + "cost=%p(%d), max_depth=%d)\n", mime, src, src ? src->super : "?", src ? src->type : "?", dst, dst ? dst->super : "?", dst ? dst->type : "?", - num_filters, num_filters ? *num_filters : 0)); + cost, cost ? *cost : 0, max_depth)); - if (mime == NULL || src == NULL || dst == NULL || num_filters == NULL || - max_depth <= 0) - return (NULL); + if (cost) + *cost = 0; - *num_filters = 0; + if (!mime || !src || !dst || !cost || max_depth <= 0) + return (NULL); /* * See if there is a filter that can convert the files directly... */ - if ((temp = lookup(mime, src, dst)) != NULL) + if ((current = lookup(mime, src, dst)) != NULL) { /* * Got a direct filter! */ - if ((mintemp = (mime_filter_t *)malloc(sizeof(mime_filter_t))) == NULL) + if ((mintemp = cupsArrayNew(NULL, NULL)) == NULL) return (NULL); - memcpy(mintemp, temp, sizeof(mime_filter_t)); - num_mintemp = 1; - mincost = mintemp->cost; + cupsArrayAdd(mintemp, current); + + mincost = current->cost; DEBUG_puts(" Found direct filter:"); DEBUG_printf((" %s (cost=%d)\n", mintemp->filter, mincost)); @@ -194,18 +184,17 @@ mimeFilter(mime_t *mime, /* I - MIME database */ * No direct filter... */ - mincost = 9999999; - mintemp = NULL; - num_mintemp = 0; + mintemp = NULL; + mincost = 9999999; } /* * OK, now look for filters from the source type to any other type... */ - for (i = mime->num_filters, current = mime->filters; - i > 0; - i --, current ++) + for (current = (mime_filter_t *)cupsArrayFirst(mime->filters); + current; + current = (mime_filter_t *)cupsArrayNext(mime->filters)) if (current->src == src) { /* @@ -213,8 +202,11 @@ mimeFilter(mime_t *mime, /* I - MIME database */ * of this filter to the final type... */ - if ((temp = mimeFilter(mime, current->dst, dst, &num_temp, - max_depth - 1)) == NULL) + cupsArraySave(mime->filters); + temp = mimeFilter(mime, current->dst, dst, &tempcost, max_depth - 1); + cupsArrayRestore(mime->filters); + + if (!temp) continue; /* @@ -222,52 +214,39 @@ mimeFilter(mime_t *mime, /* I - MIME database */ * any...) */ - for (j = 0, cost = current->cost; j < num_temp; j ++) - cost += temp[j].cost; - - if (cost < mincost) + if (tempcost < mincost) { - if (mintemp != NULL) - free(mintemp); + cupsArrayDelete(mintemp); /* * Hey, we got a match! Add the current filter to the beginning of the * filter list... */ - mintemp = (mime_filter_t *)realloc(temp, sizeof(mime_filter_t) * - (num_temp + 1)); - - if (mintemp == NULL) - { - *num_filters = 0; - return (NULL); - } - - memmove(mintemp + 1, mintemp, num_temp * sizeof(mime_filter_t)); - memcpy(mintemp, current, sizeof(mime_filter_t)); - - num_mintemp = num_temp + 1; - mincost = cost; + mintemp = temp; + mincost = tempcost + current->cost; + cupsArrayInsert(mintemp, current); } else - free(temp); + cupsArrayDelete(temp); } - if (mintemp != NULL) + if (mintemp) { /* * Hey, we got a match! */ - *num_filters = num_mintemp; - #ifdef DEBUG - printf(" Returning %d filters:\n", *num_filters); - for (i = 0; i < num_mintemp; i ++) - printf(" %s\n", mintemp[i].filter); + printf(" Returning %d filters:\n", cupsArrayCount(mintemp)); + for (current = (mime_filter_t *)cupsArrayFirst(mintemp); + current; + current = (mime_filter_t *)cupsArrayNext(mintemp)) + printf(" %s\n", current->filter); #endif /* DEBUG */ + *cost = mincost; + return (mintemp); } @@ -278,14 +257,14 @@ mimeFilter(mime_t *mime, /* I - MIME database */ /* - * 'compare()' - Compare two filter types... + * 'compare_filters()' - Compare two filters... */ -static int /* O - Comparison result */ -compare(mime_filter_t *f0, /* I - First filter */ - mime_filter_t *f1) /* I - Second filter */ +static int /* O - Comparison result */ +compare_filters(mime_filter_t *f0, /* I - First filter */ + mime_filter_t *f1) /* I - Second filter */ { - int i; /* Result of comparison */ + int i; /* Result of comparison */ if ((i = strcmp(f0->src->super, f1->src->super)) == 0) @@ -301,26 +280,21 @@ compare(mime_filter_t *f0, /* I - First filter */ * 'lookup()' - Lookup a filter... */ -static mime_filter_t * /* O - Filter for src->dst */ -lookup(mime_t *mime, /* I - MIME database */ - mime_type_t *src, /* I - Source type */ - mime_type_t *dst) /* I - Destination type */ +static mime_filter_t * /* O - Filter for src->dst */ +lookup(mime_t *mime, /* I - MIME database */ + mime_type_t *src, /* I - Source type */ + mime_type_t *dst) /* I - Destination type */ { - mime_filter_t key; /* Key record for filter search */ + mime_filter_t key; /* Key record for filter search */ - if (mime->num_filters == 0) - return (NULL); - key.src = src; key.dst = dst; - return ((mime_filter_t *)bsearch(&key, mime->filters, mime->num_filters, - sizeof(mime_filter_t), - (int (*)(const void *, const void *))compare)); + return ((mime_filter_t *)cupsArrayFind(mime->filters, &key)); } /* - * End of "$Id: filter.c 4833 2005-11-12 21:46:52Z mike $". + * End of "$Id: filter.c 4970 2006-01-24 14:05:45Z mike $". */ diff --git a/scheduler/ipp.c b/scheduler/ipp.c index d69dec1e8..f5b69ac4e 100644 --- a/scheduler/ipp.c +++ b/scheduler/ipp.c @@ -1,5 +1,5 @@ /* - * "$Id: ipp.c 4906 2006-01-10 20:53:28Z mike $" + * "$Id: ipp.c 4995 2006-01-26 20:14:42Z mike $" * * IPP routines for the Common UNIX Printing System (CUPS) scheduler. * @@ -46,6 +46,8 @@ * copy_file() - Copy a PPD file or interface script... * copy_model() - Copy a PPD model file, substituting default * values as needed... + * copy_job_attrs() - Copy job attributes. + * copy_printer_attrs() - Copy printer attributes. * copy_subscription_attrs() - Copy subscription attributes. * create_job() - Print a file to a printer or class. * create_requested_array() - Create an array for the requested-attributes. @@ -54,8 +56,8 @@ * get_default() - Get the default destination. * get_devices() - Get the list of available devices on the * local system. - * get_jobs() - Get a list of jobs for the specified printer. * get_job_attrs() - Get job attributes. + * get_jobs() - Get a list of jobs for the specified printer. * get_notifications() - Get events for a subscription. * get_ppds() - Get the list of PPD files on the local * system. @@ -130,11 +132,17 @@ static void cancel_subscription(cupsd_client_t *con, int id); static int check_quotas(cupsd_client_t *con, cupsd_printer_t *p); static ipp_attribute_t *copy_attribute(ipp_t *to, ipp_attribute_t *attr, int quickcopy); -static void copy_attrs(ipp_t *to, ipp_t *from, ipp_attribute_t *req, +static void copy_attrs(ipp_t *to, ipp_t *from, cups_array_t *ra, ipp_tag_t group, int quickcopy); static int copy_banner(cupsd_client_t *con, cupsd_job_t *job, const char *name); static int copy_file(const char *from, const char *to); static int copy_model(cupsd_client_t *con, const char *from, const char *to); +static void copy_job_attrs(cupsd_client_t *con, + cupsd_job_t *job, + cups_array_t *ra); +static void copy_printer_attrs(cupsd_client_t *con, + cupsd_printer_t *printer, + cups_array_t *ra); static void copy_subscription_attrs(cupsd_client_t *con, cupsd_subscription_t *sub, cups_array_t *ra); @@ -237,7 +245,7 @@ cupsdProcessIPPRequest( con->request->request.any.version[0], con->request->request.any.version[1]); } - else if (con->request->attrs == NULL) + else if (!con->request->attrs) { cupsdAddEvent(CUPSD_EVENT_SERVER_AUDIT, NULL, NULL, "%04X %s No attributes in request", @@ -253,7 +261,7 @@ cupsdProcessIPPRequest( */ for (attr = con->request->attrs, group = attr->group_tag; - attr != NULL; + attr; attr = attr->next) if (attr->group_tag < group && attr->group_tag != IPP_TAG_ZERO) { @@ -273,7 +281,7 @@ cupsdProcessIPPRequest( else group = attr->group_tag; - if (attr == NULL) + if (!attr) { /* * Then make sure that the first three attributes are: @@ -285,7 +293,7 @@ cupsdProcessIPPRequest( attr = con->request->attrs; if (attr && !strcmp(attr->name, "attributes-charset") && - attr->value_tag == IPP_TAG_CHARSET) + (attr->value_tag & IPP_TAG_MASK) == IPP_TAG_CHARSET) charset = attr; else charset = NULL; @@ -294,14 +302,16 @@ cupsdProcessIPPRequest( attr = attr->next; if (attr && !strcmp(attr->name, "attributes-natural-language") && - attr->value_tag == IPP_TAG_LANGUAGE) + (attr->value_tag & IPP_TAG_MASK) == IPP_TAG_LANGUAGE) language = attr; else language = NULL; - if ((attr = ippFindAttribute(con->request, "printer-uri", IPP_TAG_URI)) != NULL) + if ((attr = ippFindAttribute(con->request, "printer-uri", + IPP_TAG_URI)) != NULL) uri = attr; - else if ((attr = ippFindAttribute(con->request, "job-uri", IPP_TAG_URI)) != NULL) + else if ((attr = ippFindAttribute(con->request, "job-uri", + IPP_TAG_URI)) != NULL) uri = attr; else uri = NULL; @@ -321,8 +331,8 @@ cupsdProcessIPPRequest( ippAddString(con->response, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE, "attributes-natural-language", NULL, DefaultLanguage); - if (charset == NULL || language == NULL || - (uri == NULL && + if (!charset || !language || + (!uri && con->request->request.op.operation_id != CUPS_GET_DEFAULT && con->request->request.op.operation_id != CUPS_GET_PRINTERS && con->request->request.op.operation_id != CUPS_GET_CLASSES && @@ -367,7 +377,7 @@ cupsdProcessIPPRequest( cupsdLogMessage(CUPSD_LOG_DEBUG, "Request attributes follow..."); - for (attr = con->request->attrs; attr != NULL; attr = attr->next) + for (attr = con->request->attrs; attr; attr = attr->next) cupsdLogMessage(CUPSD_LOG_DEBUG, "attr \"%s\": group_tag = %x, value_tag = %x", attr->name ? attr->name : "(null)", attr->group_tag, @@ -757,7 +767,7 @@ add_class(cupsd_client_t *con, /* I - Client connection */ resource, sizeof(resource)); - if (strncmp(resource, "/classes/", 9) != 0 || strlen(resource) == 9) + if (strncmp(resource, "/classes/", 9) || strlen(resource) == 9) { /* * No, return an error... @@ -873,13 +883,16 @@ add_class(cupsd_client_t *con, /* I - Client connection */ * Look for attributes and copy them over as needed... */ - if ((attr = ippFindAttribute(con->request, "printer-location", IPP_TAG_TEXT)) != NULL) + if ((attr = ippFindAttribute(con->request, "printer-location", + IPP_TAG_TEXT)) != NULL) cupsdSetString(&pclass->location, attr->values[0].string.text); - if ((attr = ippFindAttribute(con->request, "printer-info", IPP_TAG_TEXT)) != NULL) + if ((attr = ippFindAttribute(con->request, "printer-info", + IPP_TAG_TEXT)) != NULL) cupsdSetString(&pclass->info, attr->values[0].string.text); - if ((attr = ippFindAttribute(con->request, "printer-is-accepting-jobs", IPP_TAG_BOOLEAN)) != NULL) + if ((attr = ippFindAttribute(con->request, "printer-is-accepting-jobs", + IPP_TAG_BOOLEAN)) != NULL) { cupsdLogMessage(CUPSD_LOG_INFO, "Setting %s printer-is-accepting-jobs to %d (was %d.)", pclass->name, attr->values[0].boolean, pclass->accepting); @@ -888,7 +901,8 @@ add_class(cupsd_client_t *con, /* I - Client connection */ cupsdAddPrinterHistory(pclass); } - if ((attr = ippFindAttribute(con->request, "printer-is-shared", IPP_TAG_BOOLEAN)) != NULL) + if ((attr = ippFindAttribute(con->request, "printer-is-shared", + IPP_TAG_BOOLEAN)) != NULL) { if (pclass->shared && !attr->values[0].boolean) cupsdSendBrowseDelete(pclass); @@ -900,7 +914,8 @@ add_class(cupsd_client_t *con, /* I - Client connection */ pclass->shared = attr->values[0].boolean; } - if ((attr = ippFindAttribute(con->request, "printer-state", IPP_TAG_ENUM)) != NULL) + if ((attr = ippFindAttribute(con->request, "printer-state", + IPP_TAG_ENUM)) != NULL) { if (attr->values[0].integer != IPP_PRINTER_IDLE && attr->values[0].integer != IPP_PRINTER_STOPPED) @@ -919,13 +934,15 @@ add_class(cupsd_client_t *con, /* I - Client connection */ else cupsdSetPrinterState(pclass, (ipp_pstate_t)(attr->values[0].integer), 0); } - if ((attr = ippFindAttribute(con->request, "printer-state-message", IPP_TAG_TEXT)) != NULL) + if ((attr = ippFindAttribute(con->request, "printer-state-message", + IPP_TAG_TEXT)) != NULL) { strlcpy(pclass->state_message, attr->values[0].string.text, sizeof(pclass->state_message)); cupsdAddPrinterHistory(pclass); } - if ((attr = ippFindAttribute(con->request, "job-sheets-default", IPP_TAG_ZERO)) != NULL && + if ((attr = ippFindAttribute(con->request, "job-sheets-default", + IPP_TAG_ZERO)) != NULL && !Classification) { cupsdSetString(&pclass->job_sheets[0], attr->values[0].string.text); @@ -942,7 +959,7 @@ add_class(cupsd_client_t *con, /* I - Client connection */ pclass->deny_users = 0; if (attr->value_tag == IPP_TAG_NAME && (attr->num_values > 1 || - strcmp(attr->values[0].string.text, "all") != 0)) + strcmp(attr->values[0].string.text, "all"))) for (i = 0; i < attr->num_values; i ++) cupsdAddPrinterUser(pclass, attr->values[i].string.text); } @@ -954,7 +971,7 @@ add_class(cupsd_client_t *con, /* I - Client connection */ pclass->deny_users = 1; if (attr->value_tag == IPP_TAG_NAME && (attr->num_values > 1 || - strcmp(attr->values[0].string.text, "none") != 0)) + strcmp(attr->values[0].string.text, "none"))) for (i = 0; i < attr->num_values; i ++) cupsdAddPrinterUser(pclass, attr->values[i].string.text); } @@ -1025,7 +1042,8 @@ add_class(cupsd_client_t *con, /* I - Client connection */ attr->values[0].string.text); cupsdSetString(&pclass->error_policy, attr->values[0].string.text); } - if ((attr = ippFindAttribute(con->request, "member-uris", IPP_TAG_URI)) != NULL) + if ((attr = ippFindAttribute(con->request, "member-uris", + IPP_TAG_URI)) != NULL) { /* * Clear the printer array as needed... @@ -1142,7 +1160,7 @@ add_file(cupsd_client_t *con, /* I - Connection to client */ sizeof(mime_type_t *)); } - if (compressions == NULL || filetypes == NULL) + if (!compressions || !filetypes) { cupsdCancelJob(job, 1); @@ -1186,7 +1204,7 @@ add_job_state_reasons( else dest = cupsdFindPrinter(job->dest); - if (dest != NULL && dest->state == IPP_PRINTER_STOPPED) + if (dest && dest->state == IPP_PRINTER_STOPPED) ippAddString(con->response, IPP_TAG_JOB, IPP_TAG_KEYWORD, "job-state-reasons", NULL, "printer-stopped"); else @@ -1195,8 +1213,10 @@ add_job_state_reasons( break; case IPP_JOB_HELD : - if (ippFindAttribute(job->attrs, "job-hold-until", IPP_TAG_KEYWORD) != NULL || - ippFindAttribute(job->attrs, "job-hold-until", IPP_TAG_NAME) != NULL) + if (ippFindAttribute(job->attrs, "job-hold-until", + IPP_TAG_KEYWORD) != NULL || + ippFindAttribute(job->attrs, "job-hold-until", + IPP_TAG_NAME) != NULL) ippAddString(con->response, IPP_TAG_JOB, IPP_TAG_KEYWORD, "job-state-reasons", NULL, "job-hold-until-specified"); else @@ -1436,7 +1456,7 @@ add_printer(cupsd_client_t *con, /* I - Client connection */ username, sizeof(username), host, sizeof(host), &port, resource, sizeof(resource)); - if (strncmp(resource, "/printers/", 10) != 0 || strlen(resource) == 10) + if (strncmp(resource, "/printers/", 10) || strlen(resource) == 10) { /* * No, return an error... @@ -1552,13 +1572,16 @@ add_printer(cupsd_client_t *con, /* I - Client connection */ * Look for attributes and copy them over as needed... */ - if ((attr = ippFindAttribute(con->request, "printer-location", IPP_TAG_TEXT)) != NULL) + if ((attr = ippFindAttribute(con->request, "printer-location", + IPP_TAG_TEXT)) != NULL) cupsdSetString(&printer->location, attr->values[0].string.text); - if ((attr = ippFindAttribute(con->request, "printer-info", IPP_TAG_TEXT)) != NULL) + if ((attr = ippFindAttribute(con->request, "printer-info", + IPP_TAG_TEXT)) != NULL) cupsdSetString(&printer->info, attr->values[0].string.text); - if ((attr = ippFindAttribute(con->request, "device-uri", IPP_TAG_URI)) != NULL) + if ((attr = ippFindAttribute(con->request, "device-uri", + IPP_TAG_URI)) != NULL) { /* * Do we have a valid device URI? @@ -1618,7 +1641,8 @@ add_printer(cupsd_client_t *con, /* I - Client connection */ cupsdSetString(&printer->device_uri, attr->values[0].string.text); } - if ((attr = ippFindAttribute(con->request, "port-monitor", IPP_TAG_KEYWORD)) != NULL) + if ((attr = ippFindAttribute(con->request, "port-monitor", + IPP_TAG_KEYWORD)) != NULL) { ipp_attribute_t *supported; /* port-monitor-supported attribute */ @@ -1648,7 +1672,8 @@ add_printer(cupsd_client_t *con, /* I - Client connection */ cupsdClearString(&printer->port_monitor); } - if ((attr = ippFindAttribute(con->request, "printer-is-accepting-jobs", IPP_TAG_BOOLEAN)) != NULL) + if ((attr = ippFindAttribute(con->request, "printer-is-accepting-jobs", + IPP_TAG_BOOLEAN)) != NULL) { cupsdLogMessage(CUPSD_LOG_INFO, "Setting %s printer-is-accepting-jobs to %d (was %d.)", @@ -1658,7 +1683,8 @@ add_printer(cupsd_client_t *con, /* I - Client connection */ cupsdAddPrinterHistory(printer); } - if ((attr = ippFindAttribute(con->request, "printer-is-shared", IPP_TAG_BOOLEAN)) != NULL) + if ((attr = ippFindAttribute(con->request, "printer-is-shared", + IPP_TAG_BOOLEAN)) != NULL) { if (printer->shared && !attr->values[0].boolean) cupsdSendBrowseDelete(printer); @@ -1670,7 +1696,8 @@ add_printer(cupsd_client_t *con, /* I - Client connection */ printer->shared = attr->values[0].boolean; } - if ((attr = ippFindAttribute(con->request, "printer-state", IPP_TAG_ENUM)) != NULL) + if ((attr = ippFindAttribute(con->request, "printer-state", + IPP_TAG_ENUM)) != NULL) { if (attr->values[0].integer != IPP_PRINTER_IDLE && attr->values[0].integer != IPP_PRINTER_STOPPED) @@ -1688,13 +1715,15 @@ add_printer(cupsd_client_t *con, /* I - Client connection */ else cupsdSetPrinterState(printer, (ipp_pstate_t)(attr->values[0].integer), 0); } - if ((attr = ippFindAttribute(con->request, "printer-state-message", IPP_TAG_TEXT)) != NULL) + if ((attr = ippFindAttribute(con->request, "printer-state-message", + IPP_TAG_TEXT)) != NULL) { strlcpy(printer->state_message, attr->values[0].string.text, sizeof(printer->state_message)); cupsdAddPrinterHistory(printer); } - if ((attr = ippFindAttribute(con->request, "job-sheets-default", IPP_TAG_ZERO)) != NULL && + if ((attr = ippFindAttribute(con->request, "job-sheets-default", + IPP_TAG_ZERO)) != NULL && !Classification) { cupsdSetString(&printer->job_sheets[0], attr->values[0].string.text); @@ -1711,7 +1740,7 @@ add_printer(cupsd_client_t *con, /* I - Client connection */ printer->deny_users = 0; if (attr->value_tag == IPP_TAG_NAME && (attr->num_values > 1 || - strcmp(attr->values[0].string.text, "all") != 0)) + strcmp(attr->values[0].string.text, "all"))) for (i = 0; i < attr->num_values; i ++) cupsdAddPrinterUser(printer, attr->values[i].string.text); } @@ -1723,7 +1752,7 @@ add_printer(cupsd_client_t *con, /* I - Client connection */ printer->deny_users = 1; if (attr->value_tag == IPP_TAG_NAME && (attr->num_values > 1 || - strcmp(attr->values[0].string.text, "none") != 0)) + strcmp(attr->values[0].string.text, "none"))) for (i = 0; i < attr->num_values; i ++) cupsdAddPrinterUser(printer, attr->values[i].string.text); } @@ -1807,7 +1836,7 @@ add_printer(cupsd_client_t *con, /* I - Client connection */ { strlcpy(srcfile, con->filename, sizeof(srcfile)); - if ((fp = cupsFileOpen(srcfile, "rb")) != NULL) + if ((fp = cupsFileOpen(srcfile, "rb"))) { /* * Yes; get the first line from it... @@ -1890,7 +1919,8 @@ add_printer(cupsd_client_t *con, /* I - Client connection */ } } } - else if ((attr = ippFindAttribute(con->request, "ppd-name", IPP_TAG_NAME)) != NULL) + else if ((attr = ippFindAttribute(con->request, "ppd-name", + IPP_TAG_NAME)) != NULL) { if (!strcmp(attr->values[0].string.text, "raw")) { @@ -1937,7 +1967,7 @@ add_printer(cupsd_client_t *con, /* I - Client connection */ * Make this printer the default if there is none... */ - if (DefaultPrinter == NULL) + if (!DefaultPrinter) DefaultPrinter = printer; /* @@ -1947,7 +1977,7 @@ add_printer(cupsd_client_t *con, /* I - Client connection */ cupsdSetPrinterAttrs(printer); cupsdSaveAllPrinters(); - if (printer->job != NULL) + if (printer->job) { cupsd_job_t *job; @@ -2079,7 +2109,8 @@ authenticate_job(cupsd_client_t *con, /* I - Client connection */ * Got a printer URI; see if we also have a job-id attribute... */ - if ((attr = ippFindAttribute(con->request, "job-id", IPP_TAG_INTEGER)) == NULL) + if ((attr = ippFindAttribute(con->request, "job-id", + IPP_TAG_INTEGER)) == NULL) { send_ipp_status(con, IPP_BAD_REQUEST, _("Got a printer-uri attribute but no job-id!")); @@ -2177,10 +2208,11 @@ authenticate_job(cupsd_client_t *con, /* I - Client connection */ * Reset the job-hold-until value to "no-hold"... */ - if ((attr = ippFindAttribute(job->attrs, "job-hold-until", IPP_TAG_KEYWORD)) == NULL) + if ((attr = ippFindAttribute(job->attrs, "job-hold-until", + IPP_TAG_KEYWORD)) == NULL) attr = ippFindAttribute(job->attrs, "job-hold-until", IPP_TAG_NAME); - if (attr != NULL) + if (attr) { attr->value_tag = IPP_TAG_KEYWORD; cupsdSetString(&(attr->values[0].string.text), "no-hold"); @@ -2238,10 +2270,12 @@ cancel_all_jobs(cupsd_client_t *con, /* I - Client connection */ * "my-jobs" is specified... */ - if ((attr = ippFindAttribute(con->request, "my-jobs", IPP_TAG_BOOLEAN)) != NULL && + if ((attr = ippFindAttribute(con->request, "my-jobs", + IPP_TAG_BOOLEAN)) != NULL && attr->values[0].boolean) { - if ((attr = ippFindAttribute(con->request, "requesting-user-name", IPP_TAG_NAME)) != NULL) + if ((attr = ippFindAttribute(con->request, "requesting-user-name", + IPP_TAG_NAME)) != NULL) username = attr->values[0].string.text; else { @@ -2257,7 +2291,8 @@ cancel_all_jobs(cupsd_client_t *con, /* I - Client connection */ * Look for the "purge-jobs" attribute... */ - if ((attr = ippFindAttribute(con->request, "purge-jobs", IPP_TAG_BOOLEAN)) != NULL) + if ((attr = ippFindAttribute(con->request, "purge-jobs", + IPP_TAG_BOOLEAN)) != NULL) purge = attr->values[0].boolean; else purge = 1; @@ -2370,7 +2405,8 @@ cancel_job(cupsd_client_t *con, /* I - Client connection */ * Got a printer URI; see if we also have a job-id attribute... */ - if ((attr = ippFindAttribute(con->request, "job-id", IPP_TAG_INTEGER)) == NULL) + if ((attr = ippFindAttribute(con->request, "job-id", + IPP_TAG_INTEGER)) == NULL) { send_ipp_status(con, IPP_BAD_REQUEST, _("Got a printer-uri attribute but no job-id!")); @@ -2417,7 +2453,7 @@ cancel_job(cupsd_client_t *con, /* I - Client connection */ !strcasecmp(job->dest, dest)) break; - if (job != NULL) + if (job) jobid = job->id; else { @@ -2546,7 +2582,7 @@ check_quotas(cupsd_client_t *con, /* I - Client connection */ * Check input... */ - if (con == NULL || p == NULL) + if (!con || !p) return (0); /* @@ -2557,7 +2593,7 @@ check_quotas(cupsd_client_t *con, /* I - Client connection */ if (con->username[0]) strlcpy(username, con->username, sizeof(username)); - else if (attr != NULL) + else if (attr) { cupsdLogMessage(CUPSD_LOG_DEBUG, "check_quotas: requesting-user-name = \"%s\"", @@ -2813,7 +2849,8 @@ copy_attribute( if (toattr->values[i].unknown.length > 0) { - if ((toattr->values[i].unknown.data = malloc(toattr->values[i].unknown.length)) == NULL) + if ((toattr->values[i].unknown.data = + malloc(toattr->values[i].unknown.length)) == NULL) toattr->values[i].unknown.length = 0; else memcpy(toattr->values[i].unknown.data, @@ -2833,46 +2870,34 @@ copy_attribute( */ static void -copy_attrs(ipp_t *to, /* I - Destination request */ - ipp_t *from, /* I - Source request */ - ipp_attribute_t *req, /* I - Requested attributes */ - ipp_tag_t group, /* I - Group to copy */ - int quickcopy) /* I - Do a quick copy? */ +copy_attrs(ipp_t *to, /* I - Destination request */ + ipp_t *from, /* I - Source request */ + cups_array_t *ra, /* I - Requested attributes */ + ipp_tag_t group, /* I - Group to copy */ + int quickcopy) /* I - Do a quick copy? */ { - int i; /* Looping var */ ipp_attribute_t *fromattr; /* Source attribute */ - cupsdLogMessage(CUPSD_LOG_DEBUG2, "copy_attrs(%p, %p, %p, %x)", to, from, - req, group); + cupsdLogMessage(CUPSD_LOG_DEBUG2, + "copy_attrs(to=%p, from=%p, ra=%p, group=%x, quickcopy=%d)", + to, from, ra, group, quickcopy); - if (to == NULL || from == NULL) + if (!to || !from) return; - if (req != NULL && strcmp(req->values[0].string.text, "all") == 0) - req = NULL; /* "all" means no filter... */ - - for (fromattr = from->attrs; fromattr != NULL; fromattr = fromattr->next) + for (fromattr = from->attrs; fromattr; fromattr = fromattr->next) { /* * Filter attributes as needed... */ if (group != IPP_TAG_ZERO && fromattr->group_tag != group && - fromattr->group_tag != IPP_TAG_ZERO) + fromattr->group_tag != IPP_TAG_ZERO && !fromattr->name) continue; - if (req != NULL && fromattr->name != NULL) - { - for (i = 0; i < req->num_values; i ++) - if (strcmp(fromattr->name, req->values[i].string.text) == 0) - break; - - if (i == req->num_values) - continue; - } - - copy_attribute(to, fromattr, quickcopy); + if (!ra || cupsArrayFind(ra, fromattr->name)) + copy_attribute(to, fromattr, quickcopy); } } @@ -2906,8 +2931,7 @@ copy_banner(cupsd_client_t *con, /* I - Client connection */ * Find the banner; return if not found or "none"... */ - if (name == NULL || - strcmp(name, "none") == 0 || + if (!name || !strcmp(name, "none") || (banner = cupsdFindBanner(name)) == NULL) return (0); @@ -3025,7 +3049,7 @@ copy_banner(cupsd_client_t *con, /* I - Client connection */ else s = attrname; - if (strcmp(s, "printer-name") == 0) + if (!strcmp(s, "printer-name")) { cupsFilePuts(out, job->dest); continue; @@ -3061,7 +3085,7 @@ copy_banner(cupsd_client_t *con, /* I - Client connection */ { case IPP_TAG_INTEGER : case IPP_TAG_ENUM : - if (strncmp(s, "time-at-", 8) == 0) + if (!strncmp(s, "time-at-", 8)) cupsFilePuts(out, cupsdGetDateTime(attr->values[i].integer)); else cupsFilePrintf(out, "%d", attr->values[i].integer); @@ -3094,7 +3118,7 @@ copy_banner(cupsd_client_t *con, /* I - Client connection */ case IPP_TAG_KEYWORD : case IPP_TAG_CHARSET : case IPP_TAG_LANGUAGE : - if (strcasecmp(banner->filetype->type, "postscript") == 0) + if (!strcasecmp(banner->filetype->type, "postscript")) { /* * Need to quote strings for PS banners... @@ -3140,7 +3164,8 @@ copy_banner(cupsd_client_t *con, /* I - Client connection */ kbytes = (cupsFileTell(out) + 1023) / 1024; - if ((attr = ippFindAttribute(job->attrs, "job-k-octets", IPP_TAG_INTEGER)) != NULL) + if ((attr = ippFindAttribute(job->attrs, "job-k-octets", + IPP_TAG_INTEGER)) != NULL) attr->values[0].integer += kbytes; cupsFileClose(out); @@ -3376,7 +3401,7 @@ copy_model(cupsd_client_t *con, /* I - Client connection */ have_letter = 0; have_a4 = 0; - while (cupsFileGets(src, buffer, sizeof(buffer)) != NULL) + while (cupsFileGets(src, buffer, sizeof(buffer))) if (!strncmp(buffer, "*PageSize ", 10)) { /* @@ -3417,7 +3442,7 @@ copy_model(cupsd_client_t *con, /* I - Client connection */ * Read all of the default lines from the old PPD... */ - while (cupsFileGets(dst, buffer, sizeof(buffer)) != NULL) + while (cupsFileGets(dst, buffer, sizeof(buffer))) if (!strncmp(buffer, "*Default", 8)) { /* @@ -3528,7 +3553,7 @@ copy_model(cupsd_client_t *con, /* I - Client connection */ * Copy the source file to the destination... */ - while (cupsFileGets(src, buffer, sizeof(buffer)) != NULL) + while (cupsFileGets(src, buffer, sizeof(buffer))) { if (!strncmp(buffer, "*Default", 8)) { @@ -3575,6 +3600,158 @@ copy_model(cupsd_client_t *con, /* I - Client connection */ /* + * 'copy_job_attrs()' - Copy job attributes. + */ + +static void +copy_job_attrs(cupsd_client_t *con, /* I - Client connection */ + cupsd_job_t *job, /* I - Job */ + cups_array_t *ra) /* I - Requested attributes array */ +{ + char job_uri[HTTP_MAX_URI]; /* Job URI */ + + + /* + * Send the requested attributes for each job... + */ + + httpAssembleURIf(job_uri, sizeof(job_uri), "ipp", NULL, + con->servername, con->serverport, "/jobs/%d", + job->id); + + if (!ra || cupsArrayFind(ra, "job-more-info")) + ippAddString(con->response, IPP_TAG_JOB, IPP_TAG_URI, + "job-more-info", NULL, job_uri); + + if (job->state->values[0].integer > IPP_JOB_PROCESSING && + (!ra || cupsArrayFind(ra, "job-preserved"))) + { + char filename[1024]; /* Job data file */ + + + snprintf(filename, sizeof(filename), "%s/d%05d-001", RequestRoot, + job->id); + ippAddBoolean(con->response, IPP_TAG_JOB, "job-preserved", + !access(filename, 0)); + } + + if (!ra || cupsArrayFind(ra, "job-printer-up-time")) + ippAddInteger(con->response, IPP_TAG_JOB, IPP_TAG_INTEGER, + "job-printer-up-time", time(NULL)); + + if (!ra || cupsArrayFind(ra, "job-state-reasons")) + add_job_state_reasons(con, job); + + if (!ra || cupsArrayFind(ra, "job-uri")) + ippAddString(con->response, IPP_TAG_JOB, IPP_TAG_URI, + "job-uri", NULL, job_uri); + + copy_attrs(con->response, job->attrs, ra, IPP_TAG_JOB, 0); +} + + +/* + * 'copy_printer_attrs()' - Copy printer attributes. + */ + +static void +copy_printer_attrs( + cupsd_client_t *con, /* I - Client connection */ + cupsd_printer_t *printer, /* I - Printer */ + cups_array_t *ra) /* I - Requested attributes array */ +{ + char printer_uri[HTTP_MAX_URI]; + /* Printer URI */ + time_t curtime; /* Current time */ + int i; /* Looping var */ + ipp_attribute_t *history; /* History collection */ + + + /* + * Copy the printer attributes to the response using requested-attributes + * and document-format attributes that may be provided by the client. + */ + + curtime = time(NULL); + + if (!ra || cupsArrayFind(ra, "printer-current-time")) + ippAddDate(con->response, IPP_TAG_PRINTER, "printer-current-time", + ippTimeToDate(curtime)); + + if (!ra || cupsArrayFind(ra, "printer-error-policy")) + ippAddString(con->response, IPP_TAG_PRINTER, IPP_TAG_NAME, + "printer-error-policy", NULL, printer->error_policy); + + if (!ra || cupsArrayFind(ra, "printer-is-accepting-jobs")) + ippAddBoolean(con->response, IPP_TAG_PRINTER, "printer-is-accepting-jobs", + printer->accepting); + + if (!ra || cupsArrayFind(ra, "printer-is-shared")) + ippAddBoolean(con->response, IPP_TAG_PRINTER, "printer-is-shared", + printer->shared); + + if (!ra || cupsArrayFind(ra, "printer-op-policy")) + ippAddString(con->response, IPP_TAG_PRINTER, IPP_TAG_NAME, + "printer-op-policy", NULL, printer->op_policy); + + if (!ra || cupsArrayFind(ra, "printer-state")) + ippAddInteger(con->response, IPP_TAG_PRINTER, IPP_TAG_ENUM, "printer-state", + printer->state); + + if (!ra || cupsArrayFind(ra, "printer-state-change-time")) + ippAddInteger(con->response, IPP_TAG_PRINTER, IPP_TAG_INTEGER, + "printer-state-change-time", printer->state_time); + + if (MaxPrinterHistory > 0 && printer->num_history > 0 && + cupsArrayFind(ra, "printer-state-history")) + { + /* + * Printer history is only sent if specifically requested, so that + * older CUPS/IPP clients won't barf on the collection attributes. + */ + + history = ippAddCollections(con->response, IPP_TAG_PRINTER, + "printer-state-history", + printer->num_history, NULL); + + for (i = 0; i < printer->num_history; i ++) + copy_attrs(history->values[i].collection = ippNew(), printer->history[i], + NULL, IPP_TAG_ZERO, 0); + } + + if (!ra || cupsArrayFind(ra, "printer-state-message")) + ippAddString(con->response, IPP_TAG_PRINTER, IPP_TAG_TEXT, + "printer-state-message", NULL, printer->state_message); + + if (!ra || cupsArrayFind(ra, "printer-state-reasons")) + add_printer_state_reasons(con, printer); + + if (!ra || cupsArrayFind(ra, "printer-up-time")) + ippAddInteger(con->response, IPP_TAG_PRINTER, IPP_TAG_INTEGER, + "printer-up-time", curtime); + + if ((!ra || cupsArrayFind(ra, "printer-uri-supported")) && + !ippFindAttribute(printer->attrs, "printer-uri-supported", + IPP_TAG_URI)) + { + httpAssembleURIf(printer_uri, sizeof(printer_uri), "ipp", NULL, + con->servername, con->serverport, "/printers/%s", + printer->name); + ippAddString(con->response, IPP_TAG_PRINTER, IPP_TAG_URI, + "printer-uri-supported", NULL, printer_uri); + cupsdLogMessage(CUPSD_LOG_DEBUG2, "printer-uri-supported=\"%s\"", + printer_uri); + } + + if (!ra || cupsArrayFind(ra, "queued-job-count")) + add_queued_job_count(con, printer); + + copy_attrs(con->response, printer->attrs, ra, IPP_TAG_ZERO, 0); + copy_attrs(con->response, CommonData, ra, IPP_TAG_ZERO, IPP_TAG_COPY); +} + + +/* * 'copy_subscription_attrs()' - Copy subscription attributes. */ @@ -3597,10 +3774,6 @@ copy_subscription_attrs( * requested-attributes attribute that may be provided by the client. */ - if (!ra || cupsArrayFind(ra, "notify-subscription-id")) - ippAddInteger(con->response, IPP_TAG_SUBSCRIPTION, IPP_TAG_INTEGER, - "notify-subscription-id", sub->id); - if (!ra || cupsArrayFind(ra, "notify-events")) { if ((name = cupsdEventName((cupsd_eventmask_t)sub->mask)) != NULL) @@ -3638,29 +3811,14 @@ copy_subscription_attrs( } } - if (!ra || cupsArrayFind(ra, "notify-subscriber-user-name")) - ippAddString(con->response, IPP_TAG_SUBSCRIPTION, IPP_TAG_NAME, - "notify-subscriber-user-name", NULL, sub->owner); - - if (sub->recipient && (!ra || cupsArrayFind(ra, "notify-recipient-uri"))) - ippAddString(con->response, IPP_TAG_SUBSCRIPTION, IPP_TAG_URI, - "notify-recipient-uri", NULL, sub->recipient); - else if (!ra || cupsArrayFind(ra, "notify-pull-method")) - ippAddString(con->response, IPP_TAG_SUBSCRIPTION, IPP_TAG_KEYWORD, - "notify-pull-method", NULL, "ippget"); - - if (sub->user_data_len > 0 && (!ra || cupsArrayFind(ra, "notify-user-data"))) - ippAddOctetString(con->response, IPP_TAG_SUBSCRIPTION, "notify-user-data", - sub->user_data, sub->user_data_len); + if (sub->job && (!ra || cupsArrayFind(ra, "notify-job-id"))) + ippAddInteger(con->response, IPP_TAG_SUBSCRIPTION, IPP_TAG_INTEGER, + "notify-job-id", sub->job->id); if (!sub->job && (!ra || cupsArrayFind(ra, "notify-lease-duration"))) ippAddInteger(con->response, IPP_TAG_SUBSCRIPTION, IPP_TAG_INTEGER, "notify-lease-duration", sub->lease); - if (!ra || cupsArrayFind(ra, "notify-time-interval")) - ippAddInteger(con->response, IPP_TAG_SUBSCRIPTION, IPP_TAG_INTEGER, - "notify-time-interval", sub->interval); - if (sub->dest && (!ra || cupsArrayFind(ra, "notify-printer-uri"))) { httpAssembleURIf(printer_uri, sizeof(printer_uri), "ipp", NULL, @@ -3670,9 +3828,28 @@ copy_subscription_attrs( "notify-printer-uri", NULL, printer_uri); } - if (sub->job && (!ra || cupsArrayFind(ra, "notify-job-id"))) + if (sub->recipient && (!ra || cupsArrayFind(ra, "notify-recipient-uri"))) + ippAddString(con->response, IPP_TAG_SUBSCRIPTION, IPP_TAG_URI, + "notify-recipient-uri", NULL, sub->recipient); + else if (!ra || cupsArrayFind(ra, "notify-pull-method")) + ippAddString(con->response, IPP_TAG_SUBSCRIPTION, IPP_TAG_KEYWORD, + "notify-pull-method", NULL, "ippget"); + + if (!ra || cupsArrayFind(ra, "notify-subscriber-user-name")) + ippAddString(con->response, IPP_TAG_SUBSCRIPTION, IPP_TAG_NAME, + "notify-subscriber-user-name", NULL, sub->owner); + + if (!ra || cupsArrayFind(ra, "notify-subscription-id")) ippAddInteger(con->response, IPP_TAG_SUBSCRIPTION, IPP_TAG_INTEGER, - "notify-job-id", sub->job->id); + "notify-subscription-id", sub->id); + + if (!ra || cupsArrayFind(ra, "notify-time-interval")) + ippAddInteger(con->response, IPP_TAG_SUBSCRIPTION, IPP_TAG_INTEGER, + "notify-time-interval", sub->interval); + + if (sub->user_data_len > 0 && (!ra || cupsArrayFind(ra, "notify-user-data"))) + ippAddOctetString(con->response, IPP_TAG_SUBSCRIPTION, "notify-user-data", + sub->user_data, sub->user_data_len); } @@ -3769,7 +3946,8 @@ create_job(cupsd_client_t *con, /* I - Client connection */ * Validate job template attributes; for now just copies and page-ranges... */ - if ((attr = ippFindAttribute(con->request, "copies", IPP_TAG_INTEGER)) != NULL) + if ((attr = ippFindAttribute(con->request, "copies", + IPP_TAG_INTEGER)) != NULL) { if (attr->values[0].integer < 1 || attr->values[0].integer > MaxCopies) { @@ -3781,7 +3959,8 @@ create_job(cupsd_client_t *con, /* I - Client connection */ } } - if ((attr = ippFindAttribute(con->request, "page-ranges", IPP_TAG_RANGE)) != NULL) + if ((attr = ippFindAttribute(con->request, "page-ranges", + IPP_TAG_RANGE)) != NULL) { for (i = 0, lowerpagerange = 1; i < attr->num_values; i ++) { @@ -3823,13 +4002,15 @@ create_job(cupsd_client_t *con, /* I - Client connection */ * Create the job and set things up... */ - if ((attr = ippFindAttribute(con->request, "job-priority", IPP_TAG_INTEGER)) != NULL) + if ((attr = ippFindAttribute(con->request, "job-priority", + IPP_TAG_INTEGER)) != NULL) priority = attr->values[0].integer; else ippAddInteger(con->request, IPP_TAG_JOB, IPP_TAG_INTEGER, "job-priority", priority = 50); - if ((attr = ippFindAttribute(con->request, "job-name", IPP_TAG_NAME)) != NULL) + if ((attr = ippFindAttribute(con->request, "job-name", + IPP_TAG_NAME)) != NULL) title = attr->values[0].string.text; else ippAddString(con->request, IPP_TAG_JOB, IPP_TAG_NAME, "job-name", NULL, @@ -3857,7 +4038,7 @@ create_job(cupsd_client_t *con, /* I - Client connection */ save_auth_info(con, job); } - else if (attr != NULL) + else if (attr) { cupsdLogMessage(CUPSD_LOG_DEBUG, "create_job: requesting-user-name = \"%s\"", @@ -3868,7 +4049,7 @@ create_job(cupsd_client_t *con, /* I - Client connection */ else cupsdSetString(&job->username, "anonymous"); - if (attr == NULL) + if (!attr) ippAddString(job->attrs, IPP_TAG_JOB, IPP_TAG_NAME, "job-originating-user-name", NULL, job->username); else @@ -3886,7 +4067,7 @@ create_job(cupsd_client_t *con, /* I - Client connection */ if (attr->value_tag != IPP_TAG_NAME || attr->num_values != 1 || - strcmp(con->http.hostname, "localhost") != 0) + strcmp(con->http.hostname, "localhost")) { /* * Can't override the value if we aren't connected via localhost. @@ -3970,18 +4151,20 @@ create_job(cupsd_client_t *con, /* I - Client connection */ ippAddString(job->attrs, IPP_TAG_JOB, IPP_TAG_NAME, "job-name", NULL, title); - if ((attr = ippFindAttribute(job->attrs, "job-k-octets", IPP_TAG_INTEGER)) != NULL) + if ((attr = ippFindAttribute(job->attrs, "job-k-octets", + IPP_TAG_INTEGER)) != NULL) attr->values[0].integer = 0; else attr = ippAddInteger(job->attrs, IPP_TAG_JOB, IPP_TAG_INTEGER, "job-k-octets", 0); - if ((attr = ippFindAttribute(job->attrs, "job-hold-until", IPP_TAG_KEYWORD)) == NULL) + if ((attr = ippFindAttribute(job->attrs, "job-hold-until", + IPP_TAG_KEYWORD)) == NULL) attr = ippFindAttribute(job->attrs, "job-hold-until", IPP_TAG_NAME); - if (attr == NULL) + if (!attr) attr = ippAddString(job->attrs, IPP_TAG_JOB, IPP_TAG_KEYWORD, "job-hold-until", NULL, "no-hold"); - if (attr != NULL && strcmp(attr->values[0].string.text, "no-hold") != 0 && + if (attr && strcmp(attr->values[0].string.text, "no-hold") && !(printer->type & CUPS_PRINTER_REMOTE)) { /* @@ -4002,7 +4185,8 @@ create_job(cupsd_client_t *con, /* I - Client connection */ * Add job sheets options... */ - if ((attr = ippFindAttribute(job->attrs, "job-sheets", IPP_TAG_ZERO)) == NULL) + if ((attr = ippFindAttribute(job->attrs, "job-sheets", + IPP_TAG_ZERO)) == NULL) { cupsdLogMessage(CUPSD_LOG_DEBUG, "Adding default job-sheets values \"%s,%s\"...", @@ -4045,9 +4229,10 @@ create_job(cupsd_client_t *con, /* I - Client connection */ job->id, Classification, job->username); } else if (attr->num_values == 2 && - strcmp(attr->values[0].string.text, attr->values[1].string.text) != 0 && - strcmp(attr->values[0].string.text, "none") != 0 && - strcmp(attr->values[1].string.text, "none") != 0) + strcmp(attr->values[0].string.text, + attr->values[1].string.text) && + strcmp(attr->values[0].string.text, "none") && + strcmp(attr->values[1].string.text, "none")) { /* * Can't put two different security markings on the same document! @@ -4082,9 +4267,9 @@ create_job(cupsd_client_t *con, /* I - Client connection */ attr->values[1].string.text, job->username); } } - else if (strcmp(attr->values[0].string.text, Classification) != 0 && + else if (strcmp(attr->values[0].string.text, Classification) && (attr->num_values == 1 || - strcmp(attr->values[1].string.text, Classification) != 0)) + strcmp(attr->values[1].string.text, Classification))) { /* * Force the banner to have the classification on it... @@ -4138,7 +4323,8 @@ create_job(cupsd_client_t *con, /* I - Client connection */ cupsdUpdateQuota(printer, job->username, 0, kbytes); } } - else if ((attr = ippFindAttribute(job->attrs, "job-sheets", IPP_TAG_ZERO)) != NULL) + else if ((attr = ippFindAttribute(job->attrs, "job-sheets", + IPP_TAG_ZERO)) != NULL) job->sheets = attr; /* @@ -4403,6 +4589,10 @@ create_subscription( * Is the destination valid? */ + cupsdLogMessage(CUPSD_LOG_DEBUG, + "cupsdCreateSubscription(con=%p(%d), uri=\"%s\")", + con, con->http.fd, uri->values[0].string.text); + httpSeparateURI(uri->values[0].string.text, method, sizeof(method), userpass, sizeof(userpass), host, sizeof(host), &port, resource, sizeof(resource)); @@ -4492,6 +4682,8 @@ create_subscription( * Process the subscription attributes in the request... */ + con->response->request.status.status_code = IPP_BAD_REQUEST; + while (attr) { recipient = NULL; @@ -4562,6 +4754,9 @@ create_subscription( attr = attr->next; } + cupsdLogMessage(CUPSD_LOG_DEBUG, "recipient=\"%s\"", recipient); + cupsdLogMessage(CUPSD_LOG_DEBUG, "pullmethod=\"%s\"", pullmethod); + if (!recipient && !pullmethod) break; @@ -4601,6 +4796,17 @@ create_subscription( sub = cupsdAddSubscription(mask, printer, job, recipient, 0); + if (job) + cupsdLogMessage(CUPSD_LOG_DEBUG, "Added subscription %d for job %d", + sub->id, job->id); + else if (printer) + cupsdLogMessage(CUPSD_LOG_DEBUG, + "Added subscription %d for printer \"%s\"", + sub->id, printer->name); + else + cupsdLogMessage(CUPSD_LOG_DEBUG, "Added subscription %d for server", + sub->id); + sub->interval = interval; sub->lease = lease; sub->expire = time(NULL) + lease; @@ -4618,13 +4824,14 @@ create_subscription( ippAddInteger(con->response, IPP_TAG_SUBSCRIPTION, IPP_TAG_INTEGER, "notify-subscription-id", sub->id); + con->response->request.status.status_code = IPP_OK; + if (attr) attr = attr->next; } cupsdSaveAllSubscriptions(); - con->response->request.status.status_code = IPP_OK; } @@ -4741,14 +4948,8 @@ delete_printer(cupsd_client_t *con, /* I - Client connection */ static void get_default(cupsd_client_t *con) /* I - Client connection */ { - http_status_t status; /* Policy status */ - int i; /* Looping var */ - ipp_attribute_t *requested, /* requested-attributes */ - *history; /* History collection */ - int need_history; /* Need to send history collection? */ - char printer_uri[HTTP_MAX_URI]; - /* Printer URI */ - time_t curtime; /* Current time */ + http_status_t status; /* Policy status */ + cups_array_t *ra; /* Requested attributes array */ cupsdLogMessage(CUPSD_LOG_DEBUG2, "get_default(%p[%d])", con, con->http.fd); @@ -4763,85 +4964,15 @@ get_default(cupsd_client_t *con) /* I - Client connection */ return; } - if (DefaultPrinter != NULL) + if (DefaultPrinter) { - /* - * Copy the printer attributes to the response using requested-attributes - * and document-format attributes that may be provided by the client. - */ + ra = create_requested_array(con->request); - if (!ippFindAttribute(DefaultPrinter->attrs, "printer-uri-supported", - IPP_TAG_URI)) - { - httpAssembleURIf(printer_uri, sizeof(printer_uri), "ipp", NULL, - con->servername, con->serverport, "/printers/%s", - DefaultPrinter->name); - ippAddString(con->response, IPP_TAG_PRINTER, IPP_TAG_URI, - "printer-uri-supported", NULL, printer_uri); - cupsdLogMessage(CUPSD_LOG_DEBUG2, "printer-uri-supported=\"%s\"", - printer_uri); - } - - ippAddInteger(con->response, IPP_TAG_PRINTER, IPP_TAG_ENUM, "printer-state", - DefaultPrinter->state); - - add_printer_state_reasons(con, DefaultPrinter); + copy_printer_attrs(con, DefaultPrinter, ra); - ippAddString(con->response, IPP_TAG_PRINTER, IPP_TAG_TEXT, - "printer-state-message", NULL, DefaultPrinter->state_message); - - ippAddBoolean(con->response, IPP_TAG_PRINTER, "printer-is-accepting-jobs", - DefaultPrinter->accepting); - ippAddBoolean(con->response, IPP_TAG_PRINTER, "printer-is-shared", - DefaultPrinter->shared); - - curtime = time(NULL); - ippAddInteger(con->response, IPP_TAG_PRINTER, IPP_TAG_INTEGER, - "printer-up-time", curtime); - ippAddInteger(con->response, IPP_TAG_PRINTER, IPP_TAG_INTEGER, - "printer-state-change-time", DefaultPrinter->state_time); - ippAddDate(con->response, IPP_TAG_PRINTER, "printer-current-time", - ippTimeToDate(curtime)); - - ippAddString(con->response, IPP_TAG_PRINTER, IPP_TAG_NAME, - "printer-error-policy", NULL, DefaultPrinter->error_policy); - ippAddString(con->response, IPP_TAG_PRINTER, IPP_TAG_NAME, - "printer-op-policy", NULL, DefaultPrinter->op_policy); + cupsArrayDelete(ra); - add_queued_job_count(con, DefaultPrinter); - - requested = ippFindAttribute(con->request, "requested-attributes", - IPP_TAG_KEYWORD); - - copy_attrs(con->response, DefaultPrinter->attrs, requested, IPP_TAG_ZERO, 0); - copy_attrs(con->response, CommonData, requested, IPP_TAG_ZERO, IPP_TAG_COPY); - - need_history = 0; - - if (MaxPrinterHistory > 0 && DefaultPrinter->num_history > 0 && requested) - { - for (i = 0; i < requested->num_values; i ++) - if (!strcmp(requested->values[i].string.text, "all") || - !strcmp(requested->values[i].string.text, "printer-state-history")) - { - need_history = 1; - break; - } - } - - if (need_history) - { - history = ippAddCollections(con->response, IPP_TAG_PRINTER, - "printer-state-history", - DefaultPrinter->num_history, NULL); - - for (i = 0; i < DefaultPrinter->num_history; i ++) - copy_attrs(history->values[i].collection = ippNew(), - DefaultPrinter->history[i], - NULL, IPP_TAG_ZERO, 0); - } - - con->response->request.status.status_code = requested ? IPP_OK_SUBST : IPP_OK; + con->response->request.status.status_code = IPP_OK; } else send_ipp_status(con, IPP_NOT_FOUND, _("No default printer")); @@ -4953,6 +5084,110 @@ get_devices(cupsd_client_t *con) /* I - Client connection */ /* + * 'get_job_attrs()' - Get job attributes. + */ + +static void +get_job_attrs(cupsd_client_t *con, /* I - Client connection */ + ipp_attribute_t *uri) /* I - Job URI */ +{ + http_status_t status; /* Policy status */ + ipp_attribute_t *attr; /* Current attribute */ + int jobid; /* Job ID */ + cupsd_job_t *job; /* Current job */ + char method[HTTP_MAX_URI], /* Method portion of URI */ + username[HTTP_MAX_URI], /* Username portion of URI */ + host[HTTP_MAX_URI], /* Host portion of URI */ + resource[HTTP_MAX_URI]; /* Resource portion of URI */ + int port; /* Port portion of URI */ + cups_array_t *ra; /* Requested attributes array */ + + + cupsdLogMessage(CUPSD_LOG_DEBUG2, "get_job_attrs(%p[%d], %s)", con, + con->http.fd, uri->values[0].string.text); + + /* + * See if we have a job URI or a printer URI... + */ + + if (!strcmp(uri->name, "printer-uri")) + { + /* + * Got a printer URI; see if we also have a job-id attribute... + */ + + if ((attr = ippFindAttribute(con->request, "job-id", + IPP_TAG_INTEGER)) == NULL) + { + send_ipp_status(con, IPP_BAD_REQUEST, + _("Got a printer-uri attribute but no job-id!")); + return; + } + + jobid = attr->values[0].integer; + } + else + { + /* + * Got a job URI; parse it to get the job ID... + */ + + httpSeparateURI(uri->values[0].string.text, method, sizeof(method), + username, sizeof(username), host, sizeof(host), &port, + resource, sizeof(resource)); + + if (strncmp(resource, "/jobs/", 6)) + { + /* + * Not a valid URI! + */ + + send_ipp_status(con, IPP_BAD_REQUEST, + _("Bad job-uri attribute \"%s\"!"), + uri->values[0].string.text); + return; + } + + jobid = atoi(resource + 6); + } + + /* + * See if the job exists... + */ + + if ((job = cupsdFindJob(jobid)) == NULL) + { + /* + * Nope - return a "not found" error... + */ + + send_ipp_status(con, IPP_NOT_FOUND, _("Job #%d does not exist!"), jobid); + return; + } + + /* + * Check policy... + */ + + if ((status = cupsdCheckPolicy(DefaultPolicyPtr, con, NULL)) != HTTP_OK) + { + send_http_error(con, status); + return; + } + + /* + * Copy attributes... + */ + + ra = create_requested_array(con->request); + copy_job_attrs(con, job, ra); + cupsArrayDelete(ra); + + con->response->request.status.status_code = IPP_OK; +} + + +/* * 'get_jobs()' - Get a list of jobs for the specified printer. */ @@ -4961,8 +5196,7 @@ get_jobs(cupsd_client_t *con, /* I - Client connection */ ipp_attribute_t *uri) /* I - Printer URI */ { http_status_t status; /* Policy status */ - ipp_attribute_t *attr, /* Current attribute */ - *requested; /* Requested attributes */ + ipp_attribute_t *attr; /* Current attribute */ const char *dest; /* Destination */ cups_ptype_t dtype; /* Destination type (printer or class) */ cups_ptype_t dmask; /* Destination type mask */ @@ -4976,9 +5210,9 @@ get_jobs(cupsd_client_t *con, /* I - Client connection */ int limit; /* Maximum number of jobs to return */ int count; /* Number of jobs that match */ cupsd_job_t *job; /* Current job pointer */ - char job_uri[HTTP_MAX_URI]; /* Job URI... */ cupsd_printer_t *printer; /* Printer */ cups_array_t *list; /* Which job list... */ + cups_array_t *ra; /* Requested attributes array */ cupsdLogMessage(CUPSD_LOG_DEBUG2, "get_jobs(%p[%d], %s)", con, con->http.fd, @@ -4992,22 +5226,22 @@ get_jobs(cupsd_client_t *con, /* I - Client connection */ username, sizeof(username), host, sizeof(host), &port, resource, sizeof(resource)); - if (strcmp(resource, "/") == 0 || - (strncmp(resource, "/jobs", 5) == 0 && strlen(resource) <= 6)) + if (!strcmp(resource, "/") || + (!strncmp(resource, "/jobs", 5) && strlen(resource) <= 6)) { dest = NULL; dtype = (cups_ptype_t)0; dmask = (cups_ptype_t)0; printer = NULL; } - else if (strncmp(resource, "/printers", 9) == 0 && strlen(resource) <= 10) + else if (!strncmp(resource, "/printers", 9) && strlen(resource) <= 10) { dest = NULL; dtype = (cups_ptype_t)0; dmask = CUPS_PRINTER_CLASS; printer = NULL; } - else if (strncmp(resource, "/classes", 8) == 0 && strlen(resource) <= 9) + else if (!strncmp(resource, "/classes", 8) && strlen(resource) <= 9) { dest = NULL; dtype = CUPS_PRINTER_CLASS; @@ -5049,7 +5283,8 @@ get_jobs(cupsd_client_t *con, /* I - Client connection */ * See if the "which-jobs" attribute have been specified... */ - if ((attr = ippFindAttribute(con->request, "which-jobs", IPP_TAG_KEYWORD)) != NULL && + if ((attr = ippFindAttribute(con->request, "which-jobs", + IPP_TAG_KEYWORD)) != NULL && !strcmp(attr->values[0].string.text, "completed")) { completed = 1; @@ -5070,7 +5305,8 @@ get_jobs(cupsd_client_t *con, /* I - Client connection */ * See if they want to limit the number of jobs reported... */ - if ((attr = ippFindAttribute(con->request, "limit", IPP_TAG_INTEGER)) != NULL) + if ((attr = ippFindAttribute(con->request, "limit", + IPP_TAG_INTEGER)) != NULL) limit = attr->values[0].integer; else limit = 1000000; @@ -5085,12 +5321,14 @@ get_jobs(cupsd_client_t *con, /* I - Client connection */ * See if we only want to see jobs for a specific user... */ - if ((attr = ippFindAttribute(con->request, "my-jobs", IPP_TAG_BOOLEAN)) != NULL && + if ((attr = ippFindAttribute(con->request, "my-jobs", + IPP_TAG_BOOLEAN)) != NULL && attr->values[0].boolean) { if (con->username[0]) strlcpy(username, con->username, sizeof(username)); - else if ((attr = ippFindAttribute(con->request, "requesting-user-name", IPP_TAG_NAME)) != NULL) + else if ((attr = ippFindAttribute(con->request, "requesting-user-name", + IPP_TAG_NAME)) != NULL) strlcpy(username, attr->values[0].string.text, sizeof(username)); else strcpy(username, "anonymous"); @@ -5098,8 +5336,7 @@ get_jobs(cupsd_client_t *con, /* I - Client connection */ else username[0] = '\0'; - requested = ippFindAttribute(con->request, "requested-attributes", - IPP_TAG_KEYWORD); + ra = create_requested_array(con->request); /* * OK, build a list of jobs for this printer... @@ -5115,14 +5352,13 @@ get_jobs(cupsd_client_t *con, /* I - Client connection */ cupsdLogMessage(CUPSD_LOG_DEBUG2, "get_jobs: job->id = %d", job->id); - if ((dest != NULL && strcmp(job->dest, dest) != 0) && - (job->printer == NULL || dest == NULL || - strcmp(job->printer->name, dest) != 0)) + if ((dest && strcmp(job->dest, dest)) && + (!job->printer || !dest || strcmp(job->printer->name, dest))) continue; if ((job->dtype & dmask) != dtype && - (job->printer == NULL || (job->printer->type & dmask) != dtype)) + (!job->printer || (job->printer->type & dmask) != dtype)) continue; - if (username[0] != '\0' && strcasecmp(username, job->username) != 0) + if (username[0] && strcasecmp(username, job->username)) continue; if (completed && job->state->values[0].integer <= IPP_JOB_STOPPED) @@ -5131,171 +5367,19 @@ get_jobs(cupsd_client_t *con, /* I - Client connection */ if (job->id < first_job_id) continue; + if (count > 0) + ippAddSeparator(con->response); + count ++; cupsdLogMessage(CUPSD_LOG_DEBUG2, "get_jobs: count = %d", count); - /* - * Send the requested attributes for each job... - */ - - snprintf(job_uri, sizeof(job_uri), "http://%s:%d/jobs/%d", ServerName, - LocalPort, job->id); - - ippAddString(con->response, IPP_TAG_JOB, IPP_TAG_URI, - "job-more-info", NULL, job_uri); - - ippAddString(con->response, IPP_TAG_JOB, IPP_TAG_URI, - "job-uri", NULL, job_uri); - - ippAddInteger(con->response, IPP_TAG_JOB, IPP_TAG_INTEGER, - "job-printer-up-time", time(NULL)); - - /* - * Copy the job attributes to the response using the requested-attributes - * attribute that may be provided by the client. - */ - - copy_attrs(con->response, job->attrs, requested, IPP_TAG_JOB, 0); - - add_job_state_reasons(con, job); - - ippAddSeparator(con->response); + copy_job_attrs(con, job, ra); } - if (requested != NULL) - con->response->request.status.status_code = IPP_OK_SUBST; - else - con->response->request.status.status_code = IPP_OK; -} - - -/* - * 'get_job_attrs()' - Get job attributes. - */ - -static void -get_job_attrs(cupsd_client_t *con, /* I - Client connection */ - ipp_attribute_t *uri) /* I - Job URI */ -{ - http_status_t status; /* Policy status */ - ipp_attribute_t *attr, /* Current attribute */ - *requested; /* Requested attributes */ - int jobid; /* Job ID */ - cupsd_job_t *job; /* Current job */ - char method[HTTP_MAX_URI], /* Method portion of URI */ - username[HTTP_MAX_URI], /* Username portion of URI */ - host[HTTP_MAX_URI], /* Host portion of URI */ - resource[HTTP_MAX_URI]; /* Resource portion of URI */ - int port; /* Port portion of URI */ - char job_uri[HTTP_MAX_URI]; /* Job URI... */ - - - cupsdLogMessage(CUPSD_LOG_DEBUG2, "get_job_attrs(%p[%d], %s)", con, - con->http.fd, uri->values[0].string.text); - - /* - * See if we have a job URI or a printer URI... - */ - - if (strcmp(uri->name, "printer-uri") == 0) - { - /* - * Got a printer URI; see if we also have a job-id attribute... - */ - - if ((attr = ippFindAttribute(con->request, "job-id", IPP_TAG_INTEGER)) == NULL) - { - send_ipp_status(con, IPP_BAD_REQUEST, - _("Got a printer-uri attribute but no job-id!")); - return; - } - - jobid = attr->values[0].integer; - } - else - { - /* - * Got a job URI; parse it to get the job ID... - */ - - httpSeparateURI(uri->values[0].string.text, method, sizeof(method), - username, sizeof(username), host, sizeof(host), &port, - resource, sizeof(resource)); - - if (strncmp(resource, "/jobs/", 6) != 0) - { - /* - * Not a valid URI! - */ - - send_ipp_status(con, IPP_BAD_REQUEST, - _("Bad job-uri attribute \"%s\"!"), - uri->values[0].string.text); - return; - } - - jobid = atoi(resource + 6); - } - - /* - * See if the job exists... - */ - - if ((job = cupsdFindJob(jobid)) == NULL) - { - /* - * Nope - return a "not found" error... - */ - - send_ipp_status(con, IPP_NOT_FOUND, _("Job #%d does not exist!"), jobid); - return; - } - - /* - * Check policy... - */ - - if ((status = cupsdCheckPolicy(DefaultPolicyPtr, con, NULL)) != HTTP_OK) - { - send_http_error(con, status); - return; - } - - /* - * Put out the standard attributes... - */ - - snprintf(job_uri, sizeof(job_uri), "http://%s:%d/jobs/%d", - ServerName, LocalPort, job->id); - - ippAddInteger(con->response, IPP_TAG_JOB, IPP_TAG_INTEGER, "job-id", job->id); - - ippAddString(con->response, IPP_TAG_JOB, IPP_TAG_URI, - "job-more-info", NULL, job_uri); - - ippAddString(con->response, IPP_TAG_JOB, IPP_TAG_URI, - "job-uri", NULL, job_uri); - - ippAddInteger(con->response, IPP_TAG_JOB, IPP_TAG_INTEGER, - "job-printer-up-time", time(NULL)); - - /* - * Copy the job attributes to the response using the requested-attributes - * attribute that may be provided by the client. - */ - - requested = ippFindAttribute(con->request, "requested-attributes", - IPP_TAG_KEYWORD); - - copy_attrs(con->response, job->attrs, requested, IPP_TAG_JOB, 0); - - add_job_state_reasons(con, job); + cupsArrayDelete(ra); - if (requested != NULL) - con->response->request.status.status_code = IPP_OK_SUBST; - else - con->response->request.status.status_code = IPP_OK; + con->response->request.status.status_code = IPP_OK; } @@ -5439,13 +5523,7 @@ get_printer_attrs(cupsd_client_t *con, /* I - Client connection */ /* Resource portion of URI */ int port; /* Port portion of URI */ cupsd_printer_t *printer; /* Printer/class */ - char printer_uri[HTTP_MAX_URI]; - /* Printer URI */ - time_t curtime; /* Current time */ - int i; /* Looping var */ - ipp_attribute_t *requested, /* requested-attributes */ - *history; /* History collection */ - int need_history; /* Need to send history collection? */ + cups_array_t *ra; /* Requested attributes array */ cupsdLogMessage(CUPSD_LOG_DEBUG2, "get_printer_attrs(%p[%d], %s)", con, @@ -5480,83 +5558,17 @@ get_printer_attrs(cupsd_client_t *con, /* I - Client connection */ return; } - curtime = time(NULL); - /* - * Copy the printer attributes to the response using requested-attributes - * and document-format attributes that may be provided by the client. + * Send the attributes... */ - if (!ippFindAttribute(printer->attrs, "printer-uri-supported", - IPP_TAG_URI)) - { - httpAssembleURIf(printer_uri, sizeof(printer_uri), "ipp", NULL, - con->servername, con->serverport, "/printers/%s", - printer->name); - ippAddString(con->response, IPP_TAG_PRINTER, IPP_TAG_URI, - "printer-uri-supported", NULL, printer_uri); - cupsdLogMessage(CUPSD_LOG_DEBUG2, "printer-uri-supported=\"%s\"", - printer_uri); - } - - ippAddInteger(con->response, IPP_TAG_PRINTER, IPP_TAG_ENUM, "printer-state", - printer->state); - - add_printer_state_reasons(con, printer); - - ippAddString(con->response, IPP_TAG_PRINTER, IPP_TAG_TEXT, - "printer-state-message", NULL, printer->state_message); - - ippAddBoolean(con->response, IPP_TAG_PRINTER, "printer-is-accepting-jobs", - printer->accepting); - ippAddBoolean(con->response, IPP_TAG_PRINTER, "printer-is-shared", - printer->shared); - - ippAddInteger(con->response, IPP_TAG_PRINTER, IPP_TAG_INTEGER, - "printer-up-time", curtime); - ippAddInteger(con->response, IPP_TAG_PRINTER, IPP_TAG_INTEGER, - "printer-state-change-time", printer->state_time); - ippAddDate(con->response, IPP_TAG_PRINTER, "printer-current-time", - ippTimeToDate(curtime)); - - ippAddString(con->response, IPP_TAG_PRINTER, IPP_TAG_NAME, - "printer-error-policy", NULL, printer->error_policy); - ippAddString(con->response, IPP_TAG_PRINTER, IPP_TAG_NAME, - "printer-op-policy", NULL, printer->op_policy); - - add_queued_job_count(con, printer); - - requested = ippFindAttribute(con->request, "requested-attributes", - IPP_TAG_KEYWORD); - - copy_attrs(con->response, printer->attrs, requested, IPP_TAG_ZERO, 0); - copy_attrs(con->response, CommonData, requested, IPP_TAG_ZERO, IPP_TAG_COPY); - - need_history = 0; - - if (MaxPrinterHistory > 0 && printer->num_history > 0 && requested) - { - for (i = 0; i < requested->num_values; i ++) - if (!strcmp(requested->values[i].string.text, "all") || - !strcmp(requested->values[i].string.text, "printer-state-history")) - { - need_history = 1; - break; - } - } + ra = create_requested_array(con->request); - if (need_history) - { - history = ippAddCollections(con->response, IPP_TAG_PRINTER, - "printer-state-history", - printer->num_history, NULL); + copy_printer_attrs(con, printer, ra); - for (i = 0; i < printer->num_history; i ++) - copy_attrs(history->values[i].collection = ippNew(), printer->history[i], - NULL, IPP_TAG_ZERO, 0); - } + cupsArrayDelete(ra); - con->response->request.status.status_code = requested ? IPP_OK_SUBST : IPP_OK; + con->response->request.status.status_code = IPP_OK; } @@ -5569,40 +5581,38 @@ get_printers(cupsd_client_t *con, /* I - Client connection */ int type) /* I - 0 or CUPS_PRINTER_CLASS */ { http_status_t status; /* Policy status */ - int i; /* Looping var */ - ipp_attribute_t *requested, /* requested-attributes */ - *history, /* History collection */ - *attr; /* Current attribute */ - int need_history; /* Need to send history collection? */ + ipp_attribute_t *attr; /* Current attribute */ int limit; /* Maximum number of printers to return */ int count; /* Number of printers that match */ cupsd_printer_t *printer; /* Current printer pointer */ - time_t curtime; /* Current time */ int printer_type, /* printer-type attribute */ printer_mask; /* printer-type-mask attribute */ char *location; /* Location string */ const char *username; /* Current user */ char *first_printer_name; /* first-printer-name attribute */ - char printer_uri[HTTP_MAX_URI]; - /* Printer URI */ + cups_array_t *ra; /* Requested attributes array */ cupsdLogMessage(CUPSD_LOG_DEBUG2, "get_printers(%p[%d], %x)", con, con->http.fd, type); - if (!Printers || !cupsArrayCount(Printers)) + /* + * Check policy... + */ + + if ((status = cupsdCheckPolicy(DefaultPolicyPtr, con, NULL)) != HTTP_OK) { - send_ipp_status(con, IPP_NOT_FOUND, _("No destinations added.")); + send_http_error(con, status); return; } /* - * Check policy... + * Check for printers... */ - if ((status = cupsdCheckPolicy(DefaultPolicyPtr, con, NULL)) != HTTP_OK) + if (!Printers || !cupsArrayCount(Printers)) { - send_http_error(con, status); + send_ipp_status(con, IPP_NOT_FOUND, _("No destinations added.")); return; } @@ -5610,7 +5620,8 @@ get_printers(cupsd_client_t *con, /* I - Client connection */ * See if they want to limit the number of printers reported... */ - if ((attr = ippFindAttribute(con->request, "limit", IPP_TAG_INTEGER)) != NULL) + if ((attr = ippFindAttribute(con->request, "limit", + IPP_TAG_INTEGER)) != NULL) limit = attr->values[0].integer; else limit = 10000000; @@ -5651,28 +5662,12 @@ get_printers(cupsd_client_t *con, /* I - Client connection */ else username = NULL; - requested = ippFindAttribute(con->request, "requested-attributes", - IPP_TAG_KEYWORD); - - need_history = 0; - - if (MaxPrinterHistory > 0 && requested) - { - for (i = 0; i < requested->num_values; i ++) - if (!strcmp(requested->values[i].string.text, "all") || - !strcmp(requested->values[i].string.text, "printer-state-history")) - { - need_history = 1; - break; - } - } + ra = create_requested_array(con->request); /* * OK, build a list of printers for this printer... */ - curtime = time(NULL); - if (first_printer_name) { if ((printer = cupsdFindDest(first_printer_name)) == NULL) @@ -5682,11 +5677,12 @@ get_printers(cupsd_client_t *con, /* I - Client connection */ printer = (cupsd_printer_t *)cupsArrayFirst(Printers); for (count = 0; - count < limit && printer != NULL; + count < limit && printer; printer = (cupsd_printer_t *)cupsArrayNext(Printers)) + { if ((!type || (printer->type & CUPS_PRINTER_CLASS) == type) && (printer->type & printer_mask) == printer_type && - (location == NULL || printer->location == NULL || + (!location || !printer->location || !strcasecmp(printer->location, location))) { /* @@ -5716,73 +5712,16 @@ get_printers(cupsd_client_t *con, /* I - Client connection */ count ++; /* - * Send the following attributes for each printer: - * - * printer-state - * printer-state-message - * printer-is-accepting-jobs - * printer-is-shared - * printer-up-time - * printer-state-change-time - * + all printer attributes + * Send the attributes... */ - if (!ippFindAttribute(printer->attrs, "printer-uri-supported", - IPP_TAG_URI)) - { - httpAssembleURIf(printer_uri, sizeof(printer_uri), "ipp", NULL, - con->servername, con->serverport, "/printers/%s", - printer->name); - ippAddString(con->response, IPP_TAG_PRINTER, IPP_TAG_URI, - "printer-uri-supported", NULL, printer_uri); - cupsdLogMessage(CUPSD_LOG_DEBUG2, "printer-uri-supported=\"%s\"", printer_uri); - } - - ippAddInteger(con->response, IPP_TAG_PRINTER, IPP_TAG_ENUM, - "printer-state", printer->state); - - add_printer_state_reasons(con, printer); - - ippAddString(con->response, IPP_TAG_PRINTER, IPP_TAG_TEXT, - "printer-state-message", NULL, printer->state_message); - - ippAddBoolean(con->response, IPP_TAG_PRINTER, "printer-is-accepting-jobs", - printer->accepting); - ippAddBoolean(con->response, IPP_TAG_PRINTER, "printer-is-shared", - printer->shared); - - ippAddInteger(con->response, IPP_TAG_PRINTER, IPP_TAG_INTEGER, - "printer-up-time", curtime); - ippAddInteger(con->response, IPP_TAG_PRINTER, IPP_TAG_INTEGER, - "printer-state-change-time", printer->state_time); - ippAddDate(con->response, IPP_TAG_PRINTER, "printer-current-time", - ippTimeToDate(curtime)); - - ippAddString(con->response, IPP_TAG_PRINTER, IPP_TAG_NAME, - "printer-error-policy", NULL, printer->error_policy); - ippAddString(con->response, IPP_TAG_PRINTER, IPP_TAG_NAME, - "printer-op-policy", NULL, printer->op_policy); - - add_queued_job_count(con, printer); - - copy_attrs(con->response, printer->attrs, requested, IPP_TAG_ZERO, 0); - - copy_attrs(con->response, CommonData, requested, IPP_TAG_ZERO, - IPP_TAG_COPY); - - if (need_history && printer->num_history > 0) - { - history = ippAddCollections(con->response, IPP_TAG_PRINTER, - "printer-state-history", - printer->num_history, NULL); - - for (i = 0; i < printer->num_history; i ++) - copy_attrs(history->values[i].collection = ippNew(), - printer->history[i], NULL, IPP_TAG_ZERO, 0); - } + copy_printer_attrs(con, printer, ra); } + } + + cupsArrayDelete(ra); - con->response->request.status.status_code = requested ? IPP_OK_SUBST : IPP_OK; + con->response->request.status.status_code = IPP_OK; } @@ -5950,7 +5889,8 @@ get_subscriptions(cupsd_client_t *con, /* I - Client connection */ ra = create_requested_array(con->request); - if ((attr = ippFindAttribute(con->request, "limit", IPP_TAG_INTEGER)) != NULL) + if ((attr = ippFindAttribute(con->request, "limit", + IPP_TAG_INTEGER)) != NULL) limit = attr->values[0].integer; else limit = 0; @@ -5965,7 +5905,8 @@ get_subscriptions(cupsd_client_t *con, /* I - Client connection */ { if (con->username[0]) strlcpy(username, con->username, sizeof(username)); - else if ((attr = ippFindAttribute(con->request, "requesting-user-name", IPP_TAG_NAME)) != NULL) + else if ((attr = ippFindAttribute(con->request, "requesting-user-name", + IPP_TAG_NAME)) != NULL) strlcpy(username, attr->values[0].string.text, sizeof(username)); else strcpy(username, "anonymous"); @@ -6028,7 +5969,8 @@ hold_job(cupsd_client_t *con, /* I - Client connection */ * Got a printer URI; see if we also have a job-id attribute... */ - if ((attr = ippFindAttribute(con->request, "job-id", IPP_TAG_INTEGER)) == NULL) + if ((attr = ippFindAttribute(con->request, "job-id", + IPP_TAG_INTEGER)) == NULL) { send_ipp_status(con, IPP_BAD_REQUEST, _("Got a printer-uri attribute but no job-id!")); @@ -6102,7 +6044,7 @@ hold_job(cupsd_client_t *con, /* I - Client connection */ IPP_TAG_KEYWORD)) == NULL) attr = ippFindAttribute(job->attrs, "job-hold-until", IPP_TAG_NAME); - if (attr != NULL) + if (attr) { /* * Free the old hold value and copy the new one over... @@ -6110,7 +6052,7 @@ hold_job(cupsd_client_t *con, /* I - Client connection */ free(attr->values[0].string.text); - if (newattr != NULL) + if (newattr) { attr->value_tag = newattr->value_tag; attr->values[0].string.text = strdup(newattr->values[0].string.text); @@ -6146,37 +6088,123 @@ move_job(cupsd_client_t *con, /* I - Client connection */ ipp_attribute_t *attr; /* Current attribute */ int jobid; /* Job ID */ cupsd_job_t *job; /* Current job */ - const char *dest; /* Destination */ - cups_ptype_t dtype; /* Destination type (printer or class) */ + const char *src, /* Source printer/class */ + *dest; /* Destination */ + cups_ptype_t stype, /* Source type (printer or class) */ + dtype; /* Destination type (printer or class) */ char method[HTTP_MAX_URI], /* Method portion of URI */ username[HTTP_MAX_URI], /* Username portion of URI */ host[HTTP_MAX_URI], /* Host portion of URI */ resource[HTTP_MAX_URI]; /* Resource portion of URI */ int port; /* Port portion of URI */ - cupsd_printer_t *printer; /* Printer */ + cupsd_printer_t *sprinter, /* Source printer */ + *dprinter; /* Destination printer */ cupsdLogMessage(CUPSD_LOG_DEBUG2, "move_job(%p[%d], %s)", con, con->http.fd, uri->values[0].string.text); /* + * Get the new printer or class... + */ + + if ((attr = ippFindAttribute(con->request, "job-printer-uri", + IPP_TAG_URI)) == NULL) + { + /* + * Need job-printer-uri... + */ + + send_ipp_status(con, IPP_BAD_REQUEST, + _("job-printer-uri attribute missing!")); + return; + } + + httpSeparateURI(attr->values[0].string.text, method, sizeof(method), + username, sizeof(username), host, sizeof(host), &port, + resource, sizeof(resource)); + + if ((dest = cupsdValidateDest(host, resource, &dtype, &dprinter)) == NULL) + { + /* + * Bad URI... + */ + + send_ipp_status(con, IPP_NOT_FOUND, + _("The printer or class was not found.")); + return; + } + + /* + * Check policy... + */ + + if ((status = cupsdCheckPolicy(dprinter->op_policy_ptr, con, NULL)) != HTTP_OK) + { + send_http_error(con, status); + return; + } + + /* * See if we have a job URI or a printer URI... */ - if (strcmp(uri->name, "printer-uri") == 0) + httpSeparateURI(uri->values[0].string.text, method, sizeof(method), + username, sizeof(username), host, sizeof(host), &port, + resource, sizeof(resource)); + + if (!strcmp(uri->name, "printer-uri")) { /* * Got a printer URI; see if we also have a job-id attribute... */ - if ((attr = ippFindAttribute(con->request, "job-id", IPP_TAG_INTEGER)) == NULL) + if ((attr = ippFindAttribute(con->request, "job-id", + IPP_TAG_INTEGER)) == NULL) { - send_ipp_status(con, IPP_BAD_REQUEST, - _("Got a printer-uri attribute but no job-id!")); - return; + /* + * Move all jobs... + */ + + if ((src = cupsdValidateDest(host, resource, &stype, &sprinter)) == NULL) + { + /* + * Bad URI... + */ + + send_ipp_status(con, IPP_NOT_FOUND, + _("The printer or class was not found.")); + return; + } + + job = NULL; } + else + { + /* + * Otherwise, just move a single job... + */ - jobid = attr->values[0].integer; + if ((job = cupsdFindJob(attr->values[0].integer)) == NULL) + { + /* + * Nope - return a "not found" error... + */ + + send_ipp_status(con, IPP_NOT_FOUND, + _("Job #%d does not exist!"), attr->values[0].integer); + return; + } + else + { + /* + * Job found, initialize source pointers... + */ + + src = NULL; + sprinter = NULL; + } + } } else { @@ -6184,10 +6212,6 @@ move_job(cupsd_client_t *con, /* I - Client connection */ * Got a job URI; parse it to get the job ID... */ - httpSeparateURI(uri->values[0].string.text, method, sizeof(method), - username, sizeof(username), host, sizeof(host), &port, - resource, sizeof(resource)); - if (strncmp(resource, "/jobs/", 6)) { /* @@ -6200,98 +6224,107 @@ move_job(cupsd_client_t *con, /* I - Client connection */ return; } + /* + * See if the job exists... + */ + jobid = atoi(resource + 6); - } - /* - * See if the job exists... - */ + if ((job = cupsdFindJob(jobid)) == NULL) + { + /* + * Nope - return a "not found" error... + */ - if ((job = cupsdFindJob(jobid)) == NULL) - { - /* - * Nope - return a "not found" error... - */ + send_ipp_status(con, IPP_NOT_FOUND, + _("Job #%d does not exist!"), jobid); + return; + } + else + { + /* + * Job found, initialize source pointers... + */ - send_ipp_status(con, IPP_NOT_FOUND, - _("Job #%d does not exist!"), jobid); - return; + src = NULL; + sprinter = NULL; + } } /* - * See if the job has been completed... + * Now move the job or jobs... */ - if (job->state->values[0].integer > IPP_JOB_STOPPED) + if (job) { /* - * Return a "not-possible" error... + * See if the job has been completed... */ - send_ipp_status(con, IPP_NOT_POSSIBLE, - _("Job #%d is finished and cannot be altered!"), - jobid); - return; - } - - /* - * See if the job is owned by the requesting user... - */ + if (job->state->values[0].integer > IPP_JOB_STOPPED) + { + /* + * Return a "not-possible" error... + */ - if (!validate_user(job, con, job->username, username, sizeof(username))) - { - send_ipp_status(con, IPP_FORBIDDEN, - _("You are not authorized to move job #%d owned " - "by \"%s\"!"), - jobid, job->username); - return; - } + send_ipp_status(con, IPP_NOT_POSSIBLE, + _("Job #%d is finished and cannot be altered!"), + job->id); + return; + } - if ((attr = ippFindAttribute(con->request, "job-printer-uri", IPP_TAG_URI)) == NULL) - { /* - * Need job-printer-uri... + * See if the job is owned by the requesting user... */ - send_ipp_status(con, IPP_BAD_REQUEST, - _("job-printer-uri attribute missing!")); - return; - } - - /* - * Get the new printer or class... - */ + if (!validate_user(job, con, job->username, username, sizeof(username))) + { + send_ipp_status(con, IPP_FORBIDDEN, + _("You are not authorized to move job #%d owned " + "by \"%s\"!"), + job->id, job->username); + return; + } - httpSeparateURI(attr->values[0].string.text, method, sizeof(method), - username, sizeof(username), host, sizeof(host), &port, - resource, sizeof(resource)); + /* + * Move the job to a different printer or class... + */ - if ((dest = cupsdValidateDest(host, resource, &dtype, &printer)) == NULL) + cupsdMoveJob(job, dest); + } + else { /* - * Bad URI... + * Got the source printer, now look through the jobs... */ - send_ipp_status(con, IPP_NOT_FOUND, - _("The printer or class was not found.")); - return; - } + for (job = (cupsd_job_t *)cupsArrayFirst(Jobs); + job; + job = (cupsd_job_t *)cupsArrayNext(Jobs)) + { + /* + * See if the job is pointing at the source printer or has not been + * completed... + */ - /* - * Check policy... - */ + if (strcasecmp(job->dest, src) || + job->state->values[0].integer > IPP_JOB_STOPPED) + continue; - if ((status = cupsdCheckPolicy(printer->op_policy_ptr, con, NULL)) != HTTP_OK) - { - send_http_error(con, status); - return; - } + /* + * See if the job can be moved by the requesting user... + */ - /* - * Move the job to a different printer or class... - */ + if (!validate_user(job, con, job->username, username, sizeof(username))) + continue; + + /* + * Move the job to a different printer or class... + */ - cupsdMoveJob(job, dest); + cupsdMoveJob(job, dest); + } + } /* * Start jobs if possible... @@ -6467,7 +6500,8 @@ print_job(cupsd_client_t *con, /* I - Client connection */ * Validate job template attributes; for now just copies and page-ranges... */ - if ((attr = ippFindAttribute(con->request, "copies", IPP_TAG_INTEGER)) != NULL) + if ((attr = ippFindAttribute(con->request, "copies", + IPP_TAG_INTEGER)) != NULL) { if (attr->values[0].integer < 1 || attr->values[0].integer > MaxCopies) { @@ -6479,7 +6513,8 @@ print_job(cupsd_client_t *con, /* I - Client connection */ } } - if ((attr = ippFindAttribute(con->request, "page-ranges", IPP_TAG_RANGE)) != NULL) + if ((attr = ippFindAttribute(con->request, "page-ranges", + IPP_TAG_RANGE)) != NULL) { for (i = 0, lowerpagerange = 1; i < attr->num_values; i ++) { @@ -6504,7 +6539,8 @@ print_job(cupsd_client_t *con, /* I - Client connection */ compression = CUPS_FILE_NONE; - if ((attr = ippFindAttribute(con->request, "compression", IPP_TAG_KEYWORD)) != NULL) + if ((attr = ippFindAttribute(con->request, "compression", + IPP_TAG_KEYWORD)) != NULL) { if (strcmp(attr->values[0].string.text, "none") #ifdef HAVE_LIBZ @@ -6575,7 +6611,7 @@ print_job(cupsd_client_t *con, /* I - Client connection */ filetype = mimeFileType(MimeDatabase, con->filename, &compression); - if (filetype != NULL) + if (filetype) { /* * Replace the document-format attribute value with the auto-typed one. @@ -6584,7 +6620,7 @@ print_job(cupsd_client_t *con, /* I - Client connection */ snprintf(mimetype, sizeof(mimetype), "%s/%s", filetype->super, filetype->type); - if (format != NULL) + if (format) { free(format->values[0].string.text); format->values[0].string.text = strdup(mimetype); @@ -6599,7 +6635,7 @@ print_job(cupsd_client_t *con, /* I - Client connection */ else filetype = mimeType(MimeDatabase, super, type); - if (filetype == NULL) + if (!filetype) { send_ipp_status(con, IPP_DOCUMENT_FORMAT, _("Unsupported format \'%s/%s\'!"), super, type); @@ -6706,13 +6742,15 @@ print_job(cupsd_client_t *con, /* I - Client connection */ * Create the job and set things up... */ - if ((attr = ippFindAttribute(con->request, "job-priority", IPP_TAG_INTEGER)) != NULL) + if ((attr = ippFindAttribute(con->request, "job-priority", + IPP_TAG_INTEGER)) != NULL) priority = attr->values[0].integer; else ippAddInteger(con->request, IPP_TAG_JOB, IPP_TAG_INTEGER, "job-priority", priority = 50); - if ((attr = ippFindAttribute(con->request, "job-name", IPP_TAG_NAME)) != NULL) + if ((attr = ippFindAttribute(con->request, "job-name", + IPP_TAG_NAME)) != NULL) title = attr->values[0].string.text; else ippAddString(con->request, IPP_TAG_JOB, IPP_TAG_NAME, "job-name", NULL, @@ -6744,7 +6782,7 @@ print_job(cupsd_client_t *con, /* I - Client connection */ save_auth_info(con, job); } - else if (attr != NULL) + else if (attr) { cupsdLogMessage(CUPSD_LOG_DEBUG, "print_job: requesting-user-name = \"%s\"", attr->values[0].string.text); @@ -6754,7 +6792,7 @@ print_job(cupsd_client_t *con, /* I - Client connection */ else cupsdSetString(&job->username, "anonymous"); - if (attr == NULL) + if (!attr) ippAddString(job->attrs, IPP_TAG_JOB, IPP_TAG_NAME, "job-originating-user-name", NULL, job->username); else @@ -6776,7 +6814,7 @@ print_job(cupsd_client_t *con, /* I - Client connection */ if (attr->value_tag != IPP_TAG_NAME || attr->num_values != 1 || - strcmp(con->http.hostname, "localhost") != 0) + strcmp(con->http.hostname, "localhost")) { /* * Can't override the value if we aren't connected via localhost. @@ -6847,7 +6885,8 @@ print_job(cupsd_client_t *con, /* I - Client connection */ ippAddString(job->attrs, IPP_TAG_JOB, IPP_TAG_NAME, "job-name", NULL, title); - if ((attr = ippFindAttribute(job->attrs, "job-k-octets", IPP_TAG_INTEGER)) == NULL) + if ((attr = ippFindAttribute(job->attrs, "job-k-octets", + IPP_TAG_INTEGER)) == NULL) attr = ippAddInteger(job->attrs, IPP_TAG_JOB, IPP_TAG_INTEGER, "job-k-octets", 0); @@ -6868,13 +6907,14 @@ print_job(cupsd_client_t *con, /* I - Client connection */ "time-at-completed", 0); attr->value_tag = IPP_TAG_NOVALUE; - if ((attr = ippFindAttribute(job->attrs, "job-hold-until", IPP_TAG_KEYWORD)) == NULL) + if ((attr = ippFindAttribute(job->attrs, "job-hold-until", + IPP_TAG_KEYWORD)) == NULL) attr = ippFindAttribute(job->attrs, "job-hold-until", IPP_TAG_NAME); - if (attr == NULL) + if (!attr) attr = ippAddString(job->attrs, IPP_TAG_JOB, IPP_TAG_KEYWORD, "job-hold-until", NULL, "no-hold"); - if (attr != NULL && strcmp(attr->values[0].string.text, "no-hold") != 0 && + if (attr && strcmp(attr->values[0].string.text, "no-hold") && !(printer->type & CUPS_PRINTER_REMOTE)) { /* @@ -6892,7 +6932,8 @@ print_job(cupsd_client_t *con, /* I - Client connection */ * Add job sheets options... */ - if ((attr = ippFindAttribute(job->attrs, "job-sheets", IPP_TAG_ZERO)) == NULL) + if ((attr = ippFindAttribute(job->attrs, "job-sheets", + IPP_TAG_ZERO)) == NULL) { cupsdLogMessage(CUPSD_LOG_DEBUG, "Adding default job-sheets values \"%s,%s\"...", @@ -6919,9 +6960,9 @@ print_job(cupsd_client_t *con, /* I - Client connection */ if (ClassifyOverride) { - if (strcmp(attr->values[0].string.text, "none") == 0 && + if (!strcmp(attr->values[0].string.text, "none") && (attr->num_values == 1 || - strcmp(attr->values[1].string.text, "none") == 0)) + !strcmp(attr->values[1].string.text, "none"))) { /* * Force the leading banner to have the classification on it... @@ -6936,9 +6977,10 @@ print_job(cupsd_client_t *con, /* I - Client connection */ job->id, Classification, job->username); } else if (attr->num_values == 2 && - strcmp(attr->values[0].string.text, attr->values[1].string.text) != 0 && - strcmp(attr->values[0].string.text, "none") != 0 && - strcmp(attr->values[1].string.text, "none") != 0) + strcmp(attr->values[0].string.text, + attr->values[1].string.text) && + strcmp(attr->values[0].string.text, "none") && + strcmp(attr->values[1].string.text, "none")) { /* * Can't put two different security markings on the same document! @@ -6975,9 +7017,9 @@ print_job(cupsd_client_t *con, /* I - Client connection */ attr->values[1].string.text, job->username); } } - else if (strcmp(attr->values[0].string.text, Classification) != 0 && + else if (strcmp(attr->values[0].string.text, Classification) && (attr->num_values == 1 || - strcmp(attr->values[1].string.text, Classification) != 0)) + strcmp(attr->values[1].string.text, Classification))) { /* * Force the banner to have the classification on it... @@ -7031,7 +7073,8 @@ print_job(cupsd_client_t *con, /* I - Client connection */ cupsdUpdateQuota(printer, job->username, 0, kbytes); } } - else if ((attr = ippFindAttribute(job->attrs, "job-sheets", IPP_TAG_ZERO)) != NULL) + else if ((attr = ippFindAttribute(job->attrs, "job-sheets", + IPP_TAG_ZERO)) != NULL) job->sheets = attr; /* @@ -7190,7 +7233,7 @@ read_ps_job_ticket(cupsd_client_t *con) /* I - Client connection */ return; } - if (strncmp(line, "%!PS-Adobe-", 11) != 0) + if (strncmp(line, "%!PS-Adobe-", 11)) { /* * Not a DSC-compliant file, so no job ticket info will be available... @@ -7207,13 +7250,13 @@ read_ps_job_ticket(cupsd_client_t *con) /* I - Client connection */ num_options = 0; options = NULL; - while (cupsFileGets(fp, line, sizeof(line)) != NULL) + while (cupsFileGets(fp, line, sizeof(line))) { /* * Stop at the first non-ticket line... */ - if (strncmp(line, "%cupsJobTicket:", 15) != 0) + if (strncmp(line, "%cupsJobTicket:", 15)) break; /* @@ -7244,7 +7287,7 @@ read_ps_job_ticket(cupsd_client_t *con) /* I - Client connection */ * See what the user wants to change. */ - for (attr = ticket->attrs; attr != NULL; attr = attr->next) + for (attr = ticket->attrs; attr; attr = attr->next) { if (attr->group_tag != IPP_TAG_JOB || !attr->name) continue; @@ -7258,7 +7301,8 @@ read_ps_job_ticket(cupsd_client_t *con) /* I - Client connection */ !strncmp(attr->name, "time-at-", 8)) continue; /* Read-only attrs */ - if ((attr2 = ippFindAttribute(con->request, attr->name, IPP_TAG_ZERO)) != NULL) + if ((attr2 = ippFindAttribute(con->request, attr->name, + IPP_TAG_ZERO)) != NULL) { /* * Some other value; first free the old value... @@ -7271,7 +7315,7 @@ read_ps_job_ticket(cupsd_client_t *con) /* I - Client connection */ } else { - for (prev2 = con->request->attrs; prev2 != NULL; prev2 = prev2->next) + for (prev2 = con->request->attrs; prev2; prev2 = prev2->next) if (prev2->next == attr2) { prev2->next = attr2->next; @@ -7422,7 +7466,8 @@ release_job(cupsd_client_t *con, /* I - Client connection */ * Got a printer URI; see if we also have a job-id attribute... */ - if ((attr = ippFindAttribute(con->request, "job-id", IPP_TAG_INTEGER)) == NULL) + if ((attr = ippFindAttribute(con->request, "job-id", + IPP_TAG_INTEGER)) == NULL) { send_ipp_status(con, IPP_BAD_REQUEST, _("Got a printer-uri attribute but no job-id!")); @@ -7501,10 +7546,11 @@ release_job(cupsd_client_t *con, /* I - Client connection */ * Reset the job-hold-until value to "no-hold"... */ - if ((attr = ippFindAttribute(job->attrs, "job-hold-until", IPP_TAG_KEYWORD)) == NULL) + if ((attr = ippFindAttribute(job->attrs, "job-hold-until", + IPP_TAG_KEYWORD)) == NULL) attr = ippFindAttribute(job->attrs, "job-hold-until", IPP_TAG_NAME); - if (attr != NULL) + if (attr) { free(attr->values[0].string.text); attr->value_tag = IPP_TAG_KEYWORD; @@ -7567,7 +7613,8 @@ restart_job(cupsd_client_t *con, /* I - Client connection */ * Got a printer URI; see if we also have a job-id attribute... */ - if ((attr = ippFindAttribute(con->request, "job-id", IPP_TAG_INTEGER)) == NULL) + if ((attr = ippFindAttribute(con->request, "job-id", + IPP_TAG_INTEGER)) == NULL) { send_ipp_status(con, IPP_BAD_REQUEST, _("Got a printer-uri attribute but no job-id!")); @@ -7586,7 +7633,7 @@ restart_job(cupsd_client_t *con, /* I - Client connection */ username, sizeof(username), host, sizeof(host), &port, resource, sizeof(resource)); - if (strncmp(resource, "/jobs/", 6) != 0) + if (strncmp(resource, "/jobs/", 6)) { /* * Not a valid URI! @@ -7806,7 +7853,8 @@ send_document(cupsd_client_t *con, /* I - Client connection */ * Got a printer URI; see if we also have a job-id attribute... */ - if ((attr = ippFindAttribute(con->request, "job-id", IPP_TAG_INTEGER)) == NULL) + if ((attr = ippFindAttribute(con->request, "job-id", + IPP_TAG_INTEGER)) == NULL) { send_ipp_status(con, IPP_BAD_REQUEST, _("Got a printer-uri attribute but no job-id!")); @@ -7874,7 +7922,8 @@ send_document(cupsd_client_t *con, /* I - Client connection */ compression = CUPS_FILE_NONE; - if ((attr = ippFindAttribute(con->request, "compression", IPP_TAG_KEYWORD)) != NULL) + if ((attr = ippFindAttribute(con->request, "compression", + IPP_TAG_KEYWORD)) != NULL) { if (strcmp(attr->values[0].string.text, "none") #ifdef HAVE_LIBZ @@ -7933,8 +7982,7 @@ send_document(cupsd_client_t *con, /* I - Client connection */ strcpy(type, "octet-stream"); } - if (strcmp(super, "application") == 0 && - strcmp(type, "octet-stream") == 0) + if (!strcmp(super, "application") && !strcmp(type, "octet-stream")) { /* * Auto-type the file... @@ -7944,7 +7992,7 @@ send_document(cupsd_client_t *con, /* I - Client connection */ filetype = mimeFileType(MimeDatabase, con->filename, &compression); - if (filetype != NULL) + if (filetype) { /* * Replace the document-format attribute value with the auto-typed one. @@ -7953,7 +8001,7 @@ send_document(cupsd_client_t *con, /* I - Client connection */ snprintf(mimetype, sizeof(mimetype), "%s/%s", filetype->super, filetype->type); - if (format != NULL) + if (format) { free(format->values[0].string.text); format->values[0].string.text = strdup(mimetype); @@ -7968,7 +8016,7 @@ send_document(cupsd_client_t *con, /* I - Client connection */ else filetype = mimeType(MimeDatabase, super, type); - if (filetype == NULL) + if (!filetype) { send_ipp_status(con, IPP_DOCUMENT_FORMAT, _("Unsupported format \'%s/%s\'!"), super, type); @@ -8005,7 +8053,8 @@ send_document(cupsd_client_t *con, /* I - Client connection */ cupsdUpdateQuota(printer, job->username, 0, kbytes); - if ((attr = ippFindAttribute(job->attrs, "job-k-octets", IPP_TAG_INTEGER)) != NULL) + if ((attr = ippFindAttribute(job->attrs, "job-k-octets", + IPP_TAG_INTEGER)) != NULL) attr->values[0].integer += kbytes; snprintf(filename, sizeof(filename), "%s/d%05d-%03d", RequestRoot, job->id, @@ -8022,16 +8071,18 @@ send_document(cupsd_client_t *con, /* I - Client connection */ * Start the job if this is the last document... */ - if ((attr = ippFindAttribute(con->request, "last-document", IPP_TAG_BOOLEAN)) != NULL && + if ((attr = ippFindAttribute(con->request, "last-document", + IPP_TAG_BOOLEAN)) != NULL && attr->values[0].boolean) { /* * See if we need to add the ending sheet... */ - if (printer != NULL && + if (printer && !(printer->type & (CUPS_PRINTER_REMOTE | CUPS_PRINTER_IMPLICIT)) && - (attr = ippFindAttribute(job->attrs, "job-sheets", IPP_TAG_ZERO)) != NULL && + (attr = ippFindAttribute(job->attrs, "job-sheets", + IPP_TAG_ZERO)) != NULL && attr->num_values > 1) { /* @@ -8051,10 +8102,11 @@ send_document(cupsd_client_t *con, /* I - Client connection */ job->state->values[0].integer = IPP_JOB_PENDING; else if (job->state->values[0].integer == IPP_JOB_HELD) { - if ((attr = ippFindAttribute(job->attrs, "job-hold-until", IPP_TAG_KEYWORD)) == NULL) + if ((attr = ippFindAttribute(job->attrs, "job-hold-until", + IPP_TAG_KEYWORD)) == NULL) attr = ippFindAttribute(job->attrs, "job-hold-until", IPP_TAG_NAME); - if (attr == NULL || strcmp(attr->values[0].string.text, "no-hold") == 0) + if (!attr || !strcmp(attr->values[0].string.text, "no-hold")) job->state->values[0].integer = IPP_JOB_PENDING; } @@ -8073,10 +8125,11 @@ send_document(cupsd_client_t *con, /* I - Client connection */ } else { - if ((attr = ippFindAttribute(job->attrs, "job-hold-until", IPP_TAG_KEYWORD)) == NULL) + if ((attr = ippFindAttribute(job->attrs, "job-hold-until", + IPP_TAG_KEYWORD)) == NULL) attr = ippFindAttribute(job->attrs, "job-hold-until", IPP_TAG_NAME); - if (attr == NULL || strcmp(attr->values[0].string.text, "no-hold") == 0) + if (!attr || !strcmp(attr->values[0].string.text, "no-hold")) { job->state->values[0].integer = IPP_JOB_HELD; job->hold_until = time(NULL) + 60; @@ -8159,7 +8212,8 @@ send_ipp_status(cupsd_client_t *con, /* I - Client connection */ con->response->request.status.status_code = status; - if (ippFindAttribute(con->response, "attributes-charset", IPP_TAG_ZERO) == NULL) + if (ippFindAttribute(con->response, "attributes-charset", + IPP_TAG_ZERO) == NULL) ippAddString(con->response, IPP_TAG_OPERATION, IPP_TAG_CHARSET, "attributes-charset", NULL, DefaultCharset); @@ -8288,13 +8342,14 @@ set_job_attrs(cupsd_client_t *con, /* I - Client connection */ * See if we have a job URI or a printer URI... */ - if (strcmp(uri->name, "printer-uri") == 0) + if (!strcmp(uri->name, "printer-uri")) { /* * Got a printer URI; see if we also have a job-id attribute... */ - if ((attr = ippFindAttribute(con->request, "job-id", IPP_TAG_INTEGER)) == NULL) + if ((attr = ippFindAttribute(con->request, "job-id", + IPP_TAG_INTEGER)) == NULL) { send_ipp_status(con, IPP_BAD_REQUEST, _("Got a printer-uri attribute but no job-id!")); @@ -8313,7 +8368,7 @@ set_job_attrs(cupsd_client_t *con, /* I - Client connection */ username, sizeof(username), host, sizeof(host), &port, resource, sizeof(resource)); - if (strncmp(resource, "/jobs/", 6) != 0) + if (strncmp(resource, "/jobs/", 6)) { /* * Not a valid URI! @@ -8374,7 +8429,7 @@ set_job_attrs(cupsd_client_t *con, /* I - Client connection */ * See what the user wants to change. */ - for (attr = con->request->attrs; attr != NULL; attr = attr->next) + for (attr = con->request->attrs; attr; attr = attr->next) { if (attr->group_tag != IPP_TAG_JOB || !attr->name) continue; @@ -8503,7 +8558,8 @@ set_job_attrs(cupsd_client_t *con, /* I - Client connection */ } else if (con->response->request.status.status_code != IPP_OK) continue; - else if ((attr2 = ippFindAttribute(job->attrs, attr->name, IPP_TAG_ZERO)) != NULL) + else if ((attr2 = ippFindAttribute(job->attrs, attr->name, + IPP_TAG_ZERO)) != NULL) { /* * Some other value; first free the old value... @@ -8824,8 +8880,9 @@ validate_job(cupsd_client_t *con, /* I - Client connection */ * doesn't support compression yet... */ - if ((attr = ippFindAttribute(con->request, "compression", IPP_TAG_KEYWORD)) != NULL && - strcmp(attr->values[0].string.text, "none") == 0) + if ((attr = ippFindAttribute(con->request, "compression", + IPP_TAG_KEYWORD)) != NULL && + !strcmp(attr->values[0].string.text, "none")) { send_ipp_status(con, IPP_ATTRIBUTES, _("Unsupported compression attribute %s!"), @@ -8849,9 +8906,8 @@ validate_job(cupsd_client_t *con, /* I - Client connection */ return; } - if ((strcmp(super, "application") != 0 || - strcmp(type, "octet-stream") != 0) && - mimeType(MimeDatabase, super, type) == NULL) + if ((strcmp(super, "application") || strcmp(type, "octet-stream")) && + !mimeType(MimeDatabase, super, type)) { cupsdLogMessage(CUPSD_LOG_INFO, "Hint: Do you have the raw file printing rules enabled?"); @@ -8982,5 +9038,5 @@ validate_user(cupsd_job_t *job, /* I - Job */ /* - * End of "$Id: ipp.c 4906 2006-01-10 20:53:28Z mike $". + * End of "$Id: ipp.c 4995 2006-01-26 20:14:42Z mike $". */ diff --git a/scheduler/job.c b/scheduler/job.c index e66a7f1a1..0921095ba 100644 --- a/scheduler/job.c +++ b/scheduler/job.c @@ -1,5 +1,5 @@ /* - * "$Id: job.c 4906 2006-01-10 20:53:28Z mike $" + * "$Id: job.c 4992 2006-01-26 17:50:58Z mike $" * * Job management routines for the Common UNIX Printing System (CUPS). * @@ -725,7 +725,7 @@ cupsdLoadAllJobs(void) cups_dir_t *dir; /* Directory */ cups_dentry_t *dent; /* Directory entry */ char filename[1024]; /* Full filename of job file */ - int fd; /* File descriptor */ + cups_file_t *fp; /* Job file */ cupsd_job_t *job; /* New job */ int jobid, /* Current job ID */ fileid; /* Current file ID */ @@ -819,10 +819,11 @@ cupsdLoadAllJobs(void) */ snprintf(filename, sizeof(filename), "%s/%s", RequestRoot, dent->filename); - if ((fd = open(filename, O_RDONLY)) < 0) + if ((fp = cupsFileOpen(filename, "r")) == NULL) { cupsdLogMessage(CUPSD_LOG_ERROR, - "cupsdLoadAllJobs: Unable to open job control file \"%s\" - %s!", + "cupsdLoadAllJobs: Unable to open job control file " + "\"%s\" - %s!", filename, strerror(errno)); ippDelete(job->attrs); free(job); @@ -831,25 +832,28 @@ cupsdLoadAllJobs(void) } else { - if (ippReadFile(fd, job->attrs) != IPP_DATA) + if (ippReadIO(fp, (ipp_iocb_t)cupsFileRead, 1, NULL, + job->attrs) != IPP_DATA) { cupsdLogMessage(CUPSD_LOG_ERROR, - "cupsdLoadAllJobs: Unable to read job control file \"%s\"!", + "cupsdLoadAllJobs: Unable to read job control file " + "\"%s\"!", filename); - close(fd); + cupsFileClose(fp); ippDelete(job->attrs); free(job); unlink(filename); continue; } - close(fd); + cupsFileClose(fp); } if ((job->state = ippFindAttribute(job->attrs, "job-state", IPP_TAG_ENUM)) == NULL) { cupsdLogMessage(CUPSD_LOG_ERROR, - "cupsdLoadAllJobs: Missing or bad job-state attribute in control file \"%s\"!", + "cupsdLoadAllJobs: Missing or bad job-state attribute " + "in control file \"%s\"!", filename); ippDelete(job->attrs); free(job); @@ -860,7 +864,8 @@ cupsdLoadAllJobs(void) if ((attr = ippFindAttribute(job->attrs, "job-printer-uri", IPP_TAG_URI)) == NULL) { cupsdLogMessage(CUPSD_LOG_ERROR, - "cupsdLoadAllJobs: No job-printer-uri attribute in control file \"%s\"!", + "cupsdLoadAllJobs: No job-printer-uri attribute in " + "control file \"%s\"!", filename); ippDelete(job->attrs); free(job); @@ -876,7 +881,8 @@ cupsdLoadAllJobs(void) NULL)) == NULL) { cupsdLogMessage(CUPSD_LOG_ERROR, - "cupsdLoadAllJobs: Unable to queue job for destination \"%s\"!", + "cupsdLoadAllJobs: Unable to queue job for destination " + "\"%s\"!", attr->values[0].string.text); ippDelete(job->attrs); free(job); @@ -890,10 +896,12 @@ cupsdLoadAllJobs(void) IPP_TAG_INTEGER); job->job_sheets = ippFindAttribute(job->attrs, "job-sheets", IPP_TAG_NAME); - if ((attr = ippFindAttribute(job->attrs, "job-priority", IPP_TAG_INTEGER)) == NULL) + if ((attr = ippFindAttribute(job->attrs, "job-priority", + IPP_TAG_INTEGER)) == NULL) { cupsdLogMessage(CUPSD_LOG_ERROR, - "cupsdLoadAllJobs: Missing or bad job-priority attribute in control file \"%s\"!", + "cupsdLoadAllJobs: Missing or bad job-priority " + "attribute in control file \"%s\"!", filename); ippDelete(job->attrs); free(job); @@ -902,10 +910,13 @@ cupsdLoadAllJobs(void) } job->priority = attr->values[0].integer; - if ((attr = ippFindAttribute(job->attrs, "job-originating-user-name", IPP_TAG_NAME)) == NULL) + if ((attr = ippFindAttribute(job->attrs, "job-originating-user-name", + IPP_TAG_NAME)) == NULL) { cupsdLogMessage(CUPSD_LOG_ERROR, - "cupsdLoadAllJobs: Missing or bad job-originating-user-name attribute in control file \"%s\"!", + "cupsdLoadAllJobs: Missing or bad " + "job-originating-user-name attribute in control file " + "\"%s\"!", filename); ippDelete(job->attrs); free(job); @@ -928,7 +939,8 @@ cupsdLoadAllJobs(void) if (job->state->values[0].integer == IPP_JOB_HELD) { - if ((attr = ippFindAttribute(job->attrs, "job-hold-until", IPP_TAG_KEYWORD)) == NULL) + if ((attr = ippFindAttribute(job->attrs, "job-hold-until", + IPP_TAG_KEYWORD)) == NULL) attr = ippFindAttribute(job->attrs, "job-hold-until", IPP_TAG_NAME); if (attr == NULL) @@ -989,7 +1001,9 @@ cupsdLoadAllJobs(void) if (compressions == NULL || filetypes == NULL) { - cupsdLogMessage(CUPSD_LOG_ERROR, "cupsdLoadAllJobs: Ran out of memory for job file types!"); + cupsdLogMessage(CUPSD_LOG_ERROR, + "cupsdLoadAllJobs: Ran out of memory for job file " + "types!"); continue; } @@ -1104,27 +1118,26 @@ void cupsdSaveJob(cupsd_job_t *job) /* I - Job */ { char filename[1024]; /* Job control filename */ - int fd; /* File descriptor */ + cups_file_t *fp; /* Job file */ snprintf(filename, sizeof(filename), "%s/c%05d", RequestRoot, job->id); - if ((fd = open(filename, O_WRONLY | O_CREAT | O_TRUNC, 0600)) < 0) + if ((fp = cupsFileOpen(filename, "w")) == NULL) { cupsdLogMessage(CUPSD_LOG_ERROR, - "cupsdSaveJob: Unable to create job control file \"%s\" - %s.", + "cupsdSaveJob: Unable to create job control file " + "\"%s\" - %s.", filename, strerror(errno)); return; } - fchmod(fd, 0600); - fchown(fd, RunUser, Group); - - ippWriteFile(fd, job->attrs); + fchmod(cupsFileNumber(fp), 0600); + fchown(cupsFileNumber(fp), RunUser, Group); - cupsdLogMessage(CUPSD_LOG_DEBUG2, "cupsdSaveJob: Closing file %d...", fd); + ippWriteIO(fp, (ipp_iocb_t)cupsFileWrite, 1, NULL, job->attrs); - close(fd); + cupsFileClose(fp); } @@ -1313,8 +1326,9 @@ cupsdStartJob(cupsd_job_t *job, /* I - Job ID */ { int i; /* Looping var */ int slot; /* Pipe slot */ - int num_filters; /* Number of filters for job */ - mime_filter_t *filters; /* Filters for job */ + cups_array_t *filters; /* Filters for job */ + mime_filter_t *filter, /* Current filter */ + port_monitor; /* Port monitor filter */ char method[255], /* Method for output */ *optptr, /* Pointer to options */ *valptr; /* Pointer in value string */ @@ -1371,7 +1385,7 @@ cupsdStartJob(cupsd_job_t *job, /* I - Job ID */ * the source to the destination type... */ - num_filters = 0; + filters = NULL; job->cost = 0; if (printer->raw) @@ -1393,9 +1407,9 @@ cupsdStartJob(cupsd_job_t *job, /* I - Job ID */ */ filters = mimeFilter(MimeDatabase, job->filetypes[job->current_file], - printer->filetype, &num_filters, MAX_FILTERS - 1); + printer->filetype, &(job->cost), MAX_FILTERS - 1); - if (num_filters == 0) + if (!filters) { cupsdLogMessage(CUPSD_LOG_ERROR, "Unable to convert file %d to printable format for job %d!", @@ -1424,31 +1438,17 @@ cupsdStartJob(cupsd_job_t *job, /* I - Job ID */ * Remove NULL ("-") filters... */ - for (i = 0; i < num_filters;) - if (strcmp(filters[i].filter, "-") == 0) - { - num_filters --; - if (i < num_filters) - memcpy(filters + i, filters + i + 1, - (num_filters - i) * sizeof(mime_filter_t)); - } - else - i ++; + for (filter = (mime_filter_t *)cupsArrayFirst(filters); + filter; + filter = (mime_filter_t *)cupsArrayNext(filters)) + if (!strcmp(filter->filter, "-")) + cupsArrayRemove(filters, filter); - if (num_filters == 0) + if (cupsArrayCount(filters) == 0) { - free(filters); + cupsArrayDelete(filters); filters = NULL; } - else - { - /* - * Compute filter cost... - */ - - for (i = 0; i < num_filters; i ++) - job->cost += filters[i].cost; - } } /* @@ -1462,8 +1462,7 @@ cupsdStartJob(cupsd_job_t *job, /* I - Job ID */ * Don't print this job quite yet... */ - if (filters != NULL) - free(filters); + cupsArrayDelete(filters); cupsdLogMessage(CUPSD_LOG_INFO, "Holding job %d because filter limit has been reached.", @@ -1487,15 +1486,7 @@ cupsdStartJob(cupsd_job_t *job, /* I - Job ID */ * Add gziptoany filter to the front of the list... */ - mime_filter_t *temp_filters; - - if (num_filters == 0) - temp_filters = malloc(sizeof(mime_filter_t)); - else - temp_filters = realloc(filters, - sizeof(mime_filter_t) * (num_filters + 1)); - - if (temp_filters == NULL) + if (!cupsArrayInsert(filters, &gziptoany_filter)) { cupsdLogMessage(CUPSD_LOG_ERROR, "Unable to add decompression filter - %s", strerror(errno)); @@ -1508,18 +1499,14 @@ cupsdStartJob(cupsd_job_t *job, /* I - Job ID */ if (job->current_file == job->num_files) { cupsdAddEvent(CUPSD_EVENT_JOB_COMPLETED, job->printer, job, - "Job canceled because the print file could not be decompressed."); + "Job canceled because the print file could not be " + "decompressed."); cupsdCancelJob(job, 0); } return; } - - filters = temp_filters; - memmove(filters + 1, filters, num_filters * sizeof(mime_filter_t)); - *filters = gziptoany_filter; - num_filters ++; } /* @@ -1532,15 +1519,7 @@ cupsdStartJob(cupsd_job_t *job, /* I - Job ID */ * Add port monitor to the end of the list... */ - mime_filter_t *temp_filters; - - if (num_filters == 0) - temp_filters = malloc(sizeof(mime_filter_t)); - else - temp_filters = realloc(filters, - sizeof(mime_filter_t) * (num_filters + 1)); - - if (temp_filters == NULL) + if (!cupsArrayAdd(filters, &port_monitor)) { cupsdLogMessage(CUPSD_LOG_ERROR, "Unable to add port monitor - %s", strerror(errno)); @@ -1553,7 +1532,8 @@ cupsdStartJob(cupsd_job_t *job, /* I - Job ID */ if (job->current_file == job->num_files) { cupsdAddEvent(CUPSD_EVENT_JOB_COMPLETED, job->printer, job, - "Job canceled because the port monitor could not be added."); + "Job canceled because the port monitor could not be " + "added."); cupsdCancelJob(job, 0); } @@ -1561,11 +1541,8 @@ cupsdStartJob(cupsd_job_t *job, /* I - Job ID */ return; } - filters = temp_filters; - memset(filters + num_filters, 0, sizeof(mime_filter_t)); - snprintf(filters[num_filters].filter, sizeof(filters[num_filters].filter), + snprintf(port_monitor.filter, sizeof(port_monitor.filter), "%s/monitor/%s", ServerBin, printer->port_monitor); - num_filters ++; } /* @@ -2002,15 +1979,17 @@ cupsdStartJob(cupsd_job_t *job, /* I - Job ID */ cupsdLogMessage(CUPSD_LOG_DEBUG, "cupsdStartJob: filterfds[%d] = [ %d %d ]", 1, filterfds[1][0], filterfds[1][1]); - for (i = 0, slot = 0; i < num_filters; i ++) + for (i = 0, slot = 0, filter = (mime_filter_t *)cupsArrayFirst(filters); + filter; + i ++, filter = (mime_filter_t *)cupsArrayNext(filters)) { - if (filters[i].filter[0] != '/') + if (filter->filter[0] != '/') snprintf(command, sizeof(command), "%s/filter/%s", ServerBin, - filters[i].filter); + filter->filter); else - strlcpy(command, filters[i].filter, sizeof(command)); + strlcpy(command, filter->filter, sizeof(command)); - if (i < (num_filters - 1)) + if (i < (cupsArrayCount(filters) - 1)) { if (cupsdOpenPipe(filterfds[slot])) { @@ -2021,8 +2000,7 @@ cupsdStartJob(cupsd_job_t *job, /* I - Job ID */ "Unable to create filter pipes - %s.", strerror(errno)); cupsdAddPrinterHistory(printer); - if (filters != NULL) - free(filters); + cupsArrayDelete(filters); cupsdClosePipe(statusfds); cupsdClosePipe(filterfds[!slot]); @@ -2049,8 +2027,7 @@ cupsdStartJob(cupsd_job_t *job, /* I - Job ID */ "Unable to create backend pipes - %s.", strerror(errno)); cupsdAddPrinterHistory(printer); - if (filters != NULL) - free(filters); + cupsArrayDelete(filters); cupsdClosePipe(statusfds); cupsdClosePipe(filterfds[!slot]); @@ -2088,8 +2065,7 @@ cupsdStartJob(cupsd_job_t *job, /* I - Job ID */ cupsdAddPrinterHistory(printer); - if (filters != NULL) - free(filters); + cupsArrayDelete(filters); cupsdClosePipe(statusfds); cupsdClosePipe(filterfds[!slot]); @@ -2130,15 +2106,14 @@ cupsdStartJob(cupsd_job_t *job, /* I - Job ID */ if (pid == 0) { cupsdLogMessage(CUPSD_LOG_ERROR, "Unable to start filter \"%s\" - %s.", - filters[i].filter, strerror(errno)); + filter->filter, strerror(errno)); snprintf(printer->state_message, sizeof(printer->state_message), "Unable to start filter \"%s\" - %s.", - filters[i].filter, strerror(errno)); + filter->filter, strerror(errno)); cupsdAddPrinterHistory(printer); - if (filters != NULL) - free(filters); + cupsArrayDelete(filters); cupsdAddPrinterHistory(printer); @@ -2156,8 +2131,7 @@ cupsdStartJob(cupsd_job_t *job, /* I - Job ID */ slot = !slot; } - if (filters != NULL) - free(filters); + cupsArrayDelete(filters); /* * Finally, pipe the final output into a backend process if needed... @@ -2184,9 +2158,6 @@ cupsdStartJob(cupsd_job_t *job, /* I - Job ID */ cupsdAddPrinterHistory(printer); - if (filters != NULL) - free(filters); - cupsdClosePipe(statusfds); cupsdAddEvent(CUPSD_EVENT_JOB_COMPLETED, job->printer, job, @@ -2714,5 +2685,5 @@ set_hold_until(cupsd_job_t *job, /* I - Job to update */ /* - * End of "$Id: job.c 4906 2006-01-10 20:53:28Z mike $". + * End of "$Id: job.c 4992 2006-01-26 17:50:58Z mike $". */ diff --git a/scheduler/main.c b/scheduler/main.c index 3bbd88876..4fd62fad5 100644 --- a/scheduler/main.c +++ b/scheduler/main.c @@ -1,9 +1,9 @@ /* - * "$Id: main.c 4838 2005-11-14 18:34:27Z mike $" + * "$Id: main.c 4993 2006-01-26 19:27:40Z mike $" * * Scheduler main loop for the Common UNIX Printing System (CUPS). * - * Copyright 1997-2005 by Easy Software Products, all rights reserved. + * Copyright 1997-2006 by Easy Software Products, all rights reserved. * * These coded instructions, statements, and computer programs are the * property of Easy Software Products and are protected by Federal @@ -56,6 +56,9 @@ #if defined(HAVE_MALLOC_H) && defined(HAVE_MALLINFO) # include <malloc.h> #endif /* HAVE_MALLOC_H && HAVE_MALLINFO */ +#ifdef HAVE_NOTIFY_H +# include <notify.h> +#endif /* HAVE_NOTIFY_H */ /* @@ -666,7 +669,7 @@ main(int argc, /* I - Number of command-line arguments */ * Update the browse list as needed... */ - if (Browsing && (BrowseLocalProtocols | BrowseRemoteProtocols)) + if (Browsing && BrowseRemoteProtocols) { if (BrowseSocket >= 0 && FD_ISSET(BrowseSocket, input)) cupsdUpdateCUPSBrowse(); @@ -679,12 +682,12 @@ main(int argc, /* I - Number of command-line arguments */ BrowseSLPRefresh <= current_time) cupsdUpdateSLPBrowse(); #endif /* HAVE_LIBSLP */ + } - if (current_time > browse_time) - { - cupsdSendBrowseList(); - browse_time = current_time; - } + if (Browsing && BrowseLocalProtocols && current_time > browse_time) + { + cupsdSendBrowseList(); + browse_time = current_time; } /* @@ -822,6 +825,46 @@ main(int argc, /* I - Number of command-line arguments */ cupsdDeleteCert(0); cupsdAddCert(0, "root"); } + + /* + * Handle OS-specific event notification for any events that have + * accumulated. Don't send these more than once a second... + */ + + if (LastEvent && (time(NULL) - LastEventTime) > 1) + { +#ifdef HAVE_NOTIFY_POST + if (LastEvent & CUPSD_EVENT_PRINTER_CHANGED) + { + cupsdLogMessage(CUPSD_LOG_DEBUG, + "notify_post(\"com.apple.printerListChange\")"); + notify_post("com.apple.printerListChange"); + } + + if (LastEvent & CUPSD_EVENT_PRINTER_STATE_CHANGED) + { + cupsdLogMessage(CUPSD_LOG_DEBUG, + "notify_post(\"com.apple.printerHistoryChange\")"); + notify_post("com.apple.printerHistoryChange"); + } + + if (LastEvent & (CUPSD_EVENT_JOB_STATE_CHANGED | + CUPSD_EVENT_JOB_CONFIG_CHANGED | + CUPSD_EVENT_JOB_PROGRESS)) + { + cupsdLogMessage(CUPSD_LOG_DEBUG, + "notify_post(\"com.apple.jobChange\")"); + notify_post("com.apple.jobChange"); + } +#endif /* HAVE_NOTIFY_POST */ + + /* + * Reset the accumulated events and notification time... + */ + + LastEventTime = time(NULL); + LastEvent = CUPSD_EVENT_NONE; + } } /* @@ -1353,6 +1396,13 @@ select_timeout(int fds) /* I - Number of ready descriptors select returned */ return (1); /* + * If we had a recent event notification, timeout in 1 second... + */ + + if (LastEvent) + return (1); + + /* * Otherwise, check all of the possible events that we need to wake for... */ @@ -1504,5 +1554,5 @@ usage(void) /* - * End of "$Id: main.c 4838 2005-11-14 18:34:27Z mike $". + * End of "$Id: main.c 4993 2006-01-26 19:27:40Z mike $". */ diff --git a/scheduler/mime.c b/scheduler/mime.c index 236ae11dc..903f66f2f 100644 --- a/scheduler/mime.c +++ b/scheduler/mime.c @@ -1,9 +1,9 @@ /* - * "$Id: mime.c 4613 2005-08-30 12:41:48Z mike $" + * "$Id: mime.c 4970 2006-01-24 14:05:45Z mike $" * * MIME database file routines for the Common UNIX Printing System (CUPS). * - * Copyright 1997-2005 by Easy Software Products, all rights reserved. + * Copyright 1997-2006 by Easy Software Products, all rights reserved. * * These coded instructions, statements, and computer programs are the * property of Easy Software Products and are protected by Federal @@ -23,12 +23,22 @@ * * Contents: * - * mimeDelete() - Delete (free) a MIME database. - * mimeMerge() - Merge a MIME database from disk with the current one. - * mimeNew() - Create a new, empty MIME database. - * load_types() - Load a xyz.types file... - * delete_rules() - Free all memory for the given rule tree. - * load_convs() - Load a xyz.convs file... + * mimeDelete() - Delete (free) a MIME database. + * mimeDeleteFilter() - Delete a filter from the MIME database. + * mimeDeleteType() - Delete a type from the MIME database. + * mimeFirstFilter() - Get the first filter in the MIME database. + * mimeFirstType() - Get the first type in the MIME database. + * mimeNextType() - Get the next type in the MIME database. + * mimeLoad() - Create a new MIME database from disk. + * mimeMerge() - Merge a MIME database from disk with the current one. + * mimeNew() - Create a new, empty MIME database. + * mimeNextFilter() - Get the next filter in the MIME database. + * mimeNextType() - Get the next type in the MIME database. + * mimeNumFilters() - Get the number of filters in a MIME database. + * mimeNumTypes() - Get the number of types in a MIME database. + * load_types() - Load a xyz.types file... + * delete_rules() - Free all memory for the given rule tree. + * load_convs() - Load a xyz.convs file... */ /* @@ -39,15 +49,10 @@ #include <stdlib.h> #include <ctype.h> +#include <cups/dir.h> #include <cups/string.h> #include "mime.h" -#ifdef WIN32 -# include <windows.h> -#else -# include <dirent.h> -#endif /* WIN32 */ - /* * Local functions... @@ -64,135 +69,129 @@ static void delete_rules(mime_magic_t *rules); */ void -mimeDelete(mime_t *mime) /* I - MIME database */ +mimeDelete(mime_t *mime) /* I - MIME database */ { - int i; /* Looping var */ + mime_type_t *type; /* Current type */ + mime_filter_t *filter; /* Current filter */ - if (mime == NULL) + if (!mime) return; /* * Loop through the file types and delete any rules... */ - for (i = 0; i < mime->num_types; i ++) - { - delete_rules(mime->types[i]->rules); - free(mime->types[i]->type); - free(mime->types[i]); - } + for (type = (mime_type_t *)cupsArrayFirst(mime->types); + type; + type = (mime_type_t *)cupsArrayNext(mime->types)) + mimeDeleteType(mime, type); + + /* + * Loop through filters and free them... + */ + + for (filter = (mime_filter_t *)cupsArrayFirst(mime->filters); + filter; + filter = (mime_filter_t *)cupsArrayNext(mime->filters)) + mimeDeleteFilter(mime, filter); /* * Free the types and filters arrays, and then the MIME database structure. */ - free(mime->types); - free(mime->filters); + cupsArrayDelete(mime->types); + cupsArrayDelete(mime->filters); free(mime); } /* - * 'mimeMerge()' - Merge a MIME database from disk with the current one. + * 'mimeDeleteFilter()' - Delete a filter from the MIME database. */ -mime_t * /* O - Updated MIME database */ -mimeMerge(mime_t *mime, /* I - MIME database to add to */ - const char *pathname, /* I - Directory to load */ - const char *filterpath)/* I - Directory to load */ +void +mimeDeleteFilter(mime_t *mime, /* I - MIME database */ + mime_filter_t *filter) /* I - Filter */ { -#ifdef WIN32 - HANDLE dir; /* Directory handle */ - WIN32_FIND_DATA dent; /* Directory entry */ - char filename[1024], /* Full filename of types/converts file */ - *pathsep; /* Last character in path */ - - - /* - * First open the directory specified by pathname... Return NULL if nothing - * was read or if the pathname is NULL... - */ - - if (pathname == NULL) - return (NULL); + if (!mime || !filter) + return; - strlcpy(filename, pathname, sizeof(filename)); + cupsArrayRemove(mime->filters, filter); + free(filter); +} - pathsep = filename + strlen(filename); - if ((pathsep - filename + 9) > sizeof(filename)) - return (NULL); - if (pathsep == filename || - (pathsep[-1] != '/' && pathsep[-1] != '\\')) - { - strcpy(pathsep, "/"); - pathsep ++; - } +/* + * 'mimeDeleteType()' - Delete a type from the MIME database. + */ - strcpy(pathsep, "*.types"); - - if ((dir = FindFirstFile(filename, &dent)) == 0) - return (NULL); +void +mimeDeleteType(mime_t *mime, /* I - MIME database */ + mime_type_t *mt) /* I - Type */ +{ + if (!mime || !mt) + return; - /* - * If "mime" is NULL, make a new, blank database... - */ + cupsArrayRemove(mime->types, mt); - if (mime == NULL) - if ((mime = mimeNew()) == NULL) - return (NULL); + delete_rules(mt->rules); + free(mt); +} - /* - * Read all the .types files... - */ - do - { - /* - * Load a mime.types file... - */ +/* + * 'mimeFirstFilter()' - Get the first filter in the MIME database. + */ - if ((pathsep - filename + strlen(dent.cFileName)) >= sizeof(filename)) - continue; +mime_filter_t * /* O - Filter or NULL */ +mimeFirstFilter(mime_t *mime) /* I - MIME database */ +{ + if (!mime) + return (NULL); + else + return ((mime_filter_t *)cupsArrayFirst(mime->filters)); +} - strcpy(pathsep, dent.cFileName); - load_types(mime, filename); - } - while (FindNextFile(dir, &dent)); - FindClose(dir); +/* + * 'mimeFirstType()' - Get the first type in the MIME database. + */ - /* - * Read all the .convs files... - */ +mime_type_t * /* O - Type or NULL */ +mimeFirstType(mime_t *mime) /* I - MIME database */ +{ + if (!mime) + return (NULL); + else + return ((mime_type_t *)cupsArrayFirst(mime->types)); +} - strcpy(pathsep, "*.convs"); - - if ((dir = FindFirstFile(filename, &dent)) == 0) - return (mime); - do - { - /* - * Load a mime.convs file... - */ +/* + * 'mimeLoad()' - Create a new MIME database from disk. + */ - if ((pathsep - filename + strlen(dent.cFileName)) >= sizeof(filename)) - continue; +mime_t * /* O - New MIME database */ +mimeLoad(const char *pathname, /* I - Directory to load */ + const char *filterpath) /* I - Directory to load */ +{ + return (mimeMerge(NULL, pathname, filterpath)); +} - strcpy(pathsep, dent.cFileName); - load_convs(mime, filename); - } - while (FindNextFile(dir, &dent)); - FindClose(dir); +/* + * 'mimeMerge()' - Merge a MIME database from disk with the current one. + */ - return (mime); -#else - DIR *dir; /* Directory */ - struct dirent *dent; /* Directory entry */ - char filename[1024]; /* Full filename of types/converts file */ +mime_t * /* O - Updated MIME database */ +mimeMerge(mime_t *mime, /* I - MIME database to add to */ + const char *pathname, /* I - Directory to load */ + const char *filterpath) /* I - Directory to load */ +{ + cups_dir_t *dir; /* Directory */ + cups_dentry_t *dent; /* Directory entry */ + char filename[1024]; /* Full filename of types/converts file */ /* @@ -200,62 +199,62 @@ mimeMerge(mime_t *mime, /* I - MIME database to add to */ * was read or if the pathname is NULL... */ - if (pathname == NULL) + if (!pathname) return (NULL); - if ((dir = opendir(pathname)) == NULL) + if ((dir = cupsDirOpen(pathname)) == NULL) return (NULL); /* * If "mime" is NULL, make a new, blank database... */ - if (mime == NULL) - if ((mime = mimeNew()) == NULL) - return (NULL); + if (!mime) + mime = mimeNew(); + if (!mime) + return (NULL); /* * Read all the .types files... */ - while ((dent = readdir(dir)) != NULL) + while ((dent = cupsDirRead(dir)) != NULL) { - if (strlen(dent->d_name) > 6 && - strcmp(dent->d_name + strlen(dent->d_name) - 6, ".types") == 0) + if (strlen(dent->filename) > 6 && + !strcmp(dent->filename + strlen(dent->filename) - 6, ".types")) { /* * Load a mime.types file... */ - snprintf(filename, sizeof(filename), "%s/%s", pathname, dent->d_name); + snprintf(filename, sizeof(filename), "%s/%s", pathname, dent->filename); load_types(mime, filename); } } - rewinddir(dir); + cupsDirRewind(dir); /* * Read all the .convs files... */ - while ((dent = readdir(dir)) != NULL) + while ((dent = cupsDirRead(dir)) != NULL) { - if (strlen(dent->d_name) > 6 && - strcmp(dent->d_name + strlen(dent->d_name) - 6, ".convs") == 0) + if (strlen(dent->filename) > 6 && + !strcmp(dent->filename + strlen(dent->filename) - 6, ".convs")) { /* * Load a mime.convs file... */ - snprintf(filename, sizeof(filename), "%s/%s", pathname, dent->d_name); + snprintf(filename, sizeof(filename), "%s/%s", pathname, dent->filename); load_convs(mime, filename, filterpath); } } - closedir(dir); + cupsDirClose(dir); return (mime); -#endif /* WIN32 */ } @@ -263,7 +262,7 @@ mimeMerge(mime_t *mime, /* I - MIME database to add to */ * 'mimeNew()' - Create a new, empty MIME database. */ -mime_t * /* O - MIME database */ +mime_t * /* O - MIME database */ mimeNew(void) { return ((mime_t *)calloc(1, sizeof(mime_t))); @@ -271,6 +270,62 @@ mimeNew(void) /* + * 'mimeNextFilter()' - Get the next filter in the MIME database. + */ + +mime_filter_t * /* O - Filter or NULL */ +mimeNextFilter(mime_t *mime) /* I - MIME database */ +{ + if (!mime) + return (NULL); + else + return ((mime_filter_t *)cupsArrayNext(mime->filters)); +} + + +/* + * 'mimeNextType()' - Get the next type in the MIME database. + */ + +mime_type_t * /* O - Type or NULL */ +mimeNextType(mime_t *mime) /* I - MIME database */ +{ + if (!mime) + return (NULL); + else + return ((mime_type_t *)cupsArrayNext(mime->types)); +} + + +/* + * 'mimeNumFilters()' - Get the number of filters in a MIME database. + */ + +int +mimeNumFilters(mime_t *mime) /* I - MIME database */ +{ + if (!mime) + return (0); + else + return (cupsArrayCount(mime->filters)); +} + + +/* + * 'mimeNumTypes()' - Get the number of types in a MIME database. + */ + +int +mimeNumTypes(mime_t *mime) /* I - MIME database */ +{ + if (!mime) + return (0); + else + return (cupsArrayCount(mime->types)); +} + + +/* * 'load_types()' - Load a xyz.types file... */ @@ -369,9 +424,8 @@ load_types(mime_t *mime, /* I - MIME database */ static void load_convs(mime_t *mime, /* I - MIME database */ const char *filename, /* I - Convs file to load */ - const char *filterpath) /* I - Directory to load */ + const char *filterpath) /* I - Path for filters */ { - int i; /* Looping var */ cups_file_t *fp; /* Convs file */ char line[1024], /* Input line from file */ *lineptr, /* Current position in line */ @@ -379,10 +433,12 @@ load_convs(mime_t *mime, /* I - MIME database */ type[MIME_MAX_TYPE], /* Type name */ *temp, /* Temporary pointer */ *filter; /* Filter program */ - mime_type_t **temptype, /* MIME type looping var */ + mime_type_t *temptype, /* MIME type looping var */ *dsttype; /* Destination MIME type */ int cost; /* Cost of filter */ +#ifndef WIN32 char filterprog[1024]; /* Full path of filter... */ +#endif /* !WIN32 */ /* @@ -475,7 +531,7 @@ load_convs(mime_t *mime, /* I - MIME database */ filter = lineptr; #ifndef WIN32 - if (strcmp(filter, "-") != 0) + if (strcmp(filter, "-")) { /* * Verify that the filter exists and is executable... @@ -483,8 +539,9 @@ load_convs(mime_t *mime, /* I - MIME database */ if (filter[0] == '/') strlcpy(filterprog, filter, sizeof(filterprog)); - else - snprintf(filterprog, sizeof(filterprog), "%s/%s", filterpath, filter); + else if (!cupsFileFind(filter, filterpath, filterprog, + sizeof(filterprog))) + continue; if (access(filterprog, X_OK)) continue; @@ -517,7 +574,7 @@ load_convs(mime_t *mime, /* I - MIME database */ *temp = '\0'; - if (strcmp(super, "*") == 0 && strcmp(type, "*") == 0) + if (!strcmp(super, "*") && !strcmp(type, "*")) { /* * Force * / * to be "application/octet-stream"... @@ -531,10 +588,12 @@ load_convs(mime_t *mime, /* I - MIME database */ * Add the filter to the MIME database, supporting wildcards as needed... */ - for (temptype = mime->types, i = 0; i < mime->num_types; i ++, temptype ++) - if ((super[0] == '*' || strcmp((*temptype)->super, super) == 0) && - (type[0] == '*' || strcmp((*temptype)->type, type) == 0)) - mimeAddFilter(mime, *temptype, dsttype, cost, filter); + for (temptype = (mime_type_t *)cupsArrayFirst(mime->types); + temptype; + temptype = (mime_type_t *)cupsArrayNext(mime->types)) + if ((super[0] == '*' || !strcmp(temptype->super, super)) && + (type[0] == '*' || !strcmp(temptype->type, type))) + mimeAddFilter(mime, temptype, dsttype, cost, filter); } cupsFileClose(fp); @@ -569,5 +628,5 @@ delete_rules(mime_magic_t *rules) /* I - Rules to free */ /* - * End of "$Id: mime.c 4613 2005-08-30 12:41:48Z mike $". + * End of "$Id: mime.c 4970 2006-01-24 14:05:45Z mike $". */ diff --git a/scheduler/mime.h b/scheduler/mime.h index 93a1f4ed3..cd023fa8a 100644 --- a/scheduler/mime.h +++ b/scheduler/mime.h @@ -1,9 +1,9 @@ /* - * "$Id: mime.h 4613 2005-08-30 12:41:48Z mike $" + * "$Id: mime.h 4970 2006-01-24 14:05:45Z mike $" * * MIME type/conversion database definitions for the Common UNIX Printing System (CUPS). * - * Copyright 1997-2005 by Easy Software Products, all rights reserved. + * Copyright 1997-2006 by Easy Software Products, all rights reserved. * * These coded instructions, statements, and computer programs are the * property of Easy Software Products and are protected by Federal @@ -25,6 +25,7 @@ #ifndef _CUPS_MIME_H_ # define _CUPS_MIME_H_ +# include <cups/array.h> # include <cups/ipp.h> # include <cups/file.h> @@ -93,9 +94,9 @@ typedef struct mime_magic_str /**** MIME Magic Data ****/ typedef struct /**** MIME Type Data ****/ { - char super[MIME_MAX_SUPER], /* Super-type name ("image", "application", etc.) */ - *type; /* Type name ("png", "postscript", etc.) */ mime_magic_t *rules; /* Rules used to detect this type */ + char super[MIME_MAX_SUPER], /* Super-type name ("image", "application", etc.) */ + type[MIME_MAX_TYPE]; /* Type name ("png", "postscript", etc.) */ } mime_type_t; typedef struct /**** MIME Conversion Filter Data ****/ @@ -108,10 +109,8 @@ typedef struct /**** MIME Conversion Filter Data ****/ typedef struct /**** MIME Database ****/ { - int num_types; /* Number of file types */ - mime_type_t **types; /* File types */ - int num_filters; /* Number of type conversion filters */ - mime_filter_t *filters; /* Type conversion filters */ + cups_array_t *types; /* File types */ + cups_array_t *filters; /* Type conversion filters */ } mime_t; @@ -120,22 +119,32 @@ typedef struct /**** MIME Database ****/ */ extern void mimeDelete(mime_t *mime); -#define mimeLoad(pathname,filterpath) \ - mimeMerge((mime_t *)0, (pathname), (filterpath)) +extern mime_t *mimeLoad(const char *pathname, const char *filterpath); extern mime_t *mimeMerge(mime_t *mime, const char *pathname, const char *filterpath); extern mime_t *mimeNew(void); -extern mime_type_t *mimeAddType(mime_t *mime, const char *super, const char *type); +extern mime_type_t *mimeAddType(mime_t *mime, const char *super, + const char *type); extern int mimeAddTypeRule(mime_type_t *mt, const char *rule); +extern void mimeDeleteType(mime_t *mime, mime_type_t *mt); extern mime_type_t *mimeFileType(mime_t *mime, const char *pathname, int *compression); -extern mime_type_t *mimeType(mime_t *mime, const char *super, const char *type); - -extern mime_filter_t *mimeAddFilter(mime_t *mime, mime_type_t *src, mime_type_t *dst, - int cost, const char *filter); -extern mime_filter_t *mimeFilter(mime_t *mime, mime_type_t *src, mime_type_t *dst, - int *num_filters, int max_depth); +extern mime_type_t *mimeFirstType(mime_t *mime); +extern mime_type_t *mimeNextType(mime_t *mime); +extern int mimeNumTypes(mime_t *mime); +extern mime_type_t *mimeType(mime_t *mime, const char *super, + const char *type); + +extern mime_filter_t *mimeAddFilter(mime_t *mime, mime_type_t *src, + mime_type_t *dst, int cost, + const char *filter); +extern void mimeDeleteFilter(mime_t *mime, mime_filter_t *filter); +extern cups_array_t *mimeFilter(mime_t *mime, mime_type_t *src, + mime_type_t *dst, int *cost, int max_depth); +extern mime_filter_t *mimeFirstFilter(mime_t *mime); +extern mime_filter_t *mimeNextFilter(mime_t *mime); +extern int mimeNumFilters(mime_t *mime); # ifdef _cplusplus } @@ -143,5 +152,5 @@ extern mime_filter_t *mimeFilter(mime_t *mime, mime_type_t *src, mime_type_t *ds #endif /* !_CUPS_MIME_H_ */ /* - * End of "$Id: mime.h 4613 2005-08-30 12:41:48Z mike $". + * End of "$Id: mime.h 4970 2006-01-24 14:05:45Z mike $". */ diff --git a/scheduler/printers.c b/scheduler/printers.c index 556bf0297..74a893b3c 100644 --- a/scheduler/printers.c +++ b/scheduler/printers.c @@ -1,5 +1,5 @@ /* - * "$Id: printers.c 4903 2006-01-10 20:02:46Z mike $" + * "$Id: printers.c 4989 2006-01-26 00:59:45Z mike $" * * Printer routines for the Common UNIX Printing System (CUPS). * @@ -33,8 +33,10 @@ * cupsdFindPrinter() - Find a printer in the list. * cupsdFreePrinterUsers() - Free allow/deny users. * cupsdLoadAllPrinters() - Load printers from the printers.conf file. - * cupsdSaveAllPrinters() - Save all printer definitions to the printers.conf - * cupsdSetPrinterAttrs() - Set printer attributes based upon the PPD file. + * cupsdSaveAllPrinters() - Save all printer definitions to the + * printers.conf file. + * cupsdSetPrinterAttrs() - Set printer attributes based upon the PPD + * file. * cupsdSetPrinterReasons() - Set/update the reasons strings. * cupsdSetPrinterState() - Update the current state of a printer. * cupsdStopPrinter() - Stop a printer from printing any jobs... @@ -46,8 +48,8 @@ * compare_printers() - Compare two printers. * write_irix_config() - Update the config files used by the IRIX * desktop tools. - * write_irix_state() - Update the status files used by IRIX printing - * desktop tools. + * write_irix_state() - Update the status files used by IRIX + * printing desktop tools. */ /* @@ -105,7 +107,7 @@ cupsdAddPrinter(const char *name) /* I - Name of printer */ p->state = IPP_PRINTER_STOPPED; p->state_time = time(NULL); p->accepting = 0; - p->shared = 1; + p->shared = DefaultShared; p->filetype = mimeAddType(MimeDatabase, "printer", name); cupsdSetString(&p->job_sheets[0], "none"); @@ -148,12 +150,11 @@ cupsdAddPrinterFilter( cupsd_printer_t *p, /* I - Printer to add to */ const char *filter) /* I - Filter to add */ { - int i; /* Looping var */ char super[MIME_MAX_SUPER], /* Super-type for filter */ type[MIME_MAX_TYPE], /* Type for filter */ program[1024]; /* Program/filter name */ int cost; /* Cost of filter */ - mime_type_t **temptype; /* MIME type looping var */ + mime_type_t *temptype; /* MIME type looping var */ /* @@ -181,18 +182,18 @@ cupsdAddPrinterFilter( * Add the filter to the MIME database, supporting wildcards as needed... */ - for (temptype = MimeDatabase->types, i = MimeDatabase->num_types; - i > 0; - i --, temptype ++) - if (((super[0] == '*' && strcasecmp((*temptype)->super, "printer") != 0) || - !strcasecmp((*temptype)->super, super)) && - (type[0] == '*' || !strcasecmp((*temptype)->type, type))) + for (temptype = mimeFirstType(MimeDatabase); + temptype; + temptype = mimeNextType(MimeDatabase)) + if (((super[0] == '*' && strcasecmp(temptype->super, "printer")) || + !strcasecmp(temptype->super, super)) && + (type[0] == '*' || !strcasecmp(temptype->type, type))) { cupsdLogMessage(CUPSD_LOG_DEBUG2, "Adding filter %s/%s %s/%s %d %s", - (*temptype)->super, (*temptype)->type, + temptype->super, temptype->type, p->filetype->super, p->filetype->type, cost, program); - mimeAddFilter(MimeDatabase, *temptype, p->filetype, cost, program); + mimeAddFilter(MimeDatabase, temptype, p->filetype, cost, program); } } @@ -238,6 +239,7 @@ cupsdAddPrinterHistory( p->state); ippAddBoolean(history, IPP_TAG_PRINTER, "printer-is-accepting-jobs", p->accepting); + ippAddBoolean(history, IPP_TAG_PRINTER, "printer-is-shared", p->shared); ippAddString(history, IPP_TAG_PRINTER, IPP_TAG_TEXT, "printer-state-message", NULL, p->state_message); if (p->num_reasons == 0) @@ -491,7 +493,7 @@ cupsdCreateCommonData(void) "job-priority-supported", 100); /* job-sheets-supported */ - if (NumBanners > 0) + if (cupsArrayCount(Banners) > 0) { /* * Setup the job-sheets-supported attribute... @@ -502,7 +504,8 @@ cupsdCreateCommonData(void) "job-sheets-supported", NULL, Classification); else attr = ippAddStrings(CommonData, IPP_TAG_PRINTER, IPP_TAG_NAME, - "job-sheets-supported", NumBanners + 1, NULL, NULL); + "job-sheets-supported", cupsArrayCount(Banners) + 1, + NULL, NULL); if (attr == NULL) cupsdLogMessage(CUPSD_LOG_EMERG, @@ -510,10 +513,15 @@ cupsdCreateCommonData(void) "job-sheets-supported attribute: %s!", strerror(errno)); else if (!Classification || ClassifyOverride) { + cupsd_banner_t *banner; /* Current banner */ + + attr->values[0].string.text = strdup("none"); - for (i = 0; i < NumBanners; i ++) - attr->values[i + 1].string.text = strdup(Banners[i].name); + for (i = 1, banner = (cupsd_banner_t *)cupsArrayFirst(Banners); + banner; + i ++, banner = (cupsd_banner_t *)cupsArrayNext(Banners)) + attr->values[i].string.text = strdup(banner->name); } } else @@ -712,6 +720,7 @@ cupsdDeletePrinter( /* * If p is the default printer, assign the next one... + * TODO: use next network default printer or NULL... */ if (p == DefaultPrinter) @@ -749,6 +758,8 @@ cupsdDeletePrinter( cupsdDeletePrinterFilters(p); + mimeDeleteType(MimeDatabase, p->filetype); + cupsdFreePrinterUsers(p); cupsdFreeQuotas(p); @@ -783,7 +794,6 @@ void cupsdDeletePrinterFilters( cupsd_printer_t *p) /* I - Printer to remove from */ { - int i; /* Looping var */ mime_filter_t *filter; /* MIME filter looping var */ @@ -799,21 +809,16 @@ cupsdDeletePrinterFilters( * type == printer... */ - for (filter = MimeDatabase->filters, i = MimeDatabase->num_filters; - i > 0; - i --, filter ++) + for (filter = mimeFirstFilter(MimeDatabase); + filter; + filter = mimeNextFilter(MimeDatabase)) if (filter->dst == p->filetype) { /* * Delete the current filter... */ - MimeDatabase->num_filters --; - - if (i > 1) - memmove(filter, filter + 1, sizeof(mime_filter_t) * (i - 1)); - - filter --; + mimeDeleteFilter(MimeDatabase, filter); } } @@ -896,9 +901,10 @@ cupsdLoadAllPrinters(void) snprintf(line, sizeof(line), "%s/printers.conf", ServerRoot); if ((fp = cupsFileOpen(line, "r")) == NULL) { - cupsdLogMessage(CUPSD_LOG_ERROR, - "cupsdLoadAllPrinters: Unable to open %s - %s", line, - strerror(errno)); + if (errno != ENOENT) + cupsdLogMessage(CUPSD_LOG_ERROR, + "cupsdLoadAllPrinters: Unable to open %s - %s", line, + strerror(errno)); return; } @@ -1298,7 +1304,7 @@ cupsdSaveAllPrinters(void) */ fchown(cupsFileNumber(fp), getuid(), Group); - fchmod(cupsFileNumber(fp), ConfigFilePerm); + fchmod(cupsFileNumber(fp), 0600); /* * Write a small header to the file... @@ -1525,7 +1531,7 @@ cupsdSetPrinterAttrs(cupsd_printer_t *p)/* I - Printer to setup */ ippAddInteger(p->attrs, IPP_TAG_PRINTER, IPP_TAG_INTEGER, "job-page-limit", p->page_limit); - if (NumBanners > 0 && !(p->type & CUPS_PRINTER_REMOTE)) + if (cupsArrayCount(Banners) > 0 && !(p->type & CUPS_PRINTER_REMOTE)) { /* * Setup the job-sheets-default attribute... @@ -1560,6 +1566,9 @@ cupsdSetPrinterAttrs(cupsd_printer_t *p)/* I - Printer to setup */ ippAddString(p->attrs, IPP_TAG_PRINTER, IPP_TAG_TEXT, "printer-make-and-model", NULL, p->make_model); + ippAddString(p->attrs, IPP_TAG_PRINTER, IPP_TAG_URI, "device-uri", NULL, + p->uri); + p->raw = 1; } else @@ -1587,6 +1596,9 @@ cupsdSetPrinterAttrs(cupsd_printer_t *p)/* I - Printer to setup */ ippAddString(p->attrs, IPP_TAG_PRINTER, IPP_TAG_TEXT, "printer-make-and-model", NULL, "Local Printer Class"); + ippAddString(p->attrs, IPP_TAG_PRINTER, IPP_TAG_URI, "device-uri", NULL, + "file:///dev/null"); + if (p->num_printers > 0) { /* @@ -2870,5 +2882,5 @@ write_irix_state(cupsd_printer_t *p) /* I - Printer to update */ /* - * End of "$Id: printers.c 4903 2006-01-10 20:02:46Z mike $". + * End of "$Id: printers.c 4989 2006-01-26 00:59:45Z mike $". */ diff --git a/scheduler/printers.h b/scheduler/printers.h index 2f740a02d..9149952bc 100644 --- a/scheduler/printers.h +++ b/scheduler/printers.h @@ -1,9 +1,9 @@ /* - * "$Id: printers.h 4775 2005-10-12 14:27:37Z mike $" + * "$Id: printers.h 4970 2006-01-24 14:05:45Z mike $" * * Printer definitions for the Common UNIX Printing System (CUPS) scheduler. * - * Copyright 1997-2005 by Easy Software Products, all rights reserved. + * Copyright 1997-2006 by Easy Software Products, all rights reserved. * * These coded instructions, statements, and computer programs are the * property of Easy Software Products and are protected by Federal @@ -72,9 +72,8 @@ typedef struct cupsd_printer_s struct cupsd_printer_s **printers; /* Printers in class */ int quota_period, /* Period for quotas */ page_limit, /* Maximum number of pages */ - k_limit, /* Maximum number of kilobytes */ - num_quotas; /* Number of quota records */ - cupsd_quota_t *quotas; /* Quota records */ + k_limit; /* Maximum number of kilobytes */ + cups_array_t *quotas; /* Quota records */ int deny_users, /* 1 = deny, 0 = allow */ num_users; /* Number of allowed/denied users */ const char **users; /* Allowed/denied users */ @@ -142,5 +141,5 @@ extern char *cupsdSanitizeURI(const char *uri, char *buffer, /* - * End of "$Id: printers.h 4775 2005-10-12 14:27:37Z mike $". + * End of "$Id: printers.h 4970 2006-01-24 14:05:45Z mike $". */ diff --git a/scheduler/quotas.c b/scheduler/quotas.c index 03735b1ab..8cd8fc9c2 100644 --- a/scheduler/quotas.c +++ b/scheduler/quotas.c @@ -1,9 +1,9 @@ /* - * "$Id: quotas.c 4729 2005-09-30 17:46:19Z mike $" + * "$Id: quotas.c 4970 2006-01-24 14:05:45Z mike $" * * Quota routines for the Common UNIX Printing System (CUPS). * - * Copyright 1997-2005 by Easy Software Products. + * Copyright 1997-2006 by Easy Software Products. * * These coded instructions, statements, and computer programs are the * property of Easy Software Products and are protected by Federal @@ -27,7 +27,7 @@ * cupsdFindQuota() - Find a quota record. * cupsdFreeQuotas() - Free quotas for a printer. * cupsdUpdateQuota() - Update quota data for the specified printer and user. - * compare() - Compare two quota records... + * compare_quotas() - Compare two quota records... */ /* @@ -41,7 +41,8 @@ * Local functions... */ -static int compare(const cupsd_quota_t *q1, const cupsd_quota_t *q2); +static int compare_quotas(const cupsd_quota_t *q1, + const cupsd_quota_t *q2); /* @@ -58,26 +59,20 @@ cupsdAddQuota(cupsd_printer_t *p, /* I - Printer */ if (!p || !username) return (NULL); - if (p->num_quotas == 0) - q = malloc(sizeof(cupsd_quota_t)); - else - q = realloc(p->quotas, sizeof(cupsd_quota_t) * (p->num_quotas + 1)); + if (!p->quotas) + p->quotas = cupsArrayNew((cups_array_func_t)compare_quotas, NULL); - if (!q) + if (!p->quotas) return (NULL); - p->quotas = q; - q += p->num_quotas; - p->num_quotas ++; + if ((q = calloc(1, sizeof(cupsd_quota_t))) == NULL) + return (NULL); - memset(q, 0, sizeof(cupsd_quota_t)); strlcpy(q->username, username, sizeof(q->username)); - if (p->num_quotas > 1) - qsort(p->quotas, p->num_quotas, sizeof(cupsd_quota_t), - (int (*)(const void *, const void *))compare); + cupsArrayAdd(p->quotas, q); - return (cupsdFindQuota(p, username)); + return (q); } @@ -97,17 +92,9 @@ cupsdFindQuota( if (!p || !username) return (NULL); - if (p->num_quotas == 0) - q = NULL; - else - { - strlcpy(match.username, username, sizeof(match.username)); - - q = bsearch(&match, p->quotas, p->num_quotas, sizeof(cupsd_quota_t), - (int(*)(const void *, const void *))compare); - } + strlcpy(match.username, username, sizeof(match.username)); - if (q) + if ((q = (cupsd_quota_t *)cupsArrayFind(p->quotas, &match)) != NULL) return (q); else return (cupsdAddQuota(p, username)); @@ -119,16 +106,22 @@ cupsdFindQuota( */ void -cupsdFreeQuotas(cupsd_printer_t *p) /* I - Printer */ +cupsdFreeQuotas(cupsd_printer_t *p) /* I - Printer */ { + cupsd_quota_t *q; /* Current quota record */ + + if (!p) return; - if (p->num_quotas) - free(p->quotas); + for (q = (cupsd_quota_t *)cupsArrayFirst(p->quotas); + q; + q = (cupsd_quota_t *)cupsArrayNext(p->quotas)) + free(q); + + cupsArrayDelete(p->quotas); - p->num_quotas = 0; - p->quotas = NULL; + p->quotas = NULL; } @@ -224,17 +217,17 @@ cupsdUpdateQuota( /* - * 'compare()' - Compare two quota records... + * 'compare_quotas()' - Compare two quota records... */ static int /* O - Result of comparison */ -compare(const cupsd_quota_t *q1, /* I - First quota record */ - const cupsd_quota_t *q2) /* I - Second quota record */ +compare_quotas(const cupsd_quota_t *q1, /* I - First quota record */ + const cupsd_quota_t *q2) /* I - Second quota record */ { return (strcasecmp(q1->username, q2->username)); } /* - * End of "$Id: quotas.c 4729 2005-09-30 17:46:19Z mike $". + * End of "$Id: quotas.c 4970 2006-01-24 14:05:45Z mike $". */ diff --git a/scheduler/server.c b/scheduler/server.c index 7cf766391..b5b71f788 100644 --- a/scheduler/server.c +++ b/scheduler/server.c @@ -1,5 +1,5 @@ /* - * "$Id: server.c 4830 2005-11-12 03:27:16Z mike $" + * "$Id: server.c 4993 2006-01-26 19:27:40Z mike $" * * Server start/stop routines for the Common UNIX Printing System (CUPS). * @@ -34,6 +34,9 @@ #include <cups/http-private.h> #include "cupsd.h" #include <grp.h> +#ifdef HAVE_NOTIFY_H +# include <notify.h> +#endif /* HAVE_NOTIFY_H */ /* @@ -110,6 +113,14 @@ cupsdStartServer(void) FD_SET(CGIPipes[0], InputSet); } + /* + * Mark that the server has started and printers and jobs may be changed... + */ + + LastEvent = CUPSD_EVENT_PRINTER_CHANGED | CUPSD_EVENT_JOB_STATE_CHANGED | + CUPSD_EVENT_SERVER_STARTED; + LastEventTime = 0; + started = 1; } @@ -197,10 +208,20 @@ cupsdStopServer(void) PageFile = NULL; } +#ifdef HAVE_NOTIFY_POST + /* + * Send one last notification as the server shuts down. + */ + + cupsdLogMessage(CUPSD_LOG_DEBUG, + "notify_post(\"com.apple.printerListChange\") last"); + notify_post("com.apple.printerListChange"); +#endif /* HAVE_NOTIFY_POST */ + started = 0; } /* - * End of "$Id: server.c 4830 2005-11-12 03:27:16Z mike $". + * End of "$Id: server.c 4993 2006-01-26 19:27:40Z mike $". */ diff --git a/scheduler/subscriptions.c b/scheduler/subscriptions.c index 88f7ffbbd..2d8d43fb7 100644 --- a/scheduler/subscriptions.c +++ b/scheduler/subscriptions.c @@ -1,9 +1,9 @@ /* - * "$Id: subscriptions.c 4840 2005-11-14 21:53:30Z mike $" + * "$Id: subscriptions.c 4993 2006-01-26 19:27:40Z mike $" * * Subscription routines for the Common UNIX Printing System (CUPS) scheduler. * - * Copyright 1997-2005 by Easy Software Products, all rights reserved. + * Copyright 1997-2006 by Easy Software Products, all rights reserved. * * These coded instructions, statements, and computer programs are the * property of Easy Software Products and are protected by Federal @@ -74,10 +74,13 @@ cupsdAddEvent( { va_list ap; /* Pointer to additional arguments */ char ftext[1024]; /* Formatted text buffer */ + ipp_attribute_t *attr; /* Printer/job attribute */ cupsd_event_t *temp; /* New event pointer */ cupsd_subscription_t *sub; /* Current subscription */ + LastEvent |= event; + /* * Return if we aren't keeping events... */ @@ -166,7 +169,7 @@ cupsdAddEvent( vsnprintf(ftext, sizeof(ftext), text, ap); va_end(ap); - ippAddString(temp->attrs, IPP_TAG_EVENT_NOTIFICATION, IPP_TAG_KEYWORD, + ippAddString(temp->attrs, IPP_TAG_EVENT_NOTIFICATION, IPP_TAG_TEXT, "notify-text", NULL, ftext); if (dest) @@ -205,10 +208,15 @@ cupsdAddEvent( */ ippAddInteger(temp->attrs, IPP_TAG_EVENT_NOTIFICATION, IPP_TAG_INTEGER, - "job-id", job->id); + "notify-job-id", job->id); ippAddInteger(temp->attrs, IPP_TAG_EVENT_NOTIFICATION, IPP_TAG_ENUM, "job-state", (int)job->state); + if ((attr = ippFindAttribute(job->attrs, "job-name", + IPP_TAG_NAME)) != NULL) + ippAddString(temp->attrs, IPP_TAG_EVENT_NOTIFICATION, IPP_TAG_NAME, + "job-name", NULL, attr->values[0].string.text); + switch (job->state->values[0].integer) { case IPP_JOB_PENDING : @@ -644,8 +652,7 @@ cupsdExpireSubscriptions( for (sub = (cupsd_subscription_t *)cupsArrayFirst(Subscriptions); sub; sub = (cupsd_subscription_t *)cupsArrayNext(Subscriptions)) - if (sub->expire <= curtime || - (dest && sub->dest == dest) || + if ((sub->expire <= curtime && dest && sub->dest == dest) || (job && sub->job == job)) { cupsdLogMessage(CUPSD_LOG_INFO, "Subscription %d has expired...", sub->id); @@ -701,9 +708,10 @@ cupsdLoadAllSubscriptions(void) snprintf(line, sizeof(line), "%s/subscriptions.conf", ServerRoot); if ((fp = cupsFileOpen(line, "r")) == NULL) { - cupsdLogMessage(CUPSD_LOG_ERROR, - "LoadAllSubscriptions: Unable to open %s - %s", line, - strerror(errno)); + if (errno != ENOENT) + cupsdLogMessage(CUPSD_LOG_ERROR, + "LoadAllSubscriptions: Unable to open %s - %s", line, + strerror(errno)); return; } @@ -1229,6 +1237,8 @@ cupsdSendNotification( if (sub->pipe < 0) cupsd_start_notifier(sub); + cupsdLogMessage(CUPSD_LOG_DEBUG, "sub->pipe=%d", sub->pipe); + if (sub->pipe >= 0) { event->attrs->state = IPP_IDLE; @@ -1270,7 +1280,7 @@ cupsdStopAllNotifiers(void) return; /* - * Yes, kill and processes that are left... + * Yes, kill any processes that are left... */ for (sub = (cupsd_subscription_t *)cupsArrayFirst(Subscriptions); @@ -1526,5 +1536,5 @@ cupsd_start_notifier( /* - * End of "$Id: subscriptions.c 4840 2005-11-14 21:53:30Z mike $". + * End of "$Id: subscriptions.c 4993 2006-01-26 19:27:40Z mike $". */ diff --git a/scheduler/subscriptions.h b/scheduler/subscriptions.h index 56f02a3ab..ffe0123ab 100644 --- a/scheduler/subscriptions.h +++ b/scheduler/subscriptions.h @@ -1,9 +1,9 @@ /* - * "$Id: subscriptions.h 4840 2005-11-14 21:53:30Z mike $" + * "$Id: subscriptions.h 4993 2006-01-26 19:27:40Z mike $" * * Subscription definitions for the Common UNIX Printing System (CUPS) scheduler. * - * Copyright 1997-2005 by Easy Software Products, all rights reserved. + * Copyright 1997-2006 by Easy Software Products, all rights reserved. * * These coded instructions, statements, and computer programs are the * property of Easy Software Products and are protected by Federal @@ -134,6 +134,9 @@ VAR int MaxEvents VALUE(100), /* Maximum number of events */ NumEvents VALUE(0); /* Number of active events */ VAR cupsd_event_t **Events VALUE(NULL); /* Active events */ +VAR unsigned LastEvent VALUE(0); /* Last events processed */ +VAR time_t LastEventTime VALUE(0); /* Time that the last events were sent */ + VAR int NotifierPipes[2] VALUE2(-1, -1); /* Pipes for notifier error/debug output */ VAR cupsd_statbuf_t *NotifierStatusBuffer VALUE(NULL); @@ -171,5 +174,5 @@ extern void cupsdUpdateNotifierStatus(void); /* - * End of "$Id: subscriptions.h 4840 2005-11-14 21:53:30Z mike $". + * End of "$Id: subscriptions.h 4993 2006-01-26 19:27:40Z mike $". */ diff --git a/scheduler/testmime.c b/scheduler/testmime.c index e84dbd568..624be9a8b 100644 --- a/scheduler/testmime.c +++ b/scheduler/testmime.c @@ -1,9 +1,9 @@ /* - * "$Id: testmime.c 4719 2005-09-28 21:12:44Z mike $" + * "$Id: testmime.c 4970 2006-01-24 14:05:45Z mike $" * * MIME test program for the Common UNIX Printing System (CUPS). * - * Copyright 1997-2005 by Easy Software Products, all rights reserved. + * Copyright 1997-2006 by Easy Software Products, all rights reserved. * * These coded instructions, statements, and computer programs are the * property of Easy Software Products and are protected by Federal @@ -51,47 +51,47 @@ int /* O - Exit status */ main(int argc, /* I - Number of command-line args */ char *argv[]) /* I - Command-line arguments */ { - int i, j; /* Looping vars */ + int i; /* Looping vars */ const char *filter_path; /* Filter path */ char super[MIME_MAX_SUPER], /* Super-type name */ type[MIME_MAX_TYPE]; /* Type name */ int compression; /* Compression of file */ + int cost; /* Cost of filters */ mime_t *mime; /* MIME database */ mime_type_t *src, /* Source type */ - *dst, /* Destination type */ - **types; /* File type array pointer */ - mime_filter_t *filters; /* Filters for the file */ - int num_filters; /* Number of filters for the file */ + *dst; /* Destination type */ + cups_array_t *filters; /* Filters for the file */ + mime_filter_t *filter; /* Current filter */ mime = NULL; src = NULL; dst = NULL; - filter_path = "../filter"; + filter_path = "../filter:../pdftops"; for (i = 1; i < argc; i ++) - if (strcmp(argv[i], "-d") == 0) + if (!strcmp(argv[i], "-d")) { i ++; if (i < argc) mime = mimeLoad(argv[i], filter_path); } - else if (strcmp(argv[i], "-f") == 0) + else if (!strcmp(argv[i], "-f")) { i ++; if (i < argc) filter_path = argv[i]; } - else if (src == NULL) + else if (!src) { if (!mime) mime = mimeLoad("../conf", filter_path); src = mimeFileType(mime, argv[i], &compression); - if (src != NULL) + if (src) printf("%s: %s/%s%s\n", argv[i], src->super, src->type, compression ? " (gzipped)" : ""); else @@ -107,46 +107,52 @@ main(int argc, /* I - Number of command-line args */ sscanf(argv[i], "%15[^/]/%31s", super, type); dst = mimeType(mime, super, type); - filters = mimeFilter(mime, src, dst, &num_filters, 10); + filters = mimeFilter(mime, src, dst, &cost, 10); - if (filters == NULL) + if (!filters) { printf("No filters to convert from %s/%s to %s.\n", src->super, src->type, argv[i]); } else { - for (j = 0; j < num_filters; j ++) - if (j < (num_filters - 1)) - printf("%s | ", filters[j].filter); - else - puts(filters[j].filter); + printf("Filter cost = %d\n", cost); - free(filters); + filter = (mime_filter_t *)cupsArrayFirst(filters); + fputs(filter->filter, stdout); + + for (filter = (mime_filter_t *)cupsArrayNext(filters); + filter; + filter = (mime_filter_t *)cupsArrayNext(filters)) + printf(" | %s", filter->filter); + + putchar('\n'); + + cupsArrayDelete(filters); } } if (!mime) mime = mimeLoad("../conf", filter_path); - if (src == NULL) + if (!src) { puts("MIME database types:"); - for (i = 0, types = mime->types; i < mime->num_types; i ++, types ++) + for (src = mimeFirstType(mime); src; src = mimeNextType(mime)) { - printf("\t%s/%s:\n", (*types)->super, (*types)->type); - print_rules((*types)->rules); + printf("\t%s/%s:\n", src->super, src->type); + print_rules(src->rules); puts(""); } puts(""); puts("MIME database filters:"); - for (i = 0, filters = mime->filters; i < mime->num_filters; i ++, filters ++) + for (filter = mimeFirstFilter(mime); filter; filter = mimeNextFilter(mime)) printf("\t%s/%s to %s/%s: %s (%d)\n", - filters->src->super, filters->src->type, - filters->dst->super, filters->dst->type, - filters->filter, filters->cost); + filter->src->super, filter->src->type, + filter->dst->super, filter->dst->type, + filter->filter, filter->cost); } return (0); @@ -242,5 +248,5 @@ print_rules(mime_magic_t *rules) /* I - Rules to print */ /* - * End of "$Id: testmime.c 4719 2005-09-28 21:12:44Z mike $". + * End of "$Id: testmime.c 4970 2006-01-24 14:05:45Z mike $". */ diff --git a/scheduler/type.c b/scheduler/type.c index fbfcb07a3..9aaa10ccd 100644 --- a/scheduler/type.c +++ b/scheduler/type.c @@ -1,9 +1,9 @@ /* - * "$Id: type.c 4613 2005-08-30 12:41:48Z mike $" + * "$Id: type.c 4970 2006-01-24 14:05:45Z mike $" * * MIME typing routines for the Common UNIX Printing System (CUPS). * - * Copyright 1997-2005 by Easy Software Products, all rights reserved. + * Copyright 1997-2006 by Easy Software Products, all rights reserved. * * These coded instructions, statements, and computer programs are the * property of Easy Software Products and are protected by Federal @@ -27,7 +27,7 @@ * mimeAddTypeRule() - Add a detection rule for a file type. * mimeFileType() - Determine the type of a file. * mimeType() - Lookup a file type. - * compare() - Compare two MIME super/type names. + * compare_types() - Compare two MIME super/type names. * checkrules() - Check each rule in a list. * patmatch() - Pattern matching... */ @@ -50,7 +50,7 @@ * Local functions... */ -static int compare(mime_type_t **, mime_type_t **); +static int compare_types(mime_type_t *t0, mime_type_t *t1); static int checkrules(const char *, cups_file_t *, mime_magic_t *); static int patmatch(const char *, const char *); @@ -59,24 +59,19 @@ static int patmatch(const char *, const char *); * 'mimeAddType()' - Add a MIME type to a database. */ -mime_type_t * /* O - New (or existing) MIME type */ -mimeAddType(mime_t *mime, /* I - MIME database */ - const char *super, /* I - Super-type name */ - const char *type) /* I - Type name */ +mime_type_t * /* O - New (or existing) MIME type */ +mimeAddType(mime_t *mime, /* I - MIME database */ + const char *super, /* I - Super-type name */ + const char *type) /* I - Type name */ { - mime_type_t *temp, /* New MIME type */ - **types; /* New MIME types array */ + mime_type_t *temp; /* New MIME type */ /* * Range check input... */ - if (mime == NULL || super == NULL || type == NULL) - return (NULL); - - if (strlen(super) > (MIME_MAX_SUPER - 1) || - strlen(type) > (MIME_MAX_TYPE - 1)) + if (!mime || !super || !type) return (NULL); /* @@ -90,35 +85,20 @@ mimeAddType(mime_t *mime, /* I - MIME database */ * The type doesn't exist; add it... */ - if ((temp = calloc(1, sizeof(mime_type_t))) == NULL) - return (NULL); - - if (mime->num_types == 0) - types = (mime_type_t **)malloc(sizeof(mime_type_t *)); - else - types = (mime_type_t **)realloc(mime->types, sizeof(mime_type_t *) * (mime->num_types + 1)); + if (!mime->types) + mime->types = cupsArrayNew((cups_array_func_t)compare_types, NULL); - if (types == NULL) - { - free(temp); + if (!mime->types) return (NULL); - } - mime->types = types; - types += mime->num_types; - mime->num_types ++; + if ((temp = calloc(1, sizeof(mime_type_t) - MIME_MAX_TYPE + + strlen(type) + 1)) == NULL) + return (NULL); - *types = temp; strlcpy(temp->super, super, sizeof(temp->super)); - if ((temp->type = strdup(type)) == NULL) - { - mime->num_types --; - return (NULL); - } + strcpy(temp->type, type); /* Safe: temp->type is allocated */ - if (mime->num_types > 1) - qsort(mime->types, mime->num_types, sizeof(mime_type_t *), - (int (*)(const void *, const void *))compare); + cupsArrayAdd(mime->types, temp); return (temp); } @@ -149,15 +129,15 @@ mimeAddTypeRule(mime_type_t *mt, /* I - Type to add to */ * Range check input... */ - if (mt == NULL || rule == NULL) + if (!mt || !rule) return (-1); /* * Find the last rule in the top-level of the rules tree. */ - for (current = mt->rules; current != NULL; current = current->next) - if (current->next == NULL) + for (current = mt->rules; current; current = current->next) + if (!current->next) break; /* @@ -389,25 +369,25 @@ mimeAddTypeRule(mime_type_t *mt, /* I - Type to add to */ * Figure out the function... */ - if (strcmp(name, "match") == 0) + if (!strcmp(name, "match")) op = MIME_MAGIC_MATCH; - else if (strcmp(name, "ascii") == 0) + else if (!strcmp(name, "ascii")) op = MIME_MAGIC_ASCII; - else if (strcmp(name, "printable") == 0) + else if (!strcmp(name, "printable")) op = MIME_MAGIC_PRINTABLE; - else if (strcmp(name, "string") == 0) + else if (!strcmp(name, "string")) op = MIME_MAGIC_STRING; - else if (strcmp(name, "istring") == 0) + else if (!strcmp(name, "istring")) op = MIME_MAGIC_ISTRING; - else if (strcmp(name, "char") == 0) + else if (!strcmp(name, "char")) op = MIME_MAGIC_CHAR; - else if (strcmp(name, "short") == 0) + else if (!strcmp(name, "short")) op = MIME_MAGIC_SHORT; - else if (strcmp(name, "int") == 0) + else if (!strcmp(name, "int")) op = MIME_MAGIC_INT; - else if (strcmp(name, "locale") == 0) + else if (!strcmp(name, "locale")) op = MIME_MAGIC_LOCALE; - else if (strcmp(name, "contains") == 0) + else if (!strcmp(name, "contains")) op = MIME_MAGIC_CONTAINS; else return (-1); @@ -542,9 +522,8 @@ mimeFileType(mime_t *mime, /* I - MIME database */ const char *pathname, /* I - Name of file to check */ int *compression) /* O - Is the file compressed? */ { - int i; /* Looping var */ cups_file_t *fp; /* File pointer */ - mime_type_t **types; /* File types */ + mime_type_t *type; /* File type */ const char *filename; /* Base filename of file */ @@ -555,7 +534,7 @@ mimeFileType(mime_t *mime, /* I - MIME database */ * Range check input parameters... */ - if (mime == NULL || pathname == NULL) + if (!mime || !pathname) return (NULL); /* @@ -578,8 +557,10 @@ mimeFileType(mime_t *mime, /* I - MIME database */ * Then check it against all known types... */ - for (i = mime->num_types, types = mime->types; i > 0; i --, types ++) - if (checkrules(filename, fp, (*types)->rules)) + for (type = (mime_type_t *)cupsArrayFirst(mime->types); + type; + type = (mime_type_t *)cupsArrayNext(mime->types)) + if (checkrules(filename, fp, type->rules)) break; /* @@ -591,10 +572,7 @@ mimeFileType(mime_t *mime, /* I - MIME database */ cupsFileClose(fp); - if (i > 0) - return (*types); - else - return (NULL); + return (type); } @@ -602,27 +580,19 @@ mimeFileType(mime_t *mime, /* I - MIME database */ * 'mimeType()' - Lookup a file type. */ -mime_type_t * /* O - Matching file type definition */ -mimeType(mime_t *mime, /* I - MIME database */ - const char *super, /* I - Super-type name */ - const char *type) /* I - Type name */ +mime_type_t * /* O - Matching file type definition */ +mimeType(mime_t *mime, /* I - MIME database */ + const char *super, /* I - Super-type name */ + const char *type) /* I - Type name */ { - mime_type_t key, /* MIME type search key*/ - *keyptr, /* Key pointer... */ - **match; /* Matching pointer */ + mime_type_t key; /* MIME type search key*/ + /* * Range check input... */ - if (mime == NULL || super == NULL || type == NULL) - return (NULL); - - if (strlen(super) > (MIME_MAX_SUPER - 1) || - strlen(type) > (MIME_MAX_TYPE - 1)) - return (NULL); - - if (mime->num_types == 0) + if (!mime || !super || !type) return (NULL); /* @@ -630,34 +600,25 @@ mimeType(mime_t *mime, /* I - MIME database */ */ strlcpy(key.super, super, sizeof(key.super)); - key.type = (char *)type; - - keyptr = &key; - - match = (mime_type_t **)bsearch(&keyptr, mime->types, mime->num_types, - sizeof(mime_type_t *), - (int (*)(const void *, const void *))compare); + strlcpy(key.type, type, sizeof(key.type)); - if (match == NULL) - return (NULL); - else - return (*match); + return ((mime_type_t *)cupsArrayFind(mime->types, &key)); } /* - * 'compare()' - Compare two MIME super/type names. + * 'compare_types()' - Compare two MIME super/type names. */ -static int /* O - Result of comparison */ -compare(mime_type_t **t0, /* I - First type */ - mime_type_t **t1) /* I - Second type */ +static int /* O - Result of comparison */ +compare_types(mime_type_t *t0, /* I - First type */ + mime_type_t *t1) /* I - Second type */ { - int i; /* Result of comparison */ + int i; /* Result of comparison */ - if ((i = strcasecmp((*t0)->super, (*t1)->super)) == 0) - i = strcasecmp((*t0)->type, (*t1)->type); + if ((i = strcmp(t0->super, t1->super)) == 0) + i = strcmp(t0->type, t1->type); return (i); } @@ -1161,5 +1122,5 @@ patmatch(const char *s, /* I - String to match against */ /* - * End of "$Id: type.c 4613 2005-08-30 12:41:48Z mike $". + * End of "$Id: type.c 4970 2006-01-24 14:05:45Z mike $". */ diff --git a/standards/Makefile b/standards/Makefile new file mode 100644 index 000000000..40736d2c6 --- /dev/null +++ b/standards/Makefile @@ -0,0 +1,113 @@ +# +# "$Id: Makefile 4966 2006-01-23 00:41:22Z mike $" +# +# Standards makefile for the Common UNIX Printing System (CUPS). +# +# Copyright 2006 by Easy Software Products. +# +# These coded instructions, statements, and computer programs are the +# property of Easy Software Products and are protected by Federal +# copyright law. Distribution and use rights are outlined in the file +# "LICENSE.txt" which should have been included with this file. If this +# file is missing or damaged please contact Easy Software Products +# at: +# +# Attn: CUPS Licensing Information +# Easy Software Products +# 44141 Airport View Drive, Suite 204 +# Hollywood, Maryland 20636 USA +# +# Voice: (301) 373-9600 +# EMail: cups-info@cups.org +# WWW: http://www.cups.org +# + +include ../Makedefs + + +# +# Standards... +# + +RFCS = \ + rfc1179.txt \ + rfc1321.txt \ + rfc2222.txt \ + rfc2246.txt \ + rfc2487.txt \ + rfc2554.txt \ + rfc2567.txt \ + rfc2568.txt \ + rfc2569.txt \ + rfc2595.txt \ + rfc2616.txt \ + rfc2617.txt \ + rfc2712.txt \ + rfc2817.txt \ + rfc2818.txt \ + rfc2821.txt \ + rfc2822.txt \ + rfc2910.txt \ + rfc2911.txt \ + rfc2965.txt \ + rfc3196.txt \ + rfc3239.txt \ + rfc3380.txt \ + rfc3381.txt \ + rfc3382.txt \ + rfc3391.txt \ + rfc3510.txt \ + rfc3712.txt \ + rfc3986.txt \ + rfc3995.txt \ + rfc3996.txt \ + rfc3997.txt \ + rfc3998.txt + +.SUFFIXES: .html .txt +.txt.html: rfctohtml + echo Converting $< to HTML... + ./rfctohtml $< ../doc/help/$@ + + +# +# Make everything... +# + +all: rfctohtml $(RFCS:.txt=.html) + + +# +# Clean all config and object files... +# + +clean: + $(RM) rfctohtml rfctohtml.o + $(RM) $(RFCS:.txt=.html) + + +# +# Dummy depend target... +# + +depend: + + +# +# Install files... +# + +install: all + + +# +# rfctohtml - make html versions of RFCs... +# + +rfctohtml: rfctohtml.o ../cups/libcups.a + $(CC) $(LDFLAGS) -o $@ rfctohtml.o ../cups/libcups.a $(LIBZ) + + +# +# End of "$Id: Makefile 4966 2006-01-23 00:41:22Z mike $". +# diff --git a/standards/pwg5100.1.doc b/standards/pwg5100.1.doc Binary files differnew file mode 100644 index 000000000..8cad2534c --- /dev/null +++ b/standards/pwg5100.1.doc diff --git a/standards/pwg5100.2.doc b/standards/pwg5100.2.doc Binary files differnew file mode 100644 index 000000000..b2e370d9c --- /dev/null +++ b/standards/pwg5100.2.doc diff --git a/standards/pwg5100.3.doc b/standards/pwg5100.3.doc Binary files differnew file mode 100644 index 000000000..518dd9742 --- /dev/null +++ b/standards/pwg5100.3.doc diff --git a/standards/pwg5100.4.pdf b/standards/pwg5100.4.pdf Binary files differdeleted file mode 100644 index 3d6c0305f..000000000 --- a/standards/pwg5100.4.pdf +++ /dev/null diff --git a/standards/pwg5100.5.doc b/standards/pwg5100.5.doc Binary files differnew file mode 100644 index 000000000..3df03484d --- /dev/null +++ b/standards/pwg5100.5.doc diff --git a/standards/pwg5100.5.pdf b/standards/pwg5100.5.pdf Binary files differnew file mode 100644 index 000000000..536270768 --- /dev/null +++ b/standards/pwg5100.5.pdf diff --git a/standards/pwg5100.6.doc b/standards/pwg5100.6.doc Binary files differnew file mode 100644 index 000000000..46b0d23fa --- /dev/null +++ b/standards/pwg5100.6.doc diff --git a/standards/pwg5100.6.pdf b/standards/pwg5100.6.pdf Binary files differnew file mode 100644 index 000000000..0da4c21d4 --- /dev/null +++ b/standards/pwg5100.6.pdf diff --git a/standards/pwg5100.7.doc b/standards/pwg5100.7.doc Binary files differnew file mode 100644 index 000000000..489f3db47 --- /dev/null +++ b/standards/pwg5100.7.doc diff --git a/standards/pwg5100.7.pdf b/standards/pwg5100.7.pdf Binary files differnew file mode 100644 index 000000000..174ba189b --- /dev/null +++ b/standards/pwg5100.7.pdf diff --git a/standards/pwg5100.8.doc b/standards/pwg5100.8.doc Binary files differnew file mode 100644 index 000000000..515477f71 --- /dev/null +++ b/standards/pwg5100.8.doc diff --git a/standards/pwg5100.8.pdf b/standards/pwg5100.8.pdf Binary files differnew file mode 100644 index 000000000..e5dd9bf92 --- /dev/null +++ b/standards/pwg5100.8.pdf diff --git a/standards/pwg5101.1.doc b/standards/pwg5101.1.doc Binary files differnew file mode 100644 index 000000000..d2e463d46 --- /dev/null +++ b/standards/pwg5101.1.doc diff --git a/standards/pwg5101.1.pdf b/standards/pwg5101.1.pdf Binary files differnew file mode 100644 index 000000000..72354a595 --- /dev/null +++ b/standards/pwg5101.1.pdf diff --git a/standards/pwg5105.1.doc b/standards/pwg5105.1.doc Binary files differnew file mode 100644 index 000000000..9a8c8526d --- /dev/null +++ b/standards/pwg5105.1.doc diff --git a/standards/pwg5105.1.pdf b/standards/pwg5105.1.pdf Binary files differnew file mode 100644 index 000000000..ace68c9fe --- /dev/null +++ b/standards/pwg5105.1.pdf diff --git a/standards/rfc2565.txt b/standards/rfc2565.txt deleted file mode 100644 index 56511d478..000000000 --- a/standards/rfc2565.txt +++ /dev/null @@ -1,2075 +0,0 @@ - - - - - - -Network Working Group R. Herriot, Ed. -Request for Comments: 2565 Xerox Corporation -Category: Experimental S. Butler - Hewlett-Packard - P. Moore - Microsoft - R. Turner - Sharp Labs - April 1999 - - - Internet Printing Protocol/1.0: Encoding and Transport - -Status of this Memo - - This memo defines an Experimental Protocol for the Internet - community. It does not specify an Internet standard of any kind. - Discussion and suggestions for improvement are requested. - Distribution of this memo is unlimited. - -Copyright Notice - - Copyright (C) The Internet Society (1999). All Rights Reserved. - -IESG Note - - This document defines an Experimental protocol for the Internet - community. The IESG expects that a revised version of this protocol - will be published as Proposed Standard protocol. The Proposed - Standard, when published, is expected to change from the protocol - defined in this memo. In particular, it is expected that the - standards-track version of the protocol will incorporate strong - authentication and privacy features, and that an "ipp:" URL type will - be defined which supports those security measures. Other changes to - the protocol are also possible. Implementors are warned that future - versions of this protocol may not interoperate with the version of - IPP defined in this document, or if they do interoperate, that some - protocol features may not be available. - - The IESG encourages experimentation with this protocol, especially in - combination with Transport Layer Security (TLS) [RFC 2246], to help - determine how TLS may effectively be used as a security layer for - IPP. - - - - - - - - -Herriot, et al. Experimental [Page 1] - -RFC 2565 IPP/1.0: Encoding and Transport April 1999 - - -Abstract - - This document is one of a set of documents, which together describe - all aspects of a new Internet Printing Protocol (IPP). IPP is an - application level protocol that can be used for distributed printing - using Internet tools and technologies. This document defines the - rules for encoding IPP operations and IPP attributes into a new - Internet mime media type called "application/ipp". This document - also defines the rules for transporting over HTTP a message body - whose Content-Type is "application/ipp". - - The full set of IPP documents includes: - - Design Goals for an Internet Printing Protocol [RFC2567] - Rationale for the Structure and Model and Protocol for the - Internet Printing Protocol [RFC2568] - Internet Printing Protocol/1.0: Model and Semantics [RFC2566] - Internet Printing Protocol/1.0: Encoding and Transport (this - document) - Internet Printing Protocol/1.0: Implementer's Guide [ipp-iig] - Mapping between LPD and IPP Protocols [RFC2569] - - The document, "Design Goals for an Internet Printing Protocol", takes - a broad look at distributed printing functionality, and it enumerates - real-life scenarios that help to clarify the features that need to be - included in a printing protocol for the Internet. It identifies - requirements for three types of users: end users, operators, and - administrators. It calls out a subset of end user requirements that - are satisfied in IPP/1.0. Operator and administrator requirements are - out of scope for version 1.0. - - The document, "Rationale for the Structure and Model and Protocol for - the Internet Printing Protocol", describes IPP from a high level - view, defines a roadmap for the various documents that form the suite - of IPP specifications, and gives background and rationale for the - IETF working group's major decisions. - - The document, "Internet Printing Protocol/1.0: Model and Semantics", - describes a simplified model with abstract objects, their attributes, - and their operations that are independent of encoding and transport. - It introduces a Printer and a Job object. The Job object optionally - supports multiple documents per Job. It also addresses security, - internationalization, and directory issues. - - This document "Internet Printing Protocol/1.0: Implementer's Guide", - gives advice to implementers of IPP clients and IPP objects. - - - - - -Herriot, et al. Experimental [Page 2] - -RFC 2565 IPP/1.0: Encoding and Transport April 1999 - - - The document "Mapping between LPD and IPP Protocols" gives some - advice to implementers of gateways between IPP and LPD (Line Printer - Daemon) implementations. - -Table of Contents - - 1. Introduction.....................................................4 - 2. Conformance Terminology..........................................4 - 3. Encoding of the Operation Layer.................................4 - 3.1 Picture of the Encoding.....................................5 - 3.2 Syntax of Encoding..........................................7 - 3.3 Version-number..............................................9 - 3.4 Operation-id................................................9 - 3.5 Status-code.................................................9 - 3.6 Request-id..................................................9 - 3.7 Tags.......................................................10 - 3.7.1 Delimiter Tags.........................................10 - 3.7.2 Value Tags.............................................11 - 3.8 Name-Length................................................13 - 3.9 (Attribute) Name...........................................13 - 3.10 Value Length...............................................16 - 3.11 (Attribute) Value..........................................16 - 3.12 Data.......................................................18 - 4. Encoding of Transport Layer.....................................18 - 5. Security Considerations.........................................19 - 5.1 Using IPP with SSL3........................................19 - 6. References......................................................20 - 7. Authors' Addresses..............................................22 - 8. Other Participants:.............................................24 - 9. Appendix A: Protocol Examples...................................25 - 9.1 Print-Job Request..........................................25 - 9.2 Print-Job Response (successful)............................26 - 9.3 Print-Job Response (failure)...............................27 - 9.4 Print-Job Response (success with attributes ignored).......28 - 9.5 Print-URI Request..........................................30 - 9.6 Create-Job Request.........................................31 - 9.7 Get-Jobs Request...........................................31 - 9.8 Get-Jobs Response..........................................32 - 10. Appendix C: Registration of MIME Media Type Information for - "application/ipp"..............................................35 - 11. Full Copyright Statement.......................................37 - - - - - - - - - - -Herriot, et al. Experimental [Page 3] - -RFC 2565 IPP/1.0: Encoding and Transport April 1999 - - -1. Introduction - - This document contains the rules for encoding IPP operations and - describes two layers: the transport layer and the operation layer. - - The transport layer consists of an HTTP/1.1 request or response. RFC - 2068 [RFC2068] describes HTTP/1.1. This document specifies the HTTP - headers that an IPP implementation supports. - - The operation layer consists of a message body in an HTTP request or - response. The document "Internet Printing Protocol/1.0: Model and - Semantics" [RFC2566] defines the semantics of such a message body and - the supported values. This document specifies the encoding of an IPP - operation. The aforementioned document [RFC2566] is henceforth - referred to as the "IPP model document" - -2. Conformance Terminology - - The key words "MUST", "MUST NOT", "REQUIRED", "SHOULD", "SHOULD NOT", - "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be - interpreted as described in RFC 2119 [RFC2119]. - -3. Encoding of the Operation Layer - - The operation layer MUST contain a single operation request or - operation response. Each request or response consists of a sequence - of values and attribute groups. Attribute groups consist of a - sequence of attributes each of which is a name and value. Names and - values are ultimately sequences of octets - - The encoding consists of octets as the most primitive type. There are - several types built from octets, but three important types are - integers, character strings and octet strings, on which most other - data types are built. Every character string in this encoding MUST be - a sequence of characters where the characters are associated with - some charset and some natural language. A character string MUST be in - "reading order" with the first character in the value (according to - reading order) being the first character in the encoding. A character - string whose associated charset is US-ASCII whose associated natural - language is US English is henceforth called a US-ASCII-STRING. A - character string whose associated charset and natural language are - specified in a request or response as described in the model document - is henceforth called a LOCALIZED-STRING. An octet string MUST be in - "IPP model document order" with the first octet in the value - (according to the IPP model document order) being the first octet in - the encoding Every integer in this encoding MUST be encoded as a - signed integer using two's-complement binary encoding with big-endian - format (also known as "network order" and "most significant byte - - - -Herriot, et al. Experimental [Page 4] - -RFC 2565 IPP/1.0: Encoding and Transport April 1999 - - - first"). The number of octets for an integer MUST be 1, 2 or 4, - depending on usage in the protocol. Such one-octet integers, - henceforth called SIGNED-BYTE, are used for the version-number and - tag fields. Such two-byte integers, henceforth called SIGNED-SHORT - are used for the operation-id, status-code and length fields. Four - byte integers, henceforth called SIGNED-INTEGER, are used for values - fields and the sequence number. - - The following two sections present the operation layer in two ways - - - informally through pictures and description - - formally through Augmented Backus-Naur Form (ABNF), as specified - by RFC 2234 [RFC2234] - -3.1 Picture of the Encoding - - The encoding for an operation request or response consists of: - - ----------------------------------------------- - | version-number | 2 bytes - required - ----------------------------------------------- - | operation-id (request) | - | or | 2 bytes - required - | status-code (response) | - ----------------------------------------------- - | request-id | 4 bytes - required - ----------------------------------------------------------- - | xxx-attributes-tag | 1 byte | - ----------------------------------------------- |-0 or more - | xxx-attribute-sequence | n bytes | - ----------------------------------------------------------- - | end-of-attributes-tag | 1 byte - required - ----------------------------------------------- - | data | q bytes - optional - ----------------------------------------------- - - The xxx-attributes-tag and xxx-attribute-sequence represents four - different values of "xxx", namely, operation, job, printer and - unsupported. The xxx-attributes-tag and an xxx-attribute-sequence - represent attribute groups in the model document. The xxx- - attributes-tag identifies the attribute group and the xxx-attribute- - sequence contains the attributes. - - The expected sequence of xxx-attributes-tag and xxx-attribute- - sequence is specified in the IPP model document for each operation - request and operation response. - - - - - -Herriot, et al. Experimental [Page 5] - -RFC 2565 IPP/1.0: Encoding and Transport April 1999 - - - A request or response SHOULD contain each xxx-attributes-tag defined - for that request or response even if there are no attributes except - for the unsupported-attributes-tag which SHOULD be present only if - the unsupported-attribute-sequence is non-empty. A receiver of a - request MUST be able to process as equivalent empty attribute groups: - - a) an xxx-attributes-tag with an empty xxx-attribute-sequence, - b) an expected but missing xxx-attributes-tag. - - The data is omitted from some operations, but the end-of-attributes- - tag is present even when the data is omitted. Note, the xxx- - attributes-tags and end-of-attributes-tag are called 'delimiter- - tags'. Note: the xxx-attribute-sequence, shown above may consist of 0 - bytes, according to the rule below. - - An xxx-attributes-sequence consists of zero or more compound- - attributes. - - ----------------------------------------------- - | compound-attribute | s bytes - 0 or more - ----------------------------------------------- - - A compound-attribute consists of an attribute with a single value - followed by zero or more additional values. - - Note: a 'compound-attribute' represents a single attribute in the - model document. The 'additional value' syntax is for attributes with - 2 or more values. - - Each attribute consists of: - - ----------------------------------------------- - | value-tag | 1 byte - ----------------------------------------------- - | name-length (value is u) | 2 bytes - ----------------------------------------------- - | name | u bytes - ----------------------------------------------- - | value-length (value is v) | 2 bytes - ----------------------------------------------- - | value | v bytes - ----------------------------------------------- - - - - - - - - - -Herriot, et al. Experimental [Page 6] - -RFC 2565 IPP/1.0: Encoding and Transport April 1999 - - - An additional value consists of: - - ----------------------------------------------------------- - | value-tag | 1 byte | - ----------------------------------------------- | - | name-length (value is 0x0000) | 2 bytes | - ----------------------------------------------- |-0 or more - | value-length (value is w) | 2 bytes | - ----------------------------------------------- | - | value | w bytes | - ----------------------------------------------------------- - - Note: an additional value is like an attribute whose name-length is 0. - - From the standpoint of a parsing loop, the encoding consists of: - - ----------------------------------------------- - | version-number | 2 bytes - required - ----------------------------------------------- - | operation-id (request) | - | or | 2 bytes - required - | status-code (response) | - ----------------------------------------------- - | request-id | 4 bytes - required - ----------------------------------------------------------- - | tag (delimiter-tag or value-tag) | 1 byte | - ----------------------------------------------- |-0 or more - | empty or rest of attribute | x bytes | - ----------------------------------------------------------- - | end-of-attributes-tag | 2 bytes - required - ----------------------------------------------- - | data | y bytes - optional - ----------------------------------------------- - - The value of the tag determines whether the bytes following the - tag are: - - - attributes - - data - - the remainder of a single attribute where the tag specifies the - type of the value. - -3.2 Syntax of Encoding - - The syntax below is ABNF [RFC2234] except 'strings of literals' MUST - be case sensitive. For example 'a' means lower case 'a' and not - upper case 'A'. In addition, SIGNED-BYTE and SIGNED-SHORT fields - are represented as '%x' values which show their range of values. - - - -Herriot, et al. Experimental [Page 7] - -RFC 2565 IPP/1.0: Encoding and Transport April 1999 - - - ipp-message = ipp-request / ipp-response - ipp-request = version-number operation-id request-id - *(xxx-attributes-tag xxx-attribute-sequence) - end-of-attributes-tag data - ipp-response = version-number status-code request-id - *(xxx-attributes-tag xxx-attribute-sequence) - end-of-attributes-tag data - xxx-attribute-sequence = *compound-attribute - - xxx-attributes-tag = operation-attributes-tag / job-attributes-tag / - printer-attributes-tag / unsupported-attributes-tag - - version-number = major-version-number minor-version-number - major-version-number = SIGNED-BYTE ; initially %d1 - minor-version-number = SIGNED-BYTE ; initially %d0 - - operation-id = SIGNED-SHORT ; mapping from model defined below - status-code = SIGNED-SHORT ; mapping from model defined below - request-id = SIGNED-INTEGER ; whose value is > 0 - - compound-attribute = attribute *additional-values - attribute = value-tag name-length name value-length value - additional-values = value-tag zero-name-length value-length value - - name-length = SIGNED-SHORT ; number of octets of 'name' - name = LALPHA *( LALPHA / DIGIT / "-" / "_" / "." ) - value-length = SIGNED-SHORT ; number of octets of 'value' - value = OCTET-STRING - - data = OCTET-STRING - - zero-name-length = %x00.00 ; name-length of 0 - operation-attributes-tag = %x01 ; tag of 1 - job-attributes-tag = %x02 ; tag of 2 - printer-attributes-tag = %x04 ; tag of 4 - unsupported-attributes-tag = %x05 ; tag of 5 - end-of-attributes-tag = %x03 ; tag of 3 - value-tag = %x10-FF - - SIGNED-BYTE = BYTE - SIGNED-SHORT = 2BYTE - SIGNED-INTEGER = 4BYTE - DIGIT = %x30-39 ; "0" to "9" - LALPHA = %x61-7A ; "a" to "z" - BYTE = %x00-FF - OCTET-STRING = *BYTE - - - - - -Herriot, et al. Experimental [Page 8] - -RFC 2565 IPP/1.0: Encoding and Transport April 1999 - - - The syntax allows an xxx-attributes-tag to be present when the xxx- - attribute-sequence that follows is empty. The syntax is defined this - way to allow for the response of Get-Jobs where no attributes are - returned for some job-objects. Although it is RECOMMENDED that the - sender not send an xxx-attributes-tag if there are no attributes - (except in the Get-Jobs response just mentioned), the receiver MUST - be able to decode such syntax. - -3.3 Version-number - - The version-number MUST consist of a major and minor version-number, - each of which MUST be represented by a SIGNED-BYTE. The protocol - described in this document MUST have a major version-number of 1 - (0x01) and a minor version-number of 0 (0x00). The ABNF for these - two bytes MUST be %x01.00. - -3.4 Operation-id - - Operation-ids are defined as enums in the model document. An - operation-ids enum value MUST be encoded as a SIGNED-SHORT. - - Note: the values 0x4000 to 0xFFFF are reserved for private - extensions. - -3.5 Status-code - - Status-codes are defined as enums in the model document. A status- - code enum value MUST be encoded as a SIGNED-SHORT. - - The status-code is an operation attribute in the model document. In - the protocol, the status-code is in a special position, outside of - the operation attributes. - - If an IPP status-code is returned, then the HTTP Status-Code MUST be - 200 (successful-ok). With any other HTTP Status-Code value, the HTTP - response MUST NOT contain an IPP message-body, and thus no IPP - status-code is returned. - -3.6 Request-id - - The request-id allows a client to match a response with a request. - This mechanism is unnecessary in HTTP, but may be useful when - application/ipp entity bodies are used in another context. - - The request-id in a response MUST be the value of the request-id - received in the corresponding request. A client can set the - request-id in each request to a unique value or a constant value, - such as 1, depending on what the client does with the request-id - - - -Herriot, et al. Experimental [Page 9] - -RFC 2565 IPP/1.0: Encoding and Transport April 1999 - - - returned in the response. The value of the request-id MUST be greater - than zero. - -3.7 Tags - - There are two kinds of tags: - - - delimiter tags: delimit major sections of the protocol, namely - attributes and data - - value tags: specify the type of each attribute value - -3.7.1 Delimiter Tags - - The following table specifies the values for the delimiter tags: - - Tag Value (Hex) Delimiter - - 0x00 reserved - 0x01 operation-attributes-tag - 0x02 job-attributes-tag - 0x03 end-of-attributes-tag - 0x04 printer-attributes-tag - 0x05 unsupported-attributes-tag - 0x06-0x0e reserved for future delimiters - 0x0F reserved for future chunking-end-of-attributes- - tag - - When an xxx-attributes-tag occurs in the protocol, it MUST mean that - zero or more following attributes up to the next delimiter tag are - attributes belonging to group xxx as defined in the model document, - where xxx is operation, job, printer, unsupported. - - Doing substitution for xxx in the above paragraph, this means the - following. When an operation-attributes-tag occurs in the protocol, - it MUST mean that the zero or more following attributes up to the - next delimiter tag are operation attributes as defined in the model - document. When an job-attributes-tag occurs in the protocol, it MUST - mean that the zero or more following attributes up to the next - delimiter tag are job attributes or job template attributes as - defined in the model document. When a printer-attributes-tag occurs - in the protocol, it MUST mean that the zero or more following - attributes up to the next delimiter tag are printer attributes as - defined in the model document. When an unsupported-attributes-tag - occurs in the protocol, it MUST mean that the zero or more following - attributes up to the next delimiter tag are unsupported attributes as - defined in the model document. - - - - - -Herriot, et al. Experimental [Page 10] - -RFC 2565 IPP/1.0: Encoding and Transport April 1999 - - - The operation-attributes-tag and end-of-attributes-tag MUST each - occur exactly once in an operation. The operation-attributes-tag MUST - be the first tag delimiter, and the end-of-attributes-tag MUST be the - last tag delimiter. If the operation has a document-content group, - the document data in that group MUST follow the end-of-attributes- - tag. - - Each of the other three xxx-attributes-tags defined above is - OPTIONAL in an operation and each MUST occur at most once in an - operation, except for job-attributes-tag in a Get-Jobs response which - may occur zero or more times. - - The order and presence of delimiter tags for each operation request - and each operation response MUST be that defined in the model - document. For further details, see section 3.9 "(Attribute) Name" and - section 9 "Appendix A: Protocol Examples". - - A Printer MUST treat the reserved delimiter tags differently from - reserved value tags so that the Printer knows that there is an entire - attribute group that it doesn't understand as opposed to a single - value that it doesn't understand. - -3.7.2 Value Tags - - The remaining tables show values for the value-tag, which is the - first octet of an attribute. The value-tag specifies the type of the - value of the attribute. The following table specifies the "out-of- - band" values for the value-tag. - - Tag Value (Hex) Meaning - - 0x10 unsupported - 0x11 reserved for future 'default' - 0x12 unknown - 0x13 no-value - - Tag Value (Hex) Meaning - - 0x14-0x1F reserved for future "out-of-band" values. - - The "unsupported" value MUST be used in the attribute-sequence of an - error response for those attributes which the printer does not - support. The "default" value is reserved for future use of setting - value back to their default value. The "unknown" value is used for - the value of a supported attribute when its value is temporarily - unknown. The "no-value" value is used for a supported attribute to - which - - - - -Herriot, et al. Experimental [Page 11] - -RFC 2565 IPP/1.0: Encoding and Transport April 1999 - - - no value has been assigned, e.g. "job-k-octets-supported" has no - value if an implementation supports this attribute, but an - administrator has not configured the printer to have a limit. - - The following table specifies the integer values for the value-tag: - - Tag Value (Hex) Meaning - - 0x20 reserved - 0x21 integer - 0x22 boolean - 0x23 enum - 0x24-0x2F reserved for future integer types - - NOTE: 0x20 is reserved for "generic integer" if it should ever be - needed. - - The following table specifies the octetString values for the value- - tag: - - Tag Value (Hex) Meaning - - 0x30 octetString with an unspecified format - 0x31 dateTime - 0x32 resolution - 0x33 rangeOfInteger - 0x34 reserved for collection (in the future) - 0x35 textWithLanguage - 0x36 nameWithLanguage - 0x37-0x3F reserved for future octetString types - - The following table specifies the character-string values for the - value-tag: - - Tag Value (Hex) Meaning - - 0x40 reserved - 0x41 textWithoutLanguage - 0x42 nameWithoutLanguage - 0x43 reserved - 0x44 keyword - 0x45 uri - 0x46 uriScheme - 0x47 charset - 0x48 naturalLanguage - - - - - - -Herriot, et al. Experimental [Page 12] - -RFC 2565 IPP/1.0: Encoding and Transport April 1999 - - - Tag Value (Hex) Meaning - - 0x49 mimeMediaType - 0x4A-0x5F reserved for future character string types - - NOTE: 0x40 is reserved for "generic character-string" if it should - ever be needed. - - NOTE: an attribute value always has a type, which is explicitly - specified by its tag; one such tag value is "nameWithoutLanguage". - An attribute's name has an implicit type, which is keyword. - - The values 0x60-0xFF are reserved for future types. There are no - values allocated for private extensions. A new type MUST be - registered via the type 2 registration process [RFC2566]. - - The tag 0x7F is reserved for extending types beyond the 255 values - available with a single byte. A tag value of 0x7F MUST signify that - the first 4 bytes of the value field are interpreted as the tag - value. Note, this future extension doesn't affect parsers that are - unaware of this special tag. The tag is like any other unknown tag, - and the value length specifies the length of a value which contains a - value that the parser treats atomically. All these 4 byte tag values - are currently unallocated except that the values 0x40000000- - 0x7FFFFFFF are reserved for experimental use. - -3.8 Name-Length - - The name-length field MUST consist of a SIGNED-SHORT. This field MUST - specify the number of octets in the name field which follows the - name-length field, excluding the two bytes of the name-length field. - - If a name-length field has a value of zero, the following name field - MUST be empty, and the following value MUST be treated as an - additional value for the preceding attribute. Within an attribute- - sequence, if two attributes have the same name, the first occurrence - MUST be ignored. The zero-length name is the only mechanism for - multi-valued attributes. - -3.9 (Attribute) Name - - Some operation elements are called parameters in the model document - [RFC2566]. They MUST be encoded in a special position and they MUST - NOT appear as an operation attributes. These parameters are: - - - "version-number": The parameter named "version-number" in the - IPP model document MUST become the "version-number" field in the - operation layer request or response. - - - -Herriot, et al. Experimental [Page 13] - -RFC 2565 IPP/1.0: Encoding and Transport April 1999 - - - - "operation-id": The parameter named "operation-id" in the IPP - model document MUST become the "operation-id" field in the - operation layer request. - - "status-code": The parameter named "status-code" in the IPP - model document MUST become the "status-code" field in the - operation layer response. - - "request-id": The parameter named "request-id" in the IPP model - document MUST become the "request-id" field in the operation - layer request or response. - - All Printer and Job objects are identified by a Uniform Resource - Identifier (URI) [RFC2396] so that they can be persistently and - unambiguously referenced. The notion of a URI is a useful concept, - however, until the notion of URI is more stable (i.e., defined more - completely and deployed more widely), it is expected that the URIs - used for IPP objects will actually be URLs [RFC1738] [RFC1808]. - Since every URL is a specialized form of a URI, even though the more - generic term URI is used throughout the rest of this document, its - usage is intended to cover the more specific notion of URL as well. - - Some operation elements are encoded twice, once as the request-URI on - the HTTP Request-Line and a second time as a REQUIRED operation - attribute in the application/ipp entity. These attributes are the - target URI for the operation: - - - "printer-uri": When the target is a printer and the transport is - HTTP or HTTPS (for SSL3 [ssl]), the target printer-uri defined - in each operation in the IPP model document MUST be an operation - attribute called "printer-uri" and it MUST also be specified - outside of the operation layer as the request-URI on the - Request-Line at the HTTP level. - - "job-uri": When the target is a job and the transport is HTTP or - HTTPS (for SSL3), the target job-uri of each operation in the - IPP model document MUST be an operation attribute called "job- - uri" and it MUST also be specified outside of the operation - layer as the request-URI on the Request-Line at the HTTP level. - - Note: The target URI is included twice in an operation referencing - the same IPP object, but the two URIs NEED NOT be literally - identical. One can be a relative URI and the other can be an absolute - URI. HTTP/1.1 allows clients to generate and send a relative URI - rather than an absolute URI. A relative URI identifies a resource - with the scope of the HTTP server, but does not include scheme, host - or port. The following statements characterize how URLs should be - used in the mapping of IPP onto HTTP/1.1: - - - - - - -Herriot, et al. Experimental [Page 14] - -RFC 2565 IPP/1.0: Encoding and Transport April 1999 - - - 1. Although potentially redundant, a client MUST supply the target - of the operation both as an operation attribute and as a URI at - the HTTP layer. The rationale for this decision is to maintain - a consistent set of rules for mapping application/ipp to - possibly many communication layers, even where URLs are not - used as the addressing mechanism in the transport layer. - 2. Even though these two URLs might not be literally identical - (one being relative and the other being absolute), they MUST - both reference the same IPP object. - 3. The URI in the HTTP layer is either relative or absolute and is - used by the HTTP server to route the HTTP request to the - correct resource relative to that HTTP server. The HTTP server - need not be aware of the URI within the operation request. - 4. Once the HTTP server resource begins to process the HTTP - request, it might get the reference to the appropriate IPP - Printer object from either the HTTP URI (using to the context - of the HTTP server for relative URLs) or from the URI within - the operation request; the choice is up to the implementation. - 5. HTTP URIs can be relative or absolute, but the target URI in - the operation MUST be an absolute URI. - - The model document arranges the remaining attributes into groups for - each operation request and response. Each such group MUST be - represented in the protocol by an xxx-attribute-sequence preceded by - the appropriate xxx-attributes-tag (See the table below and section 9 - "Appendix A: Protocol Examples"). In addition, the order of these - xxx-attributes-tags and xxx-attribute-sequences in the protocol MUST - be the same as in the model document, but the order of attributes - within each xxx-attribute-sequence MUST be unspecified. The table - below maps the model document group name to xxx-attributes-sequence: - - Model Document Group xxx-attributes-sequence - - Operation Attributes operations-attributes-sequence - Job Template Attributes job-attributes-sequence - Job Object Attributes job-attributes-sequence - Unsupported Attributes unsupported-attributes-sequence - Requested Attributes job-attributes-sequence - Get-Job-Attributes) - Requested Attributes printer-attributes-sequence - Get-Printer-Attributes) - Document Content in a special position as described - above - - If an operation contains attributes from more than one job object - (e.g. Get-Jobs response), the attributes from each job object MUST - be in a separate job-attribute-sequence, such that the attributes - - - - -Herriot, et al. Experimental [Page 15] - -RFC 2565 IPP/1.0: Encoding and Transport April 1999 - - - from the ith job object are in the ith job-attribute-sequence. See - Section 9 "Appendix A: Protocol Examples" for table showing the - application of the rules above. - -3.10 Value Length - - Each attribute value MUST be preceded by a SIGNED-SHORT, which MUST - specify the number of octets in the value which follows this length, - exclusive of the two bytes specifying the length. - - For any of the types represented by binary signed integers, the - sender MUST encode the value in exactly four octets. - - For any of the types represented by character-strings, the sender - MUST encode the value with all the characters of the string and - without any padding characters. - - If a value-tag contains an "out-of-band" value, such as - "unsupported", the value-length MUST be 0 and the value empty. The - value has no meaning when the value-tag has an "out-of-band" value. - If a client receives a response with a nonzero value-length in this - case, it MUST ignore the value field. If a printer receives a request - with a nonzero value-length in this case, it MUST reject the request. - -3.11 (Attribute) Value - - The syntax types and most of the details of their representation are - defined in the IPP model document. The table below augments the - information in the model document, and defines the syntax types from - the model document in terms of the 5 basic types defined in section 3 - "Encoding of the Operation Layer". The 5 types are US-ASCII-STRING, - LOCALIZED-STRING, SIGNED-INTEGER, SIGNED-SHORT, SIGNED-BYTE, and - OCTET-STRING. - -Syntax of Attribute Encoding -Value - -textWithoutLanguage, LOCALIZED-STRING. -nameWithoutLanguage - -textWithLanguage OCTET_STRING consisting of 4 fields: - a) a SIGNED-SHORT which is the number of octets - in the following field - b) a value of type natural-language, - c) a SIGNED-SHORT which is the number of octets - in the following field, - d) a value of type textWithoutLanguage. - - - - -Herriot, et al. Experimental [Page 16] - -RFC 2565 IPP/1.0: Encoding and Transport April 1999 - - - The length of a textWithLanguage value MUST be 4 - + the value of field a + the value of field c. - -nameWithLanguage OCTET_STRING consisting of 4 fields: - a) a SIGNED-SHORT which is the number of octets - in the following field - b) a value of type natural-language, - c) a SIGNED-SHORT which is the number of octets - in the following field - d) a value of type nameWithoutLanguage. - - The length of a nameWithLanguage value MUST be 4 - + the value of field a + the value of field c. - -charset, US-ASCII-STRING. -naturalLanguage, -mimeMediaType, -keyword, uri, and -uriScheme - -boolean SIGNED-BYTE where 0x00 is 'false' and 0x01 is - 'true'. - -Syntax of Attribute Encoding -Value - - -integer and enum a SIGNED-INTEGER. - -dateTime OCTET-STRING consisting of eleven octets whose - contents are defined by "DateAndTime" in RFC - 2579 [RFC2579]. - -resolution OCTET_STRING consisting of nine octets of 2 - SIGNED-INTEGERs followed by a SIGNED-BYTE. The - first SIGNED-INTEGER contains the value of cross - feed direction resolution. The second SIGNED- - INTEGER contains the value of feed direction - resolution. The SIGNED-BYTE contains the units - value. - -rangeOfInteger Eight octets consisting of 2 SIGNED-INTEGERs. - The first SIGNED-INTEGER contains the lower - bound and the second SIGNED-INTEGER contains the - upper bound. - - - - - - -Herriot, et al. Experimental [Page 17] - -RFC 2565 IPP/1.0: Encoding and Transport April 1999 - - -1setOf X Encoding according to the rules for an attribute - with more than 1 value. Each value X is encoded - according to the rules for encoding its type. - -octetString OCTET-STRING - - The type of the value in the model document determines the encoding - in the value and the value of the value-tag. - -3.12 Data - - The data part MUST include any data required by the operation - -4. Encoding of Transport Layer - - HTTP/1.1 [RFC2068] is the transport layer for this protocol. - - The operation layer has been designed with the assumption that the - transport layer contains the following information: - - - the URI of the target job or printer operation - - the total length of the data in the operation layer, either as a - single length or as a sequence of chunks each with a length. - - It is REQUIRED that a printer implementation support HTTP over the - IANA assigned Well Known Port 631 (the IPP default port), though a - printer implementation may support HTTP over some other port as well. - In addition, a printer may have to support another port for privacy - (See Section 5 "Security Considerations"). - - Note: even though port 631 is the IPP default, port 80 remains the - default for an HTTP URI. Thus a URI for a printer using port 631 - MUST contain an explicit port, e.g. "http://forest:631/pinetree". An - HTTP URI for IPP with no explicit port implicitly reference port 80, - which is consistent with the rules for HTTP/1.1. Each HTTP operation - MUST use the POST method where the request-URI is the object target - of the operation, and where the "Content-Type" of the message-body in - each request and response MUST be "application/ipp". The message-body - MUST contain the operation layer and MUST have the syntax described - in section 3.2 "Syntax of Encoding". A client implementation MUST - adhere to the rules for a client described for HTTP1.1 [RFC2068]. A - printer (server) implementation MUST adhere the rules for an origin - server described for HTTP1.1 [RFC2068]. - - An IPP server sends a response for each request that it receives. If - an IPP server detects an error, it MAY send a response before it has - read the entire request. If the HTTP layer of the IPP server - completes processing the HTTP headers successfully, it MAY send an - - - -Herriot, et al. Experimental [Page 18] - -RFC 2565 IPP/1.0: Encoding and Transport April 1999 - - - intermediate response, such as "100 Continue", with no IPP data - before sending the IPP response. A client MUST expect such a variety - of responses from an IPP server. For further information on HTTP/1.1, - consult the HTTP documents [RFC2068]. - -5. Security Considerations - - The IPP Model document defines an IPP implementation with "privacy" - as one that implements Secure Socket Layer Version 3 (SSL3). Note: - SSL3 is not an IETF standards track specification. SSL3 meets the - requirements for IPP security with regards to features such as mutual - authentication and privacy (via encryption). The IPP Model document - also outlines IPP-specific security considerations and should be the - primary reference for security implications with regards to the IPP - protocol itself. - - The IPP Model document defines an IPP implementation with - "authentication" as one that implements the standard way for - transporting IPP messages within HTTP 1.1. These include the security - considerations outlined in the HTTP 1.1 standard document [RFC2068] - and Digest Access Authentication extension [RFC2069]. - - The current HTTP infrastructure supports HTTP over TCP port 80. IPP - server implementations MUST offer IPP services using HTTP over the - IANA assigned Well Known Port 631 (the IPP default port). IPP server - implementations may support other ports, in addition to this port. - - See further discussion of IPP security concepts in the model document - [RFC2566]. - -5.1 Using IPP with SSL3 - - An assumption is that the URI for a secure IPP Printer object has - been found by means outside the IPP printing protocol, via a - directory service, web site or other means. - - IPP provides a transparent connection to SSL by calling the - corresponding URL (a https URI connects by default to port 443). - However, the following functions can be provided to ease the - integration of IPP with SSL during implementation: - - connect (URI), returns a status - - "connect" makes an https call and returns the immediate status - of the connection as returned by SSL to the user. The status - values are explained in section 5.4.2 of the SSL document - [ssl]. - - - - -Herriot, et al. Experimental [Page 19] - -RFC 2565 IPP/1.0: Encoding and Transport April 1999 - - - A session-id may also be retained to later resume a session. - The SSL handshake protocol may also require the cipher - specifications supported by the client, key length of the - ciphers, compression methods, certificates, etc. These should - be sent to the server and hence should be available to the IPP - client (although as part of administration features). - - disconnect (session) - - to disconnect a particular session. - - The session-id available from the "connect" could be used. - - resume (session) - - to reconnect using a previous session-id. - - The availability of this information as administration features are - left for implementers, and need not be specified at this time. - -6. References - - [RFC2278] Freed, N. and J. Postel, "IANA Charset Registration - Procedures", BCP 19, RFC 2278, January 1998. - - [dpa] ISO/IEC 10175 Document Printing Application (DPA), June - 1996. - - [iana] IANA Registry of Coded Character Sets: - ftp://ftp.isi.edu/in-notes/iana/assignments/character-sets. - - [ipp-iig] Hastings, Tom, et al., "Internet Printing Protocol/1.0: - Implementer's Guide", Work in Progress. - - [RFC2569] Herriot, R., Hastings, T., Jacobs, N. and J. Martin, - "Mapping between LPD and IPP Protocols", RFC 2569, April - 1999. - - [RFC2566] deBry, R., Hastings, T., Herriot, R., Isaacson, S. and P. - Powell, "Internet Printing Protocol/1.0: Model and - Semantics", RFC 2566, April 1999. - - [RFC2565] Herriot, R., Butler, S., Moore, P., Tuner, R., "Internet - Printing Protocol/1.0: Encoding and Transport", RFC 2565, - April 1999. - - - - - - -Herriot, et al. Experimental [Page 20] - -RFC 2565 IPP/1.0: Encoding and Transport April 1999 - - - [RFC2568] Zilles, S., "Rationale for the Structure and Model and - Protocol for the Internet Printing Protocol", RFC 2568, - April 1999. - - [RFC2567] Wright, D., "Design Goals for an Internet Printing - Protocol", RFC 2567, April 1999. - - [RFC822] Crocker, D., "Standard for the Format of ARPA Internet Text - Messages", STD 11, RFC 822, August 1982. - - [RFC1123] Braden, R., "Requirements for Internet Hosts - Application - and Support", STD 3, RFC 1123, October 1989. - - [RFC1179] McLaughlin, L. III, (editor), "Line Printer Daemon - Protocol" RFC 1179, August 1990. - - [RFC2223] Postel, J. and J. Reynolds, "Instructions to RFC Authors", - RFC 2223, October 1997. - - [RFC1738] Berners-Lee, T., Masinter, L. and M. McCahill, "Uniform - Resource Locators (URL)", RFC 1738, December 1994. - - [RFC1759] Smith, R., Wright, F., Hastings, T., Zilles, S. and J. - Gyllenskog, "Printer MIB", RFC 1759, March 1995. - - [RFC1766] Alvestrand, H., " Tags for the Identification of - Languages", RFC 1766, March 1995. - - [RFC1808] Fielding, R., "Relative Uniform Resource Locators", RFC - 1808, June 1995. - - [RFC2579] McCloghrie, K., Perkins, D. and J. Schoenwaelder, "Textual - Conventions for SMIv2", STD 58, RFC 2579, April 1999. - - [RFC2046] Freed, N. and N. Borenstein, Multipurpose Internet Mail - Extensions (MIME) Part Two: Media Types", RFC 2046, - November 1996. - - [RFC2048] Freed, N., Klensin J. and J. Postel. Multipurpose Internet - Mail Extension (MIME) Part Four: Registration Procedures", - BCP 13, RFC 2048, November 1996. - - [RFC2068] Fielding, R., Gettys, J., Mogul, J., Frystyk, H. and T. - Berners-Lee, "Hypertext Transfer Protocol -- HTTP/1.1", RFC - 2068, January 1997. - - - - - - -Herriot, et al. Experimental [Page 21] - -RFC 2565 IPP/1.0: Encoding and Transport April 1999 - - - [RFC2069] Franks, J., Hallam-Baker, P., Hostetler, J., Leach, P., - Luotonen, A., Sink, E. and L. Stewart, "An Extension to - HTTP: Digest Access Authentication", RFC 2069, January - 1997. - - [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate - Requirement Levels", BCP 14, RFC 2119, March 1997. - - [RFC2184] Freed, N. and K. Moore, "MIME Parameter Value and Encoded - Word Extensions: Character Sets, Languages, and - Continuations", RFC 2184, August 1997. - - [RFC2234] Crocker, D. and P. Overell, "Augmented BNF for Syntax - Specifications: ABNF", RFC 2234. November 1997. - - [RFC2396] Berners-Lee, T., Fielding, R. and L. Masinter, "Uniform - Resource Identifiers (URI): Generic Syntax", RFC 2396, - August 1998. - -7. Authors' Addresses - - Robert Herriot (Editor) - Xerox Corporation - 3400 Hillview Ave., Bldg #1 - Palo Alto, CA 94304 - - Phone: 650-813-7696 - Fax: 650-813-6860 - EMail: rherriot@pahv.xerox.com - - - Sylvan Butler - Hewlett-Packard - 11311 Chinden Blvd. - Boise, ID 83714 - - Phone: 208-396-6000 - Fax: 208-396-3457 - EMail: sbutler@boi.hp.com - - - - - - - - - - - - -Herriot, et al. Experimental [Page 22] - -RFC 2565 IPP/1.0: Encoding and Transport April 1999 - - - Paul Moore - Microsoft - One Microsoft Way - Redmond, WA 98053 - - Phone: 425-936-0908 - Fax: 425-93MS-FAX - EMail: paulmo@microsoft.com - - - Randy Turner - Sharp Laboratories - 5750 NW Pacific Rim Blvd - Camas, WA 98607 - - Phone: 360-817-8456 - Fax: 360-817-8436 - EMail: rturner@sharplabs.com - - - IPP Mailing List: ipp@pwg.org - IPP Mailing List Subscription: ipp-request@pwg.org - IPP Web Page: http://www.pwg.org/ipp/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Herriot, et al. Experimental [Page 23] - -RFC 2565 IPP/1.0: Encoding and Transport April 1999 - - -8. Other Participants: - - Chuck Adams - Tektronix Harry Lewis - IBM - Ron Bergman - Dataproducts Tony Liao - Vivid Image - Keith Carter - IBM David Manchala - Xerox - Angelo Caruso - Xerox Carl-Uno Manros - Xerox - Jeff Copeland - QMS Jay Martin - Underscore - Roger deBry - IBM Larry Masinter - Xerox - Lee Farrell - Canon Ira McDonald - High North Inc. - Sue Gleeson - Digital Bob Pentecost - Hewlett-Packard - Charles Gordon - Osicom Patrick Powell - Astart - Technologies - Brian Grimshaw - Apple Jeff Rackowitz - Intermec - Jerry Hadsell - IBM Xavier Riley - Xerox - Richard Hart - Digital Gary Roberts - Ricoh - Tom Hastings - Xerox Stuart Rowley - Kyocera - Stephen Holmstead Richard Schneider - Epson - Zhi-Hong Huang - Zenographics Shigern Ueda - Canon - Scott Isaacson - Novell Bob Von Andel - Allegro Software - Rich Lomicka - Digital William Wagner - Digital Products - David Kellerman - Northlake Jasper Wong - Xionics - Software - Robert Kline - TrueSpectra Don Wright - Lexmark - Dave Kuntz - Hewlett-Packard Rick Yardumian - Xerox - Takami Kurono - Brother Lloyd Young - Lexmark - Rich Landau - Digital Peter Zehler - Xerox - Greg LeClair - Epson Frank Zhao - Panasonic - Steve Zilles - Adobe - - - - - - - - - - - - - - - - - - - - - - - -Herriot, et al. Experimental [Page 24] - -RFC 2565 IPP/1.0: Encoding and Transport April 1999 - - -9. Appendix A: Protocol Examples - -9.1 Print-Job Request - - The following is an example of a Print-Job request with job-name, - copies, and sides specified. The "ipp-attribute-fidelity" attribute - is set to 'true' so that the print request will fail if the "copies" - or the "sides" attribute are not supported or their values are not - supported. - - Octets Symbolic Value Protocol field - - 0x0100 1.0 version-number - 0x0002 Print-Job operation-id - 0x00000001 1 request-id - 0x01 start operation-attributes operation-attributes-tag - 0x47 charset type value-tag - 0x0012 name-length - attributes- attributes-charset name - charset - 0x0008 value-length - us-ascii US-ASCII value - 0x48 natural-language type value-tag - 0x001B name-length - attributes- attributes-natural-language name - natural- - language - 0x0005 value-length - en-us en-US value - 0x45 uri type value-tag - 0x000B name-length - printer-uri printer-uri name - 0x001A value-length - http://forest: printer pinetree value - 631/pinetree - 0x42 nameWithoutLanguage type value-tag - 0x0008 name-length - job-name job-name name - 0x0006 value-length - foobar foobar value - 0x22 boolean type value-tag - 0x16 name-length - ipp-attribute- ipp-attribute-fidelity name - fidelity - 0x01 value-length - 0x01 true value - 0x02 start job-attributes job-attributes-tag - 0x21 integer type value-tag - - - -Herriot, et al. Experimental [Page 25] - -RFC 2565 IPP/1.0: Encoding and Transport April 1999 - - - 0x0006 name-length - copies copies name - 0x0004 value-length - 0x00000014 20 value - 0x44 keyword type value-tag - 0x0005 name-length - sides sides name - 0x0013 value-length - two-sided- two-sided-long-edge value - long-edge - 0x03 end-of-attributes end-of-attributes-tag - %!PS... <PostScript> data - -9.2 Print-Job Response (successful) - - Here is an example of a successful Print-Job response to the previous - Print-Job request. The printer supported the "copies" and "sides" - attributes and their supplied values. The status code returned is ' - successful-ok'. - - Octets Symbolic Value Protocol field - - 0x0100 1.0 version-number - 0x0000 successful-ok status-code - 0x00000001 1 request-id - 0x01 start operation-attributes operation-attributes-tag - 0x47 charset type value-tag - 0x0012 name-length - attributes- attributes-charset name - charset - 0x0008 value-length - us-ascii US-ASCII value - 0x48 natural-language type value-tag - 0x001B name-length - attributes- attributes-natural- name - natural-language language - 0x0005 value-length - en-us en-US value - 0x41 textWithoutLanguage type value-tag - 0x000E name-length - status-message status-message name - 0x000D value-length - successful-ok successful-ok value - 0x02 start job-attributes job-attributes-tag - 0x21 integer value-tag - 0x0006 name-length - - - - - -Herriot, et al. Experimental [Page 26] - -RFC 2565 IPP/1.0: Encoding and Transport April 1999 - - - Octets Symbolic Value Protocol field - - job-id job-id name - 0x0004 value-length - 147 147 value - 0x45 uri type value-tag - 0x0007 name-length - job-uri job-uri name - 0x001E value-length - http://forest:63 job 123 on pinetree value - 1/pinetree/123 - 0x42 nameWithoutLanguage type value-tag - 0x0009 name-length - job-state job-state name - 0x0004 value-length - 0x0003 pending value - 0x03 end-of-attributes end-of-attributes-tag - -9.3 Print-Job Response (failure) - - Here is an example of an unsuccessful Print-Job response to the - previous Print-Job request. It fails because, in this case, the - printer does not support the "sides" attribute and because the value - '20' for the "copies" attribute is not supported. Therefore, no job - is created, and neither a "job-id" nor a "job-uri" operation - attribute is returned. The error code returned is 'client-error- - attributes-or-values-not-supported' (0x040B). - - Octets Symbolic Value Protocol field - - 0x0100 1.0 version-number - 0x040B client-error-attributes-or- status-code - values-not-supported - 0x00000001 1 request-id - 0x01 start operation-attributes operation-attribute tag - 0x47 charset type value-tag - 0x0012 name-length - attributes- attributes-charset name - charset - 0x0008 value-length - us-ascii US-ASCII value - 0x48 natural-language type value-tag - 0x001B name-length - attributes- attributes-natural-language name - natural- - language - 0x0005 value-length - - - - -Herriot, et al. Experimental [Page 27] - -RFC 2565 IPP/1.0: Encoding and Transport April 1999 - - - Octets Symbolic Value Protocol field - - en-us en-US value - 0x41 textWithoutLanguage type value-tag - 0x000E name-length - status- status-message name - message - 0x002F value-length - client-error- client-error-attributes-or- value - attributes- values-not-supported - or-values- - not-supported - 0x05 start unsupported-attributes unsupported-attributes tag - 0x21 integer type value-tag - 0x0006 name-length - copies copies name - 0x0004 value-length - 0x00000014 20 value - 0x10 unsupported (type) value-tag - 0x0005 name-length - sides sides name - 0x0000 value-length - 0x03 end-of-attributes end-of-attributes-tag - -9.4 Print-Job Response (success with attributes ignored) - - Here is an example of a successful Print-Job response to a Print-Job - request like the previous Print-Job request, except that the value of - 'ipp-attribute-fidelity' is false. The print request succeeds, even - though, in this case, the printer supports neither the "sides" - attribute nor the value '20' for the "copies" attribute. Therefore, a - job is created, and both a "job-id" and a "job-uri" operation - attribute are returned. The unsupported attributes are also returned - in an Unsupported Attributes Group. The error code returned is ' - successful-ok-ignored-or-substituted-attributes' (0x0001). - - Octets Symbolic Value Protocol field - - 0x0100 1.0 version-number - 0x0001 successful-ok-ignored-or- status-code - substituted-attributes - 0x00000001 1 request-id - 0x01 start operation-attributes operation-attributes-tag - 0x47 charset type value-tag - 0x0012 name-length - attributes- attributes-charset name - charset - 0x0008 value-length - - - -Herriot, et al. Experimental [Page 28] - -RFC 2565 IPP/1.0: Encoding and Transport April 1999 - - - Octets Symbolic Value Protocol field - - us-ascii US-ASCII value - 0x48 natural-language type value-tag - 0x001B name-length - attributes- attributes-natural- name - natural-language language - 0x0005 value-length - en-us en-US value - 0x41 textWithoutLanguage type value-tag - 0x000E name-length - status-message status-message name - 0x002F value-length - successful-ok- successful-ok-ignored-or- value - ignored-or- substituted-attributes - substituted- - attributes - 0x05 start unsupported- unsupported-attributes - attributes tag - 0x21 integer type value-tag - 0x0006 name-length - copies copies name - 0x0004 value-length - 0x00000014 20 value - 0x10 unsupported (type) value-tag - 0x0005 name-length - sides sides name - 0x0000 value-length - 0x02 start job-attributes job-attributes-tag - 0x21 integer value-tag - 0x0006 name-length - job-id job-id name - 0x0004 value-length - 147 147 value - 0x45 uri type value-tag - 0x0007 name-length - job-uri job-uri name - 0x001E value-length - http://forest:63 job 123 on pinetree value - 1/pinetree/123 - 0x42 nameWithoutLanguage type value-tag - 0x0009 name-length - job-state job-state name - 0x0004 value-length - 0x0003 pending value - 0x03 end-of-attributes end-of-attributes-tag - - - - - -Herriot, et al. Experimental [Page 29] - -RFC 2565 IPP/1.0: Encoding and Transport April 1999 - - -9.5 Print-URI Request - - The following is an example of Print-URI request with copies and - job-name parameters: - - Octets Symbolic Value Protocol field - - 0x0100 1.0 version-number - - Octets Symbolic Value Protocol field - 0x0003 Print-URI operation-id - 0x00000001 1 request-id - 0x01 start operation-attributes operation-attributes-tag - 0x47 charset type value-tag - 0x0012 name-length - attributes- attributes-charset name - charset - 0x0008 value-length - us-ascii US-ASCII value - 0x48 natural-language type value-tag - 0x001B name-length - attributes- attributes-natural-language name - natural- - language - 0x0005 value-length - en-us en-US value - 0x45 uri type value-tag - 0x000B name-length - printer-uri printer-uri name - 0x001A value-length - http://forest printer pinetree value - :631/pinetree - 0x45 uri type value-tag - 0x000C name-length - document-uri document-uri name - 0x11 value-length - ftp://foo.com ftp://foo.com/foo value - /foo - 0x42 nameWithoutLanguage type value-tag - 0x0008 name-length - job-name job-name name - 0x0006 value-length - foobar foobar value - 0x02 start job-attributes job-attributes-tag - 0x21 integer type value-tag - 0x0006 name-length - copies copies name - 0x0004 value-length - - - -Herriot, et al. Experimental [Page 30] - -RFC 2565 IPP/1.0: Encoding and Transport April 1999 - - - 0x00000001 1 value - 0x03 end-of-attributes end-of-attributes-tag - -9.6 Create-Job Request - - The following is an example of Create-Job request with no parameters - and no attributes: - - Octets Symbolic Value Protocol field - 0x0100 1.0 version-number - 0x0005 Create-Job operation-id - 0x00000001 1 request-id - 0x01 start operation-attributes operation-attributes-tag - 0x47 charset type value-tag - 0x0012 name-length - - Octets Symbolic Value Protocol field - attributes- attributes-charset name - charset - 0x0008 value-length - us-ascii US-ASCII value - 0x48 natural-language type value-tag - 0x001B name-length - attributes- attributes-natural-language name - natural- - language - 0x0005 value-length - en-us en-US value - 0x45 uri type value-tag - 0x000B name-length - printer-uri printer-uri name - 0x001A value-length - http://forest: printer pinetree value - 631/pinetree - 0x03 end-of-attributes end-of-attributes-tag - -9.7 Get-Jobs Request - - The following is an example of Get-Jobs request with parameters but - no attributes: - - Octets Symbolic Value Protocol field - - 0x0100 1.0 version-number - 0x000A Get-Jobs operation-id - 0x00000123 0x123 request-id - 0x01 start operation-attributes operation-attributes-tag - 0x47 charset type value-tag - - - -Herriot, et al. Experimental [Page 31] - -RFC 2565 IPP/1.0: Encoding and Transport April 1999 - - - Octets Symbolic Value Protocol field - - 0x0012 name-length - attributes- attributes-charset name - charset - 0x0008 value-length - us-ascii US-ASCII value - 0x48 natural-language type value-tag - 0x001B name-length - attributes- attributes-natural-language name - natural- - language - 0x0005 value-length - en-us en-US value - 0x45 uri type value-tag - 0x000B name-length - printer-uri printer-uri name - 0x001A value-length - http://forest:6 printer pinetree value - 31/pinetree - 0x21 integer type value-tag - 0x0005 name-length - limit limit name - 0x0004 value-length - 0x00000032 50 value - 0x44 keyword type value-tag - 0x0014 name-length - requested- requested-attributes name - attributes - 0x0006 value-length - job-id job-id value - 0x44 keyword type value-tag - 0x0000 additional value name-length - 0x0008 value-length - job-name job-name value - 0x44 keyword type value-tag - 0x0000 additional value name-length - 0x000F value-length - document-format document-format value - 0x03 end-of-attributes end-of-attributes-tag - -9.8 Get-Jobs Response - - The following is an of Get-Jobs response from previous request with 3 - jobs. The Printer returns no information about the second job - (because of security reasons): - - - - - -Herriot, et al. Experimental [Page 32] - -RFC 2565 IPP/1.0: Encoding and Transport April 1999 - - - Octets Symbolic Value Protocol field - - 0x0100 1.0 version-number - 0x0000 successful-ok status-code - 0x00000123 0x123 request-id (echoed - back) - 0x01 start operation-attributes operation-attribute-tag - 0x47 charset type value-tag - 0x0012 name-length - attributes- attributes-charset name - charset - 0x000A value-length - ISO-8859-1 ISO-8859-1 value - 0x48 natural-language type value-tag - 0x001B name-length - attributes- attributes-natural-language name - natural- - language - 0x0005 value-length - en-us en-US value - 0x41 textWithoutLanguage type value-tag - 0x000E name-length - status-message status-message name - 0x000D value-length - successful-ok successful-ok value - 0x02 start job-attributes (1st job-attributes-tag - object) - 0x21 integer type value-tag - 0x0006 name-length - job-id job-id name - 0x0004 value-length - 147 147 value - 0x36 nameWithLanguage value-tag - 0x0008 name-length - job-name job-name name - 0x000C value-length - 0x0005 sub-value-length - fr-ca fr-CA value - 0x0003 sub-value-length - fou fou name - 0x02 start job-attributes (2nd job-attributes-tag - object) - 0x02 start job-attributes (3rd job-attributes-tag - object) - 0x21 integer type value-tag - 0x0006 name-length - job-id job-id name - 0x0004 value-length - - - -Herriot, et al. Experimental [Page 33] - -RFC 2565 IPP/1.0: Encoding and Transport April 1999 - - - Octets Symbolic Value Protocol field - - 148 148 value - 0x36 nameWithLanguage value-tag - 0x0008 name-length - job-name job-name name - 0x0012 value-length - 0x0005 sub-value-length - de-CH de-CH value - 0x0009 sub-value-length - isch guet isch guet name - 0x03 end-of-attributes end-of-attributes-tag - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Herriot, et al. Experimental [Page 34] - -RFC 2565 IPP/1.0: Encoding and Transport April 1999 - - -10. Appendix C: Registration of MIME Media Type Information for - "application/ipp" - - This appendix contains the information that IANA requires for - registering a MIME media type. The information following this - paragraph will be forwarded to IANA to register application/ipp whose - contents are defined in Section 3 "Encoding of the Operation Layer" - in this document: - - MIME type name: application - - MIME subtype name: ipp - - A Content-Type of "application/ipp" indicates an Internet Printing - Protocol message body (request or response). Currently there is one - version: IPP/1.0, whose syntax is described in Section 3 "Encoding of - the Operation Layer" of [RFC2565], and whose semantics are described - in [RFC2566]. - - Required parameters: none - - Optional parameters: none - - Encoding considerations: - - IPP/1.0 protocol requests/responses MAY contain long lines and ALWAYS - contain binary data (for example attribute value lengths). - - Security considerations: - - IPP/1.0 protocol requests/responses do not introduce any security - risks not already inherent in the underlying transport protocols. - Protocol mixed-version interworking rules in [RFC2566] as well as - protocol encoding rules in [RFC2565] are complete and unambiguous. - - Interoperability considerations: - - IPP/1.0 requests (generated by clients) and responses (generated by - servers) MUST comply with all conformance requirements imposed by the - normative specifications [RFC2566] and [RFC2565]. Protocol encoding - rules specified in [RFC2565] are comprehensive, so that - interoperability between conforming implementations is guaranteed - (although support for specific optional features is not ensured). - Both the "charset" and "natural-language" of all IPP/1.0 attribute - values which are a LOCALIZED-STRING are explicit within IPP protocol - requests/responses (without recourse to any external information in - HTTP, SMTP, or other message transport headers). - - - - -Herriot, et al. Experimental [Page 35] - -RFC 2565 IPP/1.0: Encoding and Transport April 1999 - - - Published specification: - - [RFC2566] Isaacson, S., deBry, R., Hastings, T., Herriot, R. and P. - Powell, "Internet Printing Protocol/1.0: Model and - Semantics" RFC 2566, April 1999. - - [RFC2565] Herriot, R., Butler, S., Moore, P., Tuner, R., "Internet - Printing Protocol/1.0: Encoding and Transport", RFC 2565, - April 1999. - - Applications which use this media type: - - Internet Printing Protocol (IPP) print clients and print servers, - communicating using HTTP/1.1 (see [RFC2565]), SMTP/ESMTP, FTP, or - other transport protocol. Messages of type "application/ipp" are - self-contained and transport-independent, including "charset" and - "natural-language" context for any LOCALIZED-STRING value. - - Person & email address to contact for further information: - - Scott A. Isaacson - Novell, Inc. - 122 E 1700 S - Provo, UT 84606 - - Phone: 801-861-7366 - Fax: 801-861-4025 - Email: sisaacson@novell.com - - or - - Robert Herriot (Editor) - Xerox Corporation - 3400 Hillview Ave., Bldg #1 - Palo Alto, CA 94304 - - Phone: 650-813-7696 - Fax: 650-813-6860 - EMail: rherriot@pahv.xerox.com - - - - - - - - - - - - -Herriot, et al. Experimental [Page 36] - -RFC 2565 IPP/1.0: Encoding and Transport April 1999 - - -11. Full Copyright Statement - - Copyright (C) The Internet Society (1999). All Rights Reserved. - - This document and translations of it may be copied and furnished to - others, and derivative works that comment on or otherwise explain it - or assist in its implementation may be prepared, copied, published - and distributed, in whole or in part, without restriction of any - kind, provided that the above copyright notice and this paragraph are - included on all such copies and derivative works. However, this - document itself may not be modified in any way, such as by removing - the copyright notice or references to the Internet Society or other - Internet organizations, except as needed for the purpose of - developing Internet standards in which case the procedures for - copyrights defined in the Internet Standards process must be - followed, or as required to translate it into languages other than - English. - - The limited permissions granted above are perpetual and will not be - revoked by the Internet Society or its successors or assigns. - - This document and the information contained herein is provided on an - "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING - TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING - BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION - HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF - MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - - - - - - - - - - - - - - - - - - - - - - - - -Herriot, et al. Experimental [Page 37] - diff --git a/standards/rfc2566.txt b/standards/rfc2566.txt deleted file mode 100644 index f373d6a0f..000000000 --- a/standards/rfc2566.txt +++ /dev/null @@ -1,9691 +0,0 @@ - - - - - - -Network Working Group R. deBry -Request for Comments: 2566 Utah Valley State College -Category: Experimental T. Hastings - Xerox Corporation - R. Herriot - Xerox Corporation - S. Isaacson - Novell, Inc. - P. Powell - Astart Technologies - April 1999 - - - Internet Printing Protocol/1.0: Model and Semantics - -Status of this Memo - - This memo defines an Experimental Protocol for the Internet - community. It does not specify an Internet standard of any kind. - Discussion and suggestions for improvement are requested. - Distribution of this memo is unlimited. - -Copyright Notice - - Copyright (C) The Internet Society (1999). All Rights Reserved. - -IESG Note - - This document defines an Experimental protocol for the Internet - community. The IESG expects that a revised version of this protocol - will be published as Proposed Standard protocol. The Proposed - Standard, when published, is expected to change from the protocol - defined in this memo. In particular, it is expected that the - standards-track version of the protocol will incorporate strong - authentication and privacy features, and that an "ipp:" URL type will - be defined which supports those security measures. Other changes to - the protocol are also possible. Implementors are warned that future - versions of this protocol may not interoperate with the version of - IPP defined in this document, or if they do interoperate, that some - protocol features may not be available. - - The IESG encourages experimentation with this protocol, especially in - combination with Transport Layer Security (TLS) [RFC 2246], to help - determine how TLS may effectively be used as a security layer for - IPP. - - - - - - -deBry, et al. Experimental [Page 1] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - -Abstract - - This document is one of a set of documents, which together describe - all aspects of a new Internet Printing Protocol (IPP). IPP is an - application level protocol that can be used for distributed printing - using Internet tools and technologies. This document describes a - simplified model consisting of abstract objects, their attributes, - and their operations that is independent of encoding and transport. - The model consists of a Printer and a Job object. A Job optionally - supports multiple documents. IPP 1.0 semantics allow end-users and - operators to query printer capabilities, submit print jobs, inquire - about the status of print jobs and printers, and cancel print jobs. - This document also addresses security, internationalization, and - directory issues. - - The full set of IPP documents includes: - - Design Goals for an Internet Printing Protocol [RFC2567] - Rationale for the Structure and Model and Protocol for the Internet - Printing Protocol [RFC2568] - Internet Printing Protocol/1.0: Model and Semantics (this document) - Internet Printing Protocol/1.0: Encoding and Transport [RFC2565] - Internet Printing Protocol/1.0: Implementer's Guide [ipp-iig] - Mapping between LPD and IPP Protocols [RFC2569] - - The "Design Goals for an Internet Printing Protocol" document takes a - broad look at distributed printing functionality, and it enumerates - real-life scenarios that help to clarify the features that need to be - included in a printing protocol for the Internet. It identifies - requirements for three types of users: end users, operators, and - administrators. It calls out a subset of end user requirements that - are satisfied in IPP/1.0. Operator and administrator requirements - are out of scope for version 1.0. - - The "Rationale for the Structure and Model and Protocol for the - Internet Printing Protocol" document describes IPP from a high level - view, defines a roadmap for the various documents that form the suite - of IPP specifications, and gives background and rationale for the - IETF working group's major decisions. - - The "Internet Printing Protocol/1.0: Encoding and Transport" document - is a formal mapping of the abstract operations and attributes defined - in the model document onto HTTP/1.1. It defines the encoding rules - for a new Internet media type called "application/ipp". - - The "Internet Printing Protocol/1.0: Implementer's Guide" document - gives insight and advice to implementers of IPP clients and IPP - objects. It is intended to help them understand IPP/1.0 and some of - - - -deBry, et al. Experimental [Page 2] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - the considerations that may assist them in the design of their client - and/or IPP object implementations. For example, a typical order of - processing requests is given, including error checking. Motivation - for some of the specification decisions is also included. - - The "Mapping between LPD and IPP Protocols" document gives some - advice to implementers of gateways between IPP and LPD (Line Printer - Daemon) implementations. - -Table of Contents - -1. Introduction 8 - 1.1 Simplified Printing Model 9 -2. IPP Objects 11 - 2.1 Printer Object 12 - 2.2 Job Object 14 - 2.3 Object Relationships 14 - 2.4 Object Identity 15 -3. IPP Operations 18 - 3.1 Common Semantics 19 - 3.1.1 Required Parameters 19 - 3.1.2 Operation IDs and Request IDs 20 - 3.1.3 Attributes 20 - 3.1.4 Character Set and Natural Language Operation Attributes 22 - 3.1.4.1 Request Operation Attributes 22 - 3.1.4.2 Response Operation Attributes 26 - 3.1.5 Operation Targets 28 - 3.1.6 Operation Status Codes and Messages 29 - 3.1.7 Versions 30 - 3.1.8 Job Creation Operations 32 - 3.2 Printer Operations 34 - 3.2.1 Print-Job Operation 34 - 3.2.1.1 Print-Job Request 34 - 3.2.1.2 Print-Job Response 38 - 3.2.2 Print-URI Operation 41 - 3.2.3 Validate-Job Operation 42 - 3.2.4 Create-Job Operation 42 - 3.2.5 Get-Printer-Attributes Operation 43 - 3.2.5.1 Get-Printer-Attributes Request 44 - 3.2.5.2 Get-Printer-Attributes Response 46 - 3.2.6 Get-Jobs Operation 47 - 3.2.6.1 Get-Jobs Request 47 - 3.2.6.2 Get-Jobs Response 49 - 3.3 Job Operations 50 - 3.3.1 Send-Document Operation 50 - 3.3.1.1 Send-Document Request 51 - 3.3.1.2 Send-Document Response 53 - 3.3.2 Send-URI Operation 54 - - - -deBry, et al. Experimental [Page 3] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - 3.3.3 Cancel-Job Operation 54 - 3.3.3.1 Cancel-Job Request 54 - 3.3.3.2 Cancel-Job Response 55 - 3.3.4 Get-Job-Attributes Operation 56 - 3.3.4.1 Get-Job-Attributes Request 57 - 3.3.4.2 Get-Job-Attributes Response 57 -4. Object Attributes 58 - 4.1 Attribute Syntaxes 59 - 4.1.1 'text' 60 - 4.1.1.1 'textWithoutLanguage' 61 - 4.1.1.2 'textWithLanguage' 61 - 4.1.2 'name' 62 - 4.1.2.1 'nameWithoutLanguage' 62 - 4.1.2.2 'nameWithLanguage' 63 - 4.1.2.3 Matching 'name' attribute values 63 - 4.1.3 'keyword' 64 - 4.1.4 'enum' 65 - 4.1.5 'uri' 65 - 4.1.6 'uriScheme' 65 - 4.1.7 'charset' 66 - 4.1.8 'naturalLanguage' 67 - 4.1.9 'mimeMediaType' 67 - 4.1.10 'octetString' 69 - 4.1.11 'boolean' 69 - 4.1.12 'integer' 69 - 4.1.13 'rangeOfInteger' 69 - 4.1.14 'dateTime' 69 - 4.1.15 'resolution' 69 - 4.1.16 '1setOf X' 70 - 4.2 Job Template Attributes 70 - 4.2.1 job-priority (integer(1:100)) 74 - 4.2.2 job-hold-until (type3 keyword | name (MAX)) 75 - 4.2.3 job-sheets (type3 keyword | name(MAX)) 75 - 4.2.4 multiple-document-handling (type2 keyword) 76 - 4.2.5 copies (integer(1:MAX)) 77 - 4.2.6 finishings (1setOf type2 enum) 78 - 4.2.7 page-ranges (1setOf rangeOfInteger (1:MAX)) 79 - 4.2.8 sides (type2 keyword) 80 - 4.2.9 number-up (integer(1:MAX)) 80 - 4.2.10 orientation-requested (type2 enum) 81 - 4.2.11 media (type3 keyword | name(MAX)) 82 - 4.2.12 printer-resolution (resolution) 83 - 4.2.13 print-quality (type2 enum) 83 - 4.3 Job Description Attributes 84 - 4.3.1 job-uri (uri) 85 - 4.3.2 job-id (integer(1:MAX)) 85 - 4.3.3 job-printer-uri (uri) 86 - 4.3.4 job-more-info (uri) 86 - - - -deBry, et al. Experimental [Page 4] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - 4.3.5 job-name (name(MAX)) 86 - 4.3.6 job-originating-user-name (name(MAX)) 86 - 4.3.7 job-state (type1 enum) 87 - 4.3.8 job-state-reasons (1setOf type2 keyword) 90 - 4.3.9 job-state-message (text(MAX)) 92 - 4.3.10 number-of-documents (integer(0:MAX)) 93 - 4.3.11 output-device-assigned (name(127)) 93 - 4.3.12 time-at-creation (integer(0:MAX)) 93 - 4.3.13 time-at-processing (integer(0:MAX)) 93 - 4.3.14 time-at-completed (integer(0:MAX)) 94 - 4.3.15 number-of-intervening-jobs (integer(0:MAX)) 94 - 4.3.16 job-message-from-operator (text(127)) 94 - 4.3.17 job-k-octets (integer(0:MAX)) 94 - 4.3.18 job-impressions (integer(0:MAX)) 95 - 4.3.19 job-media-sheets (integer(0:MAX)) 95 - 4.3.20 job-k-octets-processed (integer(0:MAX)) 96 - 4.3.21 job-impressions-completed (integer(0:MAX)) 96 - 4.3.22 job-media-sheets-completed (integer(0:MAX)) 96 - 4.3.23 attributes-charset (charset) 97 - 4.3.24 attributes-natural-language (naturalLanguage) 97 - 4.4 Printer Description Attributes 97 - 4.4.1 printer-uri-supported (1setOf uri) 99 - 4.4.2 uri-security-supported (1setOf type2 keyword) 100 - 4.4.3 printer-name (name(127)) 101 - 4.4.4 printer-location (text(127)) 101 - 4.4.5 printer-info (text(127)) 101 - 4.4.6 printer-more-info (uri) 101 - 4.4.7 printer-driver-installer (uri) 102 - 4.4.8 printer-make-and-model (text(127)) 102 - 4.4.9 printer-more-info-manufacturer (uri) 102 - 4.4.10 printer-state (type1 enum) 102 - 4.4.11 printer-state-reasons (1setOf type2 keyword) 103 - 4.4.12 printer-state-message (text(MAX)) 106 - 4.4.13 operations-supported (1setOf type2 enum) 106 - 4.4.14 charset-configured (charset) 107 - 4.4.15 charset-supported (1setOf charset) 107 - 4.4.16 natural-language-configured (naturalLanguage) 107 - 4.4.17 generated-natural-language-supported(1setOf naturalLanguage108 - 4.4.18 document-format-default (mimeMediaType) 108 - 4.4.19 document-format-supported (1setOf mimeMediaType) 108 - 4.4.20 printer-is-accepting-jobs (boolean) 109 - 4.4.21 queued-job-count (integer(0:MAX)) 109 - 4.4.22 printer-message-from-operator (text(127)) 109 - 4.4.23 color-supported (boolean) 109 - 4.4.24 reference-uri-schemes-supported (1setOf uriScheme) 109 - 4.4.25 pdl-override-supported (type2 keyword) 110 - 4.4.26 printer-up-time (integer(1:MAX)) 110 - 4.4.27 printer-current-time (dateTime) 111 - - - -deBry, et al. Experimental [Page 5] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - 4.4.28 multiple-operation-time-out (integer(1:MAX)) 111 - 4.4.29 compression-supported (1setOf type3 keyword) 111 - 4.4.30 job-k-octets-supported (rangeOfInteger(0:MAX)) 112 - 4.4.31 job-impressions-supported (rangeOfInteger(0:MAX)) 112 - 4.4.32 job-media-sheets-supported (rangeOfInteger(0:MAX)) 112 -5. Conformance 112 - 5.1 Client Conformance Requirements 112 - 5.2 IPP Object Conformance Requirements 113 - 5.2.1 Objects 113 - 5.2.2 Operations 113 - 5.2.3 IPP Object Attributes 114 - 5.2.4 Extensions 114 - 5.2.5 Attribute Syntaxes 115 - 5.3 Charset and Natural Language Requirements 115 - 5.4 Security Conformance Requirements 115 -6. IANA Considerations (registered and private extensions) 116 - 6.1 Typed 'keyword' and 'enum' Extensions 116 - 6.2 Attribute Extensibility 119 - 6.3 Attribute Syntax Extensibility 119 - 6.4 Operation Extensibility 120 - 6.5 Attribute Groups 120 - 6.6 Status Code Extensibility 120 - 6.7 Registration of MIME types/sub-types for document-formats 121 - 6.8 Registration of charsets for use in 'charset' attribute values121 -7. Internationalization Considerations 121 -8. Security Considerations 125 - 8.1 Security Scenarios 126 - 8.1.1 Client and Server in the Same Security Domain 126 - 8.1.2 Client and Server in Different Security Domains 126 - 8.1.3 Print by Reference 127 - 8.2 URIs for SSL3 and non-SSL3 Access 127 - 8.3 The "requesting-user-name" (name(MAX)) Operation Attribute 127 - 8.4 Restricted Queries 129 - 8.5 Queries on jobs submitted using non-IPP protocols 129 - 8.6 IPP Security Application Profile for SSL3 130 -9. References 131 -10. Authors' Addresses 134 -11. Formats for IPP Registration Proposals 136 - 11.1 Type2 keyword attribute values registration 136 - 11.2 Type3 keyword attribute values registration 137 - 11.3 Type2 enum attribute values registration 137 - 11.4 Type3 enum attribute values registration 137 - 11.5 Attribute registration 138 - 11.6 Attribute Syntax registration 138 - 11.7 Operation registration 139 - 11.8 Attribute Group registration 139 - 11.9 Status code registration 139 -12.APPENDIX A: Terminology 141 - - - -deBry, et al. Experimental [Page 6] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - 12.1 Conformance Terminology 141 - 12.1.1 NEED NOT 141 - 12.2 Model Terminology 141 - 12.2.1 Keyword 141 - 12.2.2 Attributes 141 - 12.2.2.1 Attribute Name 141 - 12.2.2.2 Attribute Group Name 142 - 12.2.2.3 Attribute Value 142 - 12.2.2.4 Attribute Syntax 142 - 12.2.3 Supports 142 - 12.2.4 print-stream page 144 - 12.2.5 impression 144 -13.APPENDIX B: Status Codes and Suggested Status Code Messages 145 - 13.1 Status Codes 146 - 13.1.1 Informational 146 - 13.1.2 Successful Status Codes 146 - 13.1.2.1 successful-ok (0x0000) 146 - 13.1.2.2 successful-ok-ignored-or-substituted-attributes (0x0001) 146 - 13.1.2.3 successful-ok-conflicting-attributes (0x0002) 147 - 13.1.3 Redirection Status Codes 147 - 13.1.4 Client Error Status Codes 147 - 13.1.4.1 client-error-bad-request (0x0400) 147 - 13.1.4.2 client-error-forbidden (0x0401) 147 - 13.1.4.3 client-error-not-authenticated (0x0402) 148 - 13.1.4.4 client-error-not-authorized (0x0403) 148 - 13.1.4.5 client-error-not-possible (0x0404) 148 - 13.1.4.6 client-error-timeout (0x0405) 148 - 13.1.4.7 client-error-not-found (0x0406) 149 - 13.1.4.8 client-error-gone (0x0407) 149 - 13.1.4.9 client-error-request-entity-too-large (0x0408) 149 - 13.1.4.10client-error-request-value-too-long (0x0409) 150 - 13.1.4.11client-error-document-format-not-supported (0x040A) 150 - 13.1.4.12client-error-attributes-or-values-not-supported (0x040B) 150 - 13.1.4.13client-error-uri-scheme-not-supported (0x040C) 151 - 13.1.4.14client-error-charset-not-supported (0x040D) 151 - 13.1.4.15client-error-conflicting-attributes (0x040E) 151 - 13.1.5 Server Error Status Codes 151 - 13.1.5.1 server-error-internal-error (0x0500) 151 - 13.1.5.2 server-error-operation-not-supported (0x0501) 152 - 13.1.5.3 server-error-service-unavailable (0x0502) 152 - 13.1.5.4 server-error-version-not-supported (0x0503) 152 - 13.1.5.5 server-error-device-error (0x0504) 152 - 13.1.5.6 server-error-temporary-error (0x0505) 153 - 13.1.5.7 server-error-not-accepting-jobs (0x0506) 153 - 13.1.5.8 server-error-busy (0x0507) 153 - 13.1.5.9 server-error-job-canceled (0x0508) 153 - 13.2 Status Codes for IPP Operations 153 -14.APPENDIX C: "media" keyword values 155 - - - -deBry, et al. Experimental [Page 7] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - -15.APPENDIX D: Processing IPP Attributes 160 - 15.1 Fidelity 160 - 15.2 Page Description Language (PDL) Override 161 - 15.3 Using Job Template Attributes During Document Processing. 163 -16.APPENDIX E: Generic Directory Schema 166 -17.APPENDIX F: Change History for the Model and Semantics document 168 -18.FULL COPYRIGHT STATEMENT 173 - -1. Introduction - - The Internet Printing Protocol (IPP) is an application level protocol - that can be used for distributed printing using Internet tools and - technologies. IPP version 1.0 (IPP/1.0) focuses only on end user - functionality. This document is just one of a suite of documents - that fully define IPP. The full set of IPP documents includes: - - Design Goals for an Internet Printing Protocol [RFC2567] - Rationale for the Structure and Model and Protocol for the Internet - Printing Protocol [RFC2568] - Internet Printing Protocol/1.0: Model and Semantics (this document) - Internet Printing Protocol/1.0: Encoding and Transport [RFC2565] - Internet Printing Protocol/1.0: Implementer's Guide [ipp-iig] - Mapping between LPD and IPP Protocols [RFC2569] - - Anyone reading these documents for the first time is strongly - encouraged to read the IPP documents in the above order. - - This document is laid out as follows: - - - The rest of Section 1 is an introduction to the IPP simplified - model for distributed printing. - - Section 2 introduces the object types covered in the model with - their basic behaviors, attributes, and interactions. - - Section 3 defines the operations included in IPP/1.0. IPP - operations are synchronous, therefore, for each operation, there - is a both request and a response. - - Section 4 defines the attributes (and their syntaxes) that are - used in the model. - - Sections 5 - 6 summarizes the implementation conformance - requirements for objects that support the protocol and IANA - considerations, respectively. - - Sections 7 - 11 cover the Internationalization and Security - considerations as well as References, Author contact information, - and Formats for Registration Proposals. - - Sections 12 - 14 are appendices that cover Terminology, Status - Codes and Messages, and "media" keyword values. - - - - - -deBry, et al. Experimental [Page 8] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - Note: This document uses terms such as "attributes", - "keywords", and "support". These terms have special - meaning and are defined in the model terminology section - 12.2. Capitalized terms, such as MUST, MUST NOT, REQUIRED, - SHOULD, SHOULD NOT, MAY, NEED NOT, and OPTIONAL, have - special meaning relating to conformance. These terms are - defined in section 12.1 on conformance terminology, most of - which is taken from RFC 2119 [RFC2119]. - - - Section 15 is an appendix that helps to clarify the effects of - interactions between related attributes and their values. - - Section 16 is an appendix that enumerates the subset of Printer - attributes that form a generic directory schema. These - attributes are useful when registering a Printer so that a - client can find the Printer not just by name, but by filtered - searches as well. - - Section 17 is an appendix that provides a Change History - summarizing the clarification and changes that might affect an - implementation since the June 30, 1998 draft. - -1.1 Simplified Printing Model - - In order to achieve its goal of realizing a workable printing - protocol for the Internet, the Internet Printing Protocol (IPP) is - based on a simplified printing model that abstracts the many - components of real world printing solutions. The Internet is a - distributed computing environment where requesters of print services - (clients, applications, printer drivers, etc.) cooperate and interact - with print service providers. This model and semantics document - describes a simple, abstract model for IPP even though the underlying - configurations may be complex "n-tier" client/server systems. An - important simplifying step in the IPP model is to expose only the key - objects and interfaces required for printing. The model described in - this model document does not include features, interfaces, and - relationships that are beyond the scope of the first version of IPP - (IPP/1.0). IPP/1.0 incorporates many of the relevant ideas and - lessons learned from other specification and development efforts - [HTPP] [ISO10175] [LDPA] [P1387.4] [PSIS] [RFC1179] [SWP]. IPP is - heavily influenced by the printing model introduced in the Document - Printing Application (DPA) [ISO10175] standard. Although DPA - specifies both end user and administrative features, IPP version 1.0 - (IPP/1.0) focuses only on end user functionality. - - The IPP/1.0 model encapsulates the important components of - distributed printing into two object types: - - - Printer (Section 2.1) - - Job (Section 2.2) - - - -deBry, et al. Experimental [Page 9] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - Each object type has an associated set of operations (see section 3) - and attributes (see section 4). - - It is important, however, to understand that in real system - implementations (which lie underneath the abstracted IPP/1.0 model), - there are other components of a print service which are not - explicitly defined in the IPP/1.0 model. The following figure - illustrates where IPP/1.0 fits with respect to these other - components. - - +--------------+ - | Application | - o +. . . . . . . | - \|/ | Spooler | - / \ +. . . . . . . | +---------+ - End-User | Print Driver |---| File | - +-----------+ +-----+ +------+-------+ +----+----+ - | Browser | | GUI | | | - +-----+-----+ +--+--+ | | - | | | | - | +---+------------+---+ | - N D S | | IPP Client |------------+ - O I E | +---------+----------+ - T R C | | - I E U | - F C R -------------- Transport ------------------ - I T I - C O T | --+ - A R Y +--------+--------+ | - T Y | IPP Server | | - I +--------+--------+ | - O | | - N +-----------------+ | IPP Printer - | Print Service | | - +-----------------+ | - | --+ - +-----------------+ - | Output Device(s)| - +-----------------+ - - An IPP Printer object encapsulates the functions normally associated - with physical output devices along with the spooling, scheduling and - multiple device management functions often associated with a print - server. Printer objects are optionally registered as entries in a - directory where end users find and select them based on some sort of - filtered and context based searching mechanism (see section 16). The - directory is used to store relatively static information about the - Printer, allowing end users to search for and find Printers that - - - -deBry, et al. Experimental [Page 10] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - match their search criteria, for example: name, context, printer - capabilities, etc. The more dynamic information, such as state, - currently loaded and ready media, number of jobs at the Printer, - errors, warnings, and so forth, is directly associated with the - Printer object itself rather than with the entry in the directory - which only represents the Printer object. - - IPP clients implement the IPP protocol on the client side and give - end users (or programs running on behalf of end users) the ability to - query Printer objects and submit and manage print jobs. An IPP - server is just that part of the Printer object that implements the - server-side protocol. The rest of the Printer object implements (or - gateways into) the application semantics of the print service itself. - The Printer objects may be embedded in an output device or may be - implemented on a host on the network that communicates with an output - device. - - When a job is submitted to the Printer object and the Printer object - validates the attributes in the submission request, the Printer - object creates a new Job object. The end user then interacts with - this new Job object to query its status and monitor the progress of - the job. End users may also cancel the print job by using the Job - object's Cancel-Job operation. The notification service is out of - scope for IPP/1.0, but using such a notification service, the end - user is able to register for and receive Printer specific and Job - specific events. An end user can query the status of Printer objects - and can follow the progress of Job objects by polling using the Get- - Printer-Attributes, Get-Jobs, and Get-Job-Attributes operations. - -2. IPP Objects - - The IPP/1.0 model introduces objects of type Printer and Job. Each - type of object models relevant aspects of a real-world entity such as - a real printer or real print job. Each object type is defined as a - set of possible attributes that may be supported by instances of that - object type. For each object (instance), the actual set of supported - attributes and values describe a specific implementation. The - object's attributes and values describe its state, capabilities, - realizable features, job processing functions, and default behaviors - and characteristics. For example, the Printer object type is defined - as a set of attributes that each Printer object potentially supports. - In the same manner, the Job object type is defined as a set of - attributes that are potentially supported by each Job object. - - Each attribute included in the set of attributes defining an object - type is labeled as: - - - - - -deBry, et al. Experimental [Page 11] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - - "REQUIRED": each object MUST support the attribute. - - "OPTIONAL": each object MAY support the attribute. - - There is no such similar labeling of attribute values. However, if - an implementation supports an attribute, it MUST support at least one - of the possible values for that attribute. - -2.1 Printer Object - - The major component of the IPP/1.0 model is the Printer object. A - Printer object implements the server-side of the IPP/1.0 protocol. - Using the protocol, end users may query the attributes of the Printer - object and submit print jobs to the Printer object. The actual - implementation components behind the Printer abstraction may take on - different forms and different configurations. However, the model - abstraction allows the details of the configuration of real - components to remain opaque to the end user. Section 3 describes - each of the Printer operations in detail. - - The capabilities and state of a Printer object are described by its - attributes. Printer attributes are divided into two groups: - - - "job-template" attributes: These attributes describe supported - job processing capabilities and defaults for the Printer object. - (See section 4.2) - - "printer-description" attributes: These attributes describe the - Printer object's identification, state, location, references to - other sources of information about the Printer object, etc. (see - section 4.4) - - Since a Printer object is an abstraction of a generic document output - device and print service provider, a Printer object could be used to - represent any real or virtual device with semantics consistent with - the Printer object, such as a fax device, an imager, or even a CD - writer. - - Some examples of configurations supporting a Printer object include: - - 1) An output device with no spooling capabilities - 2) An output device with a built-in spooler - 3) A print server supporting IPP with one or more associated output - devices - 3a) The associated output devices may or may not be capable of - spooling jobs - 3b) The associated output devices may or may not support IPP - - - - - - -deBry, et al. Experimental [Page 12] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - The following figures show some examples of how Printer objects can - be realized on top of various distributed printing configurations. - The embedded case below represents configurations 1 and 2. The hosted - and fan-out figures below represent configurations 3a and 3b. - - Legend: - - ##### indicates a Printer object which is - either embedded in an output device or is - hosted in a server. The Printer object - might or might not be capable of queuing/spooling. - - any indicates any network protocol or direct - connect, including IPP - - - embedded printer: - output device - +---------------+ - O +--------+ | ########### | - /|\ | client |------------IPP------------># Printer # | - / \ +--------+ | # Object # | - | ########### | - +---------------+ - - - hosted printer: - +---------------+ - O +--------+ ########### | | - /|\ | client |--IPP--># Printer #-any->| output device | - / \ +--------+ # Object # | | - ########### +---------------+ - - - - +---------------+ - fan out: | | - +-->| output device | - any/ | | - O +--------+ ########### / +---------------+ - /|\ | client |-IPP-># Printer #--* - / \ +--------+ # Object # \ +---------------+ - ########### any\ | | - +-->| output device | - | | - +---------------+ - - - - - -deBry, et al. Experimental [Page 13] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - -2.2 Job Object - - A Job object is used to model a print job. A Job object contains - documents. The information required to create a Job object is sent - in a create request from the end user via an IPP Client to the - Printer object. The Printer object validates the create request, and - if the Printer object accepts the request, the Printer object creates - the new Job object. Section 3 describes each of the Job operations - in detail. - - The characteristics and state of a Job object are described by its - attributes. Job attributes are grouped into two groups as follows: - - - "job-template" attributes: These attributes can be supplied by - the client or end user and include job processing instructions - which are intended to override any Printer object defaults and/or - instructions embedded within the document data. (See section 4.2) - - "job-description" attributes: These attributes describe the Job - object's identification, state, size, etc. The client supplies - some of these attributes, and the Printer object generates others. - (See section 4.3) - - An implementation MUST support at least one document per Job object. - An implementation MAY support multiple documents per Job object. A - document is either: - - - a stream of document data in a format supported by the Printer - object (typically a Page Description Language - PDL), or - - a reference to such a stream of document data - - In IPP/1.0, a document is not modeled as an IPP object, therefore it - has no object identifier or associated attributes. All job - processing instructions are modeled as Job object attributes. These - attributes are called Job Template attributes and they apply equally - to all documents within a Job object. - -2.3 Object Relationships - - IPP objects have relationships that are maintained persistently along - with the persistent storage of the object attributes. - - A Printer object can represent either one or more physical output - devices or a logical device which "processes" jobs but never actually - uses a physical output device to put marks on paper. Examples of - logical devices include a Web page publisher or a gateway into an - online document archive or repository. A Printer object contains - zero or more Job objects. - - - - -deBry, et al. Experimental [Page 14] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - A Job object is contained by exactly one Printer object, however the - identical document data associated with a Job object could be sent to - either the same or a different Printer object. In this case, a - second Job object would be created which would be almost identical to - the first Job object, however it would have new (different) Job - object identifiers (see section 2.4). - - A Job object is either empty (before any documents have been added) - or contains one or more documents. If the contained document is a - stream of document data, that stream can be contained in only one - document. However, there can be identical copies of the stream in - other documents in the same or different Job objects. If the - contained document is just a reference to a stream of document data, - other documents (in the same or different Job object(s)) may contain - the same reference. - -2.4 Object Identity - - All Printer and Job objects are identified by a Uniform Resource - Identifier (URI) [RFC2396] so that they can be persistently and - unambiguously referenced. The notion of a URI is a useful concept, - however, until the notion of URI is more stable (i.e., defined more - completely and deployed more widely), it is expected that the URIs - used for IPP objects will actually be URLs [RFC2396]. Since every - URL is a specialized form of a URI, even though the more generic term - URI is used throughout the rest of this document, its usage is - intended to cover the more specific notion of URL as well. - - An administrator configures Printer objects to either support or not - support authentication and/or message privacy using SSL3 [SSL] (the - mechanism for security configuration is outside the scope of - IPP/1.0). In some situations, both types of connections (both - authenticated and unauthenticated) can be established using a single - communication channel that has some sort of negotiation mechanism. - In other situations, multiple communication channels are used, one - for each type of security configuration. Section 8 provides a full - description of all security considerations and configurations. - - If a Printer object supports more than one communication channel, - some or all of those channels might support and/or require different - security mechanisms. In such cases, an administrator could expose - the simultaneous support for these multiple communication channels as - multiple URIs for a single Printer object where each URI represents - one of the communication channels to the Printer object. To support - this flexibility, the IPP Printer object type defines a multi-valued - identification attribute called the "printer-uri-supported" - attribute. It MUST contain at least one URI. It MAY contain more - than one URI. That is, every Printer object will have at least one - - - -deBry, et al. Experimental [Page 15] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - URI that identifies at least one communication channel to the Printer - object, but it may have more than one URI where each URI identifies a - different communication channel to the Printer object. The - "printer-uri-supported" attribute has a companion attribute, the - "uri-security-supported" attribute, that has the same cardinality as - "printer-uri-supported". The purpose of the "uri-security-supported" - attribute is to indicate the security mechanisms (if any) used for - each URI listed in "printer-uri-supported". These two attributes are - fully described in sections 4.4.1 and 4.4.2. - - When a job is submitted to the Printer object via a create request, - the client supplies only a single Printer object URI. The client - supplied Printer object URI MUST be one of the values in the - "printer-uri-supported" Printer attribute. - - Note: IPP/1.0 does not specify how the client obtains the client - supplied URI, but it is RECOMMENDED that a Printer object be - registered as an entry in a directory service. End-users and - programs can then interrogate the directory searching for Printers. - Section 16 defines a generic schema for Printer object entries in the - directory service and describes how the entry acts as a bridge to the - actual IPP Printer object. The entry in the directory that - represents the IPP Printer object includes the possibly many URIs for - that Printer object as values in one its attributes. - - When a client submits a create request to the Printer object, the - Printer object validates the request and creates a new Job object. - The Printer object assigns the new Job object a URI which is stored - in the "job-uri" Job attribute. This URI is then used by clients as - the target for subsequent Job operations. The Printer object - generates a Job URI based on its configured security policy and the - URI used by the client in the create request. - - For example, consider a Printer object that supports both a - communication channel secured by the use of SSL3 (using HTTP over - SSL3 with an "https" schemed URI) and another open communication - channel that is not secured with SSL3 (using a simple "http" schemed - URI). If a client were to submit a job using the secure URI, the - Printer object would assign the new Job object a secure URI as well. - If a client were to submit a job using the open-channel URI, the - Printer would assign the new Job object an open-channel URI. - - In addition, the Printer object also populates the Job object's - "job-printer-uri" attribute. This is a reference back to the Printer - object that created the Job object. If a client only has access to a - Job object's "job-uri" identifier, the client can query the Job's - "job-printer-uri" attribute in order to determine which Printer - object created the Job object. If the Printer object supports more - - - -deBry, et al. Experimental [Page 16] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - than one URI, the Printer object picks the one URI supplied by the - client when creating the job to build the value for and to populate - the Job's "job-printer-uri" attribute. - - Allowing Job objects to have URIs allows for flexibility and - scalability. For example, in some implementations, the Printer - object might create Jobs that are processed in the same local - environment as the Printer object itself. In this case, the Job URI - might just be a composition of the Printer's URI and some unique - component for the Job object, such as the unique 32-bit positive - integer mentioned later in this paragraph. In other implementations, - the Printer object might be a central clearing-house for validating - all Job object creation requests, but the Job object itself might be - created in some environment that is remote from the Printer object. - In this case, the Job object's URI may have no physical-location - relationship at all to the Printer object's URI. Again, the fact - that Job objects have URIs allows for flexibility and scalability, - however, many existing printing systems have local models or - interface constraints that force print jobs to be identified using - only a 32-bit positive integer rather than an independent URI. This - numeric Job ID is only unique within the context of the Printer - object to which the create request was originally submitted. - Therefore, in order to allow both types of client access to IPP Job - objects (either by Job URI or by numeric Job ID), when the Printer - object successfully processes a create request and creates a new Job - object, the Printer object MUST generate both a Job URI and a Job ID. - The Job ID (stored in the "job-id" attribute) only has meaning in the - context of the Printer object to which the create request was - originally submitted. This requirement to support both Job URIs and - Job IDs allows all types of clients to access Printer objects and Job - objects no matter the local constraints imposed on the client - implementation. - - In addition to identifiers, Printer objects and Job objects have - names ("printer-name" and "job-name"). An object name NEED NOT be - unique across all instances of all objects. A Printer object's name - is chosen and set by an administrator through some mechanism outside - the scope of IPP/1.0. A Job object's name is optionally chosen and - supplied by the IPP client submitting the job. If the client does - not supply a Job object name, the Printer object generates a name for - the new Job object. In all cases, the name only has local meaning. - - To summarize: - - - Each Printer object is identified with one or more URIs. The - Printer's "printer-uri-supported" attribute contains the URI(s). - - - - - -deBry, et al. Experimental [Page 17] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - - The Printer object's "uri-security-supported" attribute - identifies the communication channel security protocols that may - or may not have been configured for the various Printer object - URIs (e.g., 'ssl3' or 'none'). - - Each Job object is identified with a Job URI. The Job's "job-uri" - attribute contains the URI. - - Each Job object is also identified with Job ID which is a 32-bit, - positive integer. The Job's "job-id" attribute contains the Job - ID. The Job ID is only unique within the context of the Printer - object which created the Job object. - - Each Job object has a "job-printer-uri" attribute which contains - the URI of the Printer object that was used to create the Job - object. This attribute is used to determine the Printer object - that created a Job object when given only the URI for the Job - object. This linkage is necessary to determine the languages, - charsets, and operations which are supported on that Job (the - basis for such support comes from the creating Printer object). - - Each Printer object has a name (which is not necessarily unique). - The administrator chooses and sets this name through some - mechanism outside the scope of IPP/1.0 itself. The Printer - object's "printer-name" attribute contains the name. - - Each Job object has a name (which is not necessarily unique). The - client optionally supplies this name in the create request. If - the client does not supply this name, the Printer object generates - a name for the Job object. The Job object's "job-name" attribute - contains the name. - -3. IPP Operations - - IPP objects support operations. An operation consists of a request - and a response. When a client communicates with an IPP object, the - client issues an operation request to the URI for that object. - Operation requests and responses have parameters that identify the - operation. Operations also have attributes that affect the run-time - characteristics of the operation (the intended target, localization - information, etc.). These operation-specific attributes are called - operation attributes (as compared to object attributes such as - Printer object attributes or Job object attributes). Each request - carries along with it any operation attributes, object attributes, - and/or document data required to perform the operation. Each request - requires a response from the object. Each response indicates success - or failure of the operation with a status code as a response - parameter. The response contains any operation attributes, object - attributes, and/or status messages generated during the execution of - the operation request. - - - - - - -deBry, et al. Experimental [Page 18] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - This section describes the semantics of the IPP operations, both - requests and responses, in terms of the parameters, attributes, and - other data associated with each operation. - - The IPP/1.0 Printer operations are: - - Print-Job (section 3.2.1) - Print-URI (section 3.2.2) - Validate-Job (section 3.2.3) - Create-Job (section 3.2.4) - Get-Printer-Attributes (section 3.2.5) - Get-Jobs (section 3.2.6) - - The Job operations are: - - Send-Document (section 3.3.1) - Send-URI (section 3.3.2) - Cancel-Job (section 3.3.3) - Get-Job-Attributes (section 3.3.4) - - The Send-Document and Send-URI Job operations are used to add a new - document to an existing multi-document Job object created using the - Create-Job operation. - -3.1 Common Semantics - - All IPP operations require some common parameters and operation - attributes. These common elements and their semantic characteristics - are defined and described in more detail in the following sections. - -3.1.1 Required Parameters - - Every operation request contains the following REQUIRED parameters: - - - a "version-number", - - an "operation-id", - - a "request-id", and - - the attributes that are REQUIRED for that type of request. - - Every operation response contains the following REQUIRED parameters: - - - a "version-number", - - a "status-code", - - the "request-id" that was supplied in the corresponding request, - and - - the attributes that are REQUIRED for that type of response. - - - - - -deBry, et al. Experimental [Page 19] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - The encoding and transport document [RFC2565] defines special rules - for the encoding of these parameters. All other operation elements - are represented using the more generic encoding rules for attributes - and groups of attributes. - -3.1.2 Operation IDs and Request IDs - - Each IPP operation request includes an identifying "operation-id" - value. Valid values are defined in the "operations-supported" - Printer attribute section (see section 4.4.13). The client specifies - which operation is being requested by supplying the correct - "operation-id" value. - - In addition, every invocation of an operation is identified by a - "request-id" value. For each request, the client chooses the - "request-id" which MUST be an integer (possibly unique depending on - client requirements) in the range from 1 to 2**31 - 1 (inclusive). - This "request-id" allows clients to manage multiple outstanding - requests. The receiving IPP object copies all 32-bits of the client- - supplied "request-id" attribute into the response so that the client - can match the response with the correct outstanding request, even if - the "request-id" is out of range. If the request is terminated - before the complete "request-id" is received, the IPP object rejects - the request and returns a response with a "request-id" of 0. - - Note: In some cases, the transport protocol underneath IPP might be a - connection oriented protocol that would make it impossible for a - client to receive responses in any order other than the order in - which the corresponding requests were sent. In such cases, the - "request-id" attribute would not be essential for correct protocol - operation. However, in other mappings, the operation responses can - come back in any order. In these cases, the "request-id" would be - essential. - -3.1.3 Attributes - - Operation requests and responses are both composed of groups of - attributes and/or document data. The attributes groups are: - - - Operation Attributes: These attributes are passed in the - operation and affect the IPP object's behavior while processing - the operation request and may affect other attributes or groups - of attributes. Some operation attributes describe the document - data associated with the print job and are associated with new - Job objects, however most operation attributes do not persist - beyond the life of the operation. The description of each - operation attribute includes conformance statements indicating - which operation attributes are REQUIRED and which are OPTIONAL - - - -deBry, et al. Experimental [Page 20] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - for an IPP object to support and which attributes a client MUST - supply in a request and an IPP object MUST supply in a response. - - Job Template Attributes: These attributes affect the processing - of a job. A client OPTIONALLY supplies Job Template Attributes - in a create request, and the receiving object MUST be prepared to - receive all supported attributes. The Job object can later be - queried to find out what Job Template attributes were originally - requested in the create request, and such attributes are returned - in the response as Job Object Attributes. The Printer object can - be queried about its Job Template attributes to find out what - type of job processing capabilities are supported and/or what the - default job processing behaviors are, though such attributes are - returned in the response as Printer Object Attributes. The - "ipp-attribute-fidelity" operation attribute affects processing - of all client-supplied Job Template attributes (see section 15 - for a full description of "ipp-attribute-fidelity" and its - relationship to other attributes). - - Job Object Attributes: These attributes are returned in response - to a query operation directed at a Job object. - - Printer Object Attributes: These attributes are returned in - response to a query operation directed at a Printer object. - - Unsupported Attributes: In a create request, the client supplies - a set of Operation and Job Template attributes. If any of these - attributes or their values is unsupported by the Printer object, - the Printer object returns the set of unsupported attributes in - the response. Section 15 gives a full description of how Job - Template attributes supplied by the client in a create request - are processed by the Printer object and how unsupported - attributes are returned to the client. Because of extensibility, - any IPP object might receive a request that contains new or - unknown attributes or values for which it has no support. In such - cases, the IPP object processes what it can and returns the - unsupported attributes in the response. - - Later in this section, each operation is formally defined by - identifying the allowed and expected groups of attributes for each - request and response. The model identifies a specific order for each - group in each request or response, but the attributes within each - group may be in any order, unless specified otherwise. - - Each attribute specification includes the attribute's name followed - by the name of its attribute syntax(es) in parenthesizes. In - addition, each 'integer' attribute is followed by the allowed range - in parentheses, (m:n), for values of that attribute. Each 'text' or - 'name' attribute is followed by the maximum size in octets in - parentheses, (size), for values of that attribute. For more details - on attribute syntax notation, see the descriptions of these - attributes syntaxes in section 4.1. - - - -deBry, et al. Experimental [Page 21] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - Note: Document data included in the operation is not strictly an - attribute, but it is treated as a special attribute group for - ordering purposes. The only operations that support supplying the - document data within an operation request are Print-Job and Send- - Document. There are no operation responses that include document - data. - - Note: Some operations are REQUIRED for IPP objects to support; the - others are OPTIONAL (see section 5.2.2). Therefore, before using an - OPTIONAL operation, a client SHOULD first use the REQUIRED Get- - Printer-Attributes operation to query the Printer's "operations- - supported" attribute in order to determine which OPTIONAL Printer and - Job operations are actually supported. The client SHOULD NOT use an - OPTIONAL operation that is not supported. When an IPP object - receives a request to perform an operation it does not support, it - returns the 'server-error-operation-not-supported' status code (see - section 13.1.5.2). An IPP object is non-conformant if it does not - support a REQUIRED operation. - -3.1.4 Character Set and Natural Language Operation Attributes - - Some Job and Printer attributes have values that are text strings and - names intended for human understanding rather than machine - understanding (see the 'text' and 'name' attribute syntax - descriptions in section 4.1). The following sections describe two - special Operation Attributes called "attributes-charset" and - "attributes-natural-language". These attributes are always part of - the Operation Attributes group. For most attribute groups, the order - of the attributes within the group is not important. However, for - these two attributes within the Operation Attributes group, the order - is critical. The "attributes-charset" attribute MUST be the first - attribute in the group and the "attributes-natural-language" - attribute MUST be the second attribute in the group. In other words, - these attributes MUST be supplied in every IPP request and response, - they MUST come first in the group, and MUST come in the specified - order. For job creation operations, the IPP Printer implementation - saves these two attributes with the new Job object as Job Description - attributes. For the sake of brevity in this document, these - operation attribute descriptions are not repeated with every - operation request and response, but have a reference back to this - section instead. - -3.1.4.1 Request Operation Attributes - - The client MUST supply and the Printer object MUST support the - following REQUIRED operation attributes in every IPP/1.0 operation - request: - - - - -deBry, et al. Experimental [Page 22] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - "attributes-charset" (charset): - This operation attribute identifies the charset (coded character - set and encoding method) used by any 'text' and 'name' - attributes that the client is supplying in this request. It - also identifies the charset that the Printer object MUST use (if - supported) for all 'text' and 'name' attributes and status - messages that the Printer object returns in the response to this - request. See Sections 4.1.1 and 4.1.2 for the specification of - the 'text' and 'name' attribute syntaxes. - - All clients and IPP objects MUST support the 'utf-8' charset - [RFC2279] and MAY support additional charsets provided that they - are registered with IANA [IANA-CS]. If the Printer object does - not support the client supplied charset value, the Printer - object MUST reject the request, set the "attributes-charset" to - 'utf-8' in the response, and return the 'client-error-charset- - not-supported' status code and any 'text' or 'name' attributes - using the 'utf-8' charset. The Printer object MUST indicate the - charset(s) supported as the values of the "charset-supported" - Printer attribute (see Section 4.4.15), so that the client can - query to determine which charset(s) are supported. - - Note to client implementers: Since IPP objects are only required - to support the 'utf-8' charset, in order to maximize - interoperability with multiple IPP object implementations, a - client may want to supply 'utf-8' in the "attributes-charset" - operation attribute, even though the client is only passing and - able to present a simpler charset, such as US-ASCII or ISO- - 8859-1. Then the client will have to filter out (or charset - convert) those characters that are returned in the response that - it cannot present to its user. On the other hand, if both the - client and the IPP objects also support a charset in common - besides utf-8, the client may want to use that charset in order - to avoid charset conversion or data loss. - - See the 'charset' attribute syntax description in Section 4.1.7 - for the syntax and semantic interpretation of the values of this - attribute and for example values. - - "attributes-natural-language" (naturalLanguage): - This operation attribute identifies the natural language used by - any 'text' and 'name' attributes that the client is supplying in - this request. This attribute also identifies the natural - language that the Printer object SHOULD use for all 'text' and ' - name' attributes and status messages that the Printer object - returns in the response to this request. - - - - - -deBry, et al. Experimental [Page 23] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - There are no REQUIRED natural languages required for the Printer - object to support. However, the Printer object's "generated- - natural-language-supported" attribute identifies the natural - languages supported by the Printer object and any contained Job - objects for all text strings generated by the IPP object. A - client MAY query this attribute to determine which natural - language(s) are supported for generated messages. - - For any of the attributes for which the Printer object generates - text, i.e., for the "job-state-message", "printer-state- - message", and status messages (see Section 3.1.6), the Printer - object MUST be able to generate these text strings in any of its - supported natural languages. If the client requests a natural - language that is not supported, the Printer object MUST return - these generated messages in the Printer's configured natural - language as specified by the Printer's "natural-language- - configured" attribute" (see Section 4.4.16). - - For other 'text' and 'name' attributes supplied by the client, - authentication system, operator, system administrator, or - manufacturer (i.e., for "job-originating-user-name", "printer- - name" (name), "printer-location" (text), "printer-info" (text), - and "printer-make-and-model" (text)), the Printer object is only - required to support the configured natural language of the - Printer identified by the Printer object's "natural-language- - configured" attribute, though support of additional natural - languages for these attributes is permitted. - - For any 'text' or 'name' attribute in the request that is in a - different natural language than the value supplied in the - "attributes-natural-language" operation attribute, the client - MUST use the Natural Language Override mechanism (see sections - 4.1.1.2 and 4.1.2.2) for each such attribute value supplied. - The client MAY use the Natural Language Override mechanism - redundantly, i.e., use it even when the value is in the same - natural language as the value supplied in the "attributes- - natural-language" operation attribute of the request. - - The IPP object MUST accept any natural language and any Natural - Language Override, whether the IPP object supports that natural - language or not (and independent of the value of the "ipp- - attribute-fidelity" Operation attribute). That is the IPP - object accepts all client supplied values no matter what the - values are in the Printer object's "generated-natural-language- - supported" attribute. That attribute, "generated-natural- - language-supported", only applies to generated messages, - - - - - -deBry, et al. Experimental [Page 24] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - not client supplied messages. The IPP object MUST remember that - natural language for all client-supplied attributes, and when - returning those attributes in response to a query, the IPP - object MUST indicate that natural language. - - Each value whose attribute syntax type is 'text' or 'name' (see - sections 4.1.1 and 4.1.2) has an Associated Natural-Language. - This document does not specify how this association is stored in - a Printer or Job object. When such a value is encoded in a - request or response, the natural language is either implicit or - explicit: - - - In the implicit case, the value contains only the - text/name value, and the language is specified by the - "attributes-natural-language" operation attribute in the - request or response (see sections 4.1.1.1 - textWithoutLanguage and 4.1.2.1 nameWithoutLanguage). - - - In the explicit case (also known as the Natural-Language - Override case), the value contains both the language and - the text/name value (see sections 4.1.1.2 - textWithLanguage and 4.1.2.2 nameWithLanguage). - - For example, the "job-name" attribute MAY be supplied by the - client in a create request. The text value for this attribute - will be in the natural language identified by the "attribute- - natural-language" attribute, or if different, as identified by - the Natural Language Override mechanism. If supplied, the IPP - object will use the value of the "job-name" attribute to - populate the Job object's "job-name" attribute. Whenever any - client queries the Job object's "job-name" attribute, the IPP - object returns the attribute as stored and uses the Natural - Language Override mechanism to specify the natural language, if - it is different from that reported in the "attributes-natural- - language" operation attribute of the response. The IPP object - MAY use the Natural Language Override mechanism redundantly, - i.e., use it even when the value is in the same natural language - as the value supplied in the "attributes-natural-language" - operation attribute of the response. - - An IPP object MUST NOT reject a request based on a supplied - natural language in an "attributes-natural-language" Operation - attribute or in any attribute that uses the Natural Language - Override. - - See the 'naturalLanguage' attribute syntax description in - section 4.1.8 for the syntax and semantic interpretation of the - values of this attribute and for example values. - - - -deBry, et al. Experimental [Page 25] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - Clients SHOULD NOT supply 'text' or 'name' attributes that use an - illegal combination of natural language and charset. For example, - suppose a Printer object supports charsets 'utf-8', 'iso-8859-1', and - 'iso-8859-7'. Suppose also, that it supports natural languages 'en' - (English), 'fr' (French), and 'el' (Greek). Although the Printer - object supports the charset 'iso-8859-1' and natural language 'el', - it probably does not support the combination of Greek text strings - using the 'iso-8859-1' charset. The Printer object handles this - apparent incompatibility differently depending on the context in - which it occurs: - - - In a create request: If the client supplies a text or name - attribute (for example, the "job-name" operation attribute) that - uses an apparently incompatible combination, it is a client - choice that does not affect the Printer object or its correct - operation. Therefore, the Printer object simply accepts the - client supplied value, stores it with the Job object, and - responds back with the same combination whenever the client (or - any client) queries for that attribute. - - In a query-type operation, like Get-Printer-Attributes: If the - client requests an apparently incompatible combination, the - Printer object responds (as described in section 3.1.4.2) using - the Printer's configured natural language rather than the natural - language requested by the client. - - In either case, the Printer object does not reject the request - because of the apparent incompatibility. The potential incompatible - combination of charset and natural language can occur either at the - global operation level or at the Natural Language Override - attribute-by-attribute level. In addition, since the response always - includes explicit charset and natural language information, there is - never any question or ambiguity in how the client interprets the - response. - -3.1.4.2 Response Operation Attributes - - The Printer object MUST supply and the client MUST support the - following REQUIRED operation attributes in every IPP/1.0 operation - response: - - "attributes-charset" (charset): - This operation attribute identifies the charset used by any ' - text' and 'name' attributes that the Printer object is returning - in this response. The value in this response MUST be the same - value as the "attributes-charset" operation attribute supplied - by the client in the request. If this is not possible - - - - - -deBry, et al. Experimental [Page 26] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - (i.e., the charset requested is not supported), the request - would have been rejected. See "attributes-charset" described in - Section 3.1.4.1 above. - - If the Printer object supports more than just the 'utf-8' - charset, the Printer object MUST be able to code convert between - each of the charsets supported on a highest fidelity possible - basis in order to return the 'text' and 'name' attributes in the - charset requested by the client. However, some information loss - MAY occur during the charset conversion depending on the - charsets involved. For example, the Printer object may convert - from a UTF-8 'a' to a US-ASCII 'a' (with no loss of - information), from an ISO Latin 1 CAPITAL LETTER A WITH ACUTE - ACCENT to US-ASCII 'A' (losing the accent), or from a UTF-8 - Japanese Kanji character to some ISO Latin 1 error character - indication such as '?', decimal code equivalent, or to the - absence of a character, depending on implementation. - - Note: Whether an implementation that supports more than one - charset stores the data in the charset supplied by the client or - code converts to one of the other supported charsets, depends on - implementation. The strategy should try to minimize loss of - information during code conversion. On each response, such an - implementation converts from its internal charset to that - requested. - - "attributes-natural-language" (naturalLanguage): - This operation attribute identifies the natural language used by - any 'text' and 'name' attributes that the IPP object is - returning in this response. Unlike the "attributes-charset" - operation attribute, the IPP object NEED NOT return the same - value as that supplied by the client in the request. The IPP - object MAY return the natural language of the Job object or the - Printer's configured natural language as identified by the - Printer object's "natural-language-configured" attribute, rather - than the natural language supplied by the client. For any ' - text' or 'name' attribute or status message in the response that - is in a different natural language than the value returned in - the "attributes-natural-language" operation attribute, the IPP - object MUST use the Natural Language Override mechanism (see - sections 4.1.1.2 and 4.1.2.2) on each attribute value returned. - The IPP object MAY use the Natural Language Override mechanism - redundantly, i.e., use it even when the value is in the same - natural language as the value supplied in the "attributes- - natural-language" operation attribute of the response. - - - - - - -deBry, et al. Experimental [Page 27] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - -3.1.5 Operation Targets - - All IPP operations are directed at IPP objects. For Printer - operations, the operation is always directed at a Printer object - using one of its URIs (i.e., one of the values in the Printer - object's "printer-uri-supported" attribute). Even if the Printer - object supports more than one URI, the client supplies only one URI - as the target of the operation. The client identifies the target - object by supplying the correct URI in the "printer-uri (uri)" - operation attribute. - - For Job operations, the operation is directed at either: - - - The Job object itself using the Job object's URI. In this case, - the client identifies the target object by supplying the correct - URI in the "job-uri (uri)" operation attribute. - - The Printer object that created the Job object using both the - Printer objects URI and the Job object's Job ID. Since the - Printer object that created the Job object generated the Job ID, - it MUST be able to correctly associate the client supplied Job ID - with the correct Job object. The client supplies the Printer - object's URI in the "printer-uri (uri)" operation attribute and - the Job object's Job ID in the "job-id (integer(1:MAX))" - operation attribute. - - If the operation is directed at the Job object directly using the Job - object's URI, the client MUST NOT include the redundant "job-id" - operation attribute. - - The operation target attributes are REQUIRED operation attributes - that MUST be included in every operation request. Like the charset - and natural language attributes (see section 3.1.4), the operation - target attributes are specially ordered operation attributes. In all - cases, the operation target attributes immediately follow the - "attributes-charset" and "attributes-natural-language" attributes - within the operation attribute group, however the specific ordering - rules are: - - - In the case where there is only one operation target attribute - (i.e., either only the "printer-uri" attribute or only the "job- - uri" attribute), that attribute MUST be the third attribute in - the operation attributes group. - - In the case where Job operations use two operation target - attributes (i.e., the "printer-uri" and "job-id" attributes), the - "printer-uri" attribute MUST be the third attribute and the - "job-id" attribute MUST be the fourth attribute. - - - - - -deBry, et al. Experimental [Page 28] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - In all cases, the target URIs contained within the body of IPP - operation requests and responses must be in absolute format rather - than relative format (a relative URL identifies a resource with the - scope of the HTTP server, but does not include scheme, host or port). - - The following rules apply to the use of port numbers in URIs that - identify IPP objects: - - 1. If the URI scheme allows the port number to be explicitly - included in the URI string, and a port number is specified - within the URI, then that port number MUST be used by the client - to contact the IPP object. - - 2. If the URI scheme allows the port number to be explicitly - included in the URI string, and a port number is not specified - within the URI, then default port number implied by that URI - scheme MUST be used by the client to contact the IPP object. - - 3. If the URI scheme does not allow an explicit port number to be - specified within the URI, then the default port number implied - by that URI MUST be used by the client to contact the IPP - object. - - Note: The IPP encoding and transport document [RFC2565] shows a - mapping of IPP onto HTTP/1.1 and defines a new default port number - for using IPP over HTTP/1.1. - -3.1.6 Operation Status Codes and Messages - - Every operation response includes a REQUIRED "status-code" parameter - and an OPTIONAL "status-message" operation attribute. The "status- - code" provides information on the processing of a request. A - "status-message" attribute provides a short textual description of - the status of the operation. The status code is intended for use by - automata, and the status message is intended for the human end user. - If a response does include a "status-message" attribute, an IPP - client NEED NOT examine or display the message, however it SHOULD do - so in some implementation specific manner. - - The "status-code" value is a numeric value that has semantic meaning. - The "status-code" syntax is similar to a "type2 enum" (see section - 4.1 on "Attribute Syntaxes") except that values can range only from - 0x0000 to 0x7FFF. Section 13 describes the status codes, assigns the - numeric values, and suggests a corresponding status message for each - status code. The "status-message" attribute's syntax is "text(255)". - A client implementation of IPP SHOULD convert status code values into - any localized message that has semantic meaning to the end user. - - - - -deBry, et al. Experimental [Page 29] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - If the Printer object supports the "status-message" operation - attribute, the Printer object MUST be able to generate this message - in any of the natural languages identified by the Printer object's - "generated-natural-language-supported" attribute (see the - "attributes-natural-language" operation attribute specified in - section 3.1.4.1). As described in section 3.1.4.1 for any returned ' - text' attribute, if there is a choice for generating this message, - the Printer object uses the natural language indicated by the value - of the "attributes-natural-language" in the client request if - supported, otherwise the Printer object uses the value in the Printer - object's own "natural-language-configured" attribute. If the Printer - object supports the "status-message" operation attribute, it SHOULD - use the REQUIRED 'utf-8' charset to return a status message for the - following error status codes (see section 13): 'client-error-bad- - request', 'client-error-charset-not-supported', 'server-error- - internal-error', 'server-error-operation-not-supported', and ' - server-error-version-not-supported'. In this case, it MUST set the - value of the "attributes-charset" operation attribute to 'utf-8' in - the error response. - -3.1.7 Versions - - Each operation request and response carries with it a "version- - number" parameter. Each value of the "version-number" is in the form - "X.Y" where X is the major version number and Y is the minor version - number. By including a version number in the client request, it - allows the client to identify which version of IPP it is interested - in using. If the IPP object does not support that version, the - object responds with a status code of 'server-error-version-not- - supported' along with the closest version number that is supported - (see section 13.1.5.4). - - There is no version negotiation per se. However, if after receiving - a 'server-error-version-not-supported' status code from an IPP - object, there is nothing that prevents a client from trying again - with a different version number. In order to conform to IPP/1.0, an - implementation MUST support at least version '1.0'. - - There is only one notion of "version number" that covers both IPP - Model and IPP Protocol changes. Thus the version number MUST change - when introducing a new version of the Model and Semantics document - [RFC2566] or a new version of the Encoding and Transport document - [RFC2565]. - - Changes to the major version number indicate structural or syntactic - changes that make it impossible for older version of IPP clients and - Printer objects to correctly parse and process the new or changed - attributes, operations and responses. If the major version number - - - -deBry, et al. Experimental [Page 30] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - changes, the minor version numbers is set to zero. As an example, - adding the "ipp-attribute-fidelity" attribute (if it had not been - part of version '1.0'), would have required a change to the major - version number. Items that might affect the changing of the major - version number include any changes to the Model and Semantics - document [RFC2566] or the Encoding and Transport [RFC2565] itself, - such as: - - - reordering of ordered attributes or attribute sets - - changes to the syntax of existing attributes - - changing Operation or Job Template attributes from OPTIONAL to - REQUIRED and vice versa - - adding REQUIRED (for an IPP object to support) operation - attributes - - adding REQUIRED (for an IPP object to support) operation - attribute groups - - adding values to existing operation attributes - - adding REQUIRED operations - - Changes to the minor version number indicate the addition of new - features, attributes and attribute values that may not be understood - by all IPP objects, but which can be ignored if not understood. - Items that might affect the changing of the minor version number - include any changes to the model objects and attributes but not the - encoding and transport rules [RFC2565] (except adding attribute - syntaxes). Examples of such changes are: - - - grouping all extensions not included in a previous version into - a new version - - adding new attribute values - - adding new object attributes - - adding OPTIONAL (for an IPP object to support) operation - attributes (i.e., those attributes that an IPP object can ignore - without confusing clients) - - adding OPTIONAL (for an IPP object to support) operation - attribute groups (i.e., those attributes that an IPP object can - ignore without confusing clients) - - adding new attribute syntaxes - - adding OPTIONAL operations - - changing Job Description attributes or Printer Description - attributes from OPTIONAL to REQUIRED or vice versa. - - The encoding of the "operation-id", the "version-number", the - "status-code", and the "request-id" MUST NOT change over any version - number (either major or minor). This rule guarantees that all future - versions will be backwards compatible with all previous versions (at - least for checking the "operation-id", the "version-number", and the - "request-id"). In addition, any protocol elements (attributes, error - - - -deBry, et al. Experimental [Page 31] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - codes, tags, etc.) that are not carried forward from one version to - the next are deprecated so that they can never be reused with new - semantics. - - Implementations that support a certain major version NEED NOT support - ALL previous versions. As each new major version is defined (through - the release of a new specification), that major version will specify - which previous major versions MUST be supported in compliant - implementations. - -3.1.8 Job Creation Operations - - In order to "submit a print job" and create a new Job object, a - client issues a create request. A create request is any one of - following three operation requests: - - - The Print-Job Request: A client that wants to submit a print job - with only a single document uses the Print-Job operation. The - operation allows for the client to "push" the document data to - the Printer object by including the document data in the request - itself. - - - The Print-URI Request: A client that wants to submit a print job - with only a single document (where the Printer object "pulls" the - document data instead of the client "pushing" the data to the - Printer object) uses the Print-URI operation. In this case, the - client includes in the request only a URI reference to the - document data (not the document data itself). - - - The Create-Job Request: A client that wants to submit a print job - with multiple documents uses the Create-Job operation. This - operation is followed by an arbitrary number of Send-Document - and/or Send-URI operations (each creating another document for - the newly create Job object). The Send-Document operation - includes the document data in the request (the client "pushes" - the document data to the printer), and the Send-URI operation - includes only a URI reference to the document data in the request - (the Printer "pulls" the document data from the referenced - location). The last Send-Document or Send-URI request for a - given Job object includes a "last-document" operation attribute - set to 'true' indicating that this is the last request. - - Throughout this model specification, the term "create request" is - used to refer to any of these three operation requests. - - A Create-Job operation followed by only one Send-Document operation - is semantically equivalent to a Print-Job operation, however, for - performance reasons, the client SHOULD use the Print-Job operation - - - -deBry, et al. Experimental [Page 32] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - for all single document jobs. Also, Print-Job is a REQUIRED - operation (all implementations MUST support it) whereas Create-Job is - an OPTIONAL operation, hence some implementations might not support - it. - - Job submission time is the point in time when a client issues a - create request. The initial state of every Job object is the ' - pending' or 'pending-held' state. Later, the Printer object begins - processing the print job. At this point in time, the Job object's - state moves to 'processing'. This is known as job processing time. - There are validation checks that must be done at job submission time - and others that must be performed at job processing time. - - At job submission time and at the time a Validate-Job operation is - received, the Printer MUST do the following: - - 1. Process the client supplied attributes and either accept or - reject the request - 2. Validate the syntax of and support for the scheme of any client - supplied URI - - At job submission time the Printer object MUST validate whether or - not the supplied attributes, attribute syntaxes, and values are - supported by matching them with the Printer object's corresponding - "xxx-supported" attributes. See section 3.2.1.2 for details. [ipp- - iig] presents suggested steps for an IPP object to either accept or - reject any request and additional steps for processing create - requests. - - At job submission time the Printer object NEED NOT perform the - validation checks reserved for job processing time such as: - - 1. Validating the document data - 2. Validating the actual contents of any client supplied URI - (resolve the reference and follow the link to the document data) - - At job submission time, these additional job processing time - validation checks are essentially useless, since they require - actually parsing and interpreting the document data, are not - guaranteed to be 100% accurate, and MUST be done, yet again, at job - processing time. Also, in the case of a URI, checking for - availability at job submission time does not guarantee availability - at job processing time. In addition, at job processing time, the - Printer object might discover any of the following conditions that - were not detectable at job submission time: - - - runtime errors in the document data, - - nested document data that is in an unsupported format, - - - -deBry, et al. Experimental [Page 33] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - - the URI reference is no longer valid (i.e., the server hosting - the document might be down), or - - any other job processing error - - At job processing time, since the Printer object has already - responded with a successful status code in the response to the create - request, if the Printer object detects an error, the Printer object - is unable to inform the end user of the error with an operation - status code. In this case, the Printer, depending on the error, can - set the "job-state", "job-state-reasons", or "job-state-message" - attributes to the appropriate value(s) so that later queries can - report the correct job status. - - Note: Asynchronous notification of events is outside the scope of - IPP/1.0. - -3.2 Printer Operations - - All Printer operations are directed at Printer objects. A client - MUST always supply the "printer-uri" operation attribute in order to - identify the correct target of the operation. - -3.2.1 Print-Job Operation - - This REQUIRED operation allows a client to submit a print job with - only one document and supply the document data (rather than just a - reference to the data). See Section 15 for the suggested steps for - processing create operations and their Operation and Job Template - attributes. - -3.2.1.1 Print-Job Request - - The following groups of attributes are supplied as part of the - Print-Job Request: - - Group 1: Operation Attributes - - Natural Language and Character Set: - The "attributes-charset" and "attributes-natural-language" - attributes as described in section 3.1.4.1. The Printer object - MUST copy these values to the corresponding Job Description - attributes described in sections 4.3.23 and 4.3.24. - - Target: - The "printer-uri" (uri) operation attribute which is the target - for this operation as described in section 3.1.5. - - - - - -deBry, et al. Experimental [Page 34] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - Requesting User Name: - The "requesting-user-name" (name(MAX)) attribute SHOULD be - supplied by the client as described in section 8.3. - - "job-name" (name(MAX)): - The client OPTIONALLY supplies this attribute. The Printer - object MUST support this attribute. It contains the client - supplied Job name. If this attribute is supplied by the client, - its value is used for the "job-name" attribute of the newly - created Job object. The client MAY automatically include any - information that will help the end-user distinguish amongst - his/her jobs, such as the name of the application program along - with information from the document, such as the document name, - document subject, or source file name. If this attribute is not - supplied by the client, the Printer generates a name to use in - the "job-name" attribute of the newly created Job object (see - Section 4.3.5). - - "ipp-attribute-fidelity" (boolean): - The client OPTIONALLY supplies this attribute. The Printer - object MUST support this attribute. The value 'true' indicates - that total fidelity to client supplied Job Template attributes - and values is required, else the Printer object MUST reject the - Print-Job request. The value 'false' indicates that a - reasonable attempt to print the Job object is acceptable and the - Printer object MUST accept the Print-job request. If not - supplied, the Printer object assumes the value is 'false'. All - Printer objects MUST support both types of job processing. See - section 15 for a full description of "ipp-attribute-fidelity" - and its relationship to other attributes, especially the Printer - object's "pdl-override-supported" attribute. - - "document-name" (name(MAX)): - The client OPTIONALLY supplies this attribute. The Printer - object MUST support this attribute. It contains the client - supplied document name. The document name MAY be different than - the Job name. Typically, the client software automatically - supplies the document name on behalf of the end user by using a - file name or an application generated name. If this attribute - is supplied, its value can be used in a manner defined by each - implementation. Examples include: printed along with the Job - (job start sheet, page adornments, etc.), used by accounting or - resource tracking management tools, or even stored along with - the document as a document level attribute. IPP/1.0 does not - support the concept of document level attributes. - - - - - - -deBry, et al. Experimental [Page 35] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - "document-format" (mimeMediaType) : - The client OPTIONALLY supplies this attribute. The Printer - object MUST support this attribute. The value of this attribute - identifies the format of the supplied document data. If the - client does not supply this attribute, the Printer object - assumes that the document data is in the format defined by the - Printer object's "document-format-default" attribute. If the - client supplies this attribute, but the value is not supported - by the Printer object, i.e., the value is not one of the values - of the Printer object's "document-format-supported" attribute, - the Printer object MUST reject the request and return the ' - client-error-document-format-not-supported' status code. - - "document-natural-language" (naturalLanguage): - The client OPTIONALLY supplies this attribute. The Printer - object OPTIONALLY supports this attribute. This attribute - specifies the natural language of the document for those - document-formats that require a specification of the natural - language in order to image the document unambiguously. There are - no particular values required for the Printer object to support. - - "compression" (type3 keyword) - The client OPTIONALLY supplies this attribute. The Printer - object OPTIONALLY supports this attribute and the "compression- - supported" attribute (see section 4.4.29). The client supplied - "compression" operation attribute identifies the compression - algorithm used on the document data. If the client omits this - attribute, the Printer object MUST assume that the data is not - compressed. If the client supplies the attribute and the - Printer object supports the attribute, the Printer object uses - the corresponding decompression algorithm on the document data. - If the client supplies this attribute, but the value is not - supported by the Printer object, i.e., the value is not one of - the values of the Printer object's "compression-supported" - attribute, the Printer object MUST copy the attribute and its - value to the Unsupported Attributes response group, reject the - request, and return the 'client-error-attributes-or-values-not- - supported' status code. - - "job-k-octets" (integer(0:MAX)) - The client OPTIONALLY supplies this attribute. The Printer - object OPTIONALLY supports this attribute and the "job-k- - octets-supported" attribute (see section 4.4.30). The client - supplied "job-k-octets" operation attribute identifies the total - size of the document(s) in K octets being submitted (see section - 4.3.17 for the complete semantics). If the client supplies the - - - - - -deBry, et al. Experimental [Page 36] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - attribute and the Printer object supports the attribute, the - value of the attribute is used to populate the Job object's - "job-k-octets" Job Description attribute. - - Note: For this attribute and the following two attributes - ("job-impressions", and "job-media-sheets"), if the client - supplies the attribute, but the Printer object does not support - the attribute, the Printer object ignores the client-supplied - value. If the client supplies the attribute and the Printer - supports the attribute, and the value is within the range of the - corresponding Printer object's "xxx-supported" attribute, the - Printer object MUST use the value to populate the Job object's - "xxx" attribute. If the client supplies the attribute and the - Printer supports the attribute, but the value is outside the - range of the corresponding Printer object's "xxx-supported" - attribute, the Printer object MUST copy the attribute and its - value to the Unsupported Attributes response group, reject the - request, and return the 'client-error-attributes-or-values-not- - supported' status code. If the client does not supply the - attribute, the Printer object MAY choose to populate the - corresponding Job object attribute depending on whether the - Printer object supports the attribute and is able to calculate - or discern the correct value. - - "job-impressions" (integer(0:MAX)) - The client OPTIONALLY supplies this attribute. The Printer - object OPTIONALLY supports this attribute and the "job- - impressions-supported" attribute (see section 4.4.31). The - client supplied "job-impressions" operation attribute identifies - the total size in number of impressions of the document(s) being - submitted (see section 4.3.18 for the complete semantics). - - See note under "job-k-octets". - - "job-media-sheets" (integer(0:MAX)) - The client OPTIONALLY supplies this attribute. The Printer - object OPTIONALLY supports this attribute and the "job-media- - sheets-supported" attribute (see section 4.4.32). The client - supplied "job-media-sheets" operation attribute identifies the - total number of media sheets to be produced for this job (see - section 4.3.19 for the complete semantics). - - See note under "job-k-octets". - - - - - - - - -deBry, et al. Experimental [Page 37] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - Group 2: Job Template Attributes - - The client OPTIONALLY supplies a set of Job Template attributes - as defined in section 4.2. If the client is not supplying any - Job Template attributes in the request, the client SHOULD omit - Group 2 rather than sending an empty group. However, a Printer - object MUST be able to accept an empty group. - - Group 3: Document Content - - The client MUST supply the document data to be processed. - - Note: In addition to the MANDATORY parameters required for every - operation request, the simplest Print-Job Request consists of just - the "attributes-charset" and "attributes-natural-language" operation - attributes; the "printer-uri" target operation attribute; the - Document Content and nothing else. In this simple case, the Printer - object: - - - creates a new Job object (the Job object contains a single - document), - - stores a generated Job name in the "job-name" attribute in the - natural language and charset requested (see Section 3.1.4.1) (if - those are supported, otherwise using the Printer object's default - natural language and charset), and - - at job processing time, uses its corresponding default value - attributes for the supported Job Template attributes that were - not supplied by the client as IPP attribute or embedded - instructions in the document data. - -3.2.1.2 Print-Job Response - - The Printer object MUST return to the client the following sets - of attributes as part of the Print-Job Response: - - Group 1: Operation Attributes - - Status Message: - In addition to the REQUIRED status code returned in every - response, the response OPTIONALLY includes a "status-message" - (text) operation attribute as described in sections 14 and - 3.1.6. If the client supplies unsupported or conflicting Job - Template attributes or values, the Printer object MUST reject or - accept the Print-Job request depending on the whether the client - supplied a 'true' or 'false' value for the "ipp-attribute- - fidelity" operation attribute. See the Implementer's Guide - [ipp-iig] for a complete description of the suggested steps for - processing a create request. - - - -deBry, et al. Experimental [Page 38] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - Natural Language and Character Set: - The "attributes-charset" and "attributes-natural-language" - attributes as described in section 3.1.4.2. - - Group 2: Unsupported Attributes - - This is a set of Operation and Job Template attributes supplied - by the client (in the request) that are not supported by the - Printer object or that conflict with one another (see the - Implementer's Guide [ipp-iig]). If the Printer object is not - returning any Unsupported Attributes in the response, the - Printer object SHOULD omit Group 2 rather than sending an empty - group. However, a client MUST be able to accept an empty group. - - Unsupported attributes fall into three categories: - - 1. The Printer object does not support the supplied attribute - (no matter what the attribute syntax or value). - 2. The Printer object does support the attribute, but does not - support some or all of the particular attribute syntaxes or - values supplied by the client (i.e., the Printer object does - not have those attribute syntaxes or values in its - corresponding "xxx-supported" attribute). - 3. The Printer object does support the attributes and values - supplied, but the particular values are in conflict with one - another, because they violate a constraint, such as not being - able to staple transparencies. - - In the case of an unsupported attribute name, the Printer object - returns the client-supplied attribute with a substituted "out- - of-band" value of 'unsupported' indicating no support for the - attribute itself (see the beginning of section 4.1). - - In the case of a supported attribute with one or more - unsupported attribute syntaxes or values, the Printer object - simply returns the client-supplied attribute with the - unsupported attribute syntaxes or values as supplied by the - client. This indicates support for the attribute, but no - support for that particular attribute syntax or value. If the - client supplies a multi-valued attribute with more than one - value and the Printer object supports the attribute but only - supports a subset of the client-supplied attribute syntaxes or - values, the Printer object MUST return only those attribute - syntaxes or values that are unsupported. - - In the case of two (or more) supported attribute values that are - in conflict with one another (although each is supported - independently, the values conflict when requested together - - - -deBry, et al. Experimental [Page 39] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - within the same job), the Printer object MUST return all the - values that it ignores or substitutes to resolve the conflict, - but not any of the values that it is still using. The choice - for exactly how to resolve the conflict is implementation - dependent. See The Implementer's Guide [ipp-iig] for an - example. - - In these three cases, the value of the "ipp-attribute-fidelity" - supplied by the client does not affect what the Printer object - returns. The value of "ipp-attribute-fidelity" only affects - whether the Print-Job operation is accepted or rejected. If the - job is accepted, the client may query the job using the Get- - Job-Attributes operation requesting the unsupported attributes - that were returned in the create response to see which - attributes were ignored (not stored on the Job object) and which - attributes were stored with other (substituted) values. - - Group 3: Job Object Attributes - - "job-uri" (uri): - The Printer object MUST return the Job object's URI by returning - the contents of the REQUIRED "job-uri" Job object attribute. - The client uses the Job object's URI when directing operations - at the Job object. The Printer object always uses its - configured security policy when creating the new URI. However, - if the Printer object supports more than one URI, the Printer - object also uses information about which URI was used in the - Print-Job Request to generated the new URI so that the new URI - references the correct access channel. In other words, if the - Print-Job Request comes in over a secure channel, the Printer - object MUST generate a Job URI that uses the secure channel as - well. - - "job-id" (integer(1:MAX)): - The Printer object MUST return the Job object's Job ID by - returning the REQUIRED "job-id" Job object attribute. The - client uses this "job-id" attribute in conjunction with the - "printer-uri" attribute used in the Print-Job Request when - directing Job operations at the Printer object. - - "job-state": - The Printer object MUST return the Job object's REQUIRED "job- - state" attribute. The value of this attribute (along with the - value of the next attribute "job-state-reasons") is taken from a - "snapshot" of the new Job object at some meaningful point in - time (implementation defined) between when the Printer object - receives the Print-Job Request and when the Printer object - returns the response. - - - -deBry, et al. Experimental [Page 40] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - "job-state-reasons": - The Printer object OPTIONALLY returns the Job object's OPTIONAL - "job-state-reasons" attribute. If the Printer object supports - this attribute then it MUST be returned in the response. If - this attribute is not returned in the response, the client can - assume that the "job-state-reasons" attribute is not supported - and will not be returned in a subsequent Job object query. - - "job-state-message": - The Printer object OPTIONALLY returns the Job object's OPTIONAL - "job-state-message" attribute. If the Printer object supports - this attribute then it MUST be returned in the response. If - this attribute is not returned in the response, the client can - assume that the "job-state-message" attribute is not supported - and will not be returned in a subsequent Job object query. - - "number-of-intervening-jobs": - The Printer object OPTIONALLY returns the Job object's OPTIONAL - "number-of-intervening-jobs" attribute. If the Printer object - supports this attribute then it MUST be returned in the - response. If this attribute is not returned in the response, - the client can assume that the "number-of-intervening-jobs" - attribute is not supported and will not be returned in a - subsequent Job object query. - - Note: Since any printer state information which affects a job's - state is reflected in the "job-state" and "job-state-reasons" - attributes, it is sufficient to return only these attributes and - no specific printer status attributes. - - Note: In addition to the MANDATORY parameters required for every - operation response, the simplest response consists of the just the - "attributes-charset" and "attributes-natural-language" operation - attributes and the "job-uri", "job-id", and "job-state" Job Object - Attributes. In this simplest case, the status code is "successful- - ok" and there is no "status-message" operation attribute. - -3.2.2 Print-URI Operation - - This OPTIONAL operation is identical to the Print-Job operation - (section 3.2.1) except that a client supplies a URI reference to the - document data using the "document-uri" (uri) operation attribute (in - Group 1) rather than including the document data itself. Before - returning the response, the Printer MUST validate that the Printer - supports the retrieval method (e.g., http, ftp, etc.) implied by the - URI, and MUST check for valid URI syntax. If the client-supplied URI - scheme is not supported, i.e. the value is not in the Printer - object's "referenced-uri-scheme-supported" attribute, the Printer - - - -deBry, et al. Experimental [Page 41] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - object MUST reject the request and return the 'client-error-uri- - scheme-not-supported' status code. See The Implementer's Guide - [ipp-iig] for suggested additional checks. The Printer NEED NOT - follow the reference and validate the contents of the reference. - - If the Printer object supports this operation, it MUST support the - "reference-uri-schemes-supported" Printer attribute (see section - 4.4.24). - - It is up to the IPP object to interpret the URI and subsequently - "pull" the document from the source referenced by the URI string. - -3.2.3 Validate-Job Operation - - This REQUIRED operation is similar to the Print-Job operation - (section 3.2.1) except that a client supplies no document data and - the Printer allocates no resources (i.e., it does not create a new - Job object). This operation is used only to verify capabilities of a - printer object against whatever attributes are supplied by the client - in the Validate-Job request. By using the Validate-Job operation a - client can validate that an identical Print-Job operation (with the - document data) would be accepted. The Validate-Job operation also - performs the same security negotiation as the Print-Job operation - (see section 8), so that a client can check that the client and - Printer object security requirements can be met before performing a - Print-Job operation. - - Note: The Validate-Job operation does not accept a "document-uri" - attribute in order to allow a client to check that the same Print-URI - operation will be accepted, since the client doesn't send the data - with the Print-URI operation. The client SHOULD just issue the - Print-URI request. - - The Printer object returns the same status codes, Operation - Attributes (Group 1) and Unsupported Attributes (Group 2) as the - Print-Job operation. However, no Job Object Attributes (Group 3) are - returned, since no Job object is created. - -3.2.4 Create-Job Operation - - This OPTIONAL operation is similar to the Print-Job operation - (section 3.2.1) except that in the Create-Job request, a client does - not supply document data or any reference to document data. Also, - the client does not supply any of the "document-name", "document- - format", "compression", or "document-natural-language" operation - attributes. This operation is followed by one or more Send-Document - or Send-URI operations. In each of those operation requests, the - - - - -deBry, et al. Experimental [Page 42] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - client OPTIONALLY supplies the "document-name", "document-format", - and "document-natural-language" attributes for each document in the - multi-document Job object. - - If a Printer object supports the Create-Job operation, it MUST also - support the Send-Document operation and also MAY support the Send-URI - operation. - - If the Printer object supports this operation, it MUST support the - "multiple-operation-time-out" Printer attribute (see section 4.4.28). - - -3.2.5 Get-Printer-Attributes Operation - - This REQUIRED operation allows a client to request the values of the - attributes of a Printer object. In the request, the client supplies - the set of Printer attribute names and/or attribute group names in - which the requester is interested. In the response, the Printer - object returns a corresponding attribute set with the appropriate - attribute values filled in. - - For Printer objects, the possible names of attribute groups are: - - - 'job-template': all of the Job Template attributes that apply to - a Printer object (the last two columns of the table in Section - 4.2). - - 'printer-description': the attributes specified in Section 4.4. - - 'all': the special group 'all' that includes all supported - attributes. - - Since a client MAY request specific attributes or named groups, there - is a potential that there is some overlap. For example, if a client - requests, 'printer-name' and 'all', the client is actually requesting - the "printer-name" attribute twice: once by naming it explicitly, and - once by inclusion in the 'all' group. In such cases, the Printer - object NEED NOT return each attribute only once in the response even - if it is requested multiple times. The client SHOULD NOT request the - same attribute in multiple ways. - - It is NOT REQUIRED that a Printer object support all attributes - belonging to a group (since some attributes are OPTIONAL). However, - it is REQUIRED that each Printer object support all group names. - - - - - - - - - -deBry, et al. Experimental [Page 43] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - -3.2.5.1 Get-Printer-Attributes Request - - The following sets of attributes are part of the Get-Printer- - Attributes Request: - - Group 1: Operation Attributes - - Natural Language and Character Set: - attributes-charset" and "attributes-natural-language" butes as - described in section 3.1.4.1. - - Target: - The "printer-uri" (uri) operation attribute which is the target - for this operation as described in section 3.1.5. - - Requesting User Name: - The "requesting-user-name" (name(MAX)) attribute SHOULD be - supplied by the client as described in section 8.3. - - "requested-attributes" (1setOf keyword) : - The client OPTIONALLY supplies a set of attribute names and/or - attribute group names in whose values the requester is - interested. The Printer object MUST support this attribute. If - the client omits this attribute, the Printer MUST respond as if - this attribute had been supplied with a value of 'all'. - - "document-format" (mimeMediaType) : - The client OPTIONALLY supplies this attribute. The Printer - object MUST support this attribute. This attribute is useful - for a Printer object to determine the set of supported attribute - values that relate to the requested document format. The - Printer object MUST return the attributes and values that it - uses to validate a job on a create or Validate-Job operation in - which this document format is supplied. The Printer object - SHOULD return only (1) those attributes that are supported for - the specified format and (2) the attribute values that are - supported for the specified document format. By specifying the - document format, the client can get the Printer object to - eliminate the attributes and values that are not supported for a - specific document format. For example, a Printer object might - have multiple interpreters to support both ' - application/postscript' (for PostScript) and 'text/plain' (for - text) documents. However, for only one of those interpreters - might the Printer object be able to support "number-up" with - values of '1', '2', and '4'. For the other interpreter it might - be able to only support "number-up" with a value of '1'. Thus a - - - - - -deBry, et al. Experimental [Page 44] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - client can use the Get-Printer-Attributes operation to obtain - the attributes and values that will be used to accept/reject a - create job operation. - - If the Printer object does not distinguish between different - sets of supported values for each different document format when - validating jobs in the create and Validate-Job operations, it - MUST NOT distinguish between different document formats in the - Get-Printer-Attributes operation. If the Printer object does - distinguish between different sets of supported values for each - different document format specified by the client, this - specialization applies only to the following Printer object - attributes: - - - Printer attributes that are Job Template attributes ("xxx- - default" "xxx-supported", and "xxx-ready" in the Table in - Section 4.2), - - "pdl-override-supported", - - "compression-supported", - - "job-k-octets-supported", - - "job-impressions-supported, - - "job-media-sheets-supported" - - "printer-driver-installer", - - "color-supported", and - - "reference-uri-schemes-supported" - - The values of all other Printer object attributes (including - "document-format-supported") remain invariant with respect to - the client supplied document format (except for new Printer - description attribute as registered according to section 6.2). - - If the client omits this "document-format" operation attribute, - the Printer object MUST respond as if the attribute had been - supplied with the value of the Printer object's "document- - format-default" attribute. It is recommended that the client - always supply a value for "document-format", since the Printer - object's "document-format-default" may be 'application/octet- - stream', in which case the returned attributes and values are - for the union of the document formats that the Printer can - automatically sense. For more details, see the description of - the 'mimeMediaType' attribute syntax in section 4.1.9. - - If the client supplies a value for the "document-format" - Operation attribute that is not supported by the Printer, i.e., - is not among the values of the Printer object's "document- - format-supported" attribute, the Printer object MUST reject the - operation and return the 'client-error-document-format-not- - supported' status code. - - - -deBry, et al. Experimental [Page 45] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - -3.2.5.2 Get-Printer-Attributes Response - - The Printer object returns the following sets of attributes as part - of the Get-Printer-Attributes Response: - - Group 1: Operation Attributes - - Status Message: - In addition to the REQUIRED status code returned in every - response, the response OPTIONALLY includes a "status-message" - (text) operation attribute as described in section 3.1.6. - - Natural Language and Character Set: - The "attributes-charset" and "attributes-natural-language" - attributes as described in section 3.1.4.2. - - Group 2: Unsupported Attributes - - This is a set of Operation attributes supplied by the client (in - the request) that are not supported by the Printer object or - that conflict with one another (see sections 3.2.1.2 and 16). - The response NEED NOT contain the "requested-attributes" - operation attribute with any supplied values (attribute - keywords) that were requested by the client but are not - supported by the IPP object. If the Printer object is not - returning any Unsupported Attributes in the response, the - Printer object SHOULD omit Group 2 rather than sending an empty - group. However, a client MUST be able to accept an empty group. - - Group 3: Printer Object Attributes - - This is the set of requested attributes and their current - values. The Printer object ignores (does not respond with) any - requested attribute which is not supported. The Printer object - MAY respond with a subset of the supported attributes and - values, depending on the security policy in force. However, the - Printer object MUST respond with the 'unknown' value for any - supported attribute (including all REQUIRED attributes) for - which the Printer object does not know the value. Also the - Printer object MUST respond with the 'no-value' for any - supported attribute (including all REQUIRED attributes) for - which the system administrator has not configured a value. See - the description of the "out-of-band" values in the beginning of - Section 4.1. - - - - - - - -deBry, et al. Experimental [Page 46] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - -3.2.6 Get-Jobs Operation - - This REQUIRED operation allows a client to retrieve the list of Job - objects belonging to the target Printer object. The client may also - supply a list of Job attribute names and/or attribute group names. A - group of Job object attributes will be returned for each Job object - that is returned. - - This operation is similar to the Get-Job-Attributes operation, except - that this Get-Jobs operation returns attributes from possibly more - than one object (see the description of Job attribute group names in - section 3.3.4). - -3.2.6.1 Get-Jobs Request - - The client submits the Get-Jobs request to a Printer object. - - The following groups of attributes are part of the Get-Jobs Request: - - Group 1: Operation Attributes - - Natural Language and Character Set: - The "attributes-charset" and "attributes-natural-language" - attributes as described in section 3.1.4.1. - - Target: - The "printer-uri" (uri) operation attribute which is the target - for this operation as described in section 3.1.5. - - Requesting User Name: - The "requesting-user-name" (name(MAX)) attribute SHOULD be - supplied by the client as described in section 8.3. - - "limit" (integer(1:MAX)): - The client OPTIONALLY supplies this attribute. The Printer - object MUST support this attribute. It is an integer value that - indicates a limit to the number of Job objects returned. The - limit is a "stateless limit" in that if the value supplied by - the client is 'N', then only the first 'N' jobs are returned in - the Get-Jobs Response. There is no mechanism to allow for the - next 'M' jobs after the first 'N' jobs. If the client does not - supply this attribute, the Printer object responds with all - applicable jobs. - - "requested-attributes" (1setOf keyword): - The client OPTIONALLY supplies this attribute. The Printer - object MUST support this attribute. It is a set of Job - attribute names and/or attribute groups names in whose values - - - -deBry, et al. Experimental [Page 47] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - the requester is interested. This set of attributes is returned - for each Job object that is returned. The allowed attribute - group names are the same as those defined in the Get-Job- - Attributes operation in section 3.3.4. If the client does not - supply this attribute, the Printer MUST respond as if the client - had supplied this attribute with two values: 'job-uri' and ' - job-id'. - - "which-jobs" (type2 keyword): - The client OPTIONALLY supplies this attribute. The Printer - object MUST support this attribute. It indicates which Job - objects MUST be returned by the Printer object. The values for - this attribute are: - - 'completed': This includes any Job object whose state is - 'completed', 'canceled', or 'aborted'. - 'not-completed': This includes any Job object whose state is ' - pending', 'processing', 'processing-stopped', or 'pending- - held'. - - A Printer object MUST support both values. However, if the - mentation does not keep jobs in the 'completed', 'canceled', ' - aborted' states, then it returns no jobs when the 'completed' - value is supplied. - - If a client supplies some other value, the Printer object MUST - copy the attribute and the unsupported value to the Unsupported - Attributes response group, reject the request, and return the ' - client-error-attributes-or-values-not-supported' status code. - - If the client does not supply this attribute, the Printer object - MUST respond as if the client had supplied the attribute with a - value of 'not-completed'. - - "my-jobs" (boolean): - The client OPTIONALLY supplies this attribute. The Printer - object MUST support this attribute. It indicates whether all - jobs or just the jobs submitted by the requesting user of this - request MUST be returned by the Printer object. If the client - does not supply this attribute, the Printer object MUST respond - as if the client had supplied the attribute with a value of ' - false', i.e., all jobs. The means for authenticating the - requesting user and matching the jobs is described in section 8. - - - - - - - - -deBry, et al. Experimental [Page 48] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - -3.2.6.2 Get-Jobs Response - - The Printer object returns all of the Job objects that match the - criteria as defined by the attribute values supplied by the client in - the request. It is possible that no Job objects are returned since - there may literally be no Job objects at the Printer, or there may be - no Job objects that match the criteria supplied by the client. If - the client requests any Job attributes at all, there is a set of Job - Object Attributes returned for each Job object. - - Group 1: Operation Attributes - - Status Message: - In addition to the REQUIRED status code returned in every - response, the response OPTIONALLY includes a "status-message" - (text) operation attribute as described in sections 14 and - 3.1.6. - - Natural Language and Character Set: - The "attributes-charset" and "attributes-natural-language" - attributes as described in section 3.1.4.2. - - Group 2: Unsupported Attributes - - This is a set of Operation attributes supplied by the client (in - the request) that are not supported by the Printer object or - that conflict with one another (see sections 3.2.1.2 and the - Implementer's Guide [ipp-iig]). The response NEED NOT contain - the "requested-attributes" operation attribute with any supplied - values (attribute keywords) that were requested by the client - but are not supported by the IPP object. If the Printer object - is not returning any Unsupported Attributes in the response, the - Printer object SHOULD omit Group 2 rather than sending an empty - group. However, a client MUST be able to accept an empty group. - - Groups 3 to N: Job Object Attributes - - The Printer object responds with one set of Job Object - Attributes for each returned Job object. The Printer object - ignores (does not respond with) any requested attribute or value - which is not supported or which is restricted by the security - policy in force, including whether the requesting user is the - user that submitted the job (job originating user) or not (see - section 8). However, the Printer object MUST respond with the ' - unknown' value for any supported attribute (including all - REQUIRED attributes) for which the Printer object does not know - - - - - -deBry, et al. Experimental [Page 49] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - the value, unless it would violate the security policy. See the - description of the "out-of-band" values in the beginning of - Section 4.1. - - Jobs are returned in the following order: - - - If the client requests all 'completed' Jobs (Jobs in the ' - completed', 'aborted', or 'canceled' states), then the Jobs - are returned newest to oldest (with respect to actual - completion time) - - If the client requests all 'not-completed' Jobs (Jobs in the - 'pending', 'processing', 'pending-held', and 'processing- - stopped' states), then Jobs are returned in relative - chronological order of expected time to complete (based on - whatever scheduling algorithm is configured for the Printer - object). - -3.3 Job Operations - - All Job operations are directed at Job objects. A client MUST always - supply some means of identifying the Job object in order to identify - the correct target of the operation. That job identification MAY - either be a single Job URI or a combination of a Printer URI with a - Job ID. The IPP object implementation MUST support both forms of - identification for every job. - -3.3.1 Send-Document Operation - - This OPTIONAL operation allows a client to create a multi-document - Job object that is initially "empty" (contains no documents). In the - Create-Job response, the Printer object returns the Job object's URI - (the "job-uri" attribute) and the Job object's 32-bit identifier (the - "job-id" attribute). For each new document that the client desires - to add, the client uses a Send-Document operation. Each Send- - Document Request contains the entire stream of document data for one - document. - - Since the Create-Job and the send operations (Send-Document or Send- - URI operations) that follow could occur over an arbitrarily long - period of time for a particular job, a client MUST send another send - operation within an IPP Printer defined minimum time interval after - the receipt of the previous request for the job. If a Printer object - supports multiple document jobs, the Printer object MUST support the - "multiple-operation-time-out" attribute (see section 4.4.28). This - attribute indicates the minimum number of seconds the Printer object - will wait for the next send operation before taking some recovery - action. - - - - -deBry, et al. Experimental [Page 50] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - An IPP object MUST recover from an errant client that does not supply - a send operation, sometime after the minimum time interval specified - by the Printer object's "multiple-operation-time-out" attribute. - Such recovery MAY include any of the following or other recovery - actions: - - 1. Assume that the Job is an invalid job, start the process of - changing the job state to 'aborted', add the 'aborted-by-system' - value to the job's "job-state-reasons" attribute (see section - 4.3.8), if supported, and clean up all resources associated with - the Job. In this case, if another send operation is finally - received, the Printer responds with an "client-error-not- - possible" or "client-error-not-found" depending on whether or - not the Job object is still around when the send operation - finally arrives. - 2. Assume that the last send operation received was in fact the - last document (as if the "last-document" flag had been set to ' - true'), close the Job object, and proceed to process it (i.e., - move the Job's state to 'pending'). - 3. Assume that the last send operation received was in fact the - last document, close the Job, but move it to the 'pending-held' - and add the 'submission-interrupted' value to the job's "job- - state-reasons" attribute (see section 4.3.8), if supported. - This action allows the user or an operator to determine whether - to continue processing the Job by moving it back to the ' - pending' state or to cancel the job. - - Each implementation is free to decide the "best" action to take - depending on local policy, whether any documents have been added, - whether the implementation spools jobs or not, and/or any other piece - of information available to it. If the choice is to abort the Job - object, it is possible that the Job object may already have been - processed to the point that some media sheet pages have been printed. - -3.3.1.1 Send-Document Request - - The following attribute sets are part of the Send-Document Request: - - Group 1: Operation Attributes - - Natural Language and Character Set: - The "attributes-charset" and "attributes-natural-language" - attributes as described in section 3.1.4.1. - - - - - - - - -deBry, et al. Experimental [Page 51] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - Target: - Either (1) the "printer-uri" (uri) plus "job-id" - (integer(1:MAX))or (2) the "job-uri" (uri) operation - attribute(s) which define the target for this operation as - described in section 3.1.5. - - Requesting User Name: - "requesting-user-name" (name(MAX)) attribute SHOULD be supplied - by the client as described in section 8.3. - - "document-name" (name(MAX)): - The client OPTIONALLY supplies this attribute. The Printer - object MUST support this attribute. It contains the client - supplied document name. The document name MAY be different than - the Job name. It might be helpful, but NEED NOT be unique - across multiple documents in the same Job. Typically, the - client software automatically supplies the document name on - behalf of the end user by using a file name or an application - generated name. See the description of the "document-name" - operation attribute in the Print-Job Request (section 3.2.1.1) - for more information about this attribute - - "document-format" (mimeMediaType): - The client OPTIONALLY supplies this attribute. The Printer - object MUST support this attribute. The value of this attribute - identifies the format of the supplied document data. If the - client does not supply this attribute, the Printer object - assumes that the document data is in the format defined by the - Printer object's "document-format-default" attribute. If the - client supplies this attribute, but the value is not supported - by the Printer object, i.e., the value is not one of the values - of the Printer object's "document-format-supported" attribute, - the Printer object MUST reject the request and return the ' - client-error-document-format-not-supported' status code. - - "document-natural-language" (naturalLanguage): - The client OPTIONALLY supplies this attribute. The Printer - object OPTIONALLY supports this attribute. This attribute - specifies the natural language of the document for those - document-formats that require a specification of the natural - language in order to image the document unambiguously. There - are no particular values required for the Printer object to - support. - - "compression" (type3 keyword) - The client OPTIONALLY supplies this attribute. The Printer - object OPTIONALLY supports this attribute and the "compression- - supported" attribute (see section 4.4.29). The client supplied - - - -deBry, et al. Experimental [Page 52] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - "compression" operation attribute identifies the compression - algorithm used on the document data. If the client omits this - attribute, the Printer object MUST assume that the data is not - compressed. If the client supplies the attribute and the - Printer object supports the attribute, the Printer object MUST - use the corresponding decompression algorithm on the document - data. If the client supplies this attribute, but the value is - not supported by the Printer object, i.e., the value is not one - of the values of the Printer object's "compression-supported" - attribute, the Printer object MUST copy the attribute and its - value to the Unsupported Attributes response group, reject the - request, and return the 'client-error-attributes-or-values-not- - supported' status code. - - "last-document" (boolean): - The client MUST supply this attribute. The Printer object MUST - support this attribute. It is a boolean flag that is set to ' - true' if this is the last document for the Job, 'false' - otherwise. - - Group 2: Document Content - - The client MUST supply the document data if the "last-document" - flag is set to 'false'. However, since a client might not know - that the previous document sent with a Send-Document (or Send- - URI) operation was the last document (i.e., the "last-document" - attribute was set to 'false'), it is legal to send a Send- - Document request with no document data where the "last-document" - flag is set to 'true'. Such a request MUST NOT increment the - value of the Job object's "number-of-documents" attribute, since - no real document was added to the job. - -3.3.1.2 Send-Document Response - - The following sets of attributes are part of the Send-Document - Response: - - Group 1: Operation Attributes - - Status Message: - In addition to the REQUIRED status code returned in every - response, the response OPTIONALLY includes a "status-message" - (text) operation attribute as described in sections 14 and - 3.1.6. - - Natural Language and Character Set: - The "attributes-charset" and "attributes-natural-language" - attributes as described in section 3.1.4.2. - - - -deBry, et al. Experimental [Page 53] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - Group 2: Unsupported Attributes - - This is a set of Operation attributes supplied by the client (in - the request) that are not supported by the Printer object or - that conflict with one another (see sections 3.2.1.2 and the - Implementer's Guide [ipp-iig]). If the Printer object is not - returning any Unsupported Attributes in the response, the - Printer object SHOULD omit Group 2 rather than sending an empty - group. However, a client MUST be able to accept an empty group. - - Group 3: Job Object Attributes - - This is the same set of attributes as described in the Print-Job - response (see section 3.2.1.2). - -3.3.2 Send-URI Operation - - This OPTIONAL operation is identical to the Send-Document operation - (see section 3.3.1) except that a client MUST supply a URI reference - ("document-uri" operation attribute) rather than the document data - itself. If a Printer object supports this operation, clients can use - both Send-URI or Send-Document operations to add new documents to an - existing multi-document Job object. However, if a client needs to - indicate that the previous Send-URI or Send-Document was the last - document, the client MUST use the Send-Document operation with no - document data and the "last-document" flag set to 'true' (rather than - using a Send-URI operation with no "document-uri" operation - attribute). - - If a Printer object supports this operation, it MUST also support the - Print-URI operation (see section 3.2.2). - - The Printer object MUST validate the syntax and URI scheme of the - supplied URI before returning a response, just as in the Print-URI - operation. - -3.3.3 Cancel-Job Operation - - This REQUIRED operation allows a client to cancel a Print Job from - the time the job is created up to the time it is completed, canceled, - or aborted. Since a Job might already be printing by the time a - Cancel-Job is received, some media sheet pages might be printed - before the job is actually terminated. - -3.3.3.1 Cancel-Job Request - - The following groups of attributes are part of the Cancel-Job - Request: - - - -deBry, et al. Experimental [Page 54] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - Group 1: Operation Attributes - - Natural Language and Character Set: - The "attributes-charset" and "attributes-natural-language" - attributes as described in section 3.1.4.1. - - Target: - Either (1) the "printer-uri" (uri) plus "job-id" - (integer(1:MAX))or (2) the "job-uri" (uri) operation - attribute(s) which define the target for this operation as - described in section 3.1.5. - - Requesting User Name: - The "requesting-user-name" (name(MAX)) attribute SHOULD be - supplied by the client as described in section 8.3. - - "message" (text(127)): - The client OPTIONALLY supplies this attribute. The Printer - object OPTIONALLY supports this attribute. It is a message to - the operator. This "message" attribute is not the same as the - "job-message-from-operator" attribute. That attribute is used - to report a message from the operator to the end user that - queries that attribute. This "message" operation attribute is - used to send a message from the client to the operator along - with the operation request. It is an implementation decision of - how or where to display this message to the operator (if at - all). - -3.3.3.2 Cancel-Job Response - - The following sets of attributes are part of the Cancel-Job Response: - - Group 1: Operation Attributes - - Status Message: - In addition to the REQUIRED status code returned in every - response, the response OPTIONALLY includes a "status-message" - (text) operation attribute as described in sections 14 and - 3.1.6. - - If the job is already in the 'completed', 'aborted', or ' - canceled' state, or the 'process-to-stop-point' value is set in - the Job's "job-state-reasons" attribute, the Printer object MUST - reject the request and return the 'client-error-not-possible' - error status code. - - - - - - -deBry, et al. Experimental [Page 55] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - Natural Language and Character Set: - The "attributes-charset" and "attributes-natural-language" - attributes as described in section 3.1.4.2. - - Group 2: Unsupported Attributes - - This is a set of Operation attributes supplied by the client (in - the request) that are not supported by the Printer object or - that conflict with one another (see section 3.2.1.2 and the - Implementer's Guide [ipp-iig]). If the Printer object is not - returning any Unsupported Attributes in the response, the - Printer object SHOULD omit Group 2 rather than sending an empty - group. However, a client MUST be able to accept an empty group. - - Once a successful response has been sent, the implementation - guarantees that the Job will eventually end up in the 'canceled' - state. Between the time of the Cancel-Job operation is accepted and - when the job enters the 'canceled' job-state (see section 4.3.7), the - "job-state-reasons" attribute SHOULD contain the 'processing-to- - stop-point' value which indicates to later queries that although the - Job might still be 'processing', it will eventually end up in the ' - canceled' state, not the 'completed' state. - -3.3.4 Get-Job-Attributes Operation - - This REQUIRED operation allows a client to request the values of - attributes of a Job object and it is almost identical to the Get- - Printer-Attributes operation (see section 3.2.5). The only - differences are that the operation is directed at a Job object rather - than a Printer object, there is no "document-format" operation - attribute used when querying a Job object, and the returned attribute - group is a set of Job object attributes rather than a set of Printer - object attributes. - - For Jobs, the possible names of attribute groups are: - - - 'job-template': all of the Job Template attributes that apply to a - Job object (the first column of the table in Section 4.2). - - 'job-description': all of the Job Description attributes specified - in Section 4.3. - - 'all': the special group 'all' that includes all supported - attributes. - - Since a client MAY request specific attributes or named groups, there - is a potential that there is some overlap. For example, if a client - requests, 'job-name' and 'job-description', the client is actually - requesting the "job-name" attribute once by naming it explicitly, and - once by inclusion in the 'job-description' group. In such cases, the - - - -deBry, et al. Experimental [Page 56] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - Printer object NEED NOT return the attribute only once in the - response even if it is requested multiple times. The client SHOULD - NOT request the same attribute in multiple ways. - - It is NOT REQUIRED that a Job object support all attributes belonging - to a group (since some attributes are OPTIONAL). However it is - REQUIRED that each Job object support all group names. - -3.3.4.1 Get-Job-Attributes Request - - The following groups of attributes are part of the Get-Job-Attributes - Request when the request is directed at a Job object: - - Group 1: Operation Attributes - - Natural Language and Character Set: - The "attributes-charset" and "attributes-natural-language" - attributes as described in section 3.1.4.1. - - Target: - Either (1) the "printer-uri" (uri) plus "job-id" - (integer(1:MAX)) or (2) the "job-uri" (uri) operation - attribute(s) which define the target for this operation as - described in section 3.1.5. - - Requesting User Name: - The "requesting-user-name" (name(MAX)) attribute SHOULD be - supplied by the client as described in section 8.3. - - "requested-attributes" (1setOf keyword) : - The client OPTIONALLY supplies this attribute. The IPP object - MUST support this attribute. It is a set of attribute names - and/or attribute group names in whose values the requester is - interested. If the client omits this attribute, the IPP object - MUST respond as if this attribute had been supplied with a value - of 'all'. - -3.3.4.2 Get-Job-Attributes Response - - The Printer object returns the following sets of attributes as part - of the Get-Job-Attributes Response: - - - - - - - - - - -deBry, et al. Experimental [Page 57] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - Group 1: Operation Attributes - - Status Message: - In addition to the REQUIRED status code returned in every - response, the response OPTIONALLY includes a "status-message" - (text) operation attribute as described in sections 14 and - 3.1.6. - - Natural Language and Character Set: - The "attributes-charset" and "attributes-natural-language" - attributes as described in section 3.1.4.2. The "attributes- - natural-language" MAY be the natural language of the Job object, - rather than the one requested. - - Group 2: Unsupported Attributes - - This is a set of Operation attributes supplied by the client (in - the request) that are not supported by the Printer object or - that conflict with one another (see sections 3.2.1.2 and the - Implementer's Guide [ipp-iig]). The response NEED NOT contain - the "requested-attributes" operation attribute with any supplied - values (attribute keywords) that were requested by the client - but are not supported by the IPP object. If the Printer object - is not returning any Unsupported Attributes in the response, the - Printer object SHOULD omit Group 2 rather than sending an empty - group. However, a client MUST be able to accept an empty group. - - Group 3: Job Object Attributes - - This is the set of requested attributes and their current - values. The IPP object ignores (does not respond with) any - requested attribute or value which is not supported or which is - restricted by the security policy in force, including whether - the requesting user is the user that submitted the job (job - originating user) or not (see section 8). However, the IPP - object MUST respond with the 'unknown' value for any supported - attribute (including all RED butes) for which the IPP object - does not know the value, s it would violate the security policy. - See the description e "out-of-band" values in the beginning of - Section 4.1. - -4. Object Attributes - - This section describes the attributes with their corresponding - attribute syntaxes and values that are part of the IPP model. The - sections below show the objects and their associated attributes which - are included within the scope of this protocol. Many of these - attributes are derived from other relevant specifications: - - - -deBry, et al. Experimental [Page 58] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - - Document Printing Application (DPA) [ISO10175] - - RFC 1759 Printer MIB [RFC1759] - - Each attribute is uniquely identified in this document using a - "keyword" (see section 12.2.1) which is the name of the attribute. - The keyword is included in the section header describing that - attribute. - - Note: Not only are keywords used to identify attributes, but one of - the attribute syntaxes described below is "keyword" so that some - attributes have keyword values. Therefore, these attributes are - defined as having an attribute syntax that is a set of keywords. - -4.1 Attribute Syntaxes - - This section defines the basic attribute syntax types that all clients - and IPP objects MUST be able to accept in responses and accept in - requests, respectively. Each attribute description in sections 3 and - 4 includes the name of attribute syntax(es) in the heading (in - parentheses). A conforming implementation of an attribute MUST - include the semantics of the attribute syntax(es) so identified. - Section 6.3 describes how the protocol can be extended with new - attribute syntaxes. - - The attribute syntaxes are specified in the following sub-sections, - where the sub-section heading is the keyword name of the attribute - syntax inside the single quotes. In operation requests and responses - each attribute value MUST be represented as one of the attribute - syntaxes specified in the sub-section heading for the attribute. In - addition, the value of an attribute in a response (but not in a - request) MAY be one of the "out-of-band" values. Standard - "out-of-band" values are: - - 'unknown': The attribute is supported by the IPP object, but the - value is unknown to the IPP object for some reason. - 'unsupported': The attribute is unsupported by the IPP object. This - value MUST be returned only as the value of an attribute in the - Unsupported Attributes Group. - 'no-value': The attribute is supported by the Printer object, but - the system administrator has not yet configured a value. - - The Encoding and Transport specification [RFC2565] defines mechanisms - for passing "out-of-band" values. All attributes in a request MUST - have one or more values as defined in Sections 4.2 to 4.4. Thus - clients MUST NOT supply attributes with "out-of-band" values. All - attribute in a response MUST have one or more values as defined in - Sections 4.2 to 4.4 or a single "out-of-band" value. - - - - -deBry, et al. Experimental [Page 59] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - Most attributes are defined to have a single attribute syntax. - However, a few attributes (e.g., "job-sheet", "media", "job-hold- - until") are defined to have several attribute syntaxes, depending on - the value. These multiple attribute syntaxes are separated by the - "|" character in the sub-section heading to indicate the choice. - Since each value MUST be tagged as to its attribute syntax in the - - protocol, a single-valued attribute instance may have any one of its - attribute syntaxes and a multi-valued attribute instance may have a - mixture of its defined attribute syntaxes. - -4.1.1 'text' - - A text attribute is an attribute whose value is a sequence of zero or - more characters encoded in a maximum of 1023 ('MAX') octets. MAX is - the maximum length for each value of any text attribute. However, if - an attribute will always contain values whose maximum length is much - less than MAX, the definition of that attribute will include a - qualifier that defines the maximum length for values of that - attribute. For example: the "printer-location" attribute is - specified as "printer-location (text(127))". In this case, text - values for "printer-location" MUST NOT exceed 127 octets; if supplied - with a longer text string via some external interface (other than the - protocol), implementations are free to truncate to this shorter - length limitation. - - In this specification, all text attributes are defined using the ' - text' syntax. However, 'text' is used only for brevity; the formal - interpretation of 'text' is: 'textWithoutLanguage | - textWithLanguage'. That is, for any attribute defined in this - specification using the 'text' attribute syntax, all IPP objects and - clients MUST support both the 'textWithoutLanguage' and ' - textWithLanguage' attribute syntaxes. However, in actual usage and - protocol execution, objects and clients accept and return only one of - the two syntax per attribute. The syntax 'text' never appears "on- - the-wire". - - Both 'textWithoutLanguage' and 'textWithLanguage' are needed to - support the real world needs of interoperability between sites and - systems that use different natural languages as the basis for human - communication. Generally, one natural language applies to all text - attributes in a given request or response. The language is indicated - by the "attributes-natural-language" operation attribute defined in - section 3.1.4 or "attributes-natural-language" job attribute defined - in section 4.3.24, and there is no need to identify the natural - language for each text string on a value-by-value basis. In these - cases, the attribute syntax 'textWithoutLanguage' is used for text - attributes. In other cases, the client needs to supply or the - - - -deBry, et al. Experimental [Page 60] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - Printer object needs to return a text value in a natural language - that is different from the rest of the text values in the request or - response. In these cases, the client or Printer object uses the - attribute syntax 'textWithLanguage' for text attributes (this is the - Natural Language Override mechanism described in section 3.1.4). - - The 'textWithoutLanguage' and 'textWithLanguage' attribute syntaxes - are described in more detail in the following sections. - -4.1.1.1 'textWithoutLanguage' - - The 'textWithoutLanguage' syntax indicates a value that is sequence - of zero or more characters. Text strings are encoded using the rules - of some charset. The Printer object MUST support the UTF-8 charset - [RFC2279] and MAY support additional charsets to represent 'text' - values, provided that the charsets are registered with IANA [IANA- - CS]. See Section 4.1.7 for the specification of the 'charset' - attribute syntax, including restricted semantics and examples of - charsets. - -4.1.1.2 'textWithLanguage' - - The 'textWithLanguage' attribute syntax is a compound attribute - syntax consisting of two parts: a 'textWithoutLanguage' part plus an - additional 'naturalLanguage' (see section 4.1.8) part that overrides - the natural language in force. The 'naturalLanguage' part explicitly - identifies the natural language that applies to the text part of that - value and that value alone. For any give text attribute, the ' - textWithoutLanguage' part is limited to the maximum length defined - for that attribute, but the 'naturalLanguage' part is always limited - to 63 octets. Using the 'textWithLanguage' attribute syntax rather - than the normal 'textWithoutLanguage' syntax is the so-called Natural - Language Override mechanism and MUST be supported by all IPP objects - and clients. - - If the attribute is multi-valued (1setOf text), then the ' - textWithLanguage' attribute syntax MUST be used to explicitly specify - each attribute value whose natural language needs to be overridden. - Other values in a multi-valued 'text' attribute in a request or a - response revert to the natural language of the operation attribute. - - In a create request, the Printer object MUST accept and store with - the Job object any natural language in the "attributes-natural- - language" operation attribute, whether the Printer object supports - that natural language or not. Furthermore, the Printer object MUST - accept and store any 'textWithLanguage' attribute value, whether the - - - - - -deBry, et al. Experimental [Page 61] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - Printer object supports that natural language or not. These - requirements are independent of the value of the "ipp-attribute- - fidelity" operation attribute that the client MAY supply. - - Example: If the client supplies the "attributes-natural-language" - operation attribute with the value: 'en' indicating English, but the - value of the "job-name" attribute is in French, the client MUST use - the 'textWithLanguage' attribute syntax with the following two - values: - - 'fr': Natural Language Override indicating French - 'Rapport Mensuel': the job name in French - - See the Encoding and Transport document [RFC2565] for a detailed - example of the 'textWithLanguage' attribute syntax. - -4.1.2 'name' - - This syntax type is used for user-friendly strings, such as a Printer - name, that, for humans, are more meaningful than identifiers. Names - are never translated from one natural language to another. The ' - name' attribute syntax is essentially the same as 'text', including - the REQUIRED support of UTF-8 except that the sequence of characters - is limited so that its encoded form MUST NOT exceed 255 (MAX) octets. - - Also like 'text', 'name' is really an abbreviated notation for either - 'nameWithoutLanguage' or 'nameWithLanguage'. That is, all IPP - objects and clients MUST support both the 'nameWithoutLanguage' and ' - nameWithLanguage' attribute syntaxes. However, in actual usage and - protocol execution, objects and clients accept and return only one of - the two syntax per attribute. The syntax 'name' never appears "on- - the-wire". - - Note: Only the 'text' and 'name' attribute syntaxes permit the - Natural Language Override mechanism. - - Some attributes are defined as 'type3 keyword | name'. These - attributes support values that are either type3 keywords or names. - This dual-syntax mechanism enables a site administrator to extend - these attributes to legally include values that are locally defined - by the site administrator. Such names are not registered with IANA. - -4.1.2.1 'nameWithoutLanguage' - - The 'nameWithoutLanguage' syntax indicates a value that is sequence - of zero or more characters so that its encoded form does not exceed - MAX octets. - - - - -deBry, et al. Experimental [Page 62] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - -4.1.2.2 'nameWithLanguage' - - The 'nameWithLanguage' attribute syntax is a compound attribute - syntax consisting of two parts: a 'nameWithoutLanguage' part plus an - additional 'naturalLanguage' (see section 4.1.8) part that overrides - the natural language in force. The 'naturalLanguage' part explicitly - identifies the natural language that applies to that name value and - that name value alone. - - The 'nameWithLanguage' attribute syntax behaves the same as the ' - textWithLanguage' syntax. If a name is in a language that is - different than the rest of the object or operation, then this ' - nameWithLanguage' syntax is used rather than the generic ' - nameWithoutLanguage' syntax. - - Example: If the client supplies the "attributes-natural-language" - operation attribute with the value: 'en' indicating English, but the - "printer-name" attribute is in German, the client MUST use the ' - nameWithLanguage' attribute syntax as follows: - - 'de': Natural Language Override indicating German - 'Farbdrucker': the Printer name in German - -4.1.2.3 Matching 'name' attribute values - - For purposes of matching two 'name' attribute values for equality, - such as in job validation (where a client-supplied value for - attribute "xxx" is checked to see if the value is among the values of - the Printer object's corresponding "xxx-supported" attribute), the - following match rules apply: - - 1. 'keyword' values never match 'name' values. - - 2. 'name' (nameWithoutLanguage and nameWithLanguage) values - match if (1) the name parts match and (2) the Associated - Natural-Language parts (see section 3.1.4.1) match. The - matching rules are: - - a. the name parts match if the two names are identical - character by character, except it is RECOMMENDED that case - be ignored. For example: 'Ajax-letter-head-white' MUST - match 'Ajax-letter-head-white' and SHOULD match 'ajax- - letter-head-white' and 'AJAX-LETTER-HEAD-WHITE'. - - b. the Associated Natural-Language parts match if the - shorter of the two meets the syntactic requirements of RFC - 1766 [RFC1766] and matches byte for byte with the longer. - For example, 'en' matches 'en', 'en-us' and 'en-gb', but - - - -deBry, et al. Experimental [Page 63] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - matches neither 'fr' nor 'e'. - -4.1.3 'keyword' - - The 'keyword' attribute syntax is a sequence of characters, length: 1 - to 255, containing only the US-ASCII [ASCII] encoded values for - lowercase letters ("a" - "z"), digits ("0" - "9"), hyphen ("-"), dot - ("."), and underscore ("_"). The first character MUST be a lowercase - letter. Furthermore, keywords MUST be in U.S. English. - - This syntax type is used for enumerating semantic identifiers of - entities in the abstract protocol, i.e., entities identified in this - document. Keywords are used as attribute names or values of - attributes. Unlike 'text' and 'name' attribute values, 'keyword' - values MUST NOT use the Natural Language Override mechanism, since - they MUST always be US-ASCII and U.S. English. - - Keywords are for use in the protocol. A user interface will likely - provide a mapping between protocol keywords and displayable user- - friendly words and phrases which are localized to the natural - language of the user. While the keywords specified in this document - MAY be displayed to users whose natural language is U.S. English, - they MAY be mapped to other U.S. English words for U.S. English - users, since the user interface is outside the scope of this - document. - - In the definition for each attribute of this syntax type, the full - set of defined keyword values for that attribute are listed. - - When a keyword is used to represent an attribute (its name), it MUST - be unique within the full scope of all IPP objects and attributes. - When a keyword is used to represent a value of an attribute, it MUST - be unique just within the scope of that attribute. That is, the same - keyword MUST NOT be used for two different values within the same - attribute to mean two different semantic ideas. However, the same - keyword MAY be used across two or more attributes, representing - different semantic ideas for each attribute. Section 6.1 describes - how the protocol can be extended with new keyword values. Examples - of attribute name keywords: - - "job-name" - "attributes-charset" - - Note: This document uses "type1", "type2", and "type3" prefixes to - the "keyword" basic syntax to indicate different levels of review for - extensions (see section 6.1). - - - - - -deBry, et al. Experimental [Page 64] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - -4.1.4 'enum' - - The 'enum' attribute syntax is an enumerated integer value that is in - the range from 1 to 2**31 - 1 (MAX). Each value has an associated ' - keyword' name. In the definition for each attribute of this syntax - type, the full set of possible values for that attribute are listed. - This syntax type is used for attributes for which there are enum - values assigned by other standards, such as SNMP MIBs. A number of - attribute enum values in this specification are also used for - corresponding attributes in other standards [RFC1759]. This syntax - type is not used for attributes to which the system administrator may - assign values. Section 6.1 describes how the protocol can be - extended with new enum values. - - Enum values are for use in the protocol. A user interface will - provide a mapping between protocol enum values and displayable user- - friendly words and phrases which are localized to the natural - language of the user. While the enum symbols specified in this - document MAY be displayed to users whose natural language is U.S. - English, they MAY be mapped to other U.S. English words for U.S. - English users, since the user interface is outside the scope of this - document. - - Note: SNMP MIBs use '2' for 'unknown' which corresponds to the IPP - "out-of-band" value 'unknown'. See the description of the "out-of- - band" values at the beginning of Section 4.1. Therefore, attributes - of type 'enum' start at '3'. - - Note: This document uses "type1", "type2", and "type3" prefixes to - the "enum" basic syntax to indicate different levels of review for - extensions (see section 6.1). - -4.1.5 'uri' - - The 'uri' attribute syntax is any valid Uniform Resource Identifier - or URI [RFC2396]. Most often, URIs are simply Uniform Resource - Locators or URLs. The maximum length of URIs used as values of IPP - attributes is 1023 octets. Although most other IPP attribute syntax - types allow for only lower-cased values, this attribute syntax type - conforms to the case-sensitive and case-insensitive rules specified - in [RFC2396]. - -4.1.6 'uriScheme' - - The 'uriScheme' attribute syntax is a sequence of characters - representing a URI scheme according to RFC 2396 [RFC2396]. Though - RFC 2396 requires that the values be case-insensitive, IPP requires - - - - -deBry, et al. Experimental [Page 65] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - all lower case values in IPP attributes to simplify comparing by IPP - clients and Printer objects. Standard values for this syntax type - are the following keywords: - - 'http': for HTTP schemed URIs (e.g., "http:...") - 'https': for use with HTTPS schemed URIs (e.g., "https:...") - (not on IETF standards track) - 'ftp': for FTP schemed URIs (e.g., "ftp:...") - 'mailto': for SMTP schemed URIs (e.g., "mailto:...") - 'file': for file schemed URIs (e.g., "file:...") - - A Printer object MAY support any URI 'scheme' that has been - registered with IANA [IANA-MT]. The maximum length of URI 'scheme' - values used to represent IPP attribute values is 63 octets. - -4.1.7 'charset' - - The 'charset' attribute syntax is a standard identifier for a - charset. A charset is a coded character set and encoding scheme. - Charsets are used for labeling certain document contents and 'text' - and 'name' attribute values. The syntax and semantics of this - attribute syntax are specified in RFC 2046 [RFC2046] and contained in - the IANA character-set Registry [IANA-CS] according to the IANA - procedures [RFC2278]. Though RFC 2046 requires that the values be - case-insensitive US-ASCII, IPP requires all lower case values in IPP - attributes to simplify comparing by IPP clients and Printer objects. - When a character-set in the IANA registry has more than one name - (alias), the name labeled as "(preferred MIME name)", if present, - MUST be used. - - The maximum length of 'charset' values used to represent IPP - attribute values is 63 octets. - - Some examples are: - - 'utf-8': ISO 10646 Universal Multiple-Octet Coded Character Set - (UCS) represented as the UTF-8 [RFC2279] transfer encoding - scheme in which US-ASCII is a subset charset. - 'us-ascii': 7-bit American Standard Code for Information - Interchange (ASCII), ANSI X3.4-1986 [ASCII]. That standard - defines US-ASCII, but RFC 2045 [RFC2045] eliminates most of the - control characters from conformant usage in MIME and IPP. - 'iso-8859-1': 8-bit One-Byte Coded Character Set, Latin Alphabet - Nr 1 [ISO8859-1]. That standard defines a coded character set - that is used by Latin languages in the Western Hemisphere and - Western Europe. US-ASCII is a subset charset. - - - - - -deBry, et al. Experimental [Page 66] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - 'iso-10646-ucs-2': ISO 10646 Universal Multiple-Octet Coded - Character Set (UCS) represented as two octets (UCS-2), with the - high order octet of each pair coming first (so-called Big Endian - integer). - - Some attribute descriptions MAY place additional requirements on - charset values that may be used, such as REQUIRED values that MUST be - supported or additional restrictions, such as requiring that the - charset have US-ASCII as a subset charset. - -4.1.8 'naturalLanguage' - - The 'naturalLanguage' attribute syntax is a standard identifier for a - natural language and optionally a country. The values for this - syntax type are defined by RFC 1766 [RFC1766]. Though RFC 1766 - requires that the values be case-insensitive US-ASCII, IPP requires - all lower case to simplify comparing by IPP clients and Printer - objects. Examples include: - - 'en': for English - 'en-us': for US English - 'fr': for French - 'de': for German - - The maximum length of 'naturalLanguage' values used to represent IPP - attribute values is 63 octets. - -4.1.9 'mimeMediaType' - - The 'mimeMediaType' attribute syntax is the Internet Media Type - (sometimes called MIME type) as defined by RFC 2046 [RFC2046] and - registered according to the procedures of RFC 2048 [RFC2048] for - identifying a document format. The value MAY include a charset - parameter, depending on the specification of the Media Type in the - IANA Registry [IANA-MT]. Although most other IPP syntax types allow - for only lower-cased values, this syntax type allows for mixed-case - values which are case-insensitive. - - Examples are: - - 'text/html': An HTML document - 'text/plain': A plain text document in US-ASCII (RFC 2046 indicates - that in the absence of the charset parameter MUST mean US-ASCII - rather than simply unspecified) [RFC2046]. - 'text/plain; charset=US-ASCII': A plain text document in US-ASCII - [52, 56]. - 'text/plain; charset=ISO-8859-1': A plain text document in ISO - 8859-1 (Latin 1) [ISO8859-1]. - - - -deBry, et al. Experimental [Page 67] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - 'text/plain; charset=utf-8': A plain text document in ISO 10646 - represented as UTF-8 [RFC2279] - 'text/plain, charset=iso-10646-ucs-2': A plain text document in - ISO 10646 represented in two octets (UCS-2) [ISO10646-1] - 'application/postscript': A PostScript document [RFC2046] - 'application/vnd.hp-PCL': A PCL document [IANA-MT] (charset escape - sequence embedded in the document data) - 'application/octet-stream': Auto-sense - see below - - One special type is 'application/octet-stream'. If the Printer - object supports this value, the Printer object MUST be capable of - auto-sensing the format of the document data. If the Printer - object's default value attribute "document-format-default" is set to - 'application/octet-stream', the Printer object not only supports - auto-sensing of the document format, but will depend on the result of - applying its auto-sensing when the client does not supply the - "document-format" attribute. If the client supplies a document - format value, the Printer MUST rely on the supplied attribute, rather - than trust its auto-sensing algorithm. To summarize: - - 1. If the client does not supply a document format value, the - Printer MUST rely on its default value setting (which may be ' - application/octet-stream' indicating an auto-sensing mechanism). - 2. If the client supplies a value other than 'application/octet- - stream', the client is supplying valid information about the - format of the document data and the Printer object MUST trust - the client supplied value more than the outcome of applying an - automatic format detection mechanism. For example, the client - may be requesting the printing of a PostScript file as a ' - text/plain' document. The Printer object MUST print a text - representation of the PostScript commands rather than interpret - the stream of PostScript commands and print the result. - 3. If the client supplies a value of 'application/octet-stream', - the client is indicating that the Printer object MUST use its - auto-sensing mechanism on the client supplied document data - whether auto-sensing is the Printer object's default or not. - - Note: Since the auto-sensing algorithm is probabilistic, if the - client requests both auto-sensing ("document-format" set to ' - application/octet-stream') and true fidelity ("ipp-attribute- - fidelity" set to 'true'), the Printer object might not be able to - guarantee exactly what the end user intended (the auto-sensing - algorithm might mistake one document format for another ), but it is - able to guarantee that its auto-sensing mechanism be used. - - The maximum length of a 'mimeMediaType' value to represent IPP - attribute values is 255 octets. - - - - -deBry, et al. Experimental [Page 68] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - -4.1.10 'octetString' - - The 'octetString' attribute syntax is a sequence of octets encoded in - a maximum of 1023 octets which is indicated in sub-section headers - using the notation: octetString(MAX). This syntax type is used for - opaque data. - -4.1.11 'boolean' - - The 'boolean' attribute syntax has only two values: 'true' and ' - false'. - -4.1.12 'integer' - - The 'integer' attribute syntax is an integer value that is in the - range from -2**31 (MIN) to 2**31 - 1 (MAX). Each individual - attribute may specify the range constraint explicitly in sub-section - headers if the range is different from the full range of possible - integer values. For example: job-priority (integer(1:100)) for the - "job-priority" attribute. However, the enforcement of that - additional constraint is up to the IPP objects, not the protocol. - -4.1.13 'rangeOfInteger' - - The 'rangeOfInteger' attribute syntax is an ordered pair of integers - that defines an inclusive range of integer values. The first integer - specifies the lower bound and the second specifies the upper bound. - If a range constraint is specified in the header description for an - attribute in this document whose attribute syntax is 'rangeOfInteger' - (i.e., 'X:Y' indicating X as a minimum value and Y as a maximum - value), then the constraint applies to both integers. - -4.1.14 'dateTime' - - The 'dateTime' attribute syntax is a standard, fixed length, 11 octet - representation of the "DateAndTime" syntax as defined in RFC 2579 - [RFC2579]. RFC 2579 also identifies an 8 octet representation of a - "DateAndTime" value, but IPP objects MUST use the 11 octet - representation. A user interface will provide a mapping between - protocol dateTime values and displayable user-friendly words or - presentation values and phrases which are localized to the natural - language and date format of the user. - -4.1.15 'resolution' - - The 'resolution' attribute syntax specifies a two-dimensional - resolution in the indicated units. It consists of 3 values: a cross - feed direction resolution (positive integer value), a feed direction - - - -deBry, et al. Experimental [Page 69] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - resolution (positive integer value), and a units value. The - semantics of these three components are taken from the Printer MIB - [RFC1759] suggested values. That is, the cross feed direction - component resolution component is the same as the - prtMarkerAddressabilityXFeedDir object in the Printer MIB, the feed - direction component resolution component is the same as the - prtMarkerAddressabilityFeedDir in the Printer MIB, and the units - component is the same as the prtMarkerAddressabilityUnit object in - the Printer MIB (namely, '3' indicates dots per inch and '4' - indicates dots per centimeter). All three values MUST be present - even if the first two values are the same. Example: '300', '600', ' - 3' indicates a 300 dpi cross-feed direction resolution, a 600 dpi - feed direction resolution, since a '3' indicates dots per inch (dpi). - -4.1.16 '1setOf X' - - The '1setOf X' attribute syntax is 1 or more values of attribute - syntax type X. This syntax type is used for multi-valued attributes. - The syntax type is called '1setOf' rather than just 'setOf' as a - reminder that the set of values MUST NOT be empty (i.e., a set of - size 0). Sets are normally unordered. However each attribute - description of this type may specify that the values MUST be in a - certain order for that attribute. - -4.2 Job Template Attributes - - Job Template attributes describe job processing behavior. Support - for Job Template attributes by a Printer object is OPTIONAL (see - section 13.2.3 for a description of support for OPTIONAL attributes). - Also, clients OPTIONALLY supply Job Template attributes in create - requests. - - Job Template attributes conform to the following rules. For each Job - Template attribute called "xxx": - - 1. If the Printer object supports "xxx" then it MUST support both a - "xxx-default" attribute (unless there is a "No" in the table - below) and a "xxx-supported" attribute. If the Printer object - doesn't support "xxx", then it MUST support neither an "xxx- - default" attribute nor an "xxx-supported" attribute, and it MUST - treat an attribute "xxx" supplied by a client as unsupported. - An attribute "xxx" may be supported for some document formats - and not supported for other document formats. For example, it - is expected that a Printer object would only support - "orientation-requested" for some document formats (such as ' - text/plain' or 'text/html') but not others (such as ' - application/postscript'). - - - - -deBry, et al. Experimental [Page 70] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - 2. "xxx" is OPTIONALLY supplied by the client in a create request. - If "xxx" is supplied, the client is indicating a desired job - processing behavior for this Job. When "xxx" is not supplied, - the client is indicating that the Printer object apply its - default job processing behavior at job processing time if the - document content does not contain an embedded instruction - indicating an xxx-related behavior. - - Note: Since an administrator MAY change the default value - attribute after a Job object has been submitted but before it - has been processed, the default value used by the Printer object - at job processing time may be different that the default value - in effect at job submission time. - - 3. The "xxx-supported" attribute is a Printer object attribute that - describes which job processing behaviors are supported by that - Printer object. A client can query the Printer object to find - out what xxx-related behaviors are supported by inspecting the - returned values of the "xxx-supported" attribute. - - Note: The "xxx" in each "xxx-supported" attribute name is - singular, even though an "xxx-supported" attribute usually has - more than one value, such as "job-sheet-supported", unless the - "xxx" Job Template attribute is plural, such as "finishings" or - "sides". In such cases the "xxx-supported" attribute names are: - "finishings-supported" and "sides-supported". - - 4. The "xxx-default" default value attribute describes what will be - done at job processing time when no other job processing - information is supplied by the client (either explicitly as an - IPP attribute in the create request or implicitly as an embedded - instruction within the document data). - - If an application wishes to present an end user with a list of - supported values from which to choose, the application SHOULD query - the Printer object for its supported value attributes. The - application SHOULD also query the default value attributes. If the - application then limits selectable values to only those value that - are supported, the application can guarantee that the values supplied - by the client in the create request all fall within the set of - supported values at the Printer. When querying the Printer, the - client MAY enumerate each attribute by name in the Get-Printer- - Attributes Request, or the client MAY just name the "job-template" - group in order to get the complete set of supported attributes (both - supported and default attributes). - - - - - - -deBry, et al. Experimental [Page 71] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - The "finishings" attribute is an example of a Job Template attribute. - It can take on a set of values such as 'staple', 'punch', and/or ' - cover'. A client can query the Printer object for the "finishings- - supported" attribute and the "finishings-default" attribute. The - supported attribute contains a set of supported values. The default - value attribute contains the finishing value(s) that will be used for - a new Job if the client does not supply a "finishings" attribute in - the create request and the document data does not contain any - corresponding finishing instructions. If the client does supply the - "finishings" attribute in the create request, the IPP object - validates the value or values to make sure that they are a subset of - the supported values identified in the Printer object's "finishings- - supported" attribute. See section 3.2.1.2. - - The table below summarizes the names and relationships for all Job - Template attributes. The first column of the table (labeled "Job - Attribute") shows the name and syntax for each Job Template attribute - in the Job object. These are the attributes that can optionally be - supplied by the client in a create request. The last two columns - (labeled "Printer: Default Value Attribute" and "Printer: Supported - Values Attribute") shows the name and syntax for each Job Template - attribute in the Printer object (the default value attribute and the - supported values attribute). A "No" in the table means the Printer - MUST NOT support the attribute (that is, the attribute is simply not - applicable). For brevity in the table, the 'text' and 'name' entries - do not show the maximum length for each attribute. - - +===================+======================+======================+ - | Job Attribute |Printer: Default Value| Printer: Supported | - | | Attribute | Values Attribute | - +===================+======================+======================+ - | job-priority | job-priority-default |job-priority-supported| - | (integer 1:100) | (integer 1:100) |(integer 1:100) | - +-------------------+----------------------+----------------------+ - | job-hold-until | job-hold-until- |job-hold-until- | - | (type3 keyword | | default | supported | - | name) | (type3 keyword | |(1setOf | - | | name) | type3 keyword | name)| - +-------------------+----------------------+----------------------+ - | job-sheets | job-sheets-default |job-sheets-supported | - | (type3 keyword | | (type3 keyword | |(1setOf | - | name) | name) | type3 keyword | name)| - +-------------------+----------------------+----------------------+ - |multiple-document- |multiple-document- |multiple-document- | - | handling | handling-default |handling-supported | - | (type2 keyword) | (type2 keyword) |(1setOf type2 keyword)| - +-------------------+----------------------+----------------------+ - - - - -deBry, et al. Experimental [Page 72] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - +===================+======================+======================+ - | Job Attribute |Printer: Default Value| Printer: Supported | - | | Attribute | Values Attribute | - +===================+======================+======================+ - | copies | copies-default | copies-supported | - | (integer (1:MAX)) | (integer (1:MAX)) | (rangeOfInteger | - | | | (1:MAX)) | - +-------------------+----------------------+----------------------+ - | finishings | finishings-default | finishings-supported | - |(1setOf type2 enum)|(1setOf type2 enum) |(1setOf type2 enum) | - +-------------------+----------------------+----------------------+ - | page-ranges | No | page-ranges- | - | (1setOf | | supported (boolean) | - | rangeOfInteger | | | - | (1:MAX)) | | | - +-------------------+----------------------+----------------------+ - | sides | sides-default | sides-supported | - | (type2 keyword) | (type2 keyword) |(1setOf type2 keyword)| - +-------------------+----------------------+----------------------+ - | number-up | number-up-default | number-up-supported | - | (integer (1:MAX)) | (integer (1:MAX)) |(1setOf integer | - | | | (1:MAX) | | - | | | rangeOfInteger | - | | | (1:MAX)) | - +-------------------+----------------------+----------------------+ - | orientation- |orientation-requested-|orientation-requested-| - | requested | default | supported | - | (type2 enum) | (type2 enum) | (1setOf type2 enum) | - +-------------------+----------------------+----------------------+ - | media | media-default | media-supported | - | (type3 keyword | | (type3 keyword | |(1setOf | - | name) | name) | type3 keyword | name)| - | | | | - | | | media-ready | - | | |(1setOf | - | | | type3 keyword | name)| - +-------------------+----------------------+----------------------+ - | printer-resolution| printer-resolution- | printer-resolution- | - | (resolution) | default | supported | - | | (resolution) |(1setOf resolution) | - +-------------------+----------------------+----------------------+ - | print-quality | print-quality-default| print-quality- | - | (type2 enum) | (type2 enum) | supported | - | | |(1setOf type2 enum) | - +-------------------+----------------------+----------------------+ - - - - - - -deBry, et al. Experimental [Page 73] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - -4.2.1 job-priority (integer(1:100)) - - This attribute specifies a priority for scheduling the Job. A higher - value specifies a higher priority. The value 1 indicates the lowest - possible priority. The value 100 indicates the highest possible - priority. Among those jobs that are ready to print, a Printer MUST - print all jobs with a priority value of n before printing those with - a priority value of n-1 for all n. - - If the Printer object supports this attribute, it MUST always support - the full range from 1 to 100. No administrative restrictions are - permitted. This way an end-user can always make full use of the - entire range with any Printer object. If privileged jobs are - implemented outside IPP/1.0, they MUST have priorities higher than - 100, rather than restricting the range available to end-users. - - If the client does not supply this attribute and this attribute is - supported by the Printer object, the Printer object MUST use the - value of the Printer object's "job-priority-default" at job - submission time (unlike most Job Template attributes that are used if - necessary at job processing time). - - The syntax for the "job-priority-supported" is also integer(1:100). - This single integer value indicates the number of priority levels - supported. The Printer object MUST take the value supplied by the - client and map it to the closest integer in a sequence of n integers - values that are evenly distributed over the range from 1 to 100 using - the formula: - - roundToNearestInt((100x+50)/n) - - where n is the value of "job-priority-supported" and x ranges from 0 - through n-1. - - For example, if n=1 the sequence of values is 50; if n=2, the - sequence of values is: 25 and 75; if n = 3, the sequence of values - is: 17, 50 and 83; if n = 10, the sequence of values is: 5, 15, 25, - 35, 45, 55, 65, 75, 85, and 95; if n = 100, the sequence of values - is: 1, 2, 3, . 100. - - If the value of the Printer object's "job-priority-supported" is 10 - and the client supplies values in the range 1 to 10, the Printer - object maps them to 5, in the range 11 to 20, the Printer object maps - them to 15, etc. - - - - - - - -deBry, et al. Experimental [Page 74] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - -4.2.2 job-hold-until (type3 keyword | name (MAX)) - - This attribute specifies the named time period during which the Job - MUST become a candidate for printing. - - Standard keyword values for named time periods are: - - 'no-hold': immediately, if there are not other reasons to hold the - job - 'day-time': during the day - 'evening': evening - 'night': night - 'weekend': weekend - 'second-shift': second-shift (after close of business) - 'third-shift': third-shift (after midnight) - - An administrator MUST associate allowable print times with a named - time period (by means outside IPP/1.0). An administrator is - encouraged to pick names that suggest the type of time period. An - administrator MAY define additional values using the 'name' or ' - keyword' attribute syntax, depending on implementation. - - If the value of this attribute specifies a time period that is in the - future, the Printer MUST add the 'job-hold-until-specified' value to - the job's "job-state-reasons" attribute, move the job to the ' - pending-held' state, and MUST NOT schedule the job for printing until - the specified time-period arrives. When the specified time period - arrives, the Printer MUST remove the 'job-hold-until-specified' value - from the job's "job-state-reason" attribute and, if there are no - other job state reasons that keep the job in the 'pending-held' - state, the Printer MUST consider the job as a candidate for - processing by moving the job to the 'pending' state. - - If this job attribute value is the named value 'no-hold', or the - specified time period has already started, the job MUST be a - candidate for processing immediately. - - If the client does not supply this attribute and this attribute is - supported by the Printer object, the Printer object MUST use the - value of the Printer object's "job-hold-until-default" at job - submission time (unlike most Job Template attributes that are used if - necessary at job processing time). - -4.2.3 job-sheets (type3 keyword | name(MAX)) - - This attribute determines which job start/end sheet(s), if any, MUST - be printed with a job. - - - - -deBry, et al. Experimental [Page 75] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - Standard keyword values are: - - 'none': no job sheet is printed - 'standard': one or more site specific standard job sheets are - printed, e.g. a single start sheet or both start and end sheet - is printed - - An administrator MAY define additional values using the 'name' or ' - keyword' attribute syntax, depending on implementation. - - Note: The effect of this attribute on jobs with multiple documents - MAY be affected by the "multiple-document-handling" job attribute - (section 4.2.4), depending on the job sheet semantics. - -4.2.4 multiple-document-handling (type2 keyword) - - This attribute is relevant only if a job consists of two or more - documents. The attribute controls finishing operations and the - placement of one or more print-stream pages into impressions and onto - media sheets. When the value of the "copies" attribute exceeds 1, it - also controls the order in which the copies that result from - processing the documents are produced. For the purposes of this - explanations, if "a" represents an instance of document data, then - the result of processing the data in document "a" is a sequence of - media sheets represented by "a(*)". - - Standard keyword values are: - - 'single-document': If a Job object has multiple documents, say, the - document data is called a and b, then the result of processing - all the document data (a and then b) MUST be treated as a single - sequence of media sheets for finishing operations; that is, - finishing would be performed on the concatenation of the - sequences a(*),b(*). The Printer object MUST NOT force the data - in each document instance to be formatted onto a new print- - stream page, nor to start a new impression on a new media sheet. - If more than one copy is made, the ordering of the sets of media - sheets resulting from processing the document data MUST be a(*), - b(*), a(*), b(*), ..., and the Printer object MUST force each - copy (a(*),b(*)) to start on a new media sheet. - 'separate-documents-uncollated-copies': If a Job object has - multiple documents, say, the document data is called a and b, - then the result of processing the data in each document instance - MUST be treated as a single sequence of media sheets for - finishing operations; that is, the sets a(*) and b(*) would each - be finished separately. The Printer object MUST force each copy - of the result of processing the data in a single document to - start on a new media sheet. If more than one copy is made, the - - - -deBry, et al. Experimental [Page 76] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - ordering of the sets of media sheets resulting from processing - the document data MUST be a(*), a(*), ..., b(*), b(*) ... . - 'separate-documents-collated-copies': If a Job object has multiple - documents, say, the document data is called a and b, then the - result of processing the data in each document instance MUST be - treated as a single sequence of media sheets for finishing - operations; that is, the sets a(*) and b(*) would each be - finished separately. The Printer object MUST force each copy of - the result of processing the data in a single document to start - on a new media sheet. If more than one copy is made, the - ordering of the sets of media sheets resulting from processing - the document data MUST be a(*), b(*), a(*), b(*), ... . - 'single-document-new-sheet': Same as 'single-document', except - that the Printer object MUST ensure that the first impression of - each document instance in the job is placed on a new media - sheet. This value allows multiple documents to be stapled - together with a single staple where each document starts on a - new sheet. - - The 'single-document' value is the same as 'separate-documents- - collated-copies' with respect to ordering of print-stream pages, but - not media sheet generation, since 'single-document' will put the - first page of the next document on the back side of a sheet if an odd - number of pages have been produced so far for the job, while ' - separate-documents-collated-copies' always forces the next document - or document copy on to a new sheet. In addition, if the "finishings" - attribute specifies 'staple', then with 'single-document', documents - a and b are stapled together as a single document with no regard to - new sheets, with 'single-document-new-sheet', documents a and b are - stapled together as a single document, but document b starts on a new - sheet, but with 'separate-documents-uncollated-copies' and ' - separate-documents-collated-copies', documents a and b are stapled - separately. - - Note: None of these values provide means to produce uncollated sheets - within a document, i.e., where multiple copies of sheet n are - produced before sheet n+1 of the same document. - - The relationship of this attribute and the other attributes that - control document processing is described in section 15.3. - -4.2.5 copies (integer(1:MAX)) - - This attribute specifies the number of copies to be printed. - - On many devices the supported number of collated copies will be - limited by the number of physical output bins on the device, and may - be different from the number of uncollated copies which can be - - - -deBry, et al. Experimental [Page 77] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - supported. - - Note: The effect of this attribute on jobs with multiple documents is - controlled by the "multiple-document-handling" job attribute (section - 4.2.4) and the relationship of this attribute and the other - attributes that control document processing is described in section - 15.3. - -4.2.6 finishings (1setOf type2 enum) - - This attribute identifies the finishing operations that the Printer - uses for each copy of each printed document in the Job. For Jobs with - multiple documents, the "multiple-document-handling" attribute - determines what constitutes a "copy" for purposes of finishing. - - Standard enum values are: - - Value Symbolic Name and Description - - '3' 'none': Perform no finishing - '4' 'staple': Bind the document(s) with one or more staples. - The exact number and placement of the staples is - site-defined. - '5' 'punch': This value indicates that holes are required in - the finished document. The exact number and placement - of the holes is site-defined The punch specification - MAY be satisfied (in a site- and implementation- - specific manner) either by drilling/punching, or by - substituting pre-drilled media. - '6' 'cover': This value is specified when it is desired to - select a non-printed (or pre-printed) cover for the - document. This does not supplant the specification of - a printed cover (on cover stock medium) by the - document itself. - '7' 'bind': This value indicates that a binding is to be - applied to the document; the type and placement of the - binding is site-defined." - - Note: The effect of this attribute on jobs with multiple documents is - controlled by the "multiple-document-handling" job attribute (section - 4.2.4) and the relationship of this attribute and the other - attributes that control document processing is described in section - 15.3. - - If the client supplies a value of 'none' along with any other - combination of values, it is the same as if only that other - combination of values had been supplied (that is the 'none' value has - no effect). - - - -deBry, et al. Experimental [Page 78] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - -4.2.7 page-ranges (1setOf rangeOfInteger (1:MAX)) - - This attribute identifies the range(s) of print-stream pages that the - Printer object uses for each copy of each document which are to be - printed. Nothing is printed for any pages identified that do not - exist in the document(s). Ranges MUST be in ascending order, for - example: 1-3, 5-7, 15-19 and MUST NOT overlap, so that a non-spooling - Printer object can process the job in a single pass. If the ranges - are not ascending or are overlapping, the IPP object MUST reject the - request and return the 'client-error-bad-request' status code. The - attribute is associated with print-stream pages not application- - numbered pages (for example, the page numbers found in the headers - and or footers for certain word processing applications). - - For Jobs with multiple documents, the "multiple-document-handling" - attribute determines what constitutes a "copy" for purposes of the - specified page range(s). When "multiple-document-handling" is ' - single-document', the Printer object MUST apply each supplied page - range once to the concatenation of the print-stream pages. For - example, if there are 8 documents of 10 pages each, the page-range ' - 41:60' prints the pages in the 5th and 6th documents as a single - document and none of the pages of the other documents are printed. - When "multiple-document-handling" is 'separate-documents-uncollated- - copies' or 'separate-documents-collated-copies', the Printer object - MUST apply each supplied page range repeatedly to each document copy. - For the same job, the page-range '1:3, 10:10' would print the first 3 - pages and the 10th page of each of the 8 documents in the Job, as 8 - separate documents. - - In most cases, the exact pages to be printed will be generated by a - device driver and this attribute would not be required. However, - when printing an archived document which has already been formatted, - the end user may elect to print just a subset of the pages contained - in the document. In this case, if page-range = n.m is specified, the - first page to be printed will be page n. All subsequent pages of the - document will be printed through and including page m. - - "page-ranges-supported" is a boolean value indicating whether or not - the printer is capable of supporting the printing of page ranges. - This capability may differ from one PDL to another. There is no - "page-ranges-default" attribute. If the "page-ranges" attribute is - not supplied by the client, all pages of the document will be - printed. - - - - - - - - -deBry, et al. Experimental [Page 79] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - Note: The effect of this attribute on jobs with multiple documents is - controlled by the "multiple-document-handling" job attribute (section - 4.2.4) and the relationship of this attribute and the other - attributes that control document processing is described in section - 15.3. - -4.2.8 sides (type2 keyword) - - This attribute specifies how print-stream pages are to be imposed - upon the sides of an instance of a selected medium, i.e., an - impression. - - The standard keyword values are: - - 'one-sided': imposes each consecutive print-stream page upon the - same side of consecutive media sheets. - 'two-sided-long-edge': imposes each consecutive pair of print- - stream pages upon front and back sides of consecutive media - sheets, such that the orientation of each pair of print-stream - pages on the medium would be correct for the reader as if for - binding on the long edge. This imposition is sometimes called ' - duplex' or 'head-to-head'. - 'two-sided-short-edge': imposes each consecutive pair of print- - stream pages upon front and back sides of consecutive media - sheets, such that the orientation of each pair of print-stream - pages on the medium would be correct for the reader as if for - binding on the short edge. This imposition is sometimes called - 'tumble' or 'head-to-toe'. - - 'two-sided-long-edge', 'two-sided-short-edge', 'tumble', and 'duplex' - all work the same for portrait or landscape. However 'head-to-toe' - is 'tumble' in portrait but 'duplex' in landscape. 'head-to-head' - also switches between 'duplex' and 'tumble' when using portrait and - landscape modes. - - Note: The effect of this attribute on jobs with multiple documents is - controlled by the "multiple-document-handling" job attribute (section - 4.2.4) and the relationship of this attribute and the other - attributes that control document processing is described in section - 15.3. - -4.2.9 number-up (integer(1:MAX)) - - This attribute specifies the number of print-stream pages to impose - upon a single side of an instance of a selected medium. For example, - if the value is: - - - - - -deBry, et al. Experimental [Page 80] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - Value Description - - '1' the Printer MUST place one print-stream page on a single - side of an instance of the selected medium (MAY add - some sort of translation, scaling, or rotation). - '2' the Printer MUST place two print-stream pages on a single - side of an instance of the selected medium (MAY add - some sort of translation, scaling, or rotation). - '4' the Printer MUST place four print-stream pages on a single - side of an instance of the selected medium (MAY add - some sort of translation, scaling, or rotation). - - This attribute primarily controls the translation, scaling and - rotation of print-stream pages. - - Note: The effect of this attribute on jobs with multiple documents is - controlled by the "multiple-document-handling" job attribute (section - 4.2.4) and the relationship of this attribute and the other - attributes that control document processing is described in section - 15.3. - -4.2.10 orientation-requested (type2 enum) - - This attribute indicates the desired orientation for printed print- - stream pages; it does not describe the orientation of the client- - supplied print-stream pages. - - For some document formats (such as 'application/postscript'), the - desired orientation of the print-stream pages is specified within the - document data. This information is generated by a device driver - prior to the submission of the print job. Other document formats - (such as 'text/plain') do not include the notion of desired - orientation within the document data. In the latter case it is - possible for the Printer object to bind the desired orientation to - the document data after it has been submitted. It is expected that a - Printer object would only support "orientations-requested" for some - document formats (e.g., 'text/plain' or 'text/html') but not others - (e.g., 'application/postscript'). This is no different than any - other Job Template attribute since section 4.2, item 1, points out - that a Printer object may support or not support any Job Template - attribute based on the document format supplied by the client. - However, a special mention is made here since it is very likely that - a Printer object will support "orientation-requested" for only a - subset of the supported document formats. - - - - - - - -deBry, et al. Experimental [Page 81] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - Standard enum values are: - - Value Symbolic Name and Description - - '3' 'portrait': The content will be imaged across the short - edge of the medium. - '4' 'landscape': The content will be imaged across the long - edge of the medium. Landscape is defined to be a - rotation of the print-stream page to be imaged by +90 - degrees with respect to the medium (i.e. anti- - clockwise) from the portrait orientation. Note: The - +90 direction was chosen because simple finishing on - the long edge is the same edge whether portrait or - landscape - '5' 'reverse-landscape': The content will be imaged across the - long edge of the medium. Reverse-landscape is defined - to be a rotation of the print-stream page to be imaged - by - 90 degrees with respect to the medium (i.e. - clockwise) from the portrait orientation. Note: The ' - reverse-landscape' value was added because some - applications rotate landscape -90 degrees from - portrait, rather than +90 degrees. - '6' 'reverse-portrait': The content will be imaged across the - short edge of the medium. Reverse-portrait is defined - to be a rotation of the print-stream page to be imaged - by 180 degrees with respect to the medium from the - portrait orientation. Note: The 'reverse-portrait' - value was added for use with the "finishings" - attribute in cases where the opposite edge is desired - for finishing a portrait document on simple finishing - devices that have only one finishing position. Thus a - 'text'/plain' portrait document can be stapled "on the - right" by a simple finishing device as is common use - with some middle eastern languages such as Hebrew. - - Note: The effect of this attribute on jobs with multiple documents is - controlled by the "multiple-document-handling" job attribute (section - 4.2.4) and the relationship of this attribute and the other - attributes that control document processing is described in section - 15.3. - -4.2.11 media (type3 keyword | name(MAX)) - - This attribute identifies the medium that the Printer uses for all - impressions of the Job. - - The values for "media" include medium-names, medium-sizes, input- - trays and electronic forms so that one attribute specifies the media. - - - -deBry, et al. Experimental [Page 82] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - If a Printer object supports a medium name as a value of this - attribute, such a medium name implicitly selects an input-tray that - contains the specified medium. If a Printer object supports a medium - size as a value of this attribute, such a medium size implicitly - selects a medium name that in turn implicitly selects an input-tray - that contains the medium with the specified size. If a Printer - object supports an input-tray as the value of this attribute, such an - input-tray implicitly selects the medium that is in that input-tray - at the time the job prints. This case includes manual-feed input- - trays. If a Printer object supports an electronic form as the value - of this attribute, such an electronic form implicitly selects a - medium-name that in turn implicitly selects an input-tray that - contains the medium specified by the electronic form. The electronic - form also implicitly selects an image that the Printer MUST merge - with the document data as its prints each page. - - Standard keyword values are (taken from ISO DPA and the Printer MIB) - and are listed in section 14. An administrator MAY define additional - values using the 'name' or 'keyword' attribute syntax, depending on - implementation. - - There is also an additional Printer attribute named "media-ready" - which differs from "media-supported" in that legal values only - include the subset of "media-supported" values that are physically - loaded and ready for printing with no operator intervention required. - If an IPP object supports "media-supported", it NEED NOT support - "media-ready". - - The relationship of this attribute and the other attributes that - control document processing is described in section 15.3. - -4.2.12 printer-resolution (resolution) - - This attribute identifies the resolution that Printer uses for the - Job. - -4.2.13 print-quality (type2 enum) - - This attribute specifies the print quality that the Printer uses for - the Job. - - The standard enum values are: - - Value Symbolic Name and Description - - '3' 'draft': lowest quality available on the printer - '4' 'normal': normal or intermediate quality on the printer - '5' 'high': highest quality available on the printer - - - -deBry, et al. Experimental [Page 83] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - -4.3 Job Description Attributes - - The attributes in this section form the attribute group called "job- - description". The following table summarizes these attributes. The - third column indicates whether the attribute is a REQUIRED attribute - that MUST be supported by Printer objects. If it is not indicated as - REQUIRED, then it is OPTIONAL. The maximum size in octets for 'text' - and 'name' attributes is indicated in parenthesizes. - - +----------------------------+----------------------+----------------+ - | Attribute | Syntax | REQUIRED? | - +----------------------------+----------------------+----------------+ - | job-uri | uri | REQUIRED | - +----------------------------+----------------------+----------------+ - | job-id | integer(1:MAX) | REQUIRED | - +----------------------------+----------------------+----------------+ - | job-printer-uri | uri | REQUIRED | - +----------------------------+----------------------+----------------+ - | job-more-info | uri | | - +----------------------------+----------------------+----------------+ - | job-name | name (MAX) | REQUIRED | - +----------------------------+----------------------+----------------+ - | job-originating-user-name | name (MAX) | REQUIRED | - +----------------------------+----------------------+----------------+ - | job-state | type1 enum | REQUIRED | - +----------------------------+----------------------+----------------+ - | job-state-reasons | 1setOf type2 keyword | | - +----------------------------+----------------------+----------------+ - | job-state-message | text (MAX) | | - +----------------------------+----------------------+----------------+ - | number-of-documents | integer (0:MAX) | | - +----------------------------+----------------------+----------------+ - | output-device-assigned | name (127) | | - +----------------------------+----------------------+----------------+ - | time-at-creation | integer (0:MAX) | | - +----------------------------+----------------------+----------------+ - | time-at-processing | integer (0:MAX) | | - +----------------------------+----------------------+----------------+ - | time-at-completed | integer (0:MAX) | | - +----------------------------+----------------------+----------------+ - | number-of-intervening-jobs | integer (0:MAX) | | - +----------------------------+----------------------+----------------+ - | job-message-from-operator | text (127) | | - +----------------------------+----------------------+----------------+ - | job-k-octets | integer (0:MAX) | | - +----------------------------+----------------------+----------------+ - | job-impressions | integer (0:MAX) | | - +----------------------------+----------------------+----------------+ - - - -deBry, et al. Experimental [Page 84] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - +----------------------------+----------------------+----------------+ - | Attribute | Syntax | REQUIRED? | - +----------------------------+----------------------+----------------+ - | job-media-sheets | integer (0:MAX) | | - +----------------------------+----------------------+----------------+ - | job-k-octets-processed | integer (0:MAX) | | - +----------------------------+----------------------+----------------+ - | job-impressions-completed | integer (0:MAX) | | - +----------------------------+----------------------+----------------+ - | job-media-sheets-completed | integer (0:MAX) | | - +----------------------------+----------------------+----------------+ - | attributes-charset | charset | REQUIRED | - +----------------------------+----------------------+----------------+ - | attributes-natural-language| naturalLanguage | REQUIRED | - +----------------------------+----------------------+----------------+ - - -4.3.1 job-uri (uri) - - This REQUIRED attribute contains the URI for the job. The Printer - object, on receipt of a new job, generates a URI which identifies the - new Job. The Printer object returns the value of the "job-uri" - attribute as part of the response to a create request. The precise - format of a Job URI is implementation dependent. If the Printer - object supports more than one URI and there is some relationship - between the newly formed Job URI and the Printer object's URI, the - Printer object uses the Printer URI supplied by the client in the - create request. For example, if the create request comes in over a - secure channel, the new Job URI MUST use the same secure channel. - This can be guaranteed because the Printer object is responsible for - generating the Job URI and the Printer object is aware of its - security configuration and policy as well as the Printer URI used in - the create request. - - For a description of this attribute and its relationship to "job-id" - and "job-printer-uri" attribute, see the discussion in section 2.4 on - "Object Identity". - -4.3.2 job-id (integer(1:MAX)) - - This REQUIRED attribute contains the ID of the job. The Printer, on - receipt of a new job, generates an ID which identifies the new Job on - that Printer. The Printer returns the value of the "job-id" - attribute as part of the response to a create request. The 0 value - is not included to allow for compatibility with SNMP index values - which also cannot be 0. - - - - - -deBry, et al. Experimental [Page 85] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - For a description of this attribute and its relationship to "job-uri" - and "job-printer-uri" attribute, see the discussion in section 2.4 on - "Object Identity". - -4.3.3 job-printer-uri (uri) - - This REQUIRED attribute identifies the Printer object that created - this Job object. When a Printer object creates a Job object, it - populates this attribute with the Printer object URI that was used in - the create request. This attribute permits a client to identify the - Printer object that created this Job object when only the Job - object's URI is available to the client. The client queries the - creating Printer object to determine which languages, charsets, - operations, are supported for this Job. - - For a description of this attribute and its relationship to "job-uri" - and "job-id" attribute, see the discussion in section 2.4 on "Object - Identity". - -4.3.4 job-more-info (uri) - - Similar to "printer-more-info", this attribute contains the URI - referencing some resource with more information about this Job - object, perhaps an HTML page containing information about the Job. - -4.3.5 job-name (name(MAX)) - - This REQUIRED attribute is the name of the job. It is a name that is - more user friendly than the "job-uri" attribute value. It does not - need to be unique between Jobs. The Job's "job-name" attribute is - set to the value supplied by the client in the "job-name" operation - attribute in the create request (see Section 3.2.1.1). If, however, - the "job-name" operation attribute is not supplied by the client in - the create request, the Printer object, on creation of the Job, MUST - generate a name. The printer SHOULD generate the value of the Job's - "job-name" attribute from the first of the following sources that - produces a value: 1) the "document-name" operation attribute of the - first (or only) document, 2) the "document-URI" attribute of the - first (or only) document, or 3) any other piece of Job specific - and/or Document Content information. - -4.3.6 job-originating-user-name (name(MAX)) - - This REQUIRED attribute contains the name of the end user that - submitted the print job. The Printer object sets this attribute to - the most authenticated printable name that it can obtain from the - authentication service over which the IPP operation was received. - - - - -deBry, et al. Experimental [Page 86] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - Only if such is not available, does the Printer object use the value - supplied by the client in the "requesting-user-name" operation - attribute of the create operation (see Section 8). - - Note: The Printer object needs to keep an internal originating user - id of some form, typically as a credential of a principal, with the - Job object. Since such an internal attribute is implementation- - dependent and not of interest to clients, it is not specified as a - Job Description attribute. This originating user id is used for - authorization checks (if any) on all subsequent operation. - -4.3.7 job-state (type1 enum) - - This REQUIRED attribute identifies the current state of the job. - Even though the IPP protocol defines eight values for job states, - implementations only need to support those states which are - appropriate for the particular implementation. In other words, a - Printer supports only those job states implemented by the output - device and available to the Printer object implementation. - - Standard enum values are: - - Values Symbolic Name and Description - - '3' 'pending': The job is a candidate to start processing, but - is not yet processing. - - '4' 'pending-held': The job is not a candidate for processing - for any number of reasons but will return to the ' - pending' state as soon as the reasons are no longer - present. The job's "job-state-reason" attribute MUST - indicate why the job is no longer a candidate for - processing. - - '5' 'processing': One or more of: - - 1. the job is using, or is attempting to use, one or - more purely software processes that are analyzing, - creating, or interpreting a PDL, etc., - 2. the job is using, or is attempting to use, one or - more hardware devices that are interpreting a PDL, - making marks on a medium, and/or performing finishing, - such as stapling, etc., - 3. the Printer object has made the job ready for - printing, but the output device is not yet printing - it, either because the job hasn't reached the output - - - - - -deBry, et al. Experimental [Page 87] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - device or because the job is queued in the output - device or some other spooler, awaiting the output - device to print it. - - When the job is in the 'processing' state, the entire - job state includes the detailed status represented in - the printer's "printer-state", "printer-state- - reasons", and "printer-state-message" attributes. - - Implementations MAY, though they NEED NOT, include - additional values in the job's "job-state-reasons" - attribute to indicate the progress of the job, such as - adding the 'job-printing' value to indicate when the - output device is actually making marks on paper and/or - the 'processing-to-stop-point' value to indicate that - the IPP object is in the process of canceling or - aborting the job. Most implementations won't bother - with this nuance. - - '6' 'processing-stopped': The job has stopped while processing - for any number of reasons and will return to the ' - processing' state as soon as the reasons are no longer - present. - - The job's "job-state-reason" attribute MAY indicate - why the job has stopped processing. For example, if - the output device is stopped, the 'printer-stopped' - value MAY be included in the job's "job-state-reasons" - attribute. - - Note: When an output device is stopped, the device - usually indicates its condition in human readable form - locally at the device. A client can obtain more - complete device status remotely by querying the - Printer object's "printer-state", "printer-state- - reasons" and "printer-state-message" attributes. - - '7' 'canceled': The job has been canceled by a Cancel-Job - operation and the Printer object has completed - canceling the job and all job status attributes have - reached their final values for the job. While the - Printer object is canceling the job, the job remains - in its current state, but the job's "job-state- - reasons" attribute SHOULD contain the 'processing-to- - stop-point' value and one of the 'canceled-by-user', ' - canceled-by-operator', or 'canceled-at-device' value. - - - - - -deBry, et al. Experimental [Page 88] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - When the job moves to the 'canceled' state, the ' - processing-to-stop-point' value, if present, MUST be - removed, but the 'canceled-by-xxx', if present, MUST - remain. - - '8' 'aborted': The job has been aborted by the system, usually - while the job was in the 'processing' or 'processing- - stopped' state and the Printer has completed aborting - the job and all job status attributes have reached - their final values for the job. While the Printer - object is aborting the job, the job remains in its - current state, but the job's "job-state-reasons" - attribute SHOULD contain the 'processing-to-stop- - point' and 'aborted-by-system' values. When the job - moves to the 'aborted' state, the 'processing-to- - stop-point' value, if present, MUST be removed, but - the 'aborted-by-system' value, if present, MUST - remain. - - '9' 'completed': The job has completed successfully or with - warnings or errors after processing and all of the job - media sheets have been successfully stacked in the - appropriate output bin(s) and all job status - attributes have reached their final values for the - job. The job's "job-state-reasons" attribute SHOULD - contain one of: 'completed-successfully', ' - completed-with-warnings', or 'completed-with-errors' - values. - - The final value for this attribute MUST be one of: 'completed', ' - canceled', or 'aborted' before the Printer removes the job - altogether. The length of time that jobs remain in the 'canceled', ' - aborted', and 'completed' states depends on implementation. - - The following figure shows the normal job state transitions. - - +----> canceled - / - +----> pending --------> processing ---------+------> completed - | ^ ^ \ - --->+ | | +----> aborted - | v v / - +----> pending-held processing-stopped ---+ - - Normally a job progresses from left to right. Other state - transitions are unlikely, but are not forbidden. Not shown are the - transitions to the 'canceled' state from the 'pending', 'pending- - held', and 'processing-stopped' states. - - - -deBry, et al. Experimental [Page 89] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - Jobs reach one of the three terminal states: 'completed', 'canceled', - or 'aborted', after the jobs have completed all activity, including - stacking output media, after the jobs have completed all activity, - and all job status attributes have reached their final values for the - job. - - Note: As with all other IPP attributes, if the implementation can not - determine the correct value for this attribute, it SHOULD respond - with the out-of-band value 'unknown' (see section 4.1) rather than - try to guess at some possibly incorrect value and give the end user - the wrong impression about the state of the Job object. For example, - if the implementation is just a gateway into some printing system - that does not provide detailed status about the print job, the IPP - Job object's state might literally be 'unknown'. - -4.3.8 job-state-reasons (1setOf type2 keyword) - - This attribute provides additional information about the job's - current state, i.e., information that augments the value of the job's - "job-state" attribute. - - Implementation of these values is OPTIONAL, i.e., a Printer NEED NOT - implement them, even if (1) the output device supports the - functionality represented by the reason and (2) is available to the - Printer object implementation. These values MAY be used with any job - state or states for which the reason makes sense. Furthermore, when - implemented, the Printer MUST return these values when the reason - applies and MUST NOT return them when the reason no longer applies - whether the value of the Job's "job-state" attribute changed or not. - When the Job does not have any reasons for being in its current - state, the value of the Job's "job-state-reasons" attribute MUST be ' - none'. - - Note: While values cannot be added to the 'job-state' attribute - without impacting deployed clients that take actions upon receiving - "job-state" values, it is the intent that additional "job-state- - reasons" values can be defined and registered without impacting such - deployed clients. In other words, the "job-state-reasons" attribute - is intended to be extensible. - - The following standard keyword values are defined. For ease of - understanding, the values are presented in the order in which the - reasons are likely to occur (if implemented), starting with the ' - job-incoming' value: - - 'none': There are no reasons for the job's current state. - 'job-incoming': The Create-Job operation has been accepted by the - Printer, but the Printer is expecting additional Send-Document - - - -deBry, et al. Experimental [Page 90] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - and/or Send-URI operations and/or is accessing/accepting - document data. - 'submission-interrupted': The job was not completely submitted for - some unforeseen reason, such as: (1) the Printer has crashed - before the job was closed by the client, (2) the Printer or the - document transfer method has crashed in some non-recoverable way - before the document data was entirely transferred to the - Printer, (3) the client crashed or failed to close the job - before the time-out period. See section 4.4.28. - 'job-outgoing': The Printer is transmitting the job to the output - device. - 'job-hold-until-specified': The value of the job's "job-hold- - until" attribute was specified with a time period that is still - in the future. The job MUST NOT be a candidate for processing - until this reason is removed and there are no other reasons to - hold the job. - 'resources-are-not-ready': At least one of the resources needed by - the job, such as media, fonts, resource objects, etc., is not - ready on any of the physical printer's for which the job is a - candidate. This condition MAY be detected when the job is - accepted, or subsequently while the job is pending or - processing, depending on implementation. The job may remain in - its current state or be moved to the 'pending-held' state, - depending on implementation and/or job scheduling policy. - 'printer-stopped-partly': The value of the Printer's "printer- - state-reasons" attribute contains the value 'stopped-partly'. - 'printer-stopped': The value of the Printer's "printer-state" - attribute is 'stopped'. - 'job-interpreting': Job is in the 'processing' state, but more - specifically, the Printer is interpreting the document data. - 'job-queued': Job is in the 'processing' state, but more - specifically, the Printer has queued the document data. - 'job-transforming': Job is in the 'processing' state, but more - specifically, the Printer is interpreting document data and - producing another electronic representation. - 'job-printing': The output device is marking media. This value is - useful for Printers which spend a great deal of time processing - (1) when no marking is happening and then want to show that - marking is now happening or (2) when the job is in the process - of being canceled or aborted while the job remains in the ' - processing' state, but the marking has not yet stopped so that - impression or sheet counts are still increasing for the job. - 'job-canceled-by-user': The job was canceled by the owner of the - job using the Cancel-Job request, i.e., by a user whose - authenticated identity is the same as the value of the - originating user that created the Job object, or by some other - authorized end-user, such as a member of the job owner's - security group. - - - -deBry, et al. Experimental [Page 91] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - 'job-canceled-by-operator': The job was canceled by the operator - using the Cancel-Job request, i.e., by a user who has been - authenticated as having operator privileges (whether local or - remote). If the security policy is to allow anyone to cancel - anyone's job, then this value may be used when the job is - canceled by other than the owner of the job. For such a - security policy, in effect, everyone is an operator as far as - canceling jobs with IPP is concerned. - 'job-canceled-at-device': The job was canceled by an unidentified - local user, i.e., a user at a console at the device. - 'aborted-by-system': The job (1) is in the process of being - aborted, (2) has been aborted by the system and placed in the ' - aborted' state, or (3) has been aborted by the system and placed - in the 'pending-held' state, so that a user or operator can - manually try the job again. - 'processing-to-stop-point': The requester has issued a Cancel-Job - operation or the Printer object has aborted the job, but is - still performing some actions on the job until a specified stop - point occurs or job termination/cleanup is completed. - - This reason is recommended to be used in conjunction with the ' - processing' job state to indicate that the Printer object is - still performing some actions on the job while the job remains - in the 'processing' state. After all the job's job description - attributes have stopped incrementing, the Printer object moves - the job from the 'processing' state to the 'canceled' or ' - aborted' job states. - - 'service-off-line': The Printer is off-line and accepting no jobs. - All 'pending' jobs are put into the 'pending-held' state. This - situation could be true if the service's or document transform's - input is impaired or broken. - 'job-completed-successfully': The job completed successfully. - 'job-completed-with-warnings': The job completed with warnings. - 'job-completed-with-errors': The job completed with errors (and - possibly warnings too). - -4.3.9 job-state-message (text(MAX)) - - This attribute specifies information about the "job-state" and "job- - state-reasons" attributes in human readable text. If the Printer - object supports this attribute, the Printer object MUST be able to - generate this message in any of the natural languages identified by - the Printer's "generated-natural-language-supported" attribute (see - the "attributes-natural-language" operation attribute specified in - Section 3.1.4.1). - - - - - -deBry, et al. Experimental [Page 92] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - Note: the value SHOULD NOT contain additional information not - contained in the values of the "job-state" and "job-states-reasons" - attributes, such as interpreter error information. Otherwise, - application programs might attempt to parse the (localized text). - For such additional information such as interpreter errors for - application program consumption, a new attribute with keyword values, - needs to be developed and registered. - -4.3.10 number-of-documents (integer(0:MAX)) - - This attribute indicates the number of documents in the job, i.e., - the number of Send-Document, Send-URI, Print-Job, or Print-URI - operations that the Printer has accepted for this job, regardless of - whether the document data has reached the Printer object or not. - - Implementations supporting the OPTIONAL Create-Job/Send- - Document/Send-URI operations SHOULD support this attribute so that - clients can query the number of documents in each job. - -4.3.11 output-device-assigned (name(127)) - - This attribute identifies the output device to which the Printer - object has assigned this job. If an output device implements an - embedded Printer object, the Printer object NEED NOT set this - attribute. If a print server implements a Printer object, the value - MAY be empty (zero-length string) or not returned until the Printer - object assigns an output device to the job. This attribute is - particularly useful when a single Printer object support multiple - devices (so called "fan-out"). - -4.3.12 time-at-creation (integer(0:MAX)) - - This attribute indicates the point in time at which the Job object - was created. In order to populate this attribute, the Printer object - uses the value in its "printer-up-time" attribute at the time the Job - object is created. - -4.3.13 time-at-processing (integer(0:MAX)) - - This attribute indicates the point in time at which the Job object - began processing. In order to populate this attribute, the Printer - object uses the value in its "printer-up-time" attribute at the time - the Job object is moved into the 'processing' state for the first - time. - - - - - - - -deBry, et al. Experimental [Page 93] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - -4.3.14 time-at-completed (integer(0:MAX)) - - This attribute indicates the point in time at which the Job object - completed (or was cancelled or aborted). In order to populate this - attribute, the Printer object uses the value in its "printer-up-time" - attribute at the time the Job object is moved into the 'completed' or - 'canceled' or 'aborted' state. - -4.3.15 number-of-intervening-jobs (integer(0:MAX)) - - This attribute indicates the number of jobs that are "ahead" of this - job in the relative chronological order of expected time to complete - (i.e., the current scheduled order). For efficiency, it is only - necessary to calculate this value when an operation is performed that - requests this attribute. - -4.3.16 job-message-from-operator (text(127)) - - This attribute provides a message from an operator, system - administrator or "intelligent" process to indicate to the end user - the reasons for modification or other management action taken on a - job. - -4.3.17 job-k-octets (integer(0:MAX)) - - This attribute specifies the total size of the document(s) in K - octets, i.e., in units of 1024 octets requested to be processed in - the job. The value MUST be rounded up, so that a job between 1 and - 1024 octets MUST be indicated as being 1, 1025 to 2048 MUST be 2, - etc. - - This value MUST NOT include the multiplicative factors contributed by - the number of copies specified by the "copies" attribute, independent - of whether the device can process multiple copies without making - multiple passes over the job or document data and independent of - whether the output is collated or not. Thus the value is independent - of the implementation and indicates the size of the document(s) - measured in K octets independent of the number of copies. - - This value MUST also not include the multiplicative factor due to a - copies instruction embedded in the document data. If the document - data actually includes replications of the document data, this value - will include such replication. In other words, this value is always - the size of the source document data, rather than a measure of the - hardcopy output to be produced. - - - - - - -deBry, et al. Experimental [Page 94] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - Note: This attribute and the following two attributes ("job- - impressions" and "job-media-sheets") are not intended to be counters; - they are intended to be useful routing and scheduling information if - known. For these three attributes, the Printer object may try to - compute the value if it is not supplied in the create request. Even - if the client does supply a value for these three attributes in the - create request, the Printer object MAY choose to change the value if - the Printer object is able to compute a value which is more accurate - than the client supplied value. The Printer object may be able to - determine the correct value for these three attributes either right - at job submission time or at any later point in time. - -4.3.18 job-impressions (integer(0:MAX)) - - This attribute specifies the total size in number of impressions of - the document(s) being submitted (see the definition of impression in - section 13.2.5). - - As with "job-k-octets", this value MUST NOT include the - multiplicative factors contributed by the number of copies specified - by the "copies" attribute, independent of whether the device can - process multiple copies without making multiple passes over the job - or document data and independent of whether the output is collated or - not. Thus the value is independent of the implementation and - reflects the size of the document(s) measured in impressions - independent of the number of copies. - - As with "job-k-octets", this value MUST also not include the - multiplicative factor due to a copies instruction embedded in the - document data. If the document data actually includes replications - of the document data, this value will include such replication. In - other words, this value is always the number of impressions in the - source document data, rather than a measure of the number of - impressions to be produced by the job. - - See the Note in the "job-k-octets" attribute that also applies to - this attribute. - -4.3.19 job-media-sheets (integer(0:MAX)) - - This attribute specifies the total number of media sheets to be - produced for this job. - - Unlike the "job-k-octets" and the "job-impressions" attributes, this - value MUST include the multiplicative factors contributed by the - number of copies specified by the "copies" attribute and a 'number of - copies' instruction embedded in the document data, if any. This - difference allows the system administrator to control the lower and - - - -deBry, et al. Experimental [Page 95] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - upper bounds of both (1) the size of the document(s) with "job-k- - octets-supported" and "job-impressions-supported" and (2) the size of - the job with "job-media-sheets-supported". - - See the Note in the "job-k-octets" attribute that also applies to - this attribute. - -4.3.20 job-k-octets-processed (integer(0:MAX)) - - This attribute specifies the total number of octets processed in K - octets, i.e., in units of 1024 octets so far. The value MUST be - rounded up, so that a job between 1 and 1024 octets inclusive MUST be - indicated as being 1, 1025 to 2048 inclusive MUST be 2, etc. - - For implementations where multiple copies are produced by the - interpreter with only a single pass over the data, the final value - MUST be equal to the value of the "job-k-octets" attribute. For - implementations where multiple copies are produced by the interpreter - by processing the data for each copy, the final value MUST be a - multiple of the value of the "job-k-octets" attribute. - - Note: This attribute and the following two attributes ("job- - impressions-completed" and "job-sheets-completed") are intended to be - counters. That is, the value for a job that has not started - processing MUST be 0. When the job's "job-state" is 'processing' or - 'processing-stopped', this value is intended to contain the amount of - the job that has been processed to the time at which the attributes - are requested. - -4.3.21 job-impressions-completed (integer(0:MAX)) - - This job attribute specifies the number of impressions completed for - the job so far. For printing devices, the impressions completed - includes interpreting, marking, and stacking the output. - - See the note in "job-k-octets-processed" which also applies to this - attribute. - -4.3.22 job-media-sheets-completed (integer(0:MAX)) - - This job attribute specifies the media-sheets completed marking and - stacking for the entire job so far whether those sheets have been - processed on one side or on both. - - See the note in "job-k-octets-processed" which also applies to this - attribute. - - - - - -deBry, et al. Experimental [Page 96] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - -4.3.23 attributes-charset (charset) - - This REQUIRED attribute is populated using the value in the client - supplied "attributes-charset" attribute in the create request. It - identifies the charset (coded character set and encoding method) used - by any Job attributes with attribute syntax 'text' and 'name' that - were supplied by the client in the create request. See Section 3.1.4 - for a complete description of the "attributes-charset" operation - attribute. - - This attribute does not indicate the charset in which the 'text' and - 'name' values are stored internally in the Job object. The internal - charset is implementation-defined. The IPP object MUST convert from - whatever the internal charset is to that being requested in an - operation as specified in Section 3.1.4. - -4.3.24 attributes-natural-language (naturalLanguage) - - This REQUIRED attribute is populated using the value in the client - supplied "attributes-natural-language" attribute in the create - request. It identifies the natural language used for any Job - attributes with attribute syntax 'text' and 'name' that were supplied - by the client in the create request. See Section 3.1.4 for a - complete description of the "attributes-natural-language" operation - attribute. See Sections 4.1.1.2 and 4.1.2.2 for how a Natural - Language Override may be supplied explicitly for each 'text' and ' - name' attribute value that differs from the value identified by the - "attributes-natural-language" attribute. - -4.4 Printer Description Attributes - - These attributes form the attribute group called "printer- - description". The following table summarizes these attributes, their - syntax, and whether or not they are REQUIRED for a Printer object to - support. If they are not indicated as REQUIRED, they are OPTIONAL. - The maximum size in octets for 'text' and 'name' attributes is - indicated in parenthesizes. - - Note: How these attributes are set by an Administrator is outside the - scope of this specification. - - - - - - - - - - - -deBry, et al. Experimental [Page 97] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - +----------------------------+----------------------+----------------+ - | Attribute | Syntax | REQUIRED? | - +----------------------------+----------------------+----------------+ - | printer-uri-supported | 1setOf uri | REQUIRED | - +----------------------------+----------------------+----------------+ - | uri-security-supported | 1setOf type2 keyword | REQUIRED | - +----------------------------+----------------------+----------------+ - | printer-name | name (127) | REQUIRED | - +----------------------------+----------------------+----------------+ - | printer-location | text (127) | | - +----------------------------+----------------------+----------------+ - | printer-info | text (127) | | - +----------------------------+----------------------+----------------+ - | printer-more-info | uri | | - +----------------------------+----------------------+----------------+ - | printer-driver-installer | uri | | - +----------------------------+----------------------+----------------+ - | printer-make-and-model | text (127) | | - +----------------------------+----------------------+----------------+ - | printer-more-info- | uri | | - | manufacturer | | | - +----------------------------+----------------------+----------------+ - | printer-state | type1 enum | REQUIRED | - +----------------------------+----------------------+----------------+ - | printer-state-reasons | 1setOf type2 keyword | | - +----------------------------+----------------------+----------------+ - | printer-state-message | text (MAX) | | - +----------------------------+----------------------+----------------+ - | operations-supported | 1setOf type2 enum | REQUIRED | - +----------------------------+----------------------+----------------+ - | charset-configured | charset | REQUIRED | - +----------------------------+----------------------+----------------+ - | charset-supported | 1setOf charset | REQUIRED | - +----------------------------+----------------------+----------------+ - | natural-language-configured| naturalLanguage | REQUIRED | - +----------------------------+----------------------+----------------+ - | generated-natural-language-| 1setOf | REQUIRED | - | supported | naturalLanguage | | - +----------------------------+----------------------+----------------+ - | document-format-default | mimeMediaType | REQUIRED | - +----------------------------+----------------------+----------------+ - | document-format- | 1setOf | REQUIRED | - | supported | mimeMediaType | | - +----------------------------+----------------------+----------------+ - | printer-is-accepting-jobs | boolean | REQUIRED | - +----------------------------+----------------------+----------------+ - | queued-job-count | integer (0:MAX) | RECOMMENDED | - +----------------------------+----------------------+----------------+ - - - -deBry, et al. Experimental [Page 98] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - +----------------------------+----------------------+----------------+ - | Attribute | Syntax | REQUIRED? | - +----------------------------+----------------------+----------------+ - | printer-message-from- | text (127) | | - | operator | | | - +----------------------------+----------------------+----------------+ - | color-supported | boolean | | - +----------------------------+----------------------+----------------+ - | reference-uri-schemes- | 1setOf uriScheme | | - | supported | | | - +----------------------------+----------------------+----------------+ - | pdl-override-supported | type2 keyword | REQUIRED | - +----------------------------+----------------------+----------------+ - | printer-up-time | integer (1:MAX) | REQUIRED | - +----------------------------+----------------------+----------------+ - | printer-current-time | dateTime | | - +----------------------------+----------------------+----------------+ - | multiple-operation-time-out| integer (1:MAX) | | - +----------------------------+----------------------+----------------+ - | compression-supported | 1setOf type3 keyword | | - +----------------------------+----------------------+----------------+ - | job-k-octets-supported | rangeOfInteger | | - | | (0:MAX) | | - +----------------------------+----------------------+----------------+ - | job-impressions-supported | rangeOfInteger | | - | | (0:MAX) | | - +----------------------------+----------------------+----------------+ - | job-media-sheets-supported | rangeOfInteger | | - | | (0:MAX) | | - +----------------------------+----------------------+----------------+ - -4.4.1 printer-uri-supported (1setOf uri) - - This REQUIRED Printer attribute contains at least one URI for the - Printer object. It OPTIONALLY contains more than one URI for the - Printer object. An administrator determines a Printer object's - URI(s) and configures this attribute to contain those URIs by some - means outside the scope of IPP/1.0. The precise format of this URI - is implementation dependent and depends on the protocol. See the - next section for a description "uri-security-supported" which is the - REQUIRED companion attribute to this "printer-uri-supported" - attribute. See section 2.4 on Printer object identity and section - 8.2 on security and URIs for more information. - - - - - - - - -deBry, et al. Experimental [Page 99] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - -4.4.2 uri-security-supported (1setOf type2 keyword) - - This REQUIRED Printer attribute MUST have the same cardinality - (contain the same number of values) as the "printer-uri-supported" - attribute. This attribute identifies the security mechanisms used - for each URI listed in the "printer-uri-supported" attribute. The "i - th" value in "uri-security-supported" corresponds to the "i th" value - in "printer-uri-supported" and it describes the security mechanisms - used for accessing the Printer object via that URI. The following - standard values are defined: - - 'none': There are no secure communication channel protocols in use - for the given URI. - - 'ssl3': SSL3 [SSL] is the secure communications channel protocol in - use for the given URI. - - Consider the following example. For a single Printer object, an - administrator configures the "printer-uri-supported" and "uri- - security-supported" attributes as follows: - - "printer-uri-supported": 'http://acme.com/open-use-printer', ' - http://acme.com/restricted-use-printer', ' - http://acme.com/private-printer' - "uri-security-supported": 'none', 'none', 'ssl3' - - In this case, one Printer object has three URIs. - - - For the first URI, 'http://acme.com/open-use-printer', the value - 'none' in "uri-security-supported" indicates that there is no - secure channel protocol configured to run under HTTP. The name - implies that there is no Basic or Digest authentication being - used, but it is up to the client to determine that while using - HTTP underneath the IPP application protocol. - - For the second URI, 'http://acme.com/restricted-use-printer', the - value 'none' in "uri-security-supported" indicates that there is - no secure channel protocol configured to run under HTTP. In - this case, although the name does imply that there is some sort - of Basic or Digest authentication being used within HTTP, it is - up to the client to determine that while using HTTP and by - processing any '401 Unauthorized' HTTP error messages. - - For the third URI, 'http://acme.com/private-printer', the value ' - ssl3' in "uri-security-supported" indicates that SSL3 is being - used to secure the channel. The client SHOULD be prepared to - use SSL3 framing to negotiate an acceptable ciphersuite to use - while communicating with the Printer object. In this case, the - name implies the use of a secure communications channel, but the - fact is made explicit by the presence of the 'ssl3' value in - - - -deBry, et al. Experimental [Page 100] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - "uri-security-supported". The client does not need to resort to - understanding which security it must use by following naming - conventions or by parsing the URI to determine which security - mechanisms are implied. - - It is expected that many IPP Printer objects will be configured to - support only one channel (either configured to use SSL3 access or - not), and will therefore only ever have one URI listed in the - "printer-uri-supported" attribute. No matter the configuration of - the Printer object (whether it has only one URI or more than one - URI), a client MUST supply only one URI in the target "printer-uri" - operation attribute. - -4.4.3 printer-name (name(127)) - - This REQUIRED Printer attribute contains the name of the Printer - object. It is a name that is more end-user friendly than a URI. An - administrator determines a printer's name and sets this attribute to - that name. This name may be the last part of the printer's URI or it - may be unrelated. In non-US-English locales, a name may contain - characters that are not allowed in a URI. - -4.4.4 printer-location (text(127)) - - This Printer attribute identifies the location of the device. This - could include things like: "in Room 123A, second floor of building - XYZ". - -4.4.5 printer-info (text(127)) - - This Printer attribute identifies the descriptive information about - this Printer object. This could include things like: "This printer - can be used for printing color transparencies for HR presentations", - or "Out of courtesy for others, please print only small (1-5 page) - jobs at this printer", or even "This printer is going away on July 1, - 1997, please find a new printer". - -4.4.6 printer-more-info (uri) - - This Printer attribute contains a URI used to obtain more information - about this specific Printer object. For example, this could be an - HTTP type URI referencing an HTML page accessible to a Web Browser. - The information obtained from this URI is intended for end user - consumption. Features outside the scope of IPP can be accessed from - this URI. The information is intended to be specific to this printer - instance and site specific services (e.g. job pricing, services - offered, end user assistance). The device manufacturer may initially - populate this attribute. - - - -deBry, et al. Experimental [Page 101] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - -4.4.7 printer-driver-installer (uri) - - This Printer attribute contains a URI to use to locate the driver - installer for this Printer object. This attribute is intended for - consumption by automata. The mechanics of print driver installation - is outside the scope of IPP. The device manufacturer may initially - populate this attribute. - -4.4.8 printer-make-and-model (text(127)) - - This Printer attribute identifies the make and model of the device. - The device manufacturer may initially populate this attribute. - -4.4.9 printer-more-info-manufacturer (uri) - - This Printer attribute contains a URI used to obtain more information - about this type of device. The information obtained from this URI is - intended for end user consumption. Features outside the scope of IPP - can be accessed from this URI (e.g., latest firmware, upgrades, print - drivers, optional features available, details on color support). The - information is intended to be germane to this printer without regard - to site specific modifications or services. The device manufacturer - may initially populate this attribute. - -4.4.10 printer-state (type1 enum) - - This REQUIRED Printer attribute identifies the current state of the - device. The "printer-state reasons" attribute augments the - "printer-state" attribute to give more detailed information about the - Printer in the given printer state. - - A Printer object need only update this attribute before responding to - an operation which requests the attribute; the Printer object NEED - NOT update this attribute continually, since asynchronous event - notification is not part of IPP/1.0. A Printer NEED NOT implement - all values if they are not applicable to a given implementation. - - The following standard enum values are defined: - - Value Symbolic Name and Description - - '3' 'idle': If a Printer receives a job (whose required - resources are ready) while in this state, such a job - MUST transit into the 'processing' state immediately. - If the "printer-state-reasons" attribute contains any - reasons, they MUST be reasons that would not prevent a - job from transiting into the 'processing' state - immediately, e.g., 'toner-low'. Note: if a Printer - - - -deBry, et al. Experimental [Page 102] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - controls more than one output device, the above - definition implies that a Printer is 'idle' if at - least one output device is idle. - - '4' 'processing': If a Printer receives a job (whose required - resources are ready) while in this state, such a job - MUST transit into the 'pending' state immediately. - Such a job MUST transit into the 'processing' state - only after jobs ahead of it complete. If the - "printer-state-reasons" attribute contains any - reasons, they MUST be reasons that do not prevent the - current job from printing, e.g. 'toner-low'. Note: - if a Printer controls more than one output device, the - above definition implies that a Printer is ' - processing' if at least one output device is - processing, and none is idle. - - '5' 'stopped': If a Printer receives a job (whose required - resources are ready) while in this state, such a job - MUST transit into the 'pending' state immediately. - Such a job MUST transit into the 'processing' state - only after some human fixes the problem that stopped - the printer and after jobs ahead of it complete - processing. If supported, the "printer-state-reasons" - attribute MUST contain at least one reason, e.g. ' - media-jam', which prevents it from either processing - the current job or transitioning a 'pending' job to - the 'processing' state. - - Note: if a Printer controls more than one output - device, the above definition implies that a Printer is - 'stopped' only if all output devices are stopped. - Also, it is tempting to define 'stopped' as when a - sufficient number of output devices are stopped and - leave it to an implementation to define the sufficient - number. But such a rule complicates the definition of - 'stopped' and 'processing'. For example, with this - alternate definition of 'stopped', a job can move from - 'pending' to 'processing' without human intervention, - even though the Printer is stopped. - -4.4.11 printer-state-reasons (1setOf type2 keyword) - - This Printer attribute supplies additional detail about the device's - state. - - - - - - -deBry, et al. Experimental [Page 103] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - Each keyword value MAY have a suffix to indicate its level of - severity. The three levels are: report (least severe), warning, and - error (most severe). - - - '-report': This suffix indicates that the reason is a "report". - An implementation may choose to omit some or all reports. Some - reports specify finer granularity about the printer state; - others serve as a precursor to a warning. A report MUST contain - nothing that could affect the printed output. - - '-warning': This suffix indicates that the reason is a "warning". - An implementation may choose to omit some or all warnings. - Warnings serve as a precursor to an error. A warning MUST - contain nothing that prevents a job from completing, though in - some cases the output may be of lower quality. - - '-error': This suffix indicates that the reason is an "error". - An implementation MUST include all errors. If this attribute - contains one or more errors, printer MUST be in the stopped - state. - - If the implementation does not add any one of the three suffixes, all - parties MUST assume that the reason is an "error". - - If a Printer object controls more than one output device, each value - of this attribute MAY apply to one or more of the output devices. An - error on one output device that does not stop the Printer object as a - whole MAY appear as a warning in the Printer's "printer-state-reasons - attribute". If the "printer-state" for such a Printer has a value of - 'stopped', then there MUST be an error reason among the values in the - "printer-state-reasons" attribute. - - The following standard keyword values are defined: - - 'other': The device has detected an error other than one listed in - this document. - 'none': There are not reasons. This state reason is semantically - equivalent to "printer-state-reasons" without any value. - 'media-needed': A tray has run out of media. - 'media-jam': The device has a media jam. - 'paused': Someone has paused the Printer object. In this state, a - Printer MUST NOT produce printed output, but it MUST perform - other operations requested by a client. If a Printer had been - printing a job when the Printer was paused, the Printer MUST - resume printing that job when the Printer is no longer paused - and leave no evidence in the printed output of such a pause. - 'shutdown': Someone has removed a Printer object from service, and - the device may be powered down or physically removed. In this - state, a Printer object MUST NOT produce printed output, and - unless the Printer object is realized by a print server that is - - - -deBry, et al. Experimental [Page 104] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - still active, the Printer object MUST perform no other - operations requested by a client, including returning this - value. If a Printer object had been printing a job when it was - shutdown, the Printer NEED NOT resume printing that job when the - Printer is no longer shutdown. If the Printer resumes printing - such a job, it may leave evidence in the printed output of such - a shutdown, e.g. the part printed before the shutdown may be - printed a second time after the shutdown. - 'connecting-to-device': The Printer object has scheduled a job on - the output device and is in the process of connecting to a - shared network output device (and might not be able to actually - start printing the job for an arbitrarily long time depending on - the usage of the output device by other servers on the network). - 'timed-out': The server was able to connect to the output device - (or is always connected), but was unable to get a response from - the output device. - 'stopping': The Printer object is in the process of stopping the - device and will be stopped in a while. When the device is - stopped, the Printer object will change the Printer object's - state to 'stopped'. The 'stopping-warning' reason is never an - error, even for a Printer with a single output device. When an - output-device ceases accepting jobs, the Printer will have this - reason while the output device completes printing. - 'stopped-partly': When a Printer object controls more than one - output device, this reason indicates that one or more output - devices are stopped. If the reason is a report, fewer than half - of the output devices are stopped. If the reason is a warning, - fewer than all of the output devices are stopped. - 'toner-low': The device is low on toner. - 'toner-empty': The device is out of toner. - 'spool-area-full': The limit of persistent storage allocated for - spooling has been reached. - 'cover-open': One or more covers on the device are open. - 'interlock-open': One or more interlock devices on the printer are - unlocked. - 'door-open': One or more doors on the device are open. - 'input-tray-missing': One or more input trays are not in the - device. - 'media-low': At least one input tray is low on media. - 'media-empty': At least one input tray is empty. - 'output-tray-missing': One or more output trays are not in the - device - 'output-area-almost-full': One or more output area is almost full - (e.g. tray, stacker, collator). - 'output-area-full': One or more output area is full. (e.g. tray, - stacker, collator) - 'marker-supply-low': The device is low on at least one marker - supply. (e.g. toner, ink, ribbon) - - - -deBry, et al. Experimental [Page 105] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - 'marker-supply-empty: The device is out of at least one marker - supply. (e.g. toner, ink, ribbon) - 'marker-waste-almost-full': The device marker supply waste - receptacle is almost full. - 'marker-waste-full': The device marker supply waste receptacle is - full. - 'fuser-over-temp': The fuser temperature is above normal. - 'fuser-under-temp': The fuser temperature is below normal. - 'opc-near-eol': The optical photo conductor is near end of life. - 'opc-life-over': The optical photo conductor is no longer - functioning. - 'developer-low': The device is low on developer. - 'developer-empty: The device is out of developer. - 'interpreter-resource-unavailable': An interpreter resource is - unavailable (i.e. font, form) - -4.4.12 printer-state-message (text(MAX)) - - This Printer attribute specifies the additional information about the - printer state and printer state reasons in human readable text. If - the Printer object supports this attribute, the Printer object MUST - be able to generate this message in any of the natural languages - identified by the Printer's "generated-natural-language-supported" - attribute (see the "attributes-natural-language" operation attribute - specified in Section 3.1.4.1). - -4.4.13 operations-supported (1setOf type2 enum) - - This REQUIRED Printer attribute specifies the set of supported - operations for this Printer object and contained Job objects. All - 32-bit enum values for this attribute MUST NOT exceed 0x8FFF, since - these values are passed in two octets in each Protocol request - [RFC2565]. - - The following standard enum and "operation-id" (see section 3.1.2) - values are defined: - - Value Operation Name - ----------------- ------------------------------------- - - 0x0000 reserved, not used - 0x0001 reserved, not used - 0x0002 Print-Job - 0x0003 Print-URI - 0x0004 Validate-Job - 0x0005 Create-Job - 0x0006 Send-Document - 0x0007 Send-URI - - - -deBry, et al. Experimental [Page 106] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - 0x0008 Cancel-Job - 0x0009 Get-Job-Attributes - 0x000A Get-Jobs - 0x000B Get-Printer-Attributes - 0x000C-0x3FFF reserved for future operations - 0x4000-0x8FFF reserved for private extensions - - This allows for certain vendors to implement private extensions that - are guaranteed to not conflict with future registered extensions. - However, there is no guarantee that two or more private extensions - will not conflict. - -4.4.14 charset-configured (charset) - - This REQUIRED Printer attribute identifies the charset that the - Printer object has been configured to represent 'text' and 'name' - Printer attributes that are set by the operator, system - administrator, or manufacturer, i.e., for "printer-name" (name), - "printer-location" (text), "printer-info" (text), and "printer-make- - and-model" (text). Therefore, the value of the Printer object's - "charset-configured" attribute MUST also be among the values of the - Printer object's "charset-supported" attribute. - -4.4.15 charset-supported (1setOf charset) - - This REQUIRED Printer attribute identifies the set of charsets that - the Printer and contained Job objects support in attributes with - attribute syntax 'text' and 'name'. At least the value 'utf-8' MUST - be present, since IPP objects MUST support the UTF-8 [RFC2279] - charset. If a Printer object supports a charset, it means that for - all attributes of syntax 'text' and 'name' the IPP object MUST (1) - accept the charset in requests and return the charset in responses as - needed. - - If more charsets than UTF-8 are supported, the IPP object MUST - perform charset conversion between the charsets as described in - Section 3.2.1.2. - -4.4.16 natural-language-configured (naturalLanguage) - - This REQUIRED Printer attribute identifies the natural language that - the Printer object has been configured to represent 'text' and 'name' - Printer attributes that are set by the operator, system - administrator, or manufacturer, i.e., for "printer-name" (name), - "printer-location" (text), "printer-info" (text), and "printer-make- - and-model" (text). When returning these Printer attributes, the - Printer object MAY return them in the configured natural language - specified by this attribute, instead of the natural language - - - -deBry, et al. Experimental [Page 107] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - requested by the client in the "attributes-natural-language" - operation attribute. See Section 3.1.4.1 for the specification of - the OPTIONAL multiple natural language support. Therefore, the value - of the Printer object's "natural-language-configured" attribute MUST - also be among the values of the Printer object's "generated-natural- - language-supported" attribute. - -4.4.17 generated-natural-language-supported (1setOf naturalLanguage) - - This REQUIRED Printer attribute identifies the natural language(s) - that the Printer object and contained Job objects support in - attributes with attribute syntax 'text' and 'name'. The natural - language(s) supported depends on implementation and/or configuration. - Unlike charsets, IPP objects MUST accept requests with any natural - language or any Natural Language Override whether the natural - language is supported or not. - - If a Printer object supports a natural language, it means that for - any of the attributes for which the Printer or Job object generates - messages, i.e., for the "job-state-message" and "printer-state- - message" attributes and Operation Messages (see Section 3.1.5) in - operation responses, the Printer and Job objects MUST be able to - generate messages in any of the Printer's supported natural - languages. See section 3.1.4 for the specification of 'text' and ' - name' attributes in operation requests and responses. - - Note: A Printer object that supports multiple natural languages, - often has separate catalogs of messages, one for each natural - language supported. - -4.4.18 document-format-default (mimeMediaType) - - This REQUIRED Printer attribute identifies the document format that - the Printer object has been configured to assume if the client does - not supply a "document-format" operation attribute in any of the - operation requests that supply document data. The standard values - for this attribute are Internet Media types (sometimes called MIME - types). For further details see the description of the ' - mimeMediaType' attribute syntax in Section 4.1.9. - -4.4.19 document-format-supported (1setOf mimeMediaType) - - This REQUIRED Printer attribute identifies the set of document - formats that the Printer object and contained Job objects can - support. For further details see the description of the ' - mimeMediaType' attribute syntax in Section 4.1.9. - -4.4.20 printer-is-accepting-jobs (boolean) - - - -deBry, et al. Experimental [Page 108] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - This REQUIRED Printer attribute indicates whether the printer is - currently able to accept jobs, i.e., is accepting Print-Job, Print- - URI, and Create-Job requests. If the value is 'true', the printer is - accepting jobs. If the value is 'false', the Printer object is - currently rejecting any jobs submitted to it. In this case, the - Printer object returns the 'server-error-not-accepting-jobs' status - code. - - Note: This value is independent of the "printer-state" and "printer- - state-reasons" attributes because its value does not affect the - current job; rather it affects future jobs. This attribute may cause - the Printer to reject jobs when the "printer-state" is 'idle' or it - may cause the Printer object to accepts jobs when the "printer-state" - is 'stopped'. - -4.4.21 queued-job-count (integer(0:MAX)) - - This RECOMMENDED Printer attribute contains a count of the number of - jobs that are either 'pending', 'processing', 'pending-held', or ' - processing-stopped' and is set by the Printer object. - -4.4.22 printer-message-from-operator (text(127)) - - This Printer attribute provides a message from an operator, system - administrator or "intelligent" process to indicate to the end user - information or status of the printer, such as why it is unavailable - or when it is expected to be available. - -4.4.23 color-supported (boolean) - - This Printer attribute identifies whether the device is capable of - any type of color printing at all, including highlight color. All - document instructions having to do with color are embedded within the - document PDL (none are external IPP attributes in IPP/1.0). - - Note: end-users are able to determine the nature and details of the - color support by querying the "printer-more-info-manufacturer" - Printer attribute. - -4.4.24 reference-uri-schemes-supported (1setOf uriScheme) - - This Printer attribute specifies which URI schemes are supported for - use in the "document-uri" operation attribute of the Print-URI or - Send-URI operation. If a Printer object supports these optional - operations, it MUST support the "reference-uri-schemes-supported" - Printer attribute with at least the following schemed URI value: - - 'ftp': The Printer object will use an FTP 'get' operation as - - - -deBry, et al. Experimental [Page 109] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - defined in RFC 2228 [RFC2228] using FTP URLs as defined by - [RFC2396] and[RFC2316]. - - The Printer object MAY OPTIONALLY support other URI schemes (see - section 4.1.6). - -4.4.25 pdl-override-supported (type2 keyword) - - This REQUIRED Printer attribute expresses the ability for a - particular Printer implementation to either attempt to override - document data instructions with IPP attributes or not. - - This attribute takes on the following values: - - - 'attempted': This value indicates that the Printer object - attempts to make the IPP attribute values take precedence over - embedded instructions in the document data, however there is no - guarantee. - - - 'not-attempted': This value indicates that the Printer object - makes no attempt to make the IPP attribute values take precedence - over embedded instructions in the document data. - - Section 15 contains a full description of how this attribute - interacts with and affects other IPP attributes, especially the - "ipp-attribute-fidelity" attribute. - -4.4.26 printer-up-time (integer(1:MAX)) - - This REQUIRED Printer attribute indicates the amount of time (in - seconds) that this instance of this Printer implementation has been - up and running. This value is used to populate the Job attributes - "time-at-creation", "time-at-processing", and "time-at-completed". - These time values are all measured in seconds and all have meaning - only relative to this attribute, "printer-up-time". The value is a - monotonically increasing value starting from 1 when the Printer - object is started-up (initialized, booted, etc.). - - If the Printer object goes down at some value 'n', and comes back up, - the implementation MAY: - - 1. Know how long it has been down, and resume at some value greater - than 'n', or - 2. Restart from 1. - - In the first case, the Printer SHOULD not tweak any existing related - Job attributes ("time-at-creation", "time-at-processing", and "time- - at-completed"). In the second case, the Printer object SHOULD reset - - - -deBry, et al. Experimental [Page 110] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - those attributes to 0. If a client queries a time-related Job - attribute and finds the value to be 0, the client MUST assume that - the Job was submitted in some life other than the Printer's current - life. - -4.4.27 printer-current-time (dateTime) - - This Printer attribute indicates the current absolute wall-clock - time. If an implementation supports this attribute, then a client - could calculate the absolute wall-clock time each Job's "time-at- - creation", "time-at-processing", and "time-at-completed" attributes - by using both "printer-up-time" and this attribute, "printer- - current-time". If an implementation does not support this attribute, - a client can only calculate the relative time of certain events based - on the REQUIRED "printer-up-time" attribute. - -4.4.28 multiple-operation-time-out (integer(1:MAX)) - - This Printer attributes identifies the minimum time (in seconds) that - the Printer object waits for additional Send-Document or Send-URI - operations to follow a still-open multi-document Job object before - taking any recovery actions, such as the ones indicated in section - 3.3.1. - - It is RECOMMENDED that vendors supply a value for this attribute that - is between 60 and 240 seconds. An implementation MAY allow a system - administrator to set this attribute. If so, the system administrator - MAY be able to set values outside this range. - -4.4.29 compression-supported (1setOf type3 keyword) - - This Printer attribute identifies the set of supported compression - algorithms for document data. Compression only applies to the - document data; compression does not apply to the encoding of the IPP - operation itself. The supported values are used to validate the - client supplied "compression" operation attributes in Print-Job, - Send-Document, and Send-URI requests. - - Standard values are : - - 'none': no compression is used. - 'deflate': ZIP public domain inflate/deflate) compression - technology - 'gzip' GNU zip compression technology described in RFC 1952 - [RFC1952]. - 'compress': UNIX compression technology - -4.4.30 job-k-octets-supported (rangeOfInteger(0:MAX)) - - - -deBry, et al. Experimental [Page 111] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - This Printer attribute specifies the upper and lower bounds of total - sizes of jobs in K octets, i.e., in units of 1024 octets. The - supported values are used to validate the client supplied "job-k- - octets" operation attributes in create requests. The corresponding - job description attribute "job-k-octets" is defined in section - 4.3.17. - - 4.4.31 job-impressions-supported (rangeOfInteger(0:MAX)) - - This Printer attribute specifies the upper and lower bounds for the - number of impressions per job. The supported values are used to - validate the client supplied "job-impressions" operation attributes - in create requests. The corresponding job description attribute - "job-impressions" is defined in section 4.3.18. - -4.4.32 job-media-sheets-supported (rangeOfInteger(0:MAX)) - - This Printer attribute specifies the upper and lower bounds for the - number of media sheets per job. The supported values are used to - validate the client supplied "job-media-sheets" operation attributes - in create requests. The corresponding Job attribute "job-media- - sheets" is defined in section 4.3.19. - -5. Conformance - - This section describes conformance issues and requirements. This - document introduces model entities such as objects, operations, - attributes, attribute syntaxes, and attribute values. These - conformance sections describe the conformance requirements which - apply to these model entities. - -5.1 Client Conformance Requirements - - A conforming client MUST support all REQUIRED operations as defined - in this document. For each attribute included in an operation - request, a conforming client MUST supply a value whose type and value - syntax conforms to the requirements of the Model document as - specified in Sections 3 and 4. A conforming client MAY supply any - registered extensions and/or private extensions in an operation - request, as long as they meet the requirements in Section 6. - - Otherwise, there are no conformance requirements placed on the user - interfaces provided by IPP clients or their applications. For - example, one application might not allow an end user to submit - multiple documents per job, while another does. One application - might first query a Printer object in order to supply a graphical - user interface (GUI) dialogue box with supported and default values - whereas a different implementation might not. - - - -deBry, et al. Experimental [Page 112] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - When sending a request, an IPP client NEED NOT supply any attributes - that are indicated as OPTIONALLY supplied by the client. - - A client MUST be able to accept any of the attribute syntaxes defined - in Section 4.1, including their full range, that may be returned to - it in a response from a Printer object. In particular for each - attribute that the client supports whose attribute syntax is 'text', - the client MUST accept and process both the 'textWithoutLanguage' and - 'textWithLanguage' forms. Similarly, for each attribute that the - client supports whose attribute syntax is 'name', the client MUST - accept and process both the 'nameWithoutLanguage' and ' - nameWithLanguage' forms. For presentation purposes, truncation of - long attribute values is not recommended. A recommended approach - would be for the client implementation to allow the user to scroll - through long attribute values. - - A query response may contain attribute groups, attributes, and values - that the client does not expect. Therefore, a client implementation - MUST gracefully handle such responses and not refuse to inter-operate - with a conforming Printer that is returning extended registered or - private attributes and/or attribute values that conform to Section 6. - Clients may choose to ignore any parameters, attributes, or values - that they do not understand. - -5.2 IPP Object Conformance Requirements - - This section specifies the conformance requirements for conforming - implementations with respect to objects, operations, and attributes. - -5.2.1 Objects - - Conforming implementations MUST implement all of the model objects as - defined in this specification in the indicated sections: - - Section 2.1 - Printer Object - Section 2.2 - Job Object - -5.2.2 Operations - - Conforming IPP object implementations MUST implement all of the - REQUIRED model operations, including REQUIRED responses, as defined - in this specification in the indicated sections: - - For a Printer object: - Print-Job (section 3.2.1) REQUIRED - Print-URI (section 3.2.2) OPTIONAL - Validate-Job (section 3.2.3) REQUIRED - Create-Job (section 3.2.4) OPTIONAL - - - -deBry, et al. Experimental [Page 113] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - Get-Printer-Attributes (section 3.2.5) REQUIRED - Get-Jobs (section 3.2.6) REQUIRED - - For a Job object: - Send-Document (section 3.3.1) OPTIONAL - Send-URI (section 3.3.2) OPTIONAL - Cancel-Job (section 3.3.3) REQUIRED - Get-Job-Attributes (section 3.3.4) REQUIRED - - Conforming IPP objects MUST support all REQUIRED operation attributes - and all values of such attributes if so indicated in the description. - Conforming IPP objects MUST ignore all unsupported or unknown - operation attributes or operation attribute groups received in a - request, but MUST reject a request that contains a supported - operation attribute that contains an unsupported value. - - The following section on object attributes specifies the support - required for object attributes. - -5.2.3 IPP Object Attributes - - Conforming IPP objects MUST support all of the REQUIRED object - attributes, as defined in this specification in the indicated - sections. - - If an object supports an attribute, it MUST support only those values - specified in this document or through the extension mechanism - described in section 5.2.4. It MAY support any non-empty subset of - these values. That is, it MUST support at least one of the specified - values and at most all of them. - -5.2.4 Extensions - - A conforming IPP object MAY support registered extensions and private - extensions, as long as they meet the requirements specified in - Section 6. - - For each attribute included in an operation response, a conforming - IPP object MUST return a value whose type and value syntax conforms - to the requirement of the Model document as specified in Sections 3 - and 4. - - - - - - - - - - -deBry, et al. Experimental [Page 114] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - -5.2.5 Attribute Syntaxes - - An IPP object MUST be able to accept any of the attribute syntaxes - defined in Section 4.1, including their full range, in any operation - in which a client may supply attributes or the system administrator - may configure attributes (by means outside the scope of IPP/1.0). In - particular for each attribute that the IPP object supports whose - attribute syntax is 'text', the IPP object MUST accept and process - both the 'textWithoutLanguage' and 'textWithLanguage' forms. - Similarly, for each attribute that the IPP object supports whose - attribute syntax is 'name', the IPP object MUST accept and process - both the 'nameWithoutLanguage' and 'nameWithLanguage' forms. - Furthermore, an IPP object MUST return attributes to the client in - operation responses that conform to the syntax specified in Section - 4.1, including their full range if supplied previously by a client. - -5.3 Charset and Natural Language Requirements - - All clients and IPP objects MUST support the 'utf-8' charset as - defined in section 4.1.7. - - IPP objects MUST be able to accept any client request which correctly - uses the "attributes-natural-language" operation attribute or the - Natural Language Override mechanism on any individual attribute - whether or not the natural language is supported by the IPP object. - If an IPP object supports a natural language, then it MUST be able to - translate (perhaps by table lookup) all generated 'text' or 'name' - attribute values into one of the supported languages (see section - 3.1.4). That is, the IPP object that supports a natural language - NEED NOT be a general purpose translator of any arbitrary 'text' or ' - name' value supplied by the client into that natural language. - However, the object MUST be able to translate (automatically - generate) any of its own attribute values and messages into that - natural language. - -5.4 Security Conformance Requirements - - Conforming IPP Printer objects MAY support Secure Socket Layer - Version 3 (SSL3) [SSL] access, support access without SSL3 or support - both means of access. - - Conforming IPP clients SHOULD support SSL3 access and non-SSL3 - access. Note: This client requirement to support both means that - conforming IPP clients will be able to inter-operate with any IPP - Printer object. - - - - - - -deBry, et al. Experimental [Page 115] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - For a detailed discussion of security considerations and the IPP - application security profile required for SSL3 support, see section - 8. - -6. IANA Considerations (registered and private extensions) - - This section describes how IPP can be extended to allow the following - registered and private extensions to IPP: - - 1. keyword attribute values - 2. enum attribute values - 3. attributes - 4. attribute syntaxes - 5. operations - 6. attribute groups - 7. status codes - - Extensions registered for use with IPP/1.0 are OPTIONAL for client - and IPP object conformance to the IPP/1.0 Model specification. - - These extension procedures are aligned with the guidelines as set - forth by the IESG [RFC2434]. Section 11 describes how to propose new - registrations for consideration. IANA will reject registration - proposals that leave out required information or do not follow the - appropriate format described in Section 11. IPP/1.0 may also be - extended by an appropriate RFC that specifies any of the above - extensions. - -6.1 Typed 'keyword' and 'enum' Extensions - - IPP allows for 'keyword' and 'enum' extensions (see sections 4.1.2.3 - and 4.1.4). This document uses prefixes to the 'keyword' and 'enum' - basic attribute syntax type in order to communicate extra information - to the reader through its name. This extra information is not - represented in the protocol because it is unimportant to a client or - Printer object. The list below describes the prefixes and their - meaning. - - "type1": The IPP specification must be revised to add a new - keyword or a new enum. No private keywords or enums are - allowed. - - "type2": Implementers can, at any time, add new keyword or enum - values by proposing the complete specification to IANA: - - iana@iana.org - - - - - -deBry, et al. Experimental [Page 116] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - IANA will forward the registration proposal to the IPP - Designated Expert who will review the proposal with a mailing - list that the Designated Expert keeps for this purpose. - Initially, that list will be the mailing list used by the IPP - WG: - - ipp@pwg.org - - even after the IPP WG is disbanded as permitted by [RFC2434]. - The IPP Designated Expert is appointed by the IESG Area Director - responsible for IPP, according to [RFC2434]. - - When a type2 keyword or enum is approved, the IPP Designated - Expert becomes the point of contact for any future maintenance - that might be required for that registration. - - "type3": Implementers can, at any time, add new keyword and enum - values by submitting the complete specification to IANA as for - type2 who will forward the proposal to the IPP Designated - Expert. While no additional technical review is required, the - IPP Designated Expert may, at his/her discretion, forward the - proposal to the same mailing list as for type2 registrations for - advice and comment. - - When a type3 keyword or enum is approved by the IPP Designated - Expert, the original proposer becomes the point of contact for - any future maintenance that might be required for that - registration. - - For type2 and type3 keywords, the proposer includes the name of the - keyword in the registration proposal and the name is part of the - technical review. - - After type2 and type3 enums specifications are approved, the IPP - Designated Expert in consultation with IANA assigns the next - available enum number for each enum value. - - IANA will publish approved type2 and type3 keyword and enum - attributes value registration specifications in: - - ftp.isi.edu/iana/assignments/ipp/attribute-values/xxx/yyy.txt - - where xxx is the attribute name that specifies the initial values and - yyy.txt is a descriptive file name that contains one or more enums or - keywords approved at the same time. For example, if several - additional enums for stapling are approved for use with the - - - - - -deBry, et al. Experimental [Page 117] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - "finishings" attribute (and "finishings-default" and "finishings- - supported" attributes), IANA will publish the additional values in - the file: - - ftp.isi.edu/iana/assignments/ipp/attribute- - values/finishings/stapling.txt - - Note: Some attributes are defined to be: 'type3 keywords' | 'name' - which allows for attribute values to be extended by a site - administrator with administrator defined names. Such names are not - registered with IANA. - - By definition, each of the three types above assert some sort of - registry or review process in order for extensions to be considered - valid. Each higher numbered level (1, 2, 3) tends to be decreasingly - less stringent than the previous level. Therefore, any typeN value - MAY be registered using a process for some typeM where M is less than - N, however such registration is NOT REQUIRED. For example, a type3 - value MAY be registered in a type 1 manner (by being included in a - future version of an IPP specification), however, it is NOT REQUIRED. - - This specification defines keyword and enum values for all of the - above types, including type3 keywords. - - For private (unregistered) keyword extensions, implementers SHOULD - use keywords with a suitable distinguishing prefix, such as "xxx-" - where xxx is the (lowercase) fully qualified company name registered - with IANA for use in domain names [RFC1035]. For example, if the - company XYZ Corp. had obtained the domain name "XYZ.com", then a - private keyword 'abc' would be: 'xyz.com-abc'. - - Note: RFC 1035 [RFC1035] indicates that while upper and lower case - letters are allowed in domain names, no significance is attached to - the case. That is, two names with the same spelling but different - case are to be treated as if identical. Also, the labels in a domain - name must follow the rules for ARPANET host names: They must start - with a letter, end with a letter or digit, and have as interior - characters only letters, digits, and hyphen. Labels must be 63 - characters or less. Labels are separated by the "." character. - - For private (unregistered) enum extension, implementers MUST use - values in the reserved integer range which is 2**30 to 2**31-1. - - - - - - - - - -deBry, et al. Experimental [Page 118] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - -6.2 Attribute Extensibility - - Attribute names are type2 keywords. Therefore, new attributes may be - registered and have the same status as attributes in this document by - following the type2 extension rules. For private (unregistered) - attribute extensions, implementers SHOULD use keywords with a - suitable distinguishing prefix as described in Section 6.1. - - IANA will publish approved attribute registration specifications as - separate files: - - ftp.isi.edu/iana/assignments/ipp/attributes/xxx-yyy.txt - - where "xxx-yyy" is the new attribute name. - - If a new Printer object attribute is defined and its values can be - affected by a specific document format, its specification needs to - contain the following sentence: - - "The value of this attribute returned in a Get-Printer-Attributes - response MAY depend on the "document-format" attribute supplied - (see Section 3.2.5.1)." - - If the specification does not, then its value in the Get-Printer- - Attributes response MUST NOT depend on the "document-format" supplied - in the request. When a new Job Template attribute is registered, the - value of the Printer attributes MAY vary with "document-format" - supplied in the request without the specification having to indicate - so. - -6.3 Attribute Syntax Extensibility - - Attribute syntaxes are like type2 enums. Therefore, new attribute - syntaxes may be registered and have the same status as attribute - syntaxes in this document by following the type2 extension rules - described in Section 6.1. The value codes that identify each of the - attribute syntaxes are assigned in the Encoding and Transport - specification [RFC2565], including a designated range for private, - experimental use. - - For attribute syntaxes, the IPP Designated Expert in consultation - with IANA assigns the next attribute syntax code in the appropriate - range as specified in [RFC2565]. IANA will publish approved - attribute syntax registration specifications as separate files: - - ftp.isi.edu/iana/assignments/ipp/attribute-syntaxes/xxx-yyy.txt - - where 'xxx-yyy' is the new attribute syntax name. - - - -deBry, et al. Experimental [Page 119] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - -6.4 Operation Extensibility - - Operations may also be registered following the type2 procedures - described in Section 6.1, though major new operations will usually be - done by a new standards track RFC that augments this document. For - private (unregistered) operation extensions, implementers MUST use - the range for the "operation-id" in requests specified in Section - 4.4.13 "operations-supported" Printer attribute. - - For operations, the IPP Designated Expert in consultation with IANA - assigns the next operation-id code as specified in Section 4.4.13. - IANA will publish approved operation registration specifications as - separate files: - - ftp.isi.edu/iana/assignments/ipp/operations/Xxx-Yyy.txt - - where "Xxx-Yyy" is the new operation name. - -6.5 Attribute Groups - - Attribute groups passed in requests and responses may be registered - following the type2 procedures described in Section 6.1. The tags - that identify each of the attribute groups are assigned in [RFC2565]. - - For attribute groups, the IPP Designated Expert in consultation with - IANA assigns the next attribute group tag code in the appropriate - range as specified in [RFC2565]. IANA will publish approved - attribute group registration specifications as separate files: - - ftp.isi.edu/iana/assignments/ipp/attribute-group-tags/xxx-yyy- - tag.txt - - where 'xxx-yyy-tag' is the new attribute group tag name. - -6.6 Status Code Extensibility - - Operation status codes may also be registered following the type2 - procedures described in Section 6.1. The values for status codes are - allocated in ranges as specified in Section 13 for each status code - class: - - "informational" - Request received, continuing process - "successful" - The action was successfully received, understood, - and accepted - "redirection" - Further action must be taken in order to complete - the request - "client-error" - The request contains bad syntax or cannot be - fulfilled - - - -deBry, et al. Experimental [Page 120] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - "server-error" - The IPP object failed to fulfill an apparently - valid request - - For private (unregistered) operation status code extensions, - implementers MUST use the top of each range as specified in Section - 13. - - For operation status codes, the IPP Designated Expert in consultation - with IANA assigns the next status code in the appropriate class range - as specified in Section 13. IANA will publish approved status code - registration specifications as separate files: - - ftp.isi.edu/iana/assignments/ipp/status-codes/xxx-yyy.txt - - where "xxx-yyy" is the new operation status code keyword. - -6.7 Registration of MIME types/sub-types for document-formats - - The "document-format" attribute's syntax is 'mimeMediaType'. This - means that valid values are Internet Media Types (see Section 4.1.9). - RFC 2045 [RFC2045] defines the syntax for valid Internet media types. - IANA is the registry for all Internet media types. - -6.8 Registration of charsets for use in 'charset' attribute values - - The "attributes-charset" attribute's syntax is 'charset'. This means - that valid values are charsets names. When a charset in the IANA - registry has more than one name (alias), the name labeled as - "(preferred MIME name)", if present, MUST be used (see Section - 4.1.7). IANA is the registry for charsets following the procedures - of [RFC2278]. - -7. Internationalization Considerations - - Some of the attributes have values that are text strings and names - which are intended for human understanding rather than machine - understanding (see the 'text' and 'name' attribute syntaxes in - Sections 4.1.1 and 4.1.2). - - In each operation request, the client - - - identifies the charset and natural language of the request which - affects each supplied 'text' and 'name' attribute value, and - - requests the charset and natural language for attributes returned - by the IPP object in operation responses (as described in Section - 3.1.4.1). - - - - - -deBry, et al. Experimental [Page 121] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - In addition, the client MAY separately and individually identify the - Natural Language Override of a supplied 'text' or 'name' attribute - using the 'textWithLanguage' and 'nameWithLanguage' technique - described section 4.1.1.2 and 4.1.2.2 respectively. - - All IPP objects MUST support the UTF-8 [RFC2279] charset in all ' - text' and 'name' attributes supported. If an IPP object supports - more than the UTF-8 charset, the object MUST convert between them in - order to return the requested charset to the client according to - Section 3.1.4.2. If an IPP object supports more than one natural - language, the object SHOULD return 'text' and 'name' values in the - natural language requested where those values are generated by the - Printer (see Section 3.1.4.1). - - For Printers that support multiple charsets and/or multiple natural - languages in 'text' and 'name' attributes, different jobs may have - been submitted in differing charsets and/or natural languages. All - responses MUST be returned in the charset requested by the client. - However, the Get-Jobs operation uses the 'textWithLanguage' and ' - nameWithLanguage' mechanism to identify the differing natural - languages with each job attribute returned. - - The Printer object also has configured charset and natural language - attributes. The client can query the Printer object to determine - the list of charsets and natural languages supported by the Printer - object and what the Printer object's configured values are. See the - "charset-configured", "charset-supported", "natural-language- - configured", and "generated-natural-language-supported" Printer - description attributes for more details. - - The "charset-supported" attributed identifies the supported charsets. - If a charset is supported, the IPP object MUST be capable of - converting to and from that charset into any other supported charset. - In many cases, an IPP object will support only one charset and it - MUST be the UTF-8 charset. - - The "charset-configured" attribute identifies the one supported - charset which is the native charset given the current configuration - of the IPP object (administrator defined). - - The "generated-natural-language-supported" attribute identifies the - set of supported natural languages for generated messages; it is not - related to the set of natural languages that must be accepted for - client supplied 'text' and 'name' attributes. For client supplied ' - text' and 'name' attributes, an IPP object MUST accept ALL supplied - natural languages. Just because a Printer object is currently - - - - - -deBry, et al. Experimental [Page 122] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - configured to support 'en-us' natural language does not mean that the - Printer object should reject a job if the client supplies a job name - that is in 'fr-ca'. - - The "natural-language-configured" attribute identifies the one - supported natural language for generated messages which is the native - natural language given the current configuration of the IPP object - (administrator defined). - - Attributes of type 'text' and 'name' are populated from different - sources. These attributes can be categorized into following groups - (depending on the source of the attribute): - - 1. Some attributes are supplied by the client (e.g., the client - supplied "job-name", "document-name", and "requesting-user-name" - operation attributes along with the corresponding Job object's - "job-name" and "job-originating-user-name" attributes). The IPP - object MUST accept these attributes in any natural language no - matter what the set of supported languages for generated - messages - 2. Some attributes are supplied by the system administrator (e.g., - the Printer object's "printer-name" and "printer-location" - attributes). These too can be in any natural language. If the - natural language for these attributes is different than what a - client requests, then they must be reported using the Natural - Language Override mechanism. - 3. Some attributes are supplied by the device manufacturer (e.g., - the Printer object's "printer-make-and-model" attribute). These - too can be in any natural language. If the natural language for - these attributes is different than what a client requests, then - they must be reported using the Natural Language Override - mechanism. - 4. Some attributes are supplied by the operator (e.g., the Job - object's "job-message-from-operator" attribute). These too can - be in any natural language. If the natural language for these - attributes is different than what a client requests, then they - must be reported using the Natural Language Override mechanism. - 5. Some attributes are generated by the IPP object (e.g., the Job - object's "job-state-message" attribute, the Printer object's - "printer-state-message" attribute, and the "status-message" - operation attribute). These attributes can only be in one of - the "generated-natural-language-supported" natural languages. - If a client requests some natural language for these attributes - other than one of the supported values, the IPP object SHOULD - respond using the value of the "natural-language-configured" - attribute (using the Natural Language Override mechanism if - needed). - - - - -deBry, et al. Experimental [Page 123] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - The 'text' and 'name' attributes specified in this version of this - document (additional ones will be registered according to the - procedures in Section 6) are: - - Attributes Source - -------------------------- ---------- - Operation Attributes - job-name (name) client - document-name (name) client - requesting-user-name (name) client - status-message Job or Printer object - - Job Template Attributes: - job-hold-until) client matches administrator-configured - (keyword | name - job-hold-until-default client matches administrator-configured - (keyword | name) - job-hold-until-supported client matches administrator-configured - (keyword | name) - job-sheets client matches administrator-configured - (keyword | name) - job-sheets-default client matches administrator-configured - (keyword | name) - job-sheets-supported client matches administrator-configured - (keyword | name) - media client matches administrator-configured - (keyword | name) - media-default client matches administrator-configured - (keyword | name) - media-supported client matches administrator-configured - (keyword | name) - media-ready client matches administrator-configured - (keyword | name) - - Job Description Attributes: - job-name (name) client or Printer object - job-originating-user-name (name) Printer object - job-state-message (text) Job or Printer object - output-device-assigned (name(127)) administrator - job-message-from-operator (text(127)) operator - - Printer Description Attributes: - printer-name (name(127)) administrator - printer-location (text(127)) administrator - printer-info (text(127)) administrator - printer-make-and-model (text(127)) administrator or manufacturer - printer-state-message (text) Printer object - printer-message-from-operator (text(127)) operator - - - -deBry, et al. Experimental [Page 124] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - -8. Security Considerations - - Some IPP objects MAY be deployed over protocol stacks that support - Secure Socket Layer Version 3 (SSL3) [SSL]. Note: SSL3 is not an - IETF standards track specification. Other IPP objects MAY be - deployed over protocol stacks that do not support SSL3. Some IPP - objects MAY be deployed over both types of protocol stacks. Those - IPP objects that support SSL3, are capable of supporting mutual - authentication as well as privacy of messages via multiple encryption - schemes. An important point about security related information for - SSL3 access to an IPP object, is that the security-related parameters - (authentication, encryption keys, etc.) are "out-of-band" to the - actual IPP protocol. - - An IPP object that does not support SSL3 MAY elect to support a - transport layer that provides other security mechanisms. For - example, in a mapping of IPP over HTTP/1.1 [RFC2565], if the IPP - object does not support SSL3, HTTP still allows for client - authentication using Digest Access Authentication (DAA) [RFC2069]. - - It is difficult to anticipate the security risks that might exist in - any given IPP environment. For example, if IPP is used within a given - corporation over a private network, the risks of exposing document - data may be low enough that the corporation will choose not to use - encryption on that data. However, if the connection between the - client and the IPP object is over a public network, the client may - wish to protect the content of the information during transmission - through the network with encryption. - - Furthermore, the value of the information being printed may vary from - one IPP environment to the next. Printing payroll checks, for - example, would have a different value than printing public - information from a file. There is also the possibly of denial-of- - service attacks, but denial-of-service attacks against printing - resources are not well understood and there is no published - precedents regarding this scenario. - - Once the authenticated identity of the requester has been supplied to - the IPP object, the object uses that identity to enforce any - authorization policy that might be in place. For example, one site's - policy might be that only the job owner is allowed to cancel a job. - The details and mechanisms to set up a particular access control - policy are not part of IPP/1.0, and must be established via some - other type of administrative or access control framework. However, - there are operation status codes that allow an IPP server to return - information back to a client about any potential access control - violations for an IPP object. - - - - -deBry, et al. Experimental [Page 125] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - During a create operation, the client's identity is recorded in the - Job object in an implementation-defined attribute. This information - can be used to verify a client's identity for subsequent operations - on that Job object in order to enforce any access control policy that - might be in effect. See section 8.3 below for more details. - - Since the security levels or the specific threats that any given IPP - system administrator may be concerned with cannot be anticipated, IPP - MUST be capable of operating with different security mechanisms and - security policies as required by the individual installation. - Security policies might vary from very strong, to very weak, to none - at all, and corresponding security mechanisms will be required. SSL3 - supports the type of negotiated levels of security required by most, - if not all, potential IPP environments. IPP environments that require - no security can elect to deploy IPP objects that do not utilize the - optional SSL3 security mechanisms. - -8.1 Security Scenarios - - The following sections describe specific security attacks for IPP - environments. Where examples are provided they should be considered - illustrative of the environment and not an exhaustive set. Not all of - these environments will necessarily be addressed in initial - implementations of IPP. - -8.1.1 Client and Server in the Same Security Domain - - This environment is typical of internal networks where traditional - office workers print the output of personal productivity applications - on shared work-group printers, or where batch applications print - their output on large production printers. Although the identity of - the user may be trusted in this environment, a user might want to - protect the content of a document against such attacks as - eavesdropping, replaying or tampering. - -8.1.2 Client and Server in Different Security Domains - - Examples of this environment include printing a document created by - the client on a publicly available printer, such as at a commercial - print shop; or printing a document remotely on a business associate's - printer. This latter operation is functionally equivalent to sending - the document to the business associate as a facsimile. Printing - sensitive information on a Printer in a different security domain - requires strong security measures. In this environment authentication - of the printer is required as well as protection against unauthorized - use of print resources. Since the document crosses security domains, - - - - - -deBry, et al. Experimental [Page 126] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - protection against eavesdropping and document tampering are also - required. It will also be important in this environment to protect - Printers against "spamming" and malicious document content. - -8.1.3 Print by Reference - - When the document is not stored on the client, printing can be done - by reference. That is, the print request can contain a reference, or - pointer, to the document instead of the actual document itself. - Standard methods currently do not exist for remote entities to - "assume" the credentials of a client for forwarding requests to a 3rd - party. It is anticipated that Print-By-Reference will be used to - access "public" documents and that sophisticated methods for - authenticating "proxies" will not be specified for version 1 of IPP. - -8.2 URIs for SSL3 and non-SSL3 Access - - As described earlier, an IPP object can support SSL3 access, non-SSL3 - access, or both. The "printer-uri-supported" attribute contains the - Printer object's URI(s). Its companion attribute, "uri-security- - supported", identifies the security mechanism used for each URI - listed in the "printer-uri-supported" attribute. For each Printer - operation request, a client MUST supply only one URI in the - "printer-uri" operation attribute. In other words, even though the - Printer supports more than one URI, the client only interacts with - the Printer object using one if its URIs. This duality is not needed - for Job objects, since the Printer objects is the factory for Job - objects, and the Printer object will generate the correct URI for new - Job objects depending on the Printer object's security configuration. - -8.3 The "requesting-user-name" (name(MAX)) Operation Attribute - - Each operation MUST specify the user who is performing the operation - in both of the following two ways: - - 1) via the REQUIRED "requesting-user-name" operation attribute that - a client SHOULD supply in all operations. The client MUST obtain - the value for this attribute from an environmental or network - login name for the user, rather than allowing the user to supply - any value. If the client does not supply a value for - "requesting-user-name", the printer MUST assume that the client - is supplying some anonymous name, such as "anonymous". - 2) via an authentication mechanism of the underlying transport - which may be configured to give no authentication information. - - - - - - - -deBry, et al. Experimental [Page 127] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - There are six cases to consider: - - a) the authentication mechanism gives no information, and the - client doesn't specify "requesting-user-name". - b) the authentication mechanism gives no information, but the - client specifies "requesting-user-name". - c) the authentication mechanism specifies a user which has no human - readable representation, and the client doesn't specify - "requesting-user-name". - d) the authentication mechanism specifies a user which has no human - readable representation, but the client specifies "requesting- - user-name". - e) the authentication mechanism specifies a user which has a human - readable representation. The Printer object ignores the - "requesting-user-name". - f) the authentication mechanism specifies a user who is trusted and - whose name means that the value of the "requesting-user-name", - which MUST be present, is treated as the authenticated name. - - Note: Case "f" is intended for a tightly coupled gateway and server - to work together so that the "user" name is able to be that of the - gateway client and not that of the gateway. Because most, if not - all, system vendors will initially implement IPP via a gateway into - their existing print system, this mechanism is necessary unless the - authentication mechanism allows a gateway (client) to act on behalf - of some other client. - - The user-name has two forms: - - - one that is human readable: it is held in the REQUIRED "job- - originating-user-name" Job Description attribute which is set - during the job creation operations. It is used for presentation - only, such as returning in queries or printing on start sheets - - one for authorization: it is held in an undefined (by IPP) Job - object attribute which is set by the job creation operation. It - is used to authorize other operations, such as Send-Document, - Send-URI, Cancel-Job, to determine the user when the "my-jobs" - attribute is specified with Get-Jobs, and to limit what - attributes and values to return with Get-Job-Attributes and Get- - Jobs. - - The human readable user name: - - - is the value of the "requesting-user-name" for cases b, d and f. - - comes from the authentication mechanism for case e - - is some anonymous name, such as "anonymous" for cases a and c. - - The user name used for authorization: - - - -deBry, et al. Experimental [Page 128] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - - is the value of the "requesting-user-name" for cases b and f. - - comes from the authentication mechanism for cases c, d and e - - is some anonymous name, such as "anonymous" for case a. - - The essence of these rules for resolving conflicting sources of - user-names is that a printer implementation is free to pick either - source as long as it achieves consistent results. That is, if a user - uses the same path for a series of requests, the requests MUST appear - to come from the same user from the standpoint of both the human- - readable user name and the user name for authorization. This rule - MUST continue to apply even if a request could be authenticated by - two or more mechanisms. It doesn't matter which of several - authentication mechanisms a Printer uses as long as it achieves - consistent results. If a client uses more than one authentication - mechanism, it is recommended that an administrator make all - credentials resolve to the same user and user-name as much as - possible. - -8.4 Restricted Queries - - In many IPP operations, a client supplies a list of attributes to be - returned in the response. For security reasons, an IPP object may be - configured not to return all attributes (or all values) that a client - requests. The job attributes returned MAY depend on whether the - requesting user is the same as the user that submitted the job. The - IPP object MAY even return none of the requested attributes. In such - cases, the status returned is the same as if the object had returned - all requested attributes. The client cannot tell by such a response - whether the requested attribute was present or absent on the object. - -8.5 Queries on jobs submitted using non-IPP protocols - - If the device that an IPP Printer is representing is able to accept - jobs using other job submission protocols in addition to IPP, it is - RECOMMENDED that such an implementation at least allow such "foreign" - jobs to be queried using Get-Jobs returning "job-id" and "job-uri" as - 'unknown'. Such an implementation NEED NOT support all of the same - IPP job attributes as for IPP jobs. The IPP object returns the ' - unknown' out-of-band value for any requested attribute of a foreign - job that is supported for IPP jobs, but not for foreign jobs. - - It is further RECOMMENDED, that the IPP Printer generate "job-id" and - "job-uri" values for such "foreign jobs", if possible, so that they - may be targets of other IPP operations, such as Get-Job-Attributes - and Cancel-Job. Such an implementation also needs to deal with the - problem of authentication of such foreign jobs. One approach would - be to treat all such foreign jobs as belonging to users other than - the user of the IPP client. Another approach would be for the - - - -deBry, et al. Experimental [Page 129] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - foreign job to belong to 'anonymous'. Only if the IPP client has - been authenticated as an operator or administrator of the IPP Printer - object, could the foreign jobs be queried by an IPP request. - Alternatively, if the security policy is to allow users to query - other users' jobs, then the foreign jobs would also be visible to an - end-user IPP client using Get-Jobs and Get-Job-Attributes. - -8.6 IPP Security Application Profile for SSL3 - - The IPP application profile for SSL3 follows the "Secure Socket - Layer" requirement as documented in the SSL3 specification [SSL]. - For interoperability, the SSL3 cipher suites are: - - SSL_RSA_WITH_RC4_128_MD5 - SSL_RSA_WITH_3DES_EDE_CBC_SHA - SSL_RSA_WITH_DES_CBC_SHA - SSL_RSA_EXPORT_WITH_RC4_40_MD5 - SSL_RSA_EXPORT_WITH_RC2_CBC_40_MD5 - SSL_RSA_WITH_NULL_MD5 - - Client implementations MUST NOT assume any other cipher suites are - supported by an IPP Printer object. - - If a conforming IPP object supports SSL3, it MUST implement and - support the cipher suites listed above and MAY support additional - cipher suites. - - A conforming IPP client SHOULD support SSL3 including the cipher - suites listed above. A conforming IPP client MAY support additional - cipher suites. - - It is possible that due to certain government export restrictions - some non-compliant versions of this extension could be deployed. - Implementations wishing to inter-operate with such non-compliant - versions MAY offer the SSL_RSA_EXPORT_WITH_RC4_40_MD5 and - SSL_RSA_EXPORT_WITH_RC2_CBC_40_MD5 mechanisms. However, since 40 bit - ciphers are known to be vulnerable to attack by current technology, - any client which actives a 40 bit cipher MUST NOT indicate to the - user that the connection is completely secure from eavesdropping. - - - - - - - - - - - - -deBry, et al. Experimental [Page 130] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - -9. References - - [ASCII] Coded Character Set - 7-bit American Standard Code for - Information Interchange (ASCII), ANSI X3.4-1986. This - standard is the specification of the US-ASCII charset. - - [HTPP] J. Barnett, K. Carter, R. DeBry, "Initial Draft - - Hypertext Printing Protocol - HTPP/1.0", October 1996. - ftp://ftp.pwg.org/pub/pwg/ipp/historic/htpp/ - overview.ps.gz - - [IANA-CS] IANA Registry of Coded Character Sets: - ftp://ftp.isi.edu/in-notes/iana/assignments/character- - sets - - [IANA-MT] IANA Registry of Media Types: ftp://ftp.isi.edu/in- - notes/iana/assignments/media-types/ - - [ipp-iig] Hastings, T. and C. Manros, "Internet Printing - Protocol/1.0: Implementer's Guide", Work in Progress. - - [ISO10646-1] ISO/IEC 10646-1:1993, "Information technology -- - Universal Multiple-Octet Coded Character Set (UCS) - - Part 1: Architecture and Basic Multilingual Plane, - JTC1/SC2." - - [ISO8859-1] ISO/IEC 8859-1:1987, "Information technology -- 8-bit - One-Byte Coded Character Set - Part 1: Latin Alphabet Nr - 1", 1987, JTC1/SC2. - - [ISO10175] ISO/IEC 10175 Document Printing Application (DPA), June - 1996. - - [LDPA] T. Hastings, S. Isaacson, M. MacKay, C. Manros, D. Taylor, P. - Zehler, "LDPA - Lightweight Document Printing - Application", October 1996, - ftp://ftp.pwg.org/pub/pwg/ipp/historic/ldpa/ldpa8.pdf.gz - - [P1387.4] Kirk, M. (Editor), POSIX System Administration - Part 4: - Printing Interfaces, POSIX 1387.4 D8, 1994. - - [PSIS] Herriot, R. (editor), X/Open A Printing System - Interoperability Specification (PSIS), August 1995. - - [PWG] Printer Working Group, http://www.pwg.org. - - [RFC1035] Mockapetris, P., "DOMAIN NAMES - IMPLEMENTATION AND - SPECIFICATION", STD 13, RFC 1035, November 1987. - - - -deBry, et al. Experimental [Page 131] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - [RFC1759] Smith, R., Wright, F., Hastings, T., Zilles, S. and J. - Gyllenskog, "Printer MIB", RFC 1759, March 1995. - - [RFC1766] Alvestrand, H., "Tags for the Identification of - Languages", RFC 1766, March 1995. - - [RFC1179] McLaughlin, L. (Editor), "Line Printer Daemon Protocol", - RFC 1179, August 1990. - - [RFC1952] Deutsch, P., "GZIP file format specification version - 4.3", RFC 1952, May 1996. - - [RFC2045] Freed, N. and N. Borenstein, " Multipurpose Internet - Mail Extensions (MIME) Part One: Format of Internet - Message Bodies", RFC 2045, November 1996. - - [RFC2046] Freed, N. and N. Borenstein, "Multipurpose Internet Mail - Extensions (MIME) Part Two: Media Types", RFC 2046, - November 1996. - - [RFC2048] Freed, N., Klensin, J. and J. Postel, "Multipurpose - Internet Mail Extension (MIME) Part Four: Registration - Procedures", RFC 2048, November 1996. - - [RFC2068] Fielding, R., Gettys, J., Mogul, J., Frystyk, H. AND T. - Berners-Lee, "Hypertext Transfer Protocol - HTTP/1.1", - RFC 2068, January 1997. - - [RFC2069] Franks, J., Hallam-Baker, P., Hostetler, J., Leach, P., - Luotonen, A., Sink, E. and L. Stewart, "An Extension to - HTTP: Digest Access Authentication", RFC 2069, January - 1997. - - [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate - Requirement Levels", BCP 14, RFC 2119, March 1997. - - [RFC2228] Horowitz, M. and S. Lunt, "FTP Security Extensions", RFC - 2228, October 1997. - - [RFC2277] Alvestrand, H., "IETF Policy on Character Sets and - Languages" RFC 2277, January 1998. - - [RFC2278] Freed, N. and J. Postel: "IANA Charset Registration - Procedures", BCP 19, RFC 2278, January 1998. - - [RFC2279] Yergeau, F., "UTF-8, a transformation format of ISO - 10646", RFC 2279, January 1998. - - - - -deBry, et al. Experimental [Page 132] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - [RFC2316] Bellovin, S., "Report of the IAB Security Architecture - Workshop", RFC 2316, April 1998. - - [RFC2396] Berners-Lee, T., Fielding, R. and L. Masinter, "Uniform - Resource Identifiers (URI): Generic Syntax", RFC 2396, - August 1998. - - [RFC2434] Narten, T. and H. Alvestrand, "Guidelines for Writing an - IANA Considerations Section in RFCs", BCP 26, RFC 2434, - October 1998. - - [RFC2565] Herriot, R., Butler, S., Moore, P. and R. Tuner - "Internet Printing Protocol/1.0: Encoding and - Transport", RFC 2565, April 1999. - - [RFC2567] Wright, D., "Design Goals for an Internet Printing - Protocol", RFC 2567, April 1999. - - [RFC2568] Zilles, S., "Rationale for the Structure and Model and - Protocol for the Internet Printing Protocol", RFC 2568, - April 1999. - - [RFC2569] Herriot, R., Hastings, T., Jacobs, N. and J. Martin, - "Mapping between LPD and IPP Protocols", RFC 2569, April - 1999. - - [RFC2579] McCloghrie, K., Perkins, D. and J. Schoenwaelder, - "Textual Conventions for SMIv2", STD 58, RFC 2579, April - 1999. - - [SSL] Netscape, The SSL Protocol, Version 3, (Text version - 3.02), November 1996. - - [SWP] P. Moore, B. Jahromi, S. Butler, "Simple Web Printing - SWP/1.0", May 7, 1997, - ftp://ftp.pwg.org/pub/pwg/ipp/new_PRO/swp9705.pdf - - - - - - - - - - - - - - - -deBry, et al. Experimental [Page 133] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - -10. Authors' Addresses - - Scott A. Isaacson (Editor) - Novell, Inc. - 122 E 1700 S - Provo, UT 84606 - - Phone: 801-861-7366 - Fax: 801-861-2517 - EMail: sisaacson@novell.com - - - Tom Hastings - Xerox Corporation - 737 Hawaii St. - El Segundo, CA 90245 - - Phone: 310-333-6413 - Fax: 310-333-5514 - EMail: hastings@cp10.es.xerox.com - - - Robert Herriot - Xerox Corporation - 3400 Hillview Ave., Bldg #1 - Palo Alto, CA 94304 - - Phone: 650-813-7696 - Fax: 650-813-6860 - EMail: robert.herriot@pahv.xerox.com - - - Roger deBry - Utah Valley State College - Orem, UT 84058 - - Phone: (801) 222-8000 - EMail: debryro@uvsc.edu - - - - - - - - - - - - - -deBry, et al. Experimental [Page 134] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - Patrick Powell - Astart Technologies - 9475 Chesapeake Dr., Suite D - San Diego, CA 95123 - - Phone: (619) 874-6543 - Fax: (619) 279-8424 - EMail: papowell@astart.com - - IPP Mailing List: ipp@pwg.org - IPP Mailing List Subscription: ipp-request@pwg.org - IPP Web Page: http://www.pwg.org/ipp/ - - Implementers of this specification are encouraged to join IPP Mailing - List in order to participate in any discussions of clarification - issues and review of registration proposals for additional attributes - and values. - - Other Participants: - - Chuck Adams - Tektronix - Jeff Barnett - IBM - Ron Bergman - Dataproducts Corp. - Sylvan Butler - HP - Keith Carter - IBM Corporation - Jeff Copeland - QMS - Andy Davidson - Tektronix - Mabry Dozier - QMS - Lee Farrell - Canon Information Systems - Steve Gebert - IBM - Babek Jahromi - Microsoft - David Kellerman - Northlake Software - Rick Landau - Digital - Greg LeClair - Epson - Harry Lewis - IBM - Pete Loya - HP - Ray Lutz - Cognisys - Mike MacKay - Novell, Inc. - Daniel Manchala - Xerox - Carl-Uno Manros - Xerox - Jay Martin - Underscore - Larry Masinter - Xerox - Stan McConnell - Xerox - Ira McDonald - High North Inc. - Paul Moore - Microsoft - Tetsuya Morita - Ricoh - Yuichi Niwa - Ricoh - Pat Nogay - IBM - - - -deBry, et al. Experimental [Page 135] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - Ron Norton - Printronics - Bob Pentecost - HP - Rob Rhoads - Intel - Xavier Riley - Xerox - David Roach - Unisys - Stuart Rowley - Kyocera - Hiroyuki Sato - Canon - Bob Setterbo - Adobe - Devon Taylor - Novell, Inc. - Mike Timperman - Lexmark - Randy Turner - Sharp - Atsushi Yuki - Kyocera - Rick Yardumian - Xerox - Lloyd Young - Lexmark - Bill Wagner - DPI - Jim Walker - DAZEL - Chris Wellens - Interworking Labs - Rob Whittle - Novell, Inc. - Don Wright - Lexmark - Peter Zehler - Xerox - Steve Zilles - Adobe - -11. Formats for IPP Registration Proposals - - In order to propose an IPP extension for registration, the proposer - must submit an application to IANA by email to "iana@iana.org" or by - filling out the appropriate form on the IANA web pages - (http://www.iana.org). This section specifies the required - information and the formats for proposing registrations of extensions - to IPP as provided in Section 6 for: - - 1. type2 'keyword' attribute values - 2. type3 'keyword' attribute values - 3. type2 'enum' attribute values - 4. type3 'enum' attribute values - 5. attributes - 6. attribute syntaxes - 7. operations - 8. status codes - -11.1 Type2 keyword attribute values registration - - Type of registration: type2 keyword attribute value - Name of attribute to which this keyword specification is to be added: - Proposed keyword name of this keyword value: - Specification of this keyword value (follow the style of IPP Model - Section 4.1.2.3): - Name of proposer: - - - -deBry, et al. Experimental [Page 136] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - Address of proposer: - Email address of proposer: - - Note: For type2 keywords, the Designated Expert will be the point of - contact for the approved registration specification, if any - maintenance of the registration specification is needed. - -11.2 Type3 keyword attribute values registration - - Type of registration: type3 keyword attribute value - Name of attribute to which this keyword specification is to be added: - Proposed keyword name of this keyword value: - Specification of this keyword value (follow the style of IPP Model - Section 4.1.2.3): - Name of proposer: - Address of proposer: - Email address of proposer: - - Note: For type3 keywords, the proposer will be the point of contact - for the approved registration specification, if any maintenance of - the registration specification is needed. - -11.3 Type2 enum attribute values registration - - Type of registration: type2 enum attribute value - Name of attribute to which this enum specification is to be added: - Keyword symbolic name of this enum value: - Numeric value (to be assigned by the IPP Designated Expert in - consultation with IANA): - Specification of this enum value (follow the style of IPP Model - Section 4.1.4): - Name of proposer: - Address of proposer: - Email address of proposer: - - Note: For type2 enums, the Designated Expert will be the point of - contact for the approved registration specification, if any - maintenance of the registration specification is needed. - -11.4 Type3 enum attribute values registration - - Type of registration: type3 enum attribute value - Name of attribute to which this enum specification is to be added: - Keyword symbolic name of this enum value: - Numeric value (to be assigned by the IPP Designated Expert in - consultation with IANA): - Specification of this enum value (follow the style of IPP Model - Section 4.1.4): - - - -deBry, et al. Experimental [Page 137] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - Name of proposer: - Address of proposer: - Email address of proposer: - - Note: For type3 enums, the proposer will be the point of contact for - the approved registration specification, if any maintenance of the - registration specification is needed. - -11.5 Attribute registration - - Type of registration: attribute - Proposed keyword name of this attribute: - Types of attribute (Operation, Job Template, Job Description, - Printer Description): - Operations to be used with if the attribute is an operation - attribute: - Object (Job, Printer, etc. if bound to an object): - Attribute syntax(es) (include 1setOf and range as in Section 4.2): - If attribute syntax is 'keyword' or 'enum', is it type2 or type3: - If this is a Printer attribute, MAY the value returned depend on - "document-format" (See Section 6.2): - If this is a Job Template attribute, how does its specification - depend on the value of the "multiple-document-handling" attribute: - Specification of this attribute (follow the style of IPP Model - Section 4.2): - Name of proposer: - Address of proposer: - Email address of proposer: - - Note: For attributes, the IPP Designated Expert will be the point of - contact for the approved registration specification, if any - maintenance of the registration specification is needed. - -11.6 Attribute Syntax registration - - Type of registration: attribute syntax - Proposed name of this attribute syntax: - Type of attribute syntax (integer, octetString, character-string, - see [RFC2565]): - Numeric value (to be assigned by the IPP Designated Expert in - consultation with IANA): - Specification of this attribute (follow the style of IPP Model - Section 4.1): - Name of proposer: - Address of proposer: - Email address of proposer: - - - - - -deBry, et al. Experimental [Page 138] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - Note: For attribute syntaxes, the IPP Designated Expert will be the - point of contact for the approved registration specification, if any - maintenance of the registration specification is needed. - -11.7 Operation registration - - Type of registration: operation - Proposed name of this operation: - Numeric operation-id value (to be assigned by the IPP Designated - Expert in consultation with IANA): - Object Target (Job, Printer, etc. that operation is upon): - Specification of this attribute (follow the style of IPP Model - Section 3): - Name of proposer: - Address of proposer: - Email address of proposer: - - Note: For operations, the IPP Designated Expert will be the point of - contact for the approved registration specification, if any - maintenance of the registration specification is needed. - -11.8 Attribute Group registration - - Type of registration: attribute group - Proposed name of this attribute group: - Numeric tag according to [RFC2565] (to be assigned by the IPP - Designated Expert in consultation with IANA): - Operation requests and group number for each operation in which the - attribute group occurs: - Operation responses and group number for each operation in which the - attribute group occurs: - Specification of this attribute group (follow the style of IPP Model - Section 3): - Name of proposer: - Address of proposer: - Email address of proposer: - - Note: For attribute groups, the IPP Designated Expert will be the - point of contact for the approved registration specification, if any - maintenance of the registration specification is needed. - -11.9 Status code registration - - Type of registration: status code - Keyword symbolic name of this status code value: - Numeric value (to be assigned by the IPP Designated Expert in - consultation with IANA): - Operations that this status code may be used with: - - - -deBry, et al. Experimental [Page 139] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - Specification of this status code (follow the style of IPP Model - Section 14 APPENDIX B: Status Codes and Suggested Status Code - Messages): - Name of proposer: - Address of proposer: - Email address of proposer: - - Note: For status codes, the Designated Expert will be the point of - contact for the approved registration specification, if any - maintenance of the registration specification is needed. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -deBry, et al. Experimental [Page 140] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - -12. APPENDIX A: Terminology - - This specification uses the terminology defined in this section. - -12.1 Conformance Terminology - - The key words "MUST", "MUST NOT", "REQUIRED", "SHOULD", "SHOULD NOT", - "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be - interpreted as described in RFC 2119 [RFC2119]. - -12.1.1 NEED NOT - - This term is not included in RFC 2119. The verb "NEED NOT" indicates - an action that the subject of the sentence does not have to implement - in order to claim conformance to the standard. The verb "NEED NOT" - is used instead of "MAY NOT" since "MAY NOT" sounds like a - prohibition. - -12.2 Model Terminology - -12.2.1 Keyword - - Keywords are used within this document as identifiers of semantic - entities within the abstract model (see section 4.1.2.3). Attribute - names, some attribute values, attribute syntaxes, and attribute group - names are represented as keywords. - -12.2.2 Attributes - - An attribute is an item of information that is associated with an - instance of an IPP object. An attribute consists of an attribute - name and one or more attribute values. Each attribute has a specific - attribute syntax. All object attributes are defined in section 4 and - all operation attributes are defined in section 3. - - Job Template Attributes are described in section 4.2. The client - optionally supplies Job Template attributes in a create request - (operation requests that create Job objects). The Printer object has - associated attributes which define supported and default values for - the Printer. - -12.2.2.1 Attribute Name - - Each attribute is uniquely identified in this document by its - attribute name. An attribute name is a keyword. The keyword - attribute name is given in the section header describing that - - - - - -deBry, et al. Experimental [Page 141] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - attribute. In running text in this document, attribute names are - indicated inside double quotation marks (") where the quotation marks - are not part of the keyword itself. - -12.2.2.2 Attribute Group Name - - Related attributes are grouped into named groups. The name of the - group is a keyword. The group name may be used in place of naming - all the attributes in the group explicitly. Attribute groups are - defined in section 3. - -12.2.2.3 Attribute Value - - Each attribute has one or more values. Attribute values are - represented in the syntax type specified for that attribute. In - running text in this document, attribute values are indicated inside - single quotation marks ('), whether their attribute syntax is - keyword, integer, text, etc. where the quotation marks are not part - of the value itself. - -12.2.2.4 Attribute Syntax - - Each attribute is defined using an explicit syntax type. In this - document, each syntax type is defined as a keyword with specific - meaning. The Encoding and Transport document [RFC2565] indicates the - actual "on-the-wire" encoding rules for each syntax type. Attribute - syntax types are defined in section 4.1. - -12.2.3 Supports - - By definition, a Printer object supports an attribute only if that - Printer object responds with the corresponding attribute populated - with some value(s) in a response to a query for that attribute. A - Printer object supports an attribute value if the value is one of the - Printer object's "supported values" attributes. The device behind a - Printer object may exhibit a behavior that corresponds to some IPP - attribute, but if the Printer object, when queried for that - attribute, doesn't respond with the attribute, then as far as IPP is - concerned, that implementation does not support that feature. If the - Printer object's "xxx-supported" attribute is not populated with a - particular value (even if that value is a legal value for that - attribute), then that Printer object does not support that particular - value. - - A conforming implementation MUST support all REQUIRED attributes. - However, even for REQUIRED attributes, conformance to IPP does not - mandate that all implementations support all possible values - representing all possible job processing behaviors and features. For - - - -deBry, et al. Experimental [Page 142] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - example, if a given instance of a Printer supports only certain - document formats, then that Printer responds with the "document- - format-supported" attribute populated with a set of values, possibly - only one, taken from the entire set of possible values defined for - that attribute. This limited set of values represents the Printer's - set of supported document formats. Supporting an attribute and some - set of values for that attribute enables IPP end users to be aware of - and make use of those features associated with that attribute and - those values. If an implementation chooses to not support an - attribute or some specific value, then IPP end users would have no - ability to make use of that feature within the context of IPP itself. - However, due to existing practice and legacy systems which are not - IPP aware, there might be some other mechanism outside the scope of - IPP to control or request the "unsupported" feature (such as embedded - instructions within the document data itself). - - For example, consider the "finishings-supported" attribute. - - 1) If a Printer object is not physically capable of stapling, the - "finishings-supported" attribute MUST NOT be populated with the - value of 'staple'. - 2) A Printer object is physically capable of stapling, however an - implementation chooses not to support stapling in the IPP - "finishings" attribute. In this case, 'staple' MUST NOT be a - value in the "finishings-supported" Printer object attribute. - Without support for the value 'staple', an IPP end user would - have no means within the protocol itself to request that a Job - be stapled. However, an existing document data formatter might - be able to request that the document be stapled directly with an - embedded instruction within the document data. In this case, - the IPP implementation does not "support" stapling, however the - end user is still able to have some control over the stapling of - the completed job. - 3) A Printer object is physically capable of stapling, and an - implementation chooses to support stapling in the IPP - "finishings" attribute. In this case, 'staple' MUST be a value - in the "finishings-supported" Printer object attribute. Doing - so, would enable end users to be aware of and make use of the - stapling feature using IPP attributes. - - Even though support for Job Template attributes by a Printer object - is OPTIONAL, it is RECOMMENDED that if the device behind a Printer - object is capable of realizing any feature or function that - corresponds to an IPP attribute and some associated value, then that - implementation SHOULD support that IPP attribute and value. - - - - - - -deBry, et al. Experimental [Page 143] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - The set of values in any of the supported value attributes is set - (populated) by some administrative process or automatic sensing - mechanism that is outside the scope of IPP. For administrative - policy and control reasons, an administrator may choose to make only - a subset of possible values visible to the end user. In this case, - the real output device behind the IPP Printer abstraction may be - capable of a certain feature, however an administrator is specifying - that access to that feature not be exposed to the end user through - the IPP protocol. Also, since a Printer object may represent a - logical print device (not just a physical device) the actual process - for supporting a value is undefined and left up to the - implementation. However, if a Printer object supports a value, some - manual human action may be needed to realize the semantic action - associated with the value, but no end user action is required. - - For example, if one of the values in the "finishings-supported" - attribute is 'staple', the actual process might be an automatic - staple action by a physical device controlled by some command sent to - the device. Or, the actual process of stapling might be a manual - action by an operator at an operator attended Printer object. - - For another example of how supported attributes function, consider a - system administrator who desires to control all print jobs so that no - job sheets are printed in order to conserve paper. To force no job - sheets, the system administrator sets the only supported value for - the "job-sheets-supported" attribute to 'none'. In this case, if a - client requests anything except 'none', the create request is - rejected or the "job-sheets" value is ignored (depending on the value - of "ipp-attribute-fidelity"). To force the use of job start/end - sheets on all jobs, the administrator does not include the value ' - none' in the "job-sheets-supported" attribute. In this case, if a - client requests 'none', the create request is rejected or the "job- - sheets" value is ignored (again depending on the value of "ipp- - attribute-fidelity"). - -12.2.4 print-stream page - - A "print-stream page" is a page according to the definition of pages - in the language used to express the document data. - -12.2.5 impression - - An "impression" is the image (possibly many print-stream pages in - different configurations) imposed onto a single media page. - - - - - - - -deBry, et al. Experimental [Page 144] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - -13. APPENDIX B: Status Codes and Suggested Status Code Messages - - This section defines status code enum keywords and values that are - used to provide semantic information on the results of an operation - request. Each operation response MUST include a status code. The - response MAY also contain a status message that provides a short - textual description of the status. The status code is intended for - use by automata, and the status message is intended for the human end - user. Since the status message is an OPTIONAL component of the - operation response, an IPP application (i.e., a browser, GUI, print - driver or gateway) is NOT REQUIRED to examine or display the status - message, since it MAY not be returned to the application. - - The prefix of the status keyword defines the class of response as - follows: - - "informational" - Request received, continuing process - "successful" - The action was successfully received, understood, - and accepted - "redirection" - Further action must be taken in order to complete - the request - "client-error" - The request contains bad syntax or cannot be - fulfilled - "server-error" - The IPP object failed to fulfill an apparently - valid request - - As with type2 enums, IPP status codes are extensible. IPP clients - are NOT REQUIRED to understand the meaning of all registered status - codes, though such understanding is obviously desirable. However, - IPP clients MUST understand the class of any status code, as - indicated by the prefix, and treat any unrecognized response as being - equivalent to the first status code of that class, with the exception - that an unrecognized response MUST NOT be cached. For example, if an - unrecognized status code of "client-error-xxx-yyy" is received by the - client, it can safely assume that there was something wrong with its - request and treat the response as if it had received a "client- - error-bad-request" status code. In such cases, IPP applications - SHOULD present the OPTIONAL message (if present) to the end user - since the message is likely to contain human readable information - which will help to explain the unusual status. The name of the enum - is the suggested status message for US English. - - The status code values range from 0x0000 to 0x7FFF. The value ranges - for each status code class are as follows: - - "successful" - 0x0000 to 0x00FF - "informational" - 0x0100 to 0x01FF - "redirection" - 0x0200 to 0x02FF - - - -deBry, et al. Experimental [Page 145] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - "client-error" - 0x0400 to 0x04FF - "server-error" - 0x0500 to 0x05FF - - The top half (128 values) of each range (0x0n40 to 0x0nFF, for n = 0 - to 5) is reserved for private use within each status code class. - Values 0x0600 to 0x7FFF are reserved for future assignment and MUST - NOT be used. - -13.1 Status Codes - - Each status code is described below. Section 13.1.5.9 contains a - table that indicates which status codes apply to which operations. - The Implementer's Guide [ipp-iig] describe the suggested steps for - processing IPP attributes for all operations, including returning - status codes. - -13.1.1 Informational - - This class of status code indicates a provisional response and is to - be used for informational purposes only. - - There are no status codes defined in IPP/1.0 for this class of status - code. - -13.1.2 Successful Status Codes - - This class of status code indicates that the client's request was - successfully received, understood, and accepted. - -13.1.2.1 successful-ok (0x0000) - - The request has succeeded and no request attributes were substituted - or ignored. In the case of a response to a create request, the ' - successful-ok' status code indicates that the request was - successfully received and validated, and that the Job object has been - created; it does not indicate that the job has been processed. The - transition of the Job object into the 'completed' state is the only - indicator that the job has been printed. - -13.1.2.2 successful-ok-ignored-or-substituted-attributes (0x0001) - - The request has succeeded, but some supplied (1) attributes were - ignored or (2) unsupported values were substituted with supported - values or were ignored in order to perform the operation without - rejecting it. Unsupported attributes, attribute syntaxes, or values - MUST be returned in the Unsupported Attributes group of the response - for all operations. There is an exception to this rule for the query - operations: Get-Printer-Attributes, Get-Jobs, and Get-Job-Attributes - - - -deBry, et al. Experimental [Page 146] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - for the "requested-attributes" operation attribute only. When the - supplied values of the "requested-attributes" operation attribute are - requesting attributes that are not supported, the IPP object MAY, but - is NOT REQUIRED to, return the "requested-attributes" attribute in - the Unsupported Attribute response group (with the unsupported values - only). See section 3.2.1.2. - -13.1.2.3 successful-ok-conflicting-attributes (0x0002) - - The request has succeeded, but some supplied attribute values - conflicted with the values of other supplied attributes. These - conflicting values were either (1) substituted with (supported) - values or (2) the attributes were removed in order to process the job - without rejecting it. Attributes or values which conflict with other - attributes and have been substituted or ignored MUST be returned in - the Unsupported Attributes group of the response for all operations - as supplied by the client. See section 3.2.1.2. - -13.1.3 Redirection Status Codes - - This class of status code indicates that further action needs to be - taken to fulfill the request. - - There are no status codes defined in IPP/1.0 for this class of status - code. - -13.1.4 Client Error Status Codes - - This class of status code is intended for cases in which the client - seems to have erred. The IPP object SHOULD return a message - containing an explanation of the error situation and whether it is a - temporary or permanent condition. - -13.1.4.1 client-error-bad-request (0x0400) - - The request could not be understood by the IPP object due to - malformed syntax (such as the value of a fixed length attribute whose - length does not match the prescribed length for that attribute - see - the Implementer's Guide [ipp-iig] ). The IPP application SHOULD NOT - repeat the request without modifications. - -13.1.4.2 client-error-forbidden (0x0401) - - The IPP object understood the request, but is refusing to fulfill it. - Additional authentication information or authorization credentials - will not help and the request SHOULD NOT be repeated. This status - - - - - -deBry, et al. Experimental [Page 147] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - code is commonly used when the IPP object does not wish to reveal - exactly why the request has been refused or when no other response is - applicable. - -13.1.4.3 client-error-not-authenticated (0x0402) - - The request requires user authentication. The IPP client may repeat - the request with suitable authentication information. If the request - already included authentication information, then this status code - indicates that authorization has been refused for those credentials. - If this response contains the same challenge as the prior response, - and the user agent has already attempted authentication at least - once, then the response message may contain relevant diagnostic - information. This status codes reveals more information than - "client-error-forbidden". - -13.1.4.4 client-error-not-authorized (0x0403) - - The requester is not authorized to perform the request. Additional - authentication information or authorization credentials will not help - and the request SHOULD NOT be repeated. This status code is used - when the IPP object wishes to reveal that the authentication - information is understandable, however, the requester is explicitly - not authorized to perform the request. This status codes reveals - more information than "client-error-forbidden" and "client-error- - not-authenticated". - -13.1.4.5 client-error-not-possible (0x0404) - - This status code is used when the request is for something that can - not happen. For example, there might be a request to cancel a job - that has already been canceled or aborted by the system. The IPP - client SHOULD NOT repeat the request. - -13.1.4.6 client-error-timeout (0x0405) - - The client did not produce a request within the time that the IPP - object was prepared to wait. For example, a client issued a Create- - Job operation and then, after a long period of time, issued a Send- - Document operation and this error status code was returned in - response to the Send-Document request (see section 3.3.1). The IPP - object might have been forced to clean up resources that had been - held for the waiting additional Documents. The IPP object was forced - to close the Job since the client took too long. The client SHOULD - NOT repeat the request without modifications. - - - - - - -deBry, et al. Experimental [Page 148] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - -13.1.4.7 client-error-not-found (0x0406) - - The IPP object has not found anything matching the request URI. No - indication is given of whether the condition is temporary or - permanent. For example, a client with an old reference to a Job (a - URI) tries to cancel the Job, however in the mean time the Job might - have been completed and all record of it at the Printer has been - deleted. This status code, 'client-error-not-found' is returned - indicating that the referenced Job can not be found. This error - status code is also used when a client supplies a URI as a reference - to the document data in either a Print-URI or Send-URI operation, but - the document can not be found. - - In practice, an IPP application should avoid a not found situation by - first querying and presenting a list of valid Printer URIs and Job - URIs to the end-user. - -13.1.4.8 client-error-gone (0x0407) - - The requested object is no longer available and no forwarding address - is known. This condition should be considered permanent. Clients - with link editing capabilities should delete references to the - request URI after user approval. If the IPP object does not know or - has no facility to determine, whether or not the condition is - permanent, the status code "client-error-not-found" should be used - instead. - - This response is primarily intended to assist the task of maintenance - by notifying the recipient that the resource is intentionally - unavailable and that the IPP object administrator desires that remote - links to that resource be removed. It is not necessary to mark all - permanently unavailable resources as "gone" or to keep the mark for - any length of time -- that is left to the discretion of the IPP - object administrator. - -13.1.4.9 client-error-request-entity-too-large (0x0408) - - The IPP object is refusing to process a request because the request - entity is larger than the IPP object is willing or able to process. - An IPP Printer returns this status code when it limits the size of - print jobs and it receives a print job that exceeds that limit or - when the attributes are so many that their encoding causes the - request entity to exceed IPP object capacity. - - - - - - - - -deBry, et al. Experimental [Page 149] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - -13.1.4.10 client-error-request-value-too-long (0x0409) - - The IPP object is refusing to service the request because one or more - of the client-supplied attributes has a variable length value that is - longer than the maximum length specified for that attribute. The IPP - object might not have sufficient resources (memory, buffers, etc.) to - process (even temporarily), interpret, and/or ignore a value larger - than the maximum length. Another use of this error code is when the - IPP object supports the processing of a large value that is less than - the maximum length, but during the processing of the request as a - whole, the object may pass the value onto some other system component - which is not able to accept the large value. For more details, see - the Implementer's Guide [ipp-iig] . - - Note: For attribute values that are URIs, this rare condition is - only likely to occur when a client has improperly submitted a request - with long query information (e.g. an IPP application allows an end- - user to enter an invalid URI), when the client has descended into a - URI "black hole" of redirection (e.g., a redirected URI prefix that - points to a suffix of itself), or when the IPP object is under attack - by a client attempting to exploit security holes present in some IPP - objects using fixed-length buffers for reading or manipulating the - Request-URI. - -13.1.4.11 client-error-document-format-not-supported (0x040A) - - The IPP object is refusing to service the request because the - document data is in a format, as specified in the "document-format" - operation attribute, that is not supported by the Printer object. - This error is returned independent of the client-supplied "ipp- - attribute-fidelity". The Printer object MUST return this status - code, even if there are other attributes that are not supported as - well, since this error is a bigger problem than with Job Template - attributes. - -13.1.4.12 client-error-attributes-or-values-not-supported (0x040B) - - In a create request, if the Printer object does not support one or - more attributes, attribute syntaxes, or attribute values supplied in - the request and the client supplied the "ipp-attributes-fidelity" - operation attribute with the 'true' value, the Printer object MUST - return this status code. For example, if the request indicates ' - iso-a4' media, but that media type is not supported by the Printer - object. Or, if the client supplies an optional attribute and the - attribute itself is not even supported by the Printer. If the "ipp- - attribute-fidelity" attribute is 'false', the Printer MUST ignore or - substitute values for unsupported attributes and values rather than - reject the request and return this status code. - - - -deBry, et al. Experimental [Page 150] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - For any operation where a client requests attributes (such as a Get- - Jobs, Get-Printer-Attributes, or Get-Job-Attributes operation), if - the IPP object does not support one or more of the requested - attributes, the IPP object simply ignores the unsupported requested - attributes and processes the request as if they had not been - supplied, rather than returning this status code. In this case, the - IPP object MUST return the 'successful-ok-ignored-or-substituted- - attributes' status code and MAY return the unsupported attributes as - values of the "requested-attributes" in the Unsupported Attributes - Group (see section 13.1.2.2). - -13.1.4.13 client-error-uri-scheme-not-supported (0x040C) - - The type of the client supplied URI in a Print-URI or a Send-URI - operation is not supported. - -13.1.4.14 client-error-charset-not-supported (0x040D) - - For any operation, if the IPP Printer does not support the charset - supplied by the client in the "attributes-charset" operation - attribute, the Printer MUST reject the operation and return this - status and any 'text' or 'name' attributes using the 'utf-8' charset - (see Section 3.1.4.1). - -13.1.4.15 client-error-conflicting-attributes (0x040E) - - The request is rejected because some attribute values conflicted with - the values of other attributes which this specification does not - permit to be substituted or ignored. - -13.1.5 Server Error Status Codes - - This class of status codes indicates cases in which the IPP object is - aware that it has erred or is incapable of performing the request. - The IPP object SHOULD include a message containing an explanation of - the error situation, and whether it is a temporary or permanent - condition. - -13.1.5.1 server-error-internal-error (0x0500) - - The IPP object encountered an unexpected condition that prevented it - from fulfilling the request. This error status code differs from - "server-error-temporary-error" in that it implies a more permanent - type of internal error. It also differs from "server-error-device- - error" in that it implies an unexpected condition (unlike a paper-jam - or out-of-toner problem which is undesirable but expected). This - error status code indicates that probably some knowledgeable human - intervention is required. - - - -deBry, et al. Experimental [Page 151] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - -13.1.5.2 server-error-operation-not-supported (0x0501) - - The IPP object does not support the functionality required to fulfill - the request. This is the appropriate response when the IPP object - does not recognize an operation or is not capable of supporting it. - -13.1.5.3 server-error-service-unavailable (0x0502) - - The IPP object is currently unable to handle the request due to a - temporary overloading or maintenance of the IPP object. The - implication is that this is a temporary condition which will be - alleviated after some delay. If known, the length of the delay may be - indicated in the message. If no delay is given, the IPP application - should handle the response as it would for a "server-error- - temporary-error" response. If the condition is more permanent, the - error status codes "client-error-gone" or "client-error-not-found" - could be used. - -13.1.5.4 server-error-version-not-supported (0x0503) - - The IPP object does not support, or refuses to support, the IPP - protocol version that was used in the request message. The IPP - object is indicating that it is unable or unwilling to complete the - request using the same version as supplied in the request other than - with this error message. The response should contain a Message - describing why that version is not supported and what other versions - are supported by that IPP object. - - A conforming IPP/1.0 client MUST specify the valid version ('1.0') on - each request. A conforming IPP/1.0 object MUST NOT return this - status code to a conforming IPP/1.0 client. An IPP object MUST - return this status code to a non-conforming IPP client. The response - MUST identify in the "version-number" operation attribute the closest - version number that the IPP object does support. - -13.1.5.5 server-error-device-error (0x0504) - - A printer error, such as a paper jam, occurs while the IPP object - processes a Print or Send operation. The response contains the true - Job Status (the values of the "job-state" and "job-state-reasons" - attributes). Additional information can be returned in the optional - "job-state-message" attribute value or in the OPTIONAL status message - that describes the error in more detail. This error status code is - only returned in situations where the Printer is unable to accept the - create request because of such a device error. For example, if the - Printer is unable to spool, and can only accept one job at a time, - the reason it might reject a create request is that the printer - currently has a paper jam. In many cases however, where the Printer - - - -deBry, et al. Experimental [Page 152] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - object can accept the request even though the Printer has some error - condition, the 'successful-ok' status code will be returned. In such - a case, the client would look at the returned Job Object Attributes - or later query the Printer to determine its state and state reasons. - -13.1.5.6 server-error-temporary-error (0x0505) - - A temporary error such as a buffer full write error, a memory - overflow (i.e. the document data exceeds the memory of the Printer), - or a disk full condition, occurs while the IPP Printer processes an - operation. The client MAY try the unmodified request again at some - later point in time with an expectation that the temporary internal - error condition may have been cleared. Alternatively, as an - implementation option, a Printer object MAY delay the response until - the temporary condition is cleared so that no error is returned. - -13.1.5.7 server-error-not-accepting-jobs (0x0506) - - A temporary error indicating that the Printer is not currently - accepting jobs, because the administrator has set the value of the - Printer's "printer-is-not-accepting-jobs" attribute to 'false' (by - means outside of IPP/1.0). - -13.1.5.8 server-error-busy (0x0507) - - A temporary error indicating that the Printer is too busy processing - jobs and/or other requests. The client SHOULD try the unmodified - request again at some later point in time with an expectation that - the temporary busy condition will have been cleared. - -13.1.5.9 server-error-job-canceled (0x0508) - - An error indicating that the job has been canceled by an operator or - the system while the client was transmitting the data to the IPP - Printer. If a job-id and job-uri had been created, then they are - returned in the Print-Job, Send-Document, or Send-URI response as - usual; otherwise, no job-id and job-uri are returned in the response. - -13.2 Status Codes for IPP Operations - - PJ = Print-Job, PU = Print-URI, CJ = Create-Job, SD = Send-Document - SU = Send-URI, V = Validate-Job, GA = Get-Job-Attributes and - Get-Printer-Attributes, GJ = Get-Jobs, C = Cancel-Job - - - - - - - - -deBry, et al. Experimental [Page 153] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - IPP Operations - IPP Status Keyword PJ PU CJ SD SU V GA GJ C - ------------------ -- -- -- -- -- - -- -- - - successful-ok x x x x x x x x x - successful-ok-ignored-or-substituted- x x x x x x x x x - attributes - successful-ok-conflicting-attributes x x x x x x x x x - client-error-bad-request x x x x x x x x x - client-error-forbidden x x x x x x x x x - client-error-not-authenticated x x x x x x x x x - client-error-not-authorized x x x x x x x x x - client-error-not-possible x x x x x x x x x - client-error-timeout x x - client-error-not-found x x x x x x x x x - client-error-gone x x x x x x x x x - client-error-request-entity-too-large x x x x x x x x x - client-error-request-value-too-long x x x x x x x x x - client-error-document-format-not- x x x x x x - supported - client-error-attributes-or-values-not- x x x x x x x x x - supported - client-error-uri-scheme-not-supported x x - client-error-charset-not-supported x x x x x x x x x - client-error-conflicting-attributes x x x x x x x x x - server-error-internal-error x x x x x x x x x - server-error-operation-not-supported x x x x - server-error-service-unavailable x x x x x x x x x - server-error-version-not-supported x x x x x x x x x - server-error-device-error x x x x x - server-error-temporary-error x x x x x - server-error-not-accepting-jobs x x x x - server-error-busy x x x x x x x x x - server-error-job-canceled x x - - - - - - - - - - - - - - - - - - -deBry, et al. Experimental [Page 154] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - -14. APPENDIX C: "media" keyword values - - Standard keyword values are taken from several sources. - - Standard values are defined (taken from DPA[ISO10175] and the Printer - MIB[RFC1759]): - - 'default': The default medium for the output device - 'iso-a4-white': Specifies the ISO A4 white medium - 'iso-a4-colored': Specifies the ISO A4 colored medium - 'iso-a4-transparent' Specifies the ISO A4 transparent medium - 'iso-a3-white': Specifies the ISO A3 white medium - 'iso-a3-colored': Specifies the ISO A3 colored medium - 'iso-a5-white': Specifies the ISO A5 white medium - 'iso-a5-colored': Specifies the ISO A5 colored medium - 'iso-b4-white': Specifies the ISO B4 white medium - 'iso-b4-colored': Specifies the ISO B4 colored medium - 'iso-b5-white': Specifies the ISO B5 white medium - 'iso-b5-colored': Specifies the ISO B5 colored medium - 'jis-b4-white': Specifies the JIS B4 white medium - 'jis-b4-colored': Specifies the JIS B4 colored medium - 'jis-b5-white': Specifies the JIS B5 white medium - 'jis-b5-colored': Specifies the JIS B5 colored medium - - The following standard values are defined for North American media: - - 'na-letter-white': Specifies the North American letter white medium - 'na-letter-colored': Specifies the North American letter colored - medium - 'na-letter-transparent': Specifies the North American letter - transparent medium - 'na-legal-white': Specifies the North American legal white medium - 'na-legal-colored': Specifies the North American legal colored - medium - - The following standard values are defined for envelopes: - - 'iso-b4-envelope': Specifies the ISO B4 envelope medium - 'iso-b5-envelope': Specifies the ISO B5 envelope medium - 'iso-c3-envelope': Specifies the ISO C3 envelope medium - 'iso-c4-envelope': Specifies the ISO C4 envelope medium - 'iso-c5-envelope': Specifies the ISO C5 envelope medium - 'iso-c6-envelope': Specifies the ISO C6 envelope medium - 'iso-designated-long-envelope': Specifies the ISO Designated Long - envelope medium - 'na-10x13-envelope': Specifies the North American 10x13 envelope - medium - - - - -deBry, et al. Experimental [Page 155] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - 'na-9x12-envelope': Specifies the North American 9x12 envelope - medium - 'monarch-envelope': Specifies the Monarch envelope - 'na-number-10-envelope': Specifies the North American number 10 - business envelope medium - 'na-7x9-envelope': Specifies the North American 7x9 inch envelope - 'na-9x11-envelope': Specifies the North American 9x11 inch envelope - 'na-10x14-envelope': Specifies the North American 10x14 inch - envelope - 'na-number-9-envelope': Specifies the North American number 9 - business envelope - 'na-6x9-envelope': Specifies the North American 6x9 inch envelope - 'na-10x15-envelope': Specifies the North American 10x15 inch - envelope - - The following standard values are defined for the less commonly used - media (white-only): - - 'executive-white': Specifies the white executive medium - 'folio-white': Specifies the folio white medium - 'invoice-white': Specifies the white invoice medium - 'ledger-white': Specifies the white ledger medium - 'quarto-white': Specified the white quarto medium - 'iso-a0-white': Specifies the ISO A0 white medium - 'iso-a1-white': Specifies the ISO A1 white medium - 'iso-a2-white': Specifies the ISO A2 white medium - 'iso-a6-white': Specifies the ISO A6 white medium - 'iso-a7-white': Specifies the ISO A7 white medium - 'iso-a8-white': Specifies the ISO A8 white medium - 'iso-a9-white': Specifies the ISO A9 white medium - 'iso-10-white': Specifies the ISO A10 white medium - 'iso-b0-white': Specifies the ISO B0 white medium - 'iso-b1-white': Specifies the ISO B1 white medium - 'iso-b2-white': Specifies the ISO B2 white medium - 'iso-b3-white': Specifies the ISO B3 white medium - 'iso-b6-white': Specifies the ISO B6 white medium - 'iso-b7-white': Specifies the ISO B7 white medium - 'iso-b8-white': Specifies the ISO B8 white medium - 'iso-b9-white': Specifies the ISO B9 white medium - 'iso-b10-white': Specifies the ISO B10 white medium - 'jis-b0-white': Specifies the JIS B0 white medium - 'jis-b1-white': Specifies the JIS B1 white medium - 'jis-b2-white': Specifies the JIS B2 white medium - 'jis-b3-white': Specifies the JIS B3 white medium - 'jis-b6-white': Specifies the JIS B6 white medium - 'jis-b7-white': Specifies the JIS B7 white medium - - - - - -deBry, et al. Experimental [Page 156] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - 'jis-b8-white': Specifies the JIS B8 white medium - 'jis-b9-white': Specifies the JIS B9 white medium - 'jis-b10-white': Specifies the JIS B10 white medium - - - The following standard values are defined for engineering media: - - 'a': Specifies the engineering A size medium - 'b': Specifies the engineering B size medium - 'c': Specifies the engineering C size medium - 'd': Specifies the engineering D size medium - 'e': Specifies the engineering E size medium - - - The following standard values are defined for input-trays (from ISO - DPA and the Printer MIB): - - 'top': The top input tray in the printer. - 'middle': The middle input tray in the printer. - 'bottom': The bottom input tray in the printer. - 'envelope': The envelope input tray in the printer. - 'manual': The manual feed input tray in the printer. - 'large-capacity': The large capacity input tray in the printer. - 'main': The main input tray - 'side': The side input tray - - - The following standard values are defined for media sizes (from ISO - DPA): - - 'iso-a0': Specifies the ISO A0 size: 841 mm by 1189 mm as defined - in ISO 216 - 'iso-a1': Specifies the ISO A1 size: 594 mm by 841 mm as defined in - ISO 216 - 'iso-a2': Specifies the ISO A2 size: 420 mm by 594 mm as defined in - ISO 216 - 'iso-a3': Specifies the ISO A3 size: 297 mm by 420 mm as defined in - ISO 216 - 'iso-a4': Specifies the ISO A4 size: 210 mm by 297 mm as defined in - ISO 216 - 'iso-a5': Specifies the ISO A5 size: 148 mm by 210 mm as defined in - ISO 216 - 'iso-a6': Specifies the ISO A6 size: 105 mm by 148 mm as defined in - ISO 216 - 'iso-a7': Specifies the ISO A7 size: 74 mm by 105 mm as defined in - ISO 216 - 'iso-a8': Specifies the ISO A8 size: 52 mm by 74 mm as defined in - ISO 216 - - - -deBry, et al. Experimental [Page 157] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - 'iso-a9': Specifies the ISO A9 size: 37 mm by 52 mm as defined in - ISO 216 - 'iso-a10': Specifies the ISO A10 size: 26 mm by 37 mm as defined in - ISO 216 - 'iso-b0': Specifies the ISO B0 size: 1000 mm by 1414 mm as defined - in ISO 216 - 'iso-b1': Specifies the ISO B1 size: 707 mm by 1000 mm as defined - in ISO 216 - 'iso-b2': Specifies the ISO B2 size: 500 mm by 707 mm as defined in - ISO 216 - 'iso-b3': Specifies the ISO B3 size: 353 mm by 500 mm as defined in - ISO 216 - 'iso-b4': Specifies the ISO B4 size: 250 mm by 353 mm as defined in - ISO 216 - 'iso-b5': Specifies the ISO B5 size: 176 mm by 250 mm as defined in - ISO 216 - 'iso-b6': Specifies the ISO B6 size: 125 mm by 176 mm as defined in - ISO 216 - 'iso-b7': Specifies the ISO B7 size: 88 mm by 125 mm as defined in - ISO 216 - 'iso-b8': Specifies the ISO B8 size: 62 mm by 88 mm as defined in - ISO 216 - 'iso-b9': Specifies the ISO B9 size: 44 mm by 62 mm as defined in - ISO 216 - 'iso-b10': Specifies the ISO B10 size: 31 mm by 44 mm as defined in - ISO 216 - 'na-letter': Specifies the North American letter size: 8.5 inches by - 11 inches - 'na-legal': Specifies the North American legal size: 8.5 inches by - 14 inches - 'executive': Specifies the executive size (7.25 X 10.5 in) - 'folio': Specifies the folio size (8.5 X 13 in) - 'invoice': Specifies the invoice size (5.5 X 8.5 in) - 'ledger': Specifies the ledger size (11 X 17 in) - 'quarto': Specifies the quarto size (8.5 X 10.83 in) - 'iso-c3': Specifies the ISO C3 size: 324 mm by 458 mm as defined in - ISO 269 - 'iso-c4': Specifies the ISO C4 size: 229 mm by 324 mm as defined in - ISO 269 - 'iso-c5': Specifies the ISO C5 size: 162 mm by 229 mm as defined in - ISO 269 - 'iso-c6': Specifies the ISO C6 size: 114 mm by 162 mm as defined in - ISO 269 - 'iso-designated-long': Specifies the ISO Designated Long size: 110 - mm by 220 mm as defined in ISO 269 - 'na-10x13-envelope': Specifies the North American 10x13 size: 10 - inches by 13 inches - - - - -deBry, et al. Experimental [Page 158] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - 'na-9x12-envelope': Specifies the North American 9x12 size: 9 - inches by 12 inches - 'na-number-10-envelope': Specifies the North American number 10 - business envelope size: 4.125 inches by 9.5 inches - 'na-7x9-envelope': Specifies the North American 7x9 inch envelope - size - 'na-9x11-envelope': Specifies the North American 9x11 inch envelope - size - 'na-10x14-envelope': Specifies the North American 10x14 inch - envelope size - 'na-number-9-envelope': Specifies the North American number 9 - business envelope size - 'na-6x9-envelope': Specifies the North American 6x9 envelope size - 'na-10x15-envelope': Specifies the North American 10x15 envelope - size - 'monarch-envelope': Specifies the Monarch envelope size (3.87 x 7.5 - in) - 'jis-b0': Specifies the JIS B0 size: 1030mm x 1456mm - 'jis-b1': Specifies the JIS B1 size: 728mm x 1030mm - 'jis-b2': Specifies the JIS B2 size: 515mm x 728mm - 'jis-b3': Specifies the JIS B3 size: 364mm x 515mm - 'jis-b4': Specifies the JIS B4 size: 257mm x 364mm - 'jis-b5': Specifies the JIS B5 size: 182mm x 257mm - 'jis-b6': Specifies the JIS B6 size: 128mm x 182mm - 'jis-b7': Specifies the JIS B7 size: 91mm x 128mm - 'jis-b8': Specifies the JIS B8 size: 64mm x 91mm - 'jis-b9': Specifies the JIS B9 size: 45mm x 64mm - 'jis-b10': Specifies the JIS B10 size: 32mm x 45mm - - - - - - - - - - - - - - - - - - - - - - - -deBry, et al. Experimental [Page 159] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - -15. APPENDIX D: Processing IPP Attributes - - When submitting a print job to a Printer object, the IPP model allows - a client to supply operation and Job Template attributes along with - the document data. These Job Template attributes in the create - request affect the rendering, production and finishing of the - documents in the job. Similar types of instructions may also be - contained in the document to be printed, that is, embedded within the - print data itself. In addition, the Printer has a set of attributes - that describe what rendering and finishing options which are - supported by that Printer. This model, which allows for flexibility - and power, also introduces the potential that at job submission time, - these client-supplied attributes may conflict with either: - - - what the implementation is capable of realizing (i.e., what the - Printer supports), as well as - - the instructions embedded within the print data itself. - - The following sections describe how these two types of conflicts are - handled in the IPP model. - -15.1 Fidelity - - If there is a conflict between what the client requests and what a - Printer object supports, the client may request one of two possible - conflict handling mechanisms: - - 1) either reject the job since the job can not be processed exactly - as specified, or - 2) allow the Printer to make any changes necessary to proceed with - processing the Job the best it can. - - In the first case the client is indicating to the Printer object: - "Print the job exactly as specified with no exceptions, and if that - can't be done, don't even bother printing the job at all." In the - second case, the client is indicating to the Printer object: "It is - more important to make sure the job is printed rather than be - processed exactly as specified; just make sure the job is printed - even if client supplied attributes need to be changed or ignored." - - The IPP model accounts for this situation by introducing an "ipp- - attribute-fidelity" attribute. - - In a create request, "ipp-attribute-fidelity" is a boolean operation - attribute that is OPTIONALLY supplied by the client. The value ' - true' indicates that total fidelity to client supplied Job Template - attributes and values is required. The client is requesting that the - Job be printed exactly as specified, and if that is not possible then - - - -deBry, et al. Experimental [Page 160] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - the job MUST be rejected rather than processed incorrectly. The - value 'false' indicates that a reasonable attempt to print the Job is - acceptable. If a Printer does not support some of the client - supplied Job Template attributes or values, the Printer MUST ignore - them or substitute any supported value for unsupported values, - respectively. The Printer may choose to substitute the default value - associated with that attribute, or use some other supported value - that is similar to the unsupported requested value. For example, if - a client supplies a "media" value of 'na-letter', the Printer may - choose to substitute 'iso-a4' rather than a default value of ' - envelope'. If the client does not supply the "ipp-attribute-fidelity" - attribute, the Printer assumes a value of 'false'. - - Each Printer implementation MUST support both types of "fidelity" - printing (that is whether the client supplies a value of 'true' or ' - false'): - - - If the client supplies 'false' or does not supply the attribute, - the Printer object MUST always accept the request by ignoring - unsupported Job Template attributes and by substituting - unsupported values of supported Job Template attributes with - supported values. - - If the client supplies 'true', the Printer object MUST reject the - request if the client supplies unsupported Job Template - attributes. - - Since a client can always query a Printer to find out exactly what is - and is not supported, "ipp-attribute-fidelity" set to 'false' is - useful when: - - 1) The End-User uses a command line interface to request attributes - that might not be supported. - 2) In a GUI context, if the End User expects the job might be moved - to another printer and prefers a sub-optimal result to nothing - at all. - 3) The End User just wants something reasonable in lieu of nothing - at all. - -15.2 Page Description Language (PDL) Override - - If there is a conflict between the value of an IPP Job Template - attribute and a corresponding instruction in the document data, the - value of the IPP attribute SHOULD take precedence over the document - instruction. Consider the case where a previously formatted file of - document data is sent to an IPP Printer. In this case, if the client - supplies any attributes at job submission time, the client desires - that those attributes override the embedded instructions. Consider - the case were a previously formatted document has embedded in it - - - -deBry, et al. Experimental [Page 161] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - commands to load 'iso-a4' media. However, the document is passed to - an end user that only has access to a printer with 'na-letter' media - loaded. That end user most likely wants to submit that document to - an IPP Printer with the "media" Job Template attribute set to 'na- - letter'. The job submission attribute should take precedence over - the embedded PDL instruction. However, until companies that supply - document data interpreters allow a way for external IPP attributes to - take precedence over embedded job production instructions, a Printer - might not be able to support the semantics that IPP attributes - override the embedded instructions. - - The IPP model accounts for this situation by introducing a "pdl- - override-supported" attribute that describes the Printer objects - capabilities to override instructions embedded in the PDL data - stream. The value of the "pdl-override-supported" attribute is - configured by means outside IPP/1.0. - - This REQUIRED Printer attribute takes on the following values: - - - 'attempted': This value indicates that the Printer object - attempts to make the IPP attribute values take precedence over - embedded instructions in the document data, however there is no - guarantee. - - 'not-attempted': This value indicates that the Printer object - makes no attempt to make the IPP attribute values take precedence - over embedded instructions in the document data. - - At job processing time, an implementation that supports the value of - 'attempted' might do one of several different actions: - - 1) Generate an output device specific command sequence to realize - the feature represented by the IPP attribute value. - 2) Parse the document data itself and replace the conflicting - embedded instruction with a new embedded instruction that - matches the intent of the IPP attribute value. - 3) Indicate to the Printer that external supplied attributes take - precedence over embedded instructions and then pass the external - IPP attribute values to the document data interpreter. - 4) Anything else that allows for the semantics that IPP attributes - override embedded document data instructions. - - Since 'attempted' does not offer any type of guarantee, even though a - given Printer object might not do a very "good" job of attempting to - ensure that IPP attributes take a higher precedence over instructions - embedded in the document data, it would still be a conforming - implementation. - - - - - -deBry, et al. Experimental [Page 162] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - At job processing time, an implementation that supports the value of - 'not-attempted' might do one of the following actions: - - 1) Simply pre-pend the document data with the PDL instruction that - corresponds to the client-supplied PDL attribute, such that if - the document data also has the same PDL instruction, it will - override what the Printer object pre-pended. In other words, - this implementation is using the same implementation semantics - for the client-supplied IPP attributes as for the Printer object - defaults. - 2) Parse the document data and replace the conflicting embedded - instruction with a new embedded instruction that approximates, - but does not match, the semantic intent of the IPP attribute - value. - - Note: The "ipp-attribute-fidelity" attribute applies to the - Printer's ability to either accept or reject other unsupported Job - Template attributes. In other words, if "ipp-attribute-fidelity" is - set to 'true', a Job is accepted if and only if the client supplied - Job Template attributes and values are supported by the Printer. - Whether these attributes actually affect the processing of the Job - when the document data contains embedded instructions depends on the - ability of the Printer to override the instructions embedded in the - document data with the semantics of the IPP attributes. If the - document data attributes can be overridden ("pdl-override-supported" - set to 'attempted'), the Printer makes an attempt to use the IPP - attributes when processing the Job. If the document data attributes - can not be overridden ("pdl-override-supported" set to 'not- - attempted'), the Printer makes no attempt to override the embedded - document data instructions with the IPP attributes when processing - the Job, and hence, the IPP attributes may fail to affect the Job - processing and output when the corresponding instruction is embedded - in the document data. - -15.3 Using Job Template Attributes During Document Processing. - - The Printer object uses some of the Job object's Job Template - attributes during the processing of the document data associated with - that job. These include, but are not limited to, "orientation", - "number-up", "sides", "media", and "copies". The processing of each - document in a Job Object MUST follow the steps below. These steps are - intended only to identify when and how attributes are to be used in - processing document data and any alternative steps that accomplishes - the same effect can be used to implement this specification. - - 1. Using the client supplied "document-format" attribute or some - form of document format detection algorithm (if the value of - "document- format" is not specific enough), determine whether or - - - -deBry, et al. Experimental [Page 163] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - not the document data has already been formatted for printing. - If the document data has been formatted, then go to step 2. - Otherwise, the document data MUST be formatted. The formatting - detection algorithm is implementation defined and is not - specified by this specification. The formatting of the document - data uses the "orientation-requested" attribute to determine how - the formatted print data should be placed on a print-stream - page, see section 4.2.10 for the details. - - 2. The document data is in the form of a print-stream in a known - media type. The "page-ranges" attribute is used to select, as - specified in section 4.2.7, a sub-sequence of the pages in the - print-stream that are to be processed and images. - - 3. The input to this step is a sequence of print-stream pages. This - step is controlled by the "number-up" attribute. If the value of - "number-up" is N, then during the processing of the print-stream - pages, each N print-stream pages are positioned, as specified in - section 4.2.9, to create a single impression. If a given - document does not have N more print-stream pages, then the - completion of the impression is controlled by the "multiple- - document-handling" attribute as described in section 4.2.4; when - the value of this attribute is 'single-document' or 'single- - document-new-sheet', the print-stream pages of document data - from subsequent documents is used to complete the impression. - - The size(scaling), position(translation) and rotation of the - print-stream pages on the impression is implementation defined. - Note that during this process the print-stream pages may be - rendered to a form suitable for placing on the impression; this - rendering is controlled by the values of the "printer- - resolution" and "print- quality" attributes as described in - sections 4.2.12 and 4.2.13. In the case N=1, the impression is - nearly the same as the print-stream page; the differences would - only be in the size, position and rotation of the print-stream - page and/or any decoration, such as a frame to the page, that is - added by the implementation. - - 4. The collection of impressions is placed, in sequence, onto sides - of the media sheets. This placement is controlled by the "sides" - attribute and the orientation of the print-stream page, as - described in section 4.2.8. The orientation of the print-stream - pages affects the orientation of the impression; for example, if - "number-up" equals 2, then, typically, two portrait print-stream - pages become one landscape impression. Note that the placement - of impressions onto media sheets is also controlled by the - "multiple-document-handling" attribute as described in section - 4.2.4. - - - -deBry, et al. Experimental [Page 164] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - 5. The "copies" and "multiple-document-handling" attributes are - used to determine how many copies of each media instance are - created and in what order. See sections 4.2.5 and 4.2.4 for the - details. - - 6. When the correct number of copies are created, the media - instances are finished according to the values of the - "finishings" attribute as described in 4.2.6. Note that - sometimes finishing operations may require manual intervention - to perform the finishing operations on the copies, especially - uncollated copies. This specification allows any or all of the - processing steps to be performed automatically or manually at - the discretion of the Printer object. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -deBry, et al. Experimental [Page 165] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - -16. APPENDIX E: Generic Directory Schema - - This section defines a generic schema for an entry in a directory - service. A directory service is a means by which service users can - locate service providers. In IPP environments, this means that IPP - Printers can be registered (either automatically or with the help of - an administrator) as entries of type printer in the directory using - an implementation specific mechanism such as entry attributes, entry - type fields, specific branches, etc. IPP clients can search or - browse for entries of type printer. Clients use the directory - service to find entries based on naming, organizational contexts, or - filtered searches on attribute values of entries. For example, a - client can find all printers in the "Local Department" context. - Authentication and authorization are also often part of a directory - service so that an administrator can place limits on end users so - that they are only allowed to find entries to which they have certain - access rights. IPP itself does not require any specific directory - service protocol or provider. - - Note: Some directory implementations allow for the notion of - "aliasing". That is, one directory entry object can appear as - multiple directory entry object with different names for each object. - In each case, each alias refers to the same directory entry object - which refers to a single IPP Printer object. - - The generic schema is a subset of IPP Printer Job Template and - Printer Description attributes (sections 4.2 and 4.4). These - attributes are identified as either RECOMMENDED or OPTIONAL for the - directory entry itself. This conformance labeling is NOT the same - conformance labeling applied to the attributes of IPP Printers - objects. The conformance labeling in this Appendix is intended to - apply to directory templates and to IPP Printer implementations that - subscribe by adding one or more entries to a directory. RECOMMENDED - attributes SHOULD be associated with each directory entry. OPTIONAL - attributes MAY be associated with the directory entry (if known or - supported). In addition, all directory entry attributes SHOULD - reflect the current attribute values for the corresponding Printer - object. - - The names of attributes in directory schema and entries SHOULD be the - same as the IPP Printer attribute names as shown. - - In order to bridge between the directory service and the IPP Printer - object, one of the RECOMMENDED directory entry attributes is the - Printer object's "printer-uri-supported" attribute. The IPP client - queries the "printer-uri-supported" attribute in the directory entry - - - - - -deBry, et al. Experimental [Page 166] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - and then addresses the IPP Printer object using one of its URIs. The - "uri-security-supported" attribute identifies the protocol (if any) - used to secure a channel. - - The following attributes define the generic schema for directory - entries of type PRINTER: - - printer-uri-supported RECOMMENDED Section 4.4.1 - uri-security-supported RECOMMENDED Section 4.4.2 - printer-name RECOMMENDED Section 4.4.3 - printer-location RECOMMENDED Section 4.4.4 - printer-info OPTIONAL Section 4.4.5 - printer-more-info OPTIONAL Section 4.4.6 - printer-make-and-model RECOMMENDED Section 4.4.8 - charset-supported OPTIONAL Section 4.4.15 - generated-natural-language- - supported OPTIONAL Section 4.4.17 - document-format-supported RECOMMENDED Section 4.4.19 - color-supported RECOMMENDED Section 4.4.23 - finishings-supported OPTIONAL Section 4.2.6 - number-up-supported OPTIONAL Section 4.2.7 - sides-supported RECOMMENDED Section 4.2.8 - media-supported RECOMMENDED Section 4.2.11 - printer-resolution-supported OPTIONAL Section 4.2.12 - print-quality-supported OPTIONAL Section 4.2.13 - - - - - - - - - - - - - - - - - - - - - - - - - - -deBry, et al. Experimental [Page 167] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - -17. APPENDIX F: Change History for the IPP Model and Semantics document - - The following substantive changes and major clarifications have been - made to this document from the June 30, 1998 version based on the - interoperability testing that took place September 23-25 1998 and - subsequent mailing list and meeting discussions. They are listed in - the order of occurrence in the document. These changes are the ones - that might affect implementations. Clarifications that are unlikely - to affect implementations are not listed. The issue numbers refer to - the IPP Issues List which is available in the following directory: - - ftp://ftp.pwg.org/pub/pwg/ipp/approved-clarifications/ - - Section Description - - global Replaced TLS references with SSL3 references as agreed with - our Area Director on 11/12/1998. - - global Removed the indications that some of these IPP documents - are informational, since the intent is now to publish all - IPP/1.0 documents as informational as agreed with our Area - Director on 11/12/1998. - - 3.1.2, Clarify that the IPP object SHOULD NOT validate the - 16.3.3 range of the request-id being 1 to 2**31-1, but accepts - [now ipp- and returns any value. Clients MUST still keep in the - iig] range 1 to 2**31 though. If the request is terminated - before the complete "request-id" is received, the IPP - object rejects the request and returns a response with a - "request-id" of 0 (Issue 1.36). - - 3.1.4.1, Clarified that when a client submits a request in a - 13.1.4.14 charset that is not supported, the IPP object SHOULD - return any 'text' or 'name' attributes in the 'utf-8' - charset, if it returns any, since clients and IPP - objects MUST support 'utf-8'. (Issue 1.19) - - 3.1.4.1 Clarified Section 3.1.4.1 Request Operation Attributes - that a client MAY use the attribute level natural - language override (text/nameWithLanguage) redundantly in - a request. (Issue 1.46) - - 3.1.4.2 Clarified Section 3.1.4.2 Response Operation Attributes - that an IPP object MAY use the attribute level natural - language override (text/nameWithLanguage) redundantly in - a response. (Issue 1.46) - - - - - -deBry, et al. Experimental [Page 168] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - 3.1.6 Clarified section 3.1.6: If the Printer object supports - the "status-message" operation attribute, it NEED NOT - return a status message for the following error status - codes: 'client-error-bad-request', 'client-error- - charset-not-supported', 'server-error-internal-error', - 'server-error-operation-not-supported', and 'server- - error-version-not-supported'. - - 3.2.1.1 Clarified that if a client is not supplying any Job - Template attributes in a request, the client SHOULD omit - Group 2 rather than sending an empty group. However, a - Printer object MUST be able to accept an empty group. - This makes [RFC2566] agree with [RFC2565]. (Issue 1.16) - - 3.2.1.2, Clarified that if an IPP object is not returning any - 3.2.5.2, Unsupported Attributes in a response, the IPP object - 3.2.6.2, SHOULD omit Group 2 rather than sending an empty group. - 3.3.1.2, However, a client MUST be able to accept an empty group. - 3.3.3.2, This makes [RFC2566] agree with [RFC2565]. (Issue 1.17) - 3.3.4.2 - - 3.2.1.2, Clarified that an IPP object MUST treat an unsupported - 13.1.2.2, attribute syntax supplied in a request in the same way - 13.1.4.12 as an unsupported value. The IPP object MUST return the - attribute, the attribute syntax, and the value in the - Unsupported Attributes group. (Issue 1.26) - - 3.2.5.2, Clarified for Get-Printer-Attributes, Get-Jobs, and Get- - 3.2.6.2, Job-Attributes that an IPP object MUST return - 3.3.4.2, 'successful-ok-ignored-or-substituted-attributes' (0x1), - - 13.1.2.1, rather than 'successful-ok' (0x0), when a client - 13.1.2.2, supplies unsupported attributes as values of the - 13.1.4.12 'requested-attributes' operation attribute. (Issue - 1.24) - Also clarified that the response NEED NOT contain the - "requested-attributes" operation attribute with any - supplied values (attribute keywords) that were requested - by the client but are not supported by the IPP object. - (Issue 1.18) - - 3.2.6.2 Deleted the job-level natural language override (NLO) - 4.1.1.2 from Section 3.2.6.2 Get-Jobs Response so that all - 4.3.24 operation responses are the same with respect to NLO. - (Issue 1.47) - - - - - - -deBry, et al. Experimental [Page 169] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - 3.3.1 Clarified that an IPP Printer that supports the Create- - Job operation MUST handle the situation when a client - does not supply Send-Document or Send-URI operations - within a one- to four-minute time period. Also - clarified that a client MUST send documents in a multi- - document job without undue or unbounded delay. (Issue - 1.28) - - 3.3.3 Clarified that the IPP object MUST reject a Cancel-Job - request if the job is in 'completed', 'canceled', or - 'aborted' job states. (Issue 1.12) - - 4.1.2.3 Added this new sub-section: it specifies that - nameWithoutLanguage plus the implicit natural language - matches nameWithLanguage, if the values and natural - languages are the same. Also added that keyword never - matches nameWithLanguage or nameWithoutLanguage. - Clarified that if both have countries, that the - countries SHOULD match as well. If either do not, then - the country field SHOULD be ignored. (Issues 1.33 and - 1.34) - - 4.1.5 Clarified regarding the case-insensitivity of URLs to - refer only to the RFCs that define them. (Issue 1.10) - - 4.1.11 Clarified that 'boolean' is not a full-sized integer. - (Issue 1.38) - - 4.1.15 Clarified that 'resolution' is not three full-sized - integers. (Issue 1.20) - - 4.2.* Clarified that standard values are keywords or enums, - not names. (Issue 1.49). - - 4.2.4 Added the 'single-document-new-sheet' value to Section - 4.2.4 multiple-document-handling. (Issue 1.54) - - 4.4.18, Clarified that the "document-format-default" and - 4.4.19 "document-format-supported" Printer Description - attributes are REQUIRED to agree with the table. (Issue - 1.4) - - 4.4.21 Changed "queued-job-count" from OPTIONAL to RECOMMENDED. - (Issue 1.14) - - - - - - - -deBry, et al. Experimental [Page 170] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - 4.4.28 Clarified that the implementation supplied value for the - "multiple-operation-time-out" attribute SHOULD be - between 30 and 240 seconds, though the implementation - MAY allow the administrator to set values, and MAY allow - values outside this range. (Issue 1.28) - - 5.1, Clarified Client Conformance that if a client supports - 5.2.5 an attribute of 'text' attribute syntax, that it MUST - support both the textWithoutLanguage and the - textWithLanguage forms. Same for 'name' attribute - syntax. Same for an IPP object (Issue 1.48) - - 6.5, Added new section to allow Attribute Groups to be - 12.8 registered as extensions for being passed in operation - requests and responses. (Issue 1.25) - - 7. Updated the table of text and name attributes to agree - with Section 4.2. - - 8.5 Added a new section RECOMMENDING that the Get-Jobs - SHOULD return non-IPP jobs whether or not assigning them - a job-id and job-uri. Also RECOMMENDED generating, if - possible, job-id and job-uri and supporting other IPP - operations on foreign jobs as an implementer option. - (Issue 1.32) - - 9. Updated document references. - - 13.1.4.14 Clarified 'client-error-charset-not-supported' that - 'utf-8' must be used for any 'text' or 'name' attributes - returned in the error response (Issue 1.19). - - 13.1.5.9 Added a new error code 'server-error-job-canceled' - (0x0508) to be returned if a job is canceled by another - client or aborted by the IPP object while the first - client is still sending the document data. (Issue 1.29) - - 15.3, Moved these sections recommending operation processing - 15.4 steps to the new Implementer's Guide (informational). - There indicated that all of the error checks are not - required, so an IPP object MAY be forgiving and accept - non-conforming requests. However, a conforming client - MUST supply requests that would pass all of the error - checks indicated. (Issue 1.21) - - - - - - - -deBry, et al. Experimental [Page 171] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - - 16 Changed directory schema attributes from REQUIRED to - RECOMMENDED. Changed some of the OPTIONAL to - RECOMMENDED to agree with the SLP template. Changed the - "charset-supported" and "natural-language-supported" - from REQUIRED to OPTIONAL. Recommended that the names - be the same in a directory entry as the IPP attribute - names. (Issue 1.53) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -deBry, et al. Experimental [Page 172] - -RFC 2566 IPP/1.0: Model and Semantics April 1999 - - -18. Full Copyright Statement - - Copyright (C) The Internet Society (1999). All Rights Reserved. - - This document and translations of it may be copied and furnished to - others, and derivative works that comment on or otherwise explain it - or assist in its implementation may be prepared, copied, published - and distributed, in whole or in part, without restriction of any - kind, provided that the above copyright notice and this paragraph are - included on all such copies and derivative works. However, this - document itself may not be modified in any way, such as by removing - the copyright notice or references to the Internet Society or other - Internet organizations, except as needed for the purpose of - developing Internet standards in which case the procedures for - copyrights defined in the Internet Standards process must be - followed, or as required to translate it into languages other than - English. - - The limited permissions granted above are perpetual and will not be - revoked by the Internet Society or its successors or assigns. - - This document and the information contained herein is provided on an - "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING - TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING - BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION - HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF - MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - - - - - - - - - - - - - - - - - - - - - - - - -deBry, et al. Experimental [Page 173] - diff --git a/standards/rfc2639.txt b/standards/rfc2639.txt deleted file mode 100644 index e3ab71684..000000000 --- a/standards/rfc2639.txt +++ /dev/null @@ -1,3587 +0,0 @@ - - - - - - -Network Working Group T. Hastings -Request for Comments: 2639 C. Manros -Category: Informational Xerox Corporation - July 1999 - - - Internet Printing Protocol/1.0: Implementer's Guide - -Status of this Memo - - This memo provides information for the Internet community. It does - not specify an Internet standard of any kind. Distribution of this - memo is unlimited. - -Copyright Notice - - Copyright (C) The Internet Society (1999). All Rights Reserved. - -Abstract - - This document is one of a set of documents, which together describe - all aspects of a new Internet Printing Protocol (IPP). IPP is an - application level protocol that can be used for distributed printing - using Internet tools and technologies. This document contains - information that supplements the IPP Model and Semantics [RFC2566] - and the IPP Transport and Encoding [RFC2565] documents. It is - intended to help implementers understand IPP/1.0 and some of the - considerations that may assist them in the design of their client - and/or IPP object implementations. For example, a typical order of - processing requests is given, including error checking. Motivation - for some of the specification decisions is also included. - - The full set of IPP documents includes: - - Design Goals for an Internet Printing Protocol [RFC2567] - Rationale for the Structure and Model and Protocol for the Internet - Printing Protocol [RFC2568] - Internet Printing Protocol/1.0: Model and Semantics [RFC2566] - Internet Printing Protocol/1.0: Encoding and Transport [RFC2565] - Mapping between LPD and IPP Protocols [RFC2569] - - The document, "Design Goals for an Internet Printing Protocol", takes - a broad look at distributed printing functionality, and it enumerates - real-life scenarios that help to clarify the features that need to be - included in a printing protocol for the Internet. It identifies - requirements for three types of users: end users, operators, and - - - - - -Hastings & Manros Informational [Page 1] - -RFC 2639 IPP/1.0: Implementer's Guide July 1999 - - - administrators. The design goals document calls out a subset of end - user requirements that are satisfied in IPP/1.0. Operator and - administrator requirements are out of scope for version 1.0. - - The document, "Rationale for the Structure and Model and Protocol for - the Internet Printing Protocol", describes IPP from a high level - view, defines a roadmap for the various documents that form the suite - of IPP specifications, and gives background and rationale for the - IETF working group's major decisions. - - The document, "Internet Printing Protocol/1.0: Model and Semantics", - describes a simplified model with abstract objects, their attributes, - and their operations. The model introduces a Printer and a Job. The - Job supports multiple documents per Job. The model document also - addresses how security, internationalization, and directory issues - are addressed. - - The document, "Internet Printing Protocol/1.0: Encoding and - Transport", is a formal mapping of the abstract operations and - attributes defined in the model document onto HTTP/1.1. It also - defines the encoding rules for a new Internet media type called - "application/ipp". - - The document, "Mapping between LPD and IPP Protocols", gives some - advice to implementers of gateways between IPP and LPD (Line Printer - Daemon) implementations. - -Table of Contents - - 1 Introduction......................................................4 - 1.1 Conformance language............................................4 - 1.2 Other terminology...............................................5 - 2 Model and Semantics...............................................5 - 2.1 Summary of Operation Attributes.................................5 - 2.2 Suggested Operation Processing Steps for IPP Objects ..........10 - 2.2.1 Suggested Operation Processing Steps for all Operations..11 - 2.2.1.1 Validate version number...............................11 - 2.2.1.2 Validate operation identifier.........................11 - 2.2.1.3 Validate the request identifier.......................11 - 2.2.1.4 Validate attribute group and attribute presence and - order.................................................12 - 2.2.1.5 Validate the values of the REQUIRED Operation - attributes............................................19 - 2.2.1.6 Validate the values of the OPTIONAL Operation - attributes............................................23 - 2.2.2 Suggested Additional Processing Steps for Operations that - Create/Validate Jobs and Add Documents.....................26 - 2.2.2.1 Default "ipp-attribute-fidelity" if not supplied......26 - - - -Hastings & Manros Informational [Page 2] - -RFC 2639 IPP/1.0: Implementer's Guide July 1999 - - - 2.2.2.2 Check that the Printer object is accepting jobs.......26 - 2.2.2.3 Validate the values of the Job Template attributes....26 - 2.2.3 Algorithm for job validation...............................27 - 2.2.3.1 Check for conflicting Job Template attributes values..33 - 2.2.3.2 Decide whether to REJECT the request..................33 - 2.2.3.3 For the Validate-Job operation, RETURN one of the - success status codes..................................34 - 2.2.3.4 Create the Job object with attributes to support......34 - 2.2.3.5 Return one of the success status codes................36 - 2.2.3.6 Accept appended Document Content......................36 - 2.2.3.7 Scheduling and Starting to Process the Job............36 - 2.2.3.8 Completing the Job....................................37 - 2.2.3.9 Destroying the Job after completion...................37 - 2.2.3.10 Interaction with "ipp-attribute-fidelity".............37 - 2.3 Status codes returned by operation ............................37 - 2.3.1 Printer Operations.........................................38 - 2.3.1.1 Print-Job.............................................38 - 2.3.1.2 Print-URI.............................................40 - 2.3.1.3 Validate-Job..........................................40 - 2.3.1.4 Create-Job............................................41 - 2.3.1.5 Get-Printer-Attributes................................41 - 2.3.1.6 Get-Jobs..............................................42 - 2.3.2 Job Operations.............................................43 - 2.3.2.1 Send-Document.........................................43 - 2.3.2.2 Send-URI..............................................44 - 2.3.2.3 Cancel-Job............................................44 - 2.3.2.4 Get-Job-Attributes....................................45 - 2.4 Validate-Job...................................................46 - 2.5 Case Sensitivity in URIs ......................................46 - 2.6 Character Sets, natural languages, and internationalization....46 - 2.6.1 Character set code conversion support .....................46 - 2.6.2 What charset to return when an unsupported charset is - requested?.................................................48 - 2.6.3 Natural Language Override (NLO) ...........................48 - 2.7 The "queued-job-count" Printer Description attribute...........50 - 2.7.1 Why is "queued-job-count" RECOMMENDED?.....................50 - 2.7.2 Is "queued-job-count" a good measure of how busy a printer - is?........................................................50 - 2.8 Sending empty attribute groups ................................50 - 2.9 Returning unsupported attributes in Get-Xxxx responses ........51 - 2.10 Returning job-state in Print-Job response ....................51 - 2.11 Flow controlling the data portion of a Print-Job request .....52 - 2.12 Multi-valued attributes ......................................53 - 2.13 Querying jobs with IPP that were submitted using other job - submission protocols .........................................53 - 2.14 The 'none' value for empty sets ..............................54 - 2.15 Get-Jobs, my-jobs='true', and 'requesting-user-name'?.........54 - - - - -Hastings & Manros Informational [Page 3] - -RFC 2639 IPP/1.0: Implementer's Guide July 1999 - - - 2.16 The "multiple-document-handling" Job Template attribute and - support of multiple document jobs.............................54 - 3 Encoding and Transport...........................................55 - 3.1 General Headers................................................56 - 3.2 Request Headers...............................................57 - 3.3 Response Headers...............................................58 - 3.4 Entity Headers................................................59 - 3.5 Optional support for HTTP/1.0..................................60 - 3.6 HTTP/1.1 Chunking..............................................60 - 3.6.1 Disabling IPP Server Response Chunking.....................60 - 3.6.2 Warning About the Support of Chunked Requests..............60 - 4 References.......................................................61 - 4.1 Authors' Addresses.............................................62 - 5 Security Considerations..........................................62 - 6 Notices..........................................................62 - Full Copyright Statement............................................65 - -1 Introduction - - This document contains information that supplements the IPP Model and - Semantics [RFC2566] and the IPP Transport and Encoding [RFC2565] - documents. As such this information is not part of the formal - specifications. Instead information is presented to help implementers - understand the specification, including some of the motivation for - decisions taken by the committee in developing the specification. - Some of the implementation considerations are intended to help - implementers design their client and/or IPP object implementations. - If there are any contradictions between this document and [RFC2566] or - [RFC2565], those documents take precedence over this document. - -1.1 Conformance language - - Usually, this document does not contain the terminology MUST, MUST - NOT, MAY, NEED NOT, SHOULD, SHOULD NOT, REQUIRED, and OPTIONAL. - However, when those terms do appear in this document, their intent is - to repeat what the [RFC2566] and [RFC2565] documents require and - allow, rather than specifying additional conformance requirements. - These terms are defined in section 13 on conformance terminology in - [RFC2566], most of which is taken from RFC 2119 [RFC2119]. - - Implementers should read section 13 in [RFC2566] in order to - understand these capitalized words. The words MUST, MUST NOT, and - REQUIRED indicate what implementations are required to support in a - client or IPP object in order to be conformant to [RFC2566] and - [RFC2565]. MAY, NEED NOT, and OPTIONAL indicate was is merely allowed - as an implementer option. The verbs SHOULD and SHOULD NOT indicate - suggested behavior, but which is not required or disallowed, - respectively, in order to conform to the specification. - - - -Hastings & Manros Informational [Page 4] - -RFC 2639 IPP/1.0: Implementer's Guide July 1999 - - -1.2 Other terminology - - The term "sender" refers to the client that sends a request or an IPP - object that returns a response. The term "receiver" refers to the IPP - object that receives a request and to a client that receives a - response. - -2 Model and Semantics - - This section discusses various aspects of IPP/1.0 Model and Semantics - [RFC2566]. - -2.1 Summary of Operation Attributes - - Legend for the following table: - - R indicates a REQUIRED operation or attribute for an - implementation to support - - O indicates an OPTIONAL operation or attribute for an - implementation to support - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Hastings & Manros Informational [Page 5] - -RFC 2639 IPP/1.0: Implementer's Guide July 1999 - - - Table 1. Summary of operation attributes for Printer operations - - Printer Operations - - Requests Responses - - Operation Print- Pri Crea Get- Get- All - Attributes Job, nt- te- Printer- Jobs Opera- - Validate URI Job Attribut tions - -Job (O) (O) es - - Operation parameters--REQUIRED to be supplied by the sender - - operation-id R R R R R - - status-code R - - request-id R R R R R R - - version-number R R R R R R - - Operation attributes-REQUIRED to be supplied by the sender - - attributes-charset R R R R R R - - attributes- R R R R R R - natural-language - - document-uri R - - job-id* - - job-uri* - - last-document - - printer-uri R R R R R - - Operation attributes-RECOMMENDED to be supplied by the sender - - job-name R R R - - requesting-user- R R R R R - name - - - - - - - -Hastings & Manros Informational [Page 6] - -RFC 2639 IPP/1.0: Implementer's Guide July 1999 - - - Printer Operations - - Requests Responses - - Operation Print- Pri Crea Get- Get- All - Attributes Job, nt- te- Printer Jobs Opera- - Vali- URI Job Attri- tions - date-Job (O) (O) butes - - Operation attributes-OPTIONAL to be supplied by the sender - - status-message O - - compression O O - - document-format R R O - - document-name O O - - document-natural- O O - language - - ipp-attribute- R R R - fidelity - - job-impressions O O O - - job-k-octets O O O - - job-media-sheets O O O - - limit R - - message - - my-jobs R - - requested- R R - attributes - - which-jobs R - - * "job-id" is REQUIRED only if used together with - "printer-uri" to identify the target job; otherwise, "job- - uri" is REQUIRED. - - - - - - -Hastings & Manros Informational [Page 7] - -RFC 2639 IPP/1.0: Implementer's Guide July 1999 - - - Table 2. Summary of operation attributes for Job operations - - - Requests Responses - - Operation Send- Send- Cancel Get- All - Attributes Document URI -Job Job- Opera- - (O) (O) Attri- tions - butes - - Operation parameters--REQUIRED to be supplied by the sender - - operation-id R R R R - - status-code R - - request-id R R R R R - - version-number R R R R R - - Operation attributes-REQUIRED to be supplied by the sender - - attributes- R R R R R - charset - - attributes- R R R R R - natural-language - - document-uri R - - job-id* R R R R - - job-uri* R R R R - - last-document R R - - printer-uri R R R R - - Operation attributes-RECOMMENDED to be supplied by the - sender - - job-name - - requesting-user- R R R R - name - - - - - - -Hastings & Manros Informational [Page 8] - -RFC 2639 IPP/1.0: Implementer's Guide July 1999 - - - Job Operations - - Requests Responses - - Operation Attributes Send- Send- Cance Get- All - Document URI l-Job Job- Opera- - (O) (O) Attri- tions - butes - - Operation attributes.OPTIONAL to be supplied by the sender - - status-message O - - compression O O - - document-format R R - - document-name O O - - document-natural- O O - language - - ipp-attribute- - fidelity - - job-impressions - - job-k-octets - - job-media-sheets - - limit - - message O - - my-jobs - - requested-attributes R - - which-jobs - - * "job-id" is REQUIRED only if used together with "printer- - uri" to identify the target job; otherwise, "job-uri" is - REQUIRED. - - - - - - - -Hastings & Manros Informational [Page 9] - -RFC 2639 IPP/1.0: Implementer's Guide July 1999 - - -2.2 Suggested Operation Processing Steps for IPP Objects - - This section suggests the steps and error checks that an IPP object - MAY perform when processing requests and returning responses. An IPP - object MAY perform some or all of the error checks. However, some - implementations MAY choose to be more forgiving than the error checks - shown here, in order to be able to accept requests from non- - conforming clients. Not performing all of these error checks is a - so-called "forgiving" implementation. On the other hand, clients - that successfully submit requests to IPP objects that do perform all - the error checks will be more likely to be able to interoperate with - other IPP object implementations. Thus an implementer of an IPP - object needs to decide whether to be a "forgiving" or a "strict" - implementation. Therefore, the error status codes returned may - differ between implementations. Consequentially, client SHOULD NOT - expect exactly the error code processing described in this section. - - When an IPP object receives a request, the IPP object either accepts - or rejects the request. In order to determine whether or not to - accept or reject the request, the IPP object SHOULD execute the - following steps. The order of the steps may be rearranged and/or - combined, including making one or multiple passes over the request. - - A client MUST supply requests that would pass all of the error checks - indicated here in order to be a conforming client. Therefore, a - client SHOULD supply requests that are conforming, in order to avoid - being rejected by some IPP object implementations and/or risking - different semantics by different implementations of forgiving - implementations. For example, a forgiving implementation that - accepts multiple occurrences of the same attribute, rather than - rejecting the request might use the first occurrences, while another - might use the last occurrence. Thus such a non-conforming client - would get different results from the two forgiving implementations. - - In the following, processing continues step by step until a "RETURNS - the xxx status code ." statement is encountered. Error returns are - indicated by the verb: "REJECTS". Since clients have difficulty - getting the status code before sending all of the document data in a - Print-Job request, clients SHOULD use the Validate-Job operation - before sending large documents to be printed, in order to validate - whether the IPP Printer will accept the job or not. - - It is assumed that security authentication and authorization has - already taken place at a lower layer. - - - - - - - -Hastings & Manros Informational [Page 10] - -RFC 2639 IPP/1.0: Implementer's Guide July 1999 - - -2.2.1 Suggested Operation Processing Steps for all Operations - - This section is intended to apply to all operations. The next - section contains the additional steps for the Print-Job, Validate- - Job, Print-URI, Create-Job, Send-Document, and Send-URI operations - that create jobs, adds documents, and validates jobs. - -2.2.1.1 Validate version number - - Every request and every response contains the "version-number" - attribute. The value of this attribute is the major and minor - version number of the syntax and semantics that the client and IPP - object is using, respectively. The "version-number" attribute - remains in a fixed position across all future versions so that all - clients and IPP object that support future versions can determine - which version is being used. The IPP object checks to see if the - major version number supplied in the request is supported. If not, - the Printer object REJECTS the request and RETURNS the 'server- - error-version-not-supported' status code in the response. The IPP - object returns in the "version-number" response attribute the major - and minor version for the error response. Thus the client can learn - at least one major and minor version that the IPP object supports. - The IPP object is encouraged to return the closest version number to - the one supplied by the client. - - The checking of the minor version number is implementation dependent, - however if the client supplied minor version is explicitly supported, - the IPP object MUST respond using that identical minor version - number. If the requested minor version is not supported (the - requested minor version is either higher or lower) than a supported - minor version, the IPP object SHOULD return the closest supported - minor version. - -2.2.1.2 Validate operation identifier - - The Printer object checks to see if the "operation-id" attribute - supplied by the client is supported as indicated in the Printer - object's "operations-supported" attribute. If not, the Printer - REJECTS the request and returns the 'server-error-operation-not- - supported' status code in the response. - -2.2.1.3 Validate the request identifier - - The Printer object SHOULD NOT check to see if the "request-id" - attribute supplied by the client is in range: between 1 and 2**31 - 1 - (inclusive), but copies all 32 bits. - - - - - -Hastings & Manros Informational [Page 11] - -RFC 2639 IPP/1.0: Implementer's Guide July 1999 - - - Note: The "version-number", "operation-id", and the "request-id" - parameters are in fixed octet positions in the IPP/1.0 encoding. The - "version-number" parameter will be the same fixed octet position in - all versions of the protocol. These fields are validated before - proceeding with the rest of the validation. - -2.2.1.4 Validate attribute group and attribute presence and order - - The order of the following validation steps depends on - implementation. - -2.2.1.4.1 Validate the presence and order of attribute groups - - Client requests and IPP object responses contain attribute groups - that Section 3 requires to be present and in a specified order. An - IPP object verifies that the attribute groups are present and in the - correct order in requests supplied by clients (attribute groups - without an * in the following tables). - - If an IPP object receives a request with (1) required attribute - groups missing, or (2) the attributes groups are out of order, or (3) - the groups are repeated, the IPP object REJECTS the request and - RETURNS the 'client-error-bad-request' status code. For example, it - is an error for the Job Template Attributes group to occur before the - Operation Attributes group, for the Operation Attributes group to be - omitted, or for an attribute group to occur more than once, except in - the Get-Jobs response. - - Since this kind of attribute group error is most likely to be an - error detected by a client developer rather than by a customer, the - IPP object NEED NOT return an indication of which attribute group was - in error in either the Unsupported Attributes group or the Status - Message. Also, the IPP object NEED NOT find all attribute group - errors before returning this error. - -2.2.1.4.2 Ignore unknown attribute groups in the expected position - - Future attribute groups may be added to the specification at the end - of requests just before the Document Content and at the end of - response, except for the Get-Jobs response, where it maybe there or - before the first job attributes returned. If an IPP object receives - an unknown attribute group in these positions, it ignores the entire - group, rather than returning an error, since that group may be a new - group in a later minor version of the protocol that can be ignored. - (If the new attribute group cannot be ignored without confusing the - client, the major version number would have been increased in the - - - - - -Hastings & Manros Informational [Page 12] - -RFC 2639 IPP/1.0: Implementer's Guide July 1999 - - - protocol document and in the request). If the unknown group occurs - in a different position, the IPP object REJECTS the request and - RETURNS the 'client-error-bad-request' status code. - - Clients also ignore unknown attribute groups returned in a response. - - Note: By validating that requests are in the proper form, IPP - objects force clients to use the proper form which, in turn, - increases the chances that customers will be able to use such clients - from multiple vendors with IPP objects from other vendors. - -2.2.1.4.3 Validate the presence of a single occurrence of required - Operation attributes - - Client requests and IPP object responses contain Operation attributes - that [RFC2566] Section 3 requires to be present. Attributes within a - group may be in any order, except for the ordering of target, - charset, and natural languages attributes. These attributes MUST be - first, and MUST be supplied in the following order: charset, natural - language, and then target. An IPP object verifies that the attributes - that Section 4 requires to be supplied by the client have been - supplied in the request (attributes without an * in the following - tables). An asterisk (*) indicates groups and Operation attributes - that the client may omit in a request or an IPP object may omit in a - response. - - If an IPP object receives a request with required attributes missing - or repeated from a group or in the wrong position, the behavior of - the IPP object is IMPLEMENTATION DEPENDENT. Some of the possible - implementations are: - - 1.REJECTS the request and RETURNS the 'client-error-bad-request' - status code - - 2.accepts the request and uses the first occurrence of the - attribute no matter where it is - - 3.accepts the request and uses the last occurrence of the - attribute no matter where it is - - 4.accept the request and assume some default value for the missing - attribute - - Therefore, client MUST send conforming requests, if they want to - receive the same behavior from all IPP object implementations. For - example, it is an error for the "attributes-charset" or "attributes- - natural-language" attribute to be omitted in any operation request, - or for an Operation attribute to be supplied in a Job Template group - - - -Hastings & Manros Informational [Page 13] - -RFC 2639 IPP/1.0: Implementer's Guide July 1999 - - - or a Job Template attribute to be supplied in an Operation Attribute - group in a create request. It is also an error to supply the - "attributes-charset" attribute twice. - - Since these kinds of attribute errors are most likely to be detected - by a client developer rather than by a customer, the IPP object NEED - NOT return an indication of which attribute was in error in either - the Unsupported Attributes group or the Status Message. Also, the - IPP object NEED NOT find all attribute errors before returning this - error. - - The following tables list all the attributes for all the operations - by attribute group in each request and each response. The order of - the groups is the order that the client supplies the groups as - specified in [RFC2566] Section 3. The order of the attributes within - a group is arbitrary, except as noted for some of the special - operation attributes (charset, natural language, and target). The - tables below use the following notation: - - R indicates a REQUIRED attribute that an IPP object MUST support - O indicates an OPTIONAL attribute that an IPP object NEED NOT - support - * indicates that a client MAY omit the attribute in a request - and that an IPP object MAY omit the attribute in a - response. The absence of an * means that a client MUST - supply the attribute in a request and an IPP object MUST - supply the attribute in a response. - - Operation Requests - - The tables below show the attributes in their proper attribute groups - for operation requests: - - Note: All operation requests contain "version-number", "operation- - id", and "request-id" parameters. - - Print-Job Request: - Group 1: Operation Attributes (R) - attributes-charset (R) - attributes-natural-language (R) - printer-uri (R) - requesting-user-name (R*) - job-name (R*) - ipp-attribute-fidelity (R*) - document-name (R*) - document-format (R*) - document-natural-language (O*) - compression (O*) - - - -Hastings & Manros Informational [Page 14] - -RFC 2639 IPP/1.0: Implementer's Guide July 1999 - - - job-k-octets (O*) - job-impressions (O*) - job-media-sheets (O*) - Group 2: Job Template Attributes (R*) - <Job Template attributes> (O*) - (see [RFC2566] Section 4.2) - Group 3: Document Content (R) - <document content> - - Validate-Job Request: - Group 1: Operation Attributes (R) - attributes-charset (R) - attributes-natural-language (R) - printer-uri (R) - requesting-user-name (R*) - job-name (R*) - ipp-attribute-fidelity (R*) - document-name (R*) - document-format (R*) - document-natural-language (O*) - compression (O*) - job-k-octets (O*) - job-impressions (O*) - job-media-sheets (O*) - Group 2: Job Template Attributes (R*) - <Job Template attributes> (O*) - (see [RFC2566] Section 4.2) - - Create-Job Request: - Group 1: Operation Attributes (R) - attributes-charset (R) - attributes-natural-language (R) - printer-uri (R) - requesting-user-name (R*) - job-name (R*) - ipp-attribute-fidelity (R*) - job-k-octets (O*) - job-impressions (O*) - job-media-sheets (O*) - Group 2: Job Template Attributes (R*) - <Job Template attributes> (O*) (see - (see [RFC2566] Section 4.2) - - Print-URI Request: - Group 1: Operation Attributes (R) - attributes-charset (R) - attributes-natural-language (R) - printer-uri (R) - - - -Hastings & Manros Informational [Page 15] - -RFC 2639 IPP/1.0: Implementer's Guide July 1999 - - - document-uri (R) - requesting-user-name (R*) - job-name (R*) - ipp-attribute-fidelity (R*) - document-name (R*) - document-format (R*) - document-natural-language (O*) - compression (O*) - job-k-octets (O*) - job-impressions (O*) - job-media-sheets (O*) - Group 2: Job Template Attributes (R*) - <Job Template attributes> (O*) (see - (see [RFC2566] Section 4.2) - - Send-Document Request: - Group 1: Operation Attributes (R) - attributes-charset (R) - attributes-natural-language (R) - (printer-uri & job-id) | job-uri (R) - last-document (R) - requesting-user-name (R*) - document-name (R*) - document-format (R*) - document-natural-language (O*) - compression (O*) - Group 2: Document Content (R*) - <document content> - - Send-URI Request: - Group 1: Operation Attributes (R) - attributes-charset (R) - attributes-natural-language (R) - (printer-uri & job-id) | job-uri (R) - last-document (R) - document-uri (R) - requesting-user-name (R*) - document-name (R*) - document-format (R*) - document-natural-language (O*) - compression (O*) - - - - - - - - - - -Hastings & Manros Informational [Page 16] - -RFC 2639 IPP/1.0: Implementer's Guide July 1999 - - - Cancel-Job Request: - Group 1: Operation Attributes (R) - attributes-charset (R) - attributes-natural-language (R) - (printer-uri & job-id) | job-uri (R) - requesting-user-name (R*) - message (O*) - - Get-Printer-Attributes Request: - Group 1: Operation Attributes (R) - attributes-charset (R) - attributes-natural-language (R) - printer-uri (R) - requesting-user-name (R*) - requested-attributes (R*) - document-format (R*) - - Get-Job-Attributes Request: - Group 1: Operation Attributes (R) - attributes-charset (R) - attributes-natural-language (R) - (printer-uri & job-id) | job-uri (R) - requesting-user-name (R*) - requested-attributes (R*) - - Get-Jobs Request: - Group 1: Operation Attributes (R) - attributes-charset (R) - attributes-natural-language (R) - printer-uri (R) - requesting-user-name (R*) - limit (R*) - requested-attributes (R*) - which-jobs (R*) - my-jobs (R*) - - - Operation Responses - - The tables below show the response attributes in their proper - attribute groups for responses. - - Note: All operation responses contain "version-number", "status- - code", and "request-id" parameters. - - Print-Job Response: - Print-URI Response: - Create-Job Response: - - - -Hastings & Manros Informational [Page 17] - -RFC 2639 IPP/1.0: Implementer's Guide July 1999 - - - Send-Document Response: - Send-URI Response: - Group 1: Operation Attributes (R) - attributes-charset (R) - attributes-natural-language (R) - status-message (O*) - Group 2: Unsupported Attributes (R*) (see Note 3) - <unsupported attributes> (R*) - Group 3: Job Object Attributes(R*) (see Note 2) - job-uri (R) - job-id (R) - job-state (R) - job-state-reasons (O*) - job-state-message (O*) - number-of-intervening-jobs (O*) - - Validate-Job Response: - Cancel-Job Response: - Group 1: Operation Attributes (R) - attributes-charset (R) - attributes-natural-language (R) - status-message (O*) - Group 2: Unsupported Attributes (R*) (see Note 3) - <unsupported attributes> (R*) - - Note 2 - the Job Object Attributes and Printer Object Attributes are - returned only if the IPP object returns one of the success status - codes. - - Note 3 - the Unsupported Attributes Group is present only if the - client included some Operation and/or Job Template attributes or - values that the Printer doesn't support whether a success or an error - return. - - Get-Printer-Attributes Response: - Group 1: Operation Attributes (R) - attributes-charset (R) - attributes-natural-language (R) - status-message (O*) - Group 2: Unsupported Attributes (R*) (see Note 4) - <unsupported attributes> (R*) - Group 3: Printer Object Attributes(R*) (see Note 2) - <requested attributes> (R*) - - Note 4 - the Unsupported Attributes Group is present only if the - client included some Operation attributes that the Printer doesn't - support whether a success or an error return. - - - - -Hastings & Manros Informational [Page 18] - -RFC 2639 IPP/1.0: Implementer's Guide July 1999 - - - Get-Job-Attributes Response: - Group 1: Operation Attributes (R) - attributes-charset (R) - attributes-natural-language (R) - status-message (O*) - Group 2: Unsupported Attributes (R*) (see Note 4) - <unsupported attributes> (R*) - Group 3: Job Object Attributes(R*) (see Note 2) - <requested attributes> (R*) - - Get-Jobs Response: - Group 1: Operation Attributes (R) - attributes-charset (R) - attributes-natural-language (R) - status-message (O*) - Group 2: Unsupported Attributes (R*) (see Note 4) - <unsupported attributes> (R*) - Group 3: Job Object Attributes(R*) (see Note 2, 5) - <requested attributes> (R*) - - Note 5: for the Get-Jobs operation the response contains a separate - Job Object Attributes group 3 to N containing requested-attributes - for each job object in the response. - -2.2.1.5 Validate the values of the REQUIRED Operation attributes - - An IPP object validates the values supplied by the client of the - REQUIRED Operation attribute that the IPP object MUST support. The - next section specifies the validation of the values of the OPTIONAL - Operation attributes that IPP objects MAY support. - - The IPP object performs the following syntactic validation checks of - each Operation attribute value: - - a)that the length of each Operation attribute value is correct for - the attribute syntax tag supplied by the client according to - [RFC2566] Section 4.1, - - b)that the attribute syntax tag is correct for that Operation - attribute according to [RFC2566] Section 3, - - c)that the value is in the range specified for that Operation - attribute according to [RFC2566] Section 3, - - d)that multiple values are supplied by the client only for - operation attributes that are multi-valued, i.e., that are - 1setOf X according to [RFC2566] Section 3. - - - - -Hastings & Manros Informational [Page 19] - -RFC 2639 IPP/1.0: Implementer's Guide July 1999 - - - If any of these checks fail, the IPP object REJECTS the request and - RETURNS the 'client-error-bad-request' or the 'client-error-request- - value-too-long' status code. Since such an error is most likely to - be an error detected by a client developer, rather than by an end- - user, the IPP object NEED NOT return an indication of which attribute - had the error in either the Unsupported Attributes Group or the - - Status Message. The description for each of these syntactic checks - is explicitly expressed in the first IF statement in the following - table. - - In addition, the IPP object checks each Operation attribute value - against some Printer object attribute or some hard-coded value if - there is no "xxx-supported" Printer object attribute defined. If its - value is not among those supported or is not in the range supported, - then the IPP object REJECTS the request and RETURNS the error status - code indicated in the table by the second IF statement. If the value - of the Printer object's "xxx-supported" attribute is 'no-value' - (because the system administrator hasn't configured a value), the - check always fails. - - attributes-charset (charset) - - IF NOT a single non-empty 'charset' value, REJECT/RETURN 'client- - error-bad-request'. - - IF the value length is greater than 63 octets, REJECT/RETURN ' - client-error-request-value-too-long'. - IF NOT in the Printer object's "charset-supported" attribute, - REJECT/RETURN "client-error-charset-not-supported". - - - attributes-natural-language(naturalLanguage) - - IF NOT a single non-empty 'naturalLanguage' value, REJECT/RETURN - 'client-error-bad-request'. - IF the value length is greater than 63 octets, REJECT/RETURN ' - client-error-request-value-too-long'. - ACCEPT the request even if not a member of the set in the Printer - object's "generated-natural-language-supported" attribute. If - the supplied value is not a member of the Printer object's - "generated-natural-language-supported" attribute, use the - Printer object's "natural-language-configured" value. - - - - - - - - -Hastings & Manros Informational [Page 20] - -RFC 2639 IPP/1.0: Implementer's Guide July 1999 - - - requesting-user-name - - IF NOT a single 'name' value, REJECT/RETURN 'client-error-bad- - request'. - IF the value length is greater than 255 octets, REJECT/RETURN - 'client-error-request-value-too-long'. - IF the IPP object can obtain a better authenticated name, use it - instead. - - - job-name(name) - - IF NOT a single 'name' value, REJECT/RETURN 'client-error-bad- - request'. - IF the value length is greater than 255 octets, REJECT/RETURN - 'client-error-request-value-too-long'. - IF NOT supplied by the client, the Printer object creates a name - from the document-name or document-uri. - - - document-name (name) - - IF NOT a single 'name' value, REJECT/RETURN 'client-error-bad- - request'. - IF the value length is greater than 255 octets, REJECT/RETURN - 'client-error-request-value-too-long'. - - - ipp-attribute-fidelity (boolean) - - IF NEITHER a single 'true' NOR a single 'false' 'boolean' value, - REJECT/RETURN 'client-error-bad-request'. - IF the value length is NOT equal to 1 octet, REJECT/RETURN ' - client-error-request-value-too-long' - IF NOT supplied by the client, the IPP object assumes the value - 'false'. - - - document-format (mimeMediaType) - - IF NOT a single non-empty 'mimeMediaType' value, REJECT/RETURN - 'client-error-bad-request'. - IF the value length is greater than 255 octets, REJECT/RETURN - 'client-error-request-value-too-long'. - IF NOT in the Printer object's "document-format-supported" - attribute, REJECT/RETURN 'client-error-document-format-not- - supported' - - - - -Hastings & Manros Informational [Page 21] - -RFC 2639 IPP/1.0: Implementer's Guide July 1999 - - - IF NOT supplied by the client, the IPP object assumes the value of - the Printer object's "document-format-default" attribute. - - - document-uri (uri) - - IF NOT a single non-empty 'uri' value, REJECT/RETURN 'client- - error-bad-request'. - IF the value length is greater than 1023 octets, REJECT/RETURN - 'client-error-request-value-too-long'. - IF the URI syntax is not valid, REJECT/RETURN 'client-error-bad- - request'. - IF scheme is NOT in the Printer object's "reference-uri-schemes- - supported" attribute, REJECT/RETURN 'client-error-uri-scheme- - not-supported'. - The Printer object MAY check to see if the document exists and is - accessible. If the document is not found or is not accessible, - REJECT/RETURN 'client-error-not found'. - - - last-document (boolean) - - IF NEITHER a single 'true' NOR a single 'false' 'boolean' value, - REJECT/RETURN 'client-error-bad-request'. - IF the value length is NOT equal to 1 octet, REJECT/RETURN ' - client-error-request-value-too-long' - - - job-id (integer(1:MAX)) - - IF NOT an single 'integer' value equal to 4 octets AND in the - range 1 to MAX, REJECT/RETURN 'client-error-bad-request'. - - IF NOT a job-id of an existing Job object, REJECT/RETURN 'client- - error-not-found' or 'client-error-gone' status code, if keep - track of recently deleted jobs. - - - requested-attributes (1setOf keyword) - - IF NOT one or more 'keyword' values, REJECT/RETURN 'client-error- - bad-request'. - IF the value length is greater than 255 octets, REJECT/RETURN - 'client-error-request-value-too-long'. - Ignore unsupported values which are the keyword names of - unsupported attributes. Don't bother to copy such requested - (unsupported) attributes to the Unsupported Attribute response - group since the response will not return them. - - - -Hastings & Manros Informational [Page 22] - -RFC 2639 IPP/1.0: Implementer's Guide July 1999 - - - which-jobs (type2 keyword) - - IF NOT a single 'keyword' value, REJECT/RETURN 'client-error-bad- - request'. - IF the value length is greater than 255 octets, REJECT/RETURN - 'client-error-request-value-too-long'. - IF NEITHER 'completed' NOR 'not-completed', copy the attribute and - the unsupported value to the Unsupported Attributes response - group and REJECT/RETURN 'client-error-attributes-or-values- - not-supported'. - Note: a Printer still supports the 'completed' value even if it - keeps no completed/canceled/aborted jobs: by returning no jobs - when so queried. - IF NOT supplied by the client, the IPP object assumes the 'not- - completed' value. - - - my-jobs (boolean) - - IF NEITHER a single 'true' NOR a single 'false' 'boolean' value, - REJECT/RETURN 'client-error-bad-request'. - IF the value length is NOT equal to 1 octet, REJECT/RETURN ' - client-error-request-value-too-long' - IF NOT supplied by the client, the IPP object assumes the 'false' - value. - - - limit (integer(1:MAX)) - - IF NOT a single 'integer' value equal to 4 octets AND in the range - 1 to MAX, REJECT/RETURN 'client-error-bad-request'. - IF NOT supplied by the client, the IPP object returns all jobs, no - matter how many. - -2.2.1.6 Validate the values of the OPTIONAL Operation attributes - - OPTIONAL Operation attributes are those that an IPP object MAY or MAY - NOT support. An IPP object validates the values of the OPTIONAL - attributes supplied by the client. The IPP object performs the same - syntactic validation checks for each OPTIONAL attribute value as in - Section 2.2.1.5. As in Section 2.2.1.5, if any fail, the IPP object - REJECTS the request and RETURNS the 'client-error-bad-request' or the - 'client-error-request-value-too-long' status code. - - In addition, the IPP object checks each Operation attribute value - against some Printer attribute or some hard-coded value if there is - no "xxx-supported" Printer attribute defined. If its value is not - among those supported or is not in the range supported, then the IPP - - - -Hastings & Manros Informational [Page 23] - -RFC 2639 IPP/1.0: Implementer's Guide July 1999 - - - object REJECTS the request and RETURNS the error status code - indicated in the table. If the value of the Printer object's "xxx- - supported" attribute is 'no-value' (because the system administrator - hasn't configured a value), the check always fails. - - If the IPP object doesn't recognize/support an attribute, the IPP - object treats the attribute as an unknown or unsupported attribute - (see the last row in the table below). - - document-natural-language (naturalLanguage) - - IF NOT a single non-empty 'naturalLanguage' value, REJECT/RETURN ' - client-error-bad-request'. - IF the value length is greater than 63 octets, REJECT/RETURN ' - client-error-request-value-too-long'. - IF NOT a value that the Printer object supports in document - formats, (no corresponding "xxx-supported" Printer attribute), - REJECT/RETURN 'client-error-natural-language-not-supported'. - - - compression (type3 keyword) - - IF NOT a single 'keyword' value, REJECT/RETURN 'client-error-bad- - request'. - IF the value length is greater than 255 octets, REJECT/RETURN ' - client-error-request-value-too-long'. - IF NOT in the Printer object's "compression-supported" attribute, - copy the attribute and the unsupported value to the Unsupported - Attributes response group and REJECT/RETURN 'client-error- - attributes-or-values-not-supported'. - - - job-k-octets (integer(0:MAX)) - - IF NOT a single 'integer' value equal to 4 octets, - REJECT/RETURN 'client-error-bad-request'. - IF NOT in the range of the Printer object's "job-k-octets- - supported" attribute, copy the attribute and the unsupported - value to the Unsupported Attributes response group and - REJECT/RETURN 'client-error-attributes-or-values-not- - supported'. - - - job-impressions (integer(0:MAX)) - - IF NOT a single 'integer' value equal to 4 octets, - REJECT/RETURN 'client-error-bad-request'. - - - - -Hastings & Manros Informational [Page 24] - -RFC 2639 IPP/1.0: Implementer's Guide July 1999 - - - IF NOT in the range of the Printer object's "job-impressions- - supported" attribute, copy the attribute and the unsupported - value to the Unsupported Attributes response group and - REJECT/RETURN 'client-error-attributes-or-values-not- - supported'. - - - job-media-sheets (integer(0:MAX)) - - IF NOT a single 'integer' value equal to 4 octets, - REJECT/RETURN 'client-error-bad-request'. - IF NOT in the range of the Printer object's "job-media-sheets- - supported" attribute, copy the attribute and the unsupported - value to the Unsupported Attributes response group and - REJECT/RETURN 'client-error-attributes-or-values-not- - supported'. - - - message (text(127)) - - IF NOT a single 'text' value, REJECT/RETURN 'client-error-bad- - request'. - IF the value length is greater than 127 octets, - REJECT/RETURN 'client-error-request-value-too-long'. - - - unknown or unsupported attribute - - IF the attribute syntax supplied by the client is supported but - the length is not legal for that attribute syntax, - REJECT/RETURN 'client-error-request-value-too-long'. - ELSE copy the attribute and value to the Unsupported Attributes - response group and change the attribute value to the "out-of- - band" 'unsupported' value, but otherwise ignore the attribute. - - Note: Future Operation attributes may be added to the protocol - specification that may occur anywhere in the specified group. - When the operation is otherwise successful, the IPP object returns - the 'successful-ok-ignored-or-substituted-attributes' status code. - Ignoring unsupported Operation attributes in all operations is - analogous to the handling of unsupported Job Template attributes - in the create and Validate-Job operations when the client supplies - the "ipp-attribute-fidelity" Operation attribute with the 'false' - value. This last rule is so that we can add OPTIONAL Operation - attributes to future versions of IPP so that older clients can - inter-work with new IPP objects and newer clients can inter-work - with older IPP objects. (If the new attribute cannot be ignored - without performing unexpectedly, the major version number would - - - -Hastings & Manros Informational [Page 25] - -RFC 2639 IPP/1.0: Implementer's Guide July 1999 - - - have been increased in the protocol document and in the request). - This rule for Operation attributes is independent of the value of - the "ipp-attribute-fidelity" attribute. For example, if an IPP - object doesn't support the OPTIONAL "job-k-octets" attribute', the - IPP object treats "job-k-octets" as an unknown attribute and only - checks the length for the 'integer' attribute syntax supplied by - the client. If it is not four octets, the IPP object REJECTS the - request and RETURNS the 'client-error-bad-request' status code, - else the IPP object copies the attribute to the Unsupported - Attribute response group, setting the value to the "out-of-band" ' - unsupported' value, but otherwise ignores the attribute. - -2.2.2 Suggested Additional Processing Steps for Operations that - Create/Validate Jobs and Add Documents - - This section in combination with the previous section recommends the - processing steps for the Print-Job, Validate-Job, Print-URI, Create- - Job, Send-Document, and Send-URI operations that IPP objects SHOULD - use. These are the operations that create jobs, validate a Print-Job - request, and add documents to a job. - -2.2.2.1 Default "ipp-attribute-fidelity" if not supplied - - The Printer object checks to see if the client supplied an "ipp- - attribute-fidelity" Operation attribute. If the attribute is not - supplied by the client, the IPP object assumes that the value is - 'false'. - -2.2.2.2 Check that the Printer object is accepting jobs - - If the value of the Printer object's "printer-is-accepting-jobs" is - 'false', the Printer object REJECTS the request and RETURNS the - 'server-error-not-accepting-jobs' status code. - -2.2.2.3 Validate the values of the Job Template attributes - - An IPP object validates the values of all Job Template attribute - supplied by the client. The IPP object performs the analogous - syntactic validation checks of each Job Template attribute value that - it performs for Operation attributes (see Section 2.2.1.5.): - - a)that the length of each value is correct for the attribute - syntax tag supplied by the client according to [RFC2566] Section - 4.1. - - b)that the attribute syntax tag is correct for that attribute - according to [RFC2566] Sections 4.2 to 4.4. - - - - -Hastings & Manros Informational [Page 26] - -RFC 2639 IPP/1.0: Implementer's Guide July 1999 - - - c)that multiple values are supplied only for multi-valued - attributes, i.e., that are 1setOf X according to [RFC2566] - Sections 4.2 to 4.4. - - As in Section 2.2.1.5, if any of these syntactic checks fail, the IPP - object REJECTS the request and RETURNS the 'client-error-bad-request' - or 'client-error-request-value-too-long' status code as appropriate, - independent of the value of the "ipp-attribute-fidelity". Since such - an error is most likely to be an error detected by a client - developer, rather than by an end-user, the IPP object NEED NOT return - an indication of which attribute had the error in either the - Unsupported Attributes Group or the Status Message. The description - for each of these syntactic checks is explicitly expressed in the - first IF statement in the following table. - - Each Job Template attribute MUST occur no more than once. If an IPP - Printer receives a create request with multiple occurrences of a Job - Template attribute, it MAY: - - 1.reject the operation and return the 'client-error-bad syntax' - error status code - - 2.accept the operation and use the first occurrence of the - attribute - - 3.accept the operation and use the last occurrence of the - attribute - - depending on implementation. Therefore, clients MUST NOT supply - multiple occurrences of the same Job Template attribute in the Job - Attributes group in the request. - -2.2.3 Algorithm for job validation - - The process of validating a Job-Template attribute "xxx" against a - Printer attribute "xxx-supported" can use the following validation - algorithm (see section 3.2.1.2 in [RFC2566]). - - To validate the value U of Job-Template attribute "xxx" against the - value V of Printer "xxx-supported", perform the following algorithm: - - 1.If U is multi-valued, validate each value X of U by performing - the algorithm in Table 3 with each value X. Each validation is - separate from the standpoint of returning unsupported values. - - Example: If U is "finishings" that the client supplies with - 'staple', 'bind' values, then X takes on the successive values: - 'staple', then 'bind' - - - -Hastings & Manros Informational [Page 27] - -RFC 2639 IPP/1.0: Implementer's Guide July 1999 - - - 2.If V is multi-valued, validate X against each Z of V by - performing the algorithm in Table 3 with each value Z. If a - value Z validates, the validation for the attribute value X - succeeds. If it fails, the algorithm is applied to the next - value Z of V. If there are no more values Z of V, validation - fails. - - Example: If V is "sides-supported" with values: 'one-sided', - 'two-sided-long', and 'two-sided-short', then Z takes on the - successive values: 'one-sided', 'two-sided-long', and - 'two-sided-short'. If the client supplies "sides" with 'two- - sided-long', the first comparison fails ('one-sided' is not - equal to 'two-sided-long'), the second comparison succeeds - ('two-sided-long' is equal to 'two-sided-long"), and the third - comparison ('two-sided-short' with 'two-sided-long') is not even - performed. - - 3.If both U and V are single-valued, let X be U and Z be V and use - the validation rules in Table 3. - - Table 3 - Rules for validating single values X against Z - - attribute attribute validated if: - syntax of X syntax of Z - - integer rangeOfInteger X is within the range of - Z - - uri uriScheme the uri scheme in X is - equal to Z - - any boolean the value of Z is TRUE - - any any X and Z are of the same - type and are equal. - - If the value of the Printer object's "xxx-supported" attribute is ' - no-value' (because the system administrator hasn't configured a - value), the check always fails. If the check fails, the IPP object - copies the attribute to the Unsupported Attributes response group - with its unsupported value. If the attribute contains more than one - value, each value is checked and each unsupported value is separately - copied, while supported values are not copied. If an IPP object - doesn't recognize/support a Job Template attribute, i.e., there is no - corresponding Printer object "xxx-supported" attribute, the IPP - object treats the attribute as an unknown or unsupported attribute - (see the last row in the table below). - - - - -Hastings & Manros Informational [Page 28] - -RFC 2639 IPP/1.0: Implementer's Guide July 1999 - - - If some Job Template attributes are supported for some document - formats and not for others or the values are different for different - document formats, the IPP object SHOULD take that into account in - this validation using the value of the "document-format" supplied by - the client (or defaulted to the value of the Printer's "document- - format-default" attribute, if not supplied by the client). For - example, if "number-up" is supported for the 'text/plain' document - format, but not for the 'application/postscript' document format, the - check SHOULD (though it NEED NOT) depend on the value of the - "document-format" operation attribute. See "document-format" in - [RFC2566] section 3.2.1.1 and 3.2.5.1. - - Note: whether the request is accepted or rejected is determined by - the value of the "ipp-attribute-fidelity" attribute in a subsequent - step, so that all Job Template attribute supplied are examined and - all unsupported attributes and/or values are copied to the - Unsupported Attributes response group. - - job-priority (integer(1:100)) - - IF NOT a single 'integer' value with a length equal to 4 octets, - REJECT/RETURN 'client-error-bad-request'. - IF NOT supplied by the client, use the value of the Printer - object's "job-priority-default" attribute at job submission - time. - IF NOT in the range 1 to 100, inclusive, copy the attribute and - the unsupported value to the Unsupported Attributes response - group. - Map the value to the nearest supported value in the range 1:100 as - specified by the number of discrete values indicated by the - value of the Printer's "job-priority-supported" attribute. See - the formula in [RFC2566] Section 4.2.1. - - job-hold-until (type3 keyword | name) - - IF NOT a single 'keyword' or 'name' value, REJECT/RETURN 'client- - error-bad-request'. - IF the value length is greater than 255 octets, REJECT/RETURN - 'client-error-request-value-too-long'. - IF NOT supplied by the client, use the value of the Printer - object's "job-hold-until" attribute at job submission time. - IF NOT in the Printer object's "job-hold-until-supported" - attribute, copy the attribute and the unsupported value to the - Unsupported Attributes response group. - - - - - - - -Hastings & Manros Informational [Page 29] - -RFC 2639 IPP/1.0: Implementer's Guide July 1999 - - - job-sheets (type3 keyword | name) - - IF NOT a single 'keyword' or 'name' value, REJECT/RETURN 'client- - error-bad-request'. - IF the value length is greater than 255 octets, REJECT/RETURN - 'client-error-request-value-too-long'. - IF NOT in the Printer object's "job-sheets-supported" attribute, - copy the attribute and the unsupported value to the Unsupported - Attributes response group. - - multiple-document-handling (type2 keyword) - - IF NOT a single 'keyword' value, REJECT/RETURN 'client-error-bad- - request'. - IF the value length is greater than 255 octets, REJECT/RETURN - 'client-error-request-value-too-long'. - IF NOT in the Printer object's "multiple-document-handling- - supported" attribute, copy the attribute and the unsupported - value to the Unsupported Attributes response group. - - copies (integer(1:MAX)) - - IF NOT a single 'integer' value with a length equal to 4 octets, - REJECT/RETURN 'client-error-bad-request'. - IF NOT in range of the Printer object's "copies-supported" - attribute copy the attribute and the unsupported value to the - Unsupported - Attributes response group. - - finishings (1setOf type2 enum) - - IF NOT an 'enum' value(s) each with a length equal to 4 octets, - REJECT/RETURN 'client-error-bad-request'. - IF NOT in the Printer object's "finishings-supported" attribute, - copy the attribute and the unsupported value(s), but not any - supported values, to the Unsupported Attributes response group. - - page-ranges (1setOf rangeOfInteger(1:MAX)) - - IF NOT a 'rangeOfInteger' value(s) each with a length equal to 8 - octets, REJECT/RETURN 'client-error-bad-request'. - IF first value is greater than second value in any range, the - ranges are not in ascending order, or ranges overlap, - REJECT/RETURN 'client-error-bad-request'. - IF the value of the Printer object's "page-ranges-supported" - attribute is 'false', copy the attribute to the Unsupported - Attributes response group and set the value to the "out-of- - band" 'unsupported' value. - - - -Hastings & Manros Informational [Page 30] - -RFC 2639 IPP/1.0: Implementer's Guide July 1999 - - - sides (type2 keyword) - - IF NOT a single 'keyword' value, REJECT/RETURN 'client-error-bad- - request'. - IF the value length is greater than 255 octets, REJECT/RETURN - 'client-error-request-value-too-long'. - IF NOT in the Printer object's "sides-supported" attribute, copy - the attribute and the unsupported value to the Unsupported - Attributes response group. - - number-up (integer(1:MAX)) - - IF NOT a single 'integer' value with a length equal to 4 octets, - REJECT/RETURN 'client-error-bad-request'. - IF NOT a value or in the range of one of the values of the Printer - object's "number-up-supported" attribute, copy the attribute - and value to the Unsupported Attribute response group. - - orientation-requested (type2 enum) - - IF NOT a single 'enum' value with a length equal to 4 octets, - REJECT/RETURN 'client-error-bad-request'. - IF NOT in the Printer object's "orientation-requested-supported" - attribute, copy the attribute and the unsupported value to the - Unsupported Attributes response group. - - media (type3 keyword | name) - - IF NOT a single 'keyword' or 'name' value, REJECT/RETURN 'client- - error-bad-request'. - IF the value length is greater than 255 octets, REJECT/RETURN - 'client-error-request-value-too-long'. - IF NOT in the Printer object's "media-supported" attribute, copy - the attribute and the unsupported value to the Unsupported - Attributes response group. - - printer-resolution (resolution) - - IF NOT a single 'resolution' value with a length equal to 9 - octets, - REJECT/RETURN 'client-error-bad-request'. - IF NOT in the Printer object's "printer-resolution-supported" - attribute, copy the attribute and the unsupported value to the - Unsupported Attributes response group. - - - - - - - -Hastings & Manros Informational [Page 31] - -RFC 2639 IPP/1.0: Implementer's Guide July 1999 - - - print-quality (type2 enum) - - IF NOT a single 'enum' value with a length equal to 4 octets, - REJECT/RETURN 'client-error-bad-request'. - IF NOT in the Printer object's "print-quality-supported" - attribute, copy the attribute and the unsupported value to the - Unsupported Attributes response group. - - unknown or unsupported attribute (i.e., there is no corresponding - Printer object "xxx-supported" attribute) - - IF the attribute syntax supplied by the client is supported but - the length is not legal for that attribute syntax, - REJECT/RETURN 'client-error-bad-request' if the length of the - attribute syntax is fixed or 'client-error-request-value-too- - long' if the length of the attribute syntax is variable. - ELSE copy the attribute and value to the Unsupported Attributes - response group and change the attribute value to the "out-of- - band" 'unsupported' value. Any remaining Job Template - Attributes are either unknown or unsupported Job Template - attributes and are validated algorithmically according to their - attribute syntax for proper length (see below). - - If the attribute syntax is supported AND the length check - fails, the IPP object REJECTS the request and RETURNS the ' - client-error-bad-request' if the length of the attribute syntax - is fixed or the 'client-error-request-value-too-long' status - code if the length of the attribute syntax is variable. - Otherwise, the IPP object copies the unsupported Job Template - attribute to the Unsupported Attributes response group and - changes the attribute value to the "out-of-band" 'unsupported' - value. The following table shows the length checks for all - attribute syntaxes. In the following table: "<=" means less - than or equal, "=" means equal to: - - Name Octet length check for read-write attributes - ----------- -------------------------------------------- - 'textWithLanguage <= 1023 AND 'naturalLanguage' <= 63 - 'textWithoutLanguage' <= 1023 - 'nameWithLanguage' <= 255 AND 'naturalLanguage' <= 63 - 'nameWithoutLanguage' <= 255 - 'keyword' <= 255 - 'enum' = 4 - 'uri' <= 1023 - 'uriScheme' <= 63 - 'charset' <= 63 - 'naturalLanguage' <= 63 - 'mimeMediaType' <= 255 - - - -Hastings & Manros Informational [Page 32] - -RFC 2639 IPP/1.0: Implementer's Guide July 1999 - - - 'octetString' <= 1023 - 'boolean' = 1 - 'integer' = 4 - 'rangeOfInteger' = 8 - 'dateTime' = 11 - 'resolution' = 9 - '1setOf X' - -2.2.3.1 Check for conflicting Job Template attributes values - - Once all the Operation and Job Template attributes have been checked - individually, the Printer object SHOULD check for any conflicting - values among all the supported values supplied by the client. For - example, a Printer object might be able to staple and to print on - transparencies, however due to physical stapling constraints, the - Printer object might not be able to staple transparencies. The IPP - object copies the supported attributes and their conflicting - attribute values to the Unsupported Attributes response group. The - Printer object only copies over those attributes that the Printer - object either ignores or substitutes in order to resolve the - conflict, and it returns the original values which were supplied by - the client. For example suppose the client supplies "finishings" - equals 'staple' and "media" equals 'transparency', but the Printer - object does not support stapling transparencies. If the Printer - chooses to ignore the stapling request in order to resolve the - conflict, the Printer objects returns "finishings" equal to 'staple' - in the Unsupported Attributes response group. If any attributes are - multi-valued, only the conflicting values of the attributes are - copied. - - Note: The decisions made to resolve the conflict (if there is a - choice) is implementation dependent. - -2.2.3.2 Decide whether to REJECT the request - - If there were any unsupported Job Template attributes or - unsupported/conflicting Job Template attribute values and the client - supplied the "ipp-attribute-fidelity" attribute with the 'true' - value, the Printer object REJECTS the request and return the status - code: - - (1) 'client-error-conflicting-attributes' status code, if there - were any conflicts between attributes supplied by the client. - (2) 'client-error-attributes-or-values-not-supported' status code, - otherwise. - - - - - - -Hastings & Manros Informational [Page 33] - -RFC 2639 IPP/1.0: Implementer's Guide July 1999 - - - Note: Unsupported Operation attributes or values that are returned - do not affect the status returned in this step. If the unsupported - Operation attribute was a serious error, the above already rejected - the request in a previous step. If control gets to this step with - unsupported Operation attributes being returned, they are not serious - errors. - -2.2.3.3 For the Validate-Job operation, RETURN one of the success - status codes - - If the requested operation is the Validate-Job operation, the Printer - object returns: - - (1) the "successful-ok" status code, if there are no unsupported - or conflicting Job Template attributes or values. - (2) the "successful-ok-conflicting-attributes, if there are any - conflicting Job Template attribute or values. - (3) the "successful-ok-ignored-or-substituted-attributes, if there - are only unsupported Job Template attributes or values. - - Note: Unsupported Operation attributes or values that are returned - do not affect the status returned in this step. If the unsupported - Operation attribute was a serious error, the above already rejected - the request in a previous step. If control gets to this step with - unsupported Operation attributes being returned, they are not serious - errors. - -2.2.3.4 Create the Job object with attributes to support - - If "ipp-attribute-fidelity" is set to 'false' (or it was not supplied - by the client), the Printer object: - - (1) creates a Job object, assigns a unique value to the job's - "job-uri" and "job-id" attributes, and initializes all of the - job's other supported Job Description attributes. - (2) removes all unsupported attributes from the Job object. - (3) for each unsupported value, removes either the unsupported - value or substitutes the unsupported attribute value with some - supported value. If an attribute has no values after removing - unsupported values from it, the attribute is removed from the - Job object (so that the normal default behavior at job - processing time will take place for that attribute). - (4) for each conflicting value, removes either the conflicting - value or substitutes the conflicting attribute value with some - other supported value. If an attribute has no values after - removing conflicting values from it, the attribute is removed - from the Job object (so that the normal default behavior at - job processing time will take place for that attribute). - - - -Hastings & Manros Informational [Page 34] - -RFC 2639 IPP/1.0: Implementer's Guide July 1999 - - - If there were no attributes or values flagged as unsupported, or the - value of 'ipp-attribute-fidelity" was 'false', the Printer object is - able to accept the create request and create a new Job object. If - the "ipp-attribute-fidelity" attribute is set to 'true', the Job - Template attributes that populate the new Job object are necessarily - all the Job Template attributes supplied in the create request. If - the "ipp-attribute-fidelity" attribute is set to 'false', the Job - Template attributes that populate the new Job object are all the - client supplied Job Template attributes that are supported or that - have value substitution. Thus, some of the requested Job Template - attributes may not appear in the Job object because the Printer - object did not support those attributes. The attributes that - populate the Job object are persistently stored with the Job object - for that Job. A Get-Job-Attributes operation on that Job object will - return only those attributes that are persistently stored with the - Job object. - - Note: All Job Template attributes that are persistently stored with - the Job object are intended to be "override values"; that is, they - that take precedence over whatever other embedded instructions might - be in the document data itself. However, it is not possible for all - Printer objects to realize the semantics of "override". End users - may query the Printer's "pdl-override-supported" attribute to - determine if the Printer either attempts or does not attempt to - override document data instructions with IPP attributes. - - There are some cases, where a Printer supports a Job Template - attribute and has an associated default value set for that attribute. - In the case where a client does not supply the corresponding - attribute, the Printer does not use its default values to populate - Job attributes when creating the new Job object; only Job Template - attributes actually in the create request are used to populate the - Job object. The Printer's default values are only used later at Job - processing time if no other IPP attribute or instruction embedded in - the document data is present. - - Note: If the default values associated with Job Template attributes - that the client did not supply were to be used to populate the Job - object, then these values would become "override values" rather than - defaults. If the Printer supports the 'attempted' value of the - "pdl-override-supported" attribute, then these override values could - replace values specified within the document data. This is not the - intent of the default value mechanism. A default value for an - attribute is used only if the create request did not specify that - attribute (or it was ignored when allowed by "ipp-attribute-fidelity" - being 'false') and no value was provided within the content of the - document data. - - - - -Hastings & Manros Informational [Page 35] - -RFC 2639 IPP/1.0: Implementer's Guide July 1999 - - - If the client does not supply a value for some Job Template - attribute, and the Printer does not support that attribute, as far as - IPP is concerned, the result of processing that Job (with respect to - the missing attribute) is undefined. - -2.2.3.5 Return one of the success status codes - - Once the Job object has been created, the Printer object accepts the - request and returns to the client: - - (1) the 'successful-ok' status code, if there are no unsupported - or conflicting Job Template attributes or values. - (2) the 'successful-ok-conflicting-attributes' status code, if - there are any conflicting Job Template attribute or values. - (3) the 'successful-ok-ignored-or-substituted-attributes' status - code, if there are only unsupported Job Template attributes or - values. - - Note: Unsupported Operation attributes or values that are returned - do not affect the status returned in this step. If the unsupported - Operation attribute was a serious error, the above already rejected - the request in a previous step. If control gets to this step with - unsupported Operation attributes being returned, they are not serious - errors. - - The Printer object also returns Job status attributes that indicate - the initial state of the Job ('pending', 'pending-held', ' - processing', etc.), etc. See Print-Job Response, [RFC2566] section - 3.2.1.2. - -2.2.3.6 Accept appended Document Content - - The Printer object accepts the appended Document Content data and - either starts it printing, or spools it for later processing. - -2.2.3.7 Scheduling and Starting to Process the Job - - The Printer object uses its own configuration and implementation - specific algorithms for scheduling the Job in the correct processing - order. Once the Printer object begins processing the Job, the - Printer changes the Job's state to 'processing'. If the Printer - object supports PDL override (the "pdl-override-supported" attribute - set to 'attempted'), the implementation does its best to see that IPP - attributes take precedence over embedded instructions in the document - data. - - - - - - -Hastings & Manros Informational [Page 36] - -RFC 2639 IPP/1.0: Implementer's Guide July 1999 - - -2.2.3.8 Completing the Job - - The Printer object continues to process the Job until it can move the - Job into the 'completed' state. If an Cancel-Job operation is - received, the implementation eventually moves the Job into the ' - canceled' state. If the system encounters errors during processing - that do not allow it to progress the Job into a completed state, the - implementation halts all processing, cleans up any resources, and - moves the Job into the 'aborted' state. - -2.2.3.9 Destroying the Job after completion - - Once the Job moves to the 'completed', 'aborted', or 'canceled' - state, it is an implementation decision as to when to destroy the Job - object and release all associated resources. Once the Job has been - destroyed, the Printer would return either the "client-error-not- - found" or "client-error-gone" status codes for operations directed at - that Job. - - Note: the Printer object SHOULD NOT re-use a "job-uri" or "job-id" - value for a sufficiently long time after a job has been destroyed, so - that stale references kept by clients are less likely to access the - wrong (newer) job. - -2.2.3.10 Interaction with "ipp-attribute-fidelity" - - Some Printer object implementations may support "ipp-attribute- - fidelity" set to 'true' and "pdl-override-supported" set to ' - attempted' and yet still not be able to realize exactly what the - client specifies in the create request. This is due to legacy - decisions and assumptions that have been made about the role of job - instructions embedded within the document data and external job - instructions that accompany the document data and how to handle - conflicts between such instructions. The inability to be 100% - precise about how a given implementation will behave is also - compounded by the fact that the two special attributes, "ipp- - attribute-fidelity" and "pdl-override-supported", apply to the whole - job rather than specific values for each attribute. For example, some - implementations may be able to override almost all Job Template - attributes except for "number-up". - -2.3 Status codes returned by operation - - This section lists all status codes once in the first operation - (Print-Job). Then it lists the status codes that are different or - specialized for subsequent operations under each operation. - - - - - -Hastings & Manros Informational [Page 37] - -RFC 2639 IPP/1.0: Implementer's Guide July 1999 - - -2.3.1 Printer Operations - -2.3.1.1 Print-Job - - The Printer object MUST return one of the following "status-code" - values for the indicated reason. Whether all of the document data - has been accepted or not before returning the success or error - response depends on implementation. See Section 14 for a more - complete description of each status code. - - For the following success status codes, the Job object has been - created and the "job-id", and "job-uri" assigned and returned in the - response: - - successful-ok: no request attributes were substituted or ignored. - successful-ok-ignored-or-substituted-attributes: some supplied - (1) attributes were ignored or (2) unsupported attribute - syntaxes or values were substituted with supported values or - were ignored. Unsupported attributes, attribute syntaxes, or - values MUST be returned in the Unsupported Attributes group of - the response. - successful-ok-conflicting-attributes: some supplied attribute - values conflicted with the values of other supplied attributes - and were either substituted or ignored. Attributes or values - which conflict with other attributes and have been substituted - or ignored MUST be returned in the Unsupported Attributes group - of the response as supplied by the client. - - [RFC2566] section 3.1.6 Operation Status Codes and Messages states: - - If the Printer object supports the "status-message" operation - attribute, it SHOULD use the REQUIRED 'utf-8' charset to return - a status message for the following error status codes (see - section 14): 'client-error-bad-request', 'client-error- - charset-not-supported', 'server-error-internal-error', ' - server-error-operation-not-supported', and 'server-error- - version-not-supported'. In this case, it MUST set the value of - the "attributes-charset" operation attribute to 'utf-8' in the - error response. - - For the following error status codes, no job is created and no "job- - id" or "job-uri" is returned: - - client-error-bad-request: The request syntax does not conform to - the specification. - - - - - - -Hastings & Manros Informational [Page 38] - -RFC 2639 IPP/1.0: Implementer's Guide July 1999 - - - client-error-forbidden: The request is being refused for - authorization or authentication reasons. The implementation - security policy is to not reveal whether the failure is one of - authentication or authorization. - client-error-not-authenticated: Either the request requires - authentication information to be supplied or the authentication - information is not sufficient for authorization. - client-error-not-authorized: The requester is not authorized to - perform the request on the target object. - client-error-not-possible: The request cannot be carried out - because of the state of the system. See also 'server-error- - not-accepting-jobs' status code which MUST take precedence if - the Printer object's "printer-accepting-jobs" attribute is ' - false'. - client-error-timeout: not applicable. - client-error-not-found: the target object does not exist. - client-error-gone: the target object no longer exists and no - forwarding address is known. - client-error-request-entity-too-large: the size of the request - and/or print data exceeds the capacity of the IPP Printer to - process it. - client-error-request-value-too-long: the size of request variable - length attribute values, such as 'text' and 'name' attribute - syntaxes, exceed the maximum length specified in [RFC2566] for - the attribute and MUST be returned in the Unsupported - Attributes Group. - client-error-document-format-not-supported: the document format - supplied is not supported. The "document-format" attribute - with the unsupported value MUST be returned in the Unsupported - Attributes Group. This error SHOULD take precedence over any - other 'xxx-not-supported' error, except 'client-error-charset- - not-supported'. - client-error-attributes-or-values-not-supported: one or more - supplied attributes, attribute syntaxes, or values are not - supported and the client supplied the "ipp-attributes-fidelity" - operation attribute with a 'true' value. They MUST be returned - in the Unsupported Attributes Group as explained below. - client-error-uri-scheme-not-supported: not applicable. - client-error-charset-not-supported: the charset supplied in the - "attributes-charset" operation attribute is not supported. The - Printer's "configured-charset" MUST be returned in the response - as the value of the "attributes-charset" operation attribute - and used for any 'text' and 'name' attributes returned in the - error response. This error SHOULD take precedence over any - other error, unless the request syntax is so bad that the - client's supplied "attributes-charset" cannot be determined. - - - - - -Hastings & Manros Informational [Page 39] - -RFC 2639 IPP/1.0: Implementer's Guide July 1999 - - - client-error-conflicting-attributes: one or more supplied - attribute va attribute values conflicted with each other and - the client supplied the "ipp-attributes-fidelity" operation - attribute with a 'true' value. They MUST be returned in the - Unsupported Attributes Group as explained below. - server-error-internal-error: an unexpected condition prevents the - request from being fulfilled. - server-error-operation-not-supported: not applicable (since - Print-Job is REQUIRED). - server-error-service-unavailable: the service is temporarily - overloaded. - server-error-version-not-supported: the version in the request is - not supported. The "closest" version number supported MUST be - returned in the response. - server-error-device-error: a device error occurred while - receiving or spooling the request or document data or the IPP - Printer object can only accept one job at a time. - server-error-temporary-error: a temporary error such as a buffer - full write error, a memory overflow, or a disk full condition - occurred while receiving the request and/or the document data. - server-error-not-accepting-jobs: the Printer object's "printer- - is-not-accepting-jobs" attribute is 'false'. - server-error-busy: the Printer is too busy processing jobs to - accept another job at this time. - server-error-job-canceled: the job has been canceled by an - operator or the system while the client was transmitting the - document data. - -2.3.1.2 Print-URI - - All of the Print-Job status codes described in Section 3.2.1.2 - Print-Job Response are applicable to Print-URI with the following - specializations and differences. See Section 14 for a more complete - description of each status code. - - server-error-uri-scheme-not-supported: the URI scheme supplied in - the "document-uri" operation attribute is not supported and is - returned in the Unsupported Attributes group. - -2.3.1.3 Validate-Job - - All of the Print-Job status codes described in Section 3.2.1.2 - Print-Job Response are applicable to Validate-Job. See Section 14 - for a more complete description of each status code. - - - - - - - -Hastings & Manros Informational [Page 40] - -RFC 2639 IPP/1.0: Implementer's Guide July 1999 - - -2.3.1.4 Create-Job - - All of the Print-Job status codes described in Section 3.2.1.2 - Print-Job Response are applicable to Create-Job with the following - specializations and differences. See Section 14 for a more complete - description of each status code. - - server-error-operation-not-supported: the Create-Job operation is - not supported. - -2.3.1.5 Get-Printer-Attributes - - All of the Print-Job status codes described in Section 3.2.1.2 - Print-Job Response are applicable to the Get-Printer-Attributes - operation with the following specializations and differences. See - Section 14 for a more complete description of each status code. - - For the following success status codes, the requested attributes are - returned in Group 3 in the response: - - successful-ok: no request attributes were substituted or ignored - (same as Print-Job) and no requested attributes were - unsupported. - successful-ok-ignored-or-substituted-attributes: same as Print- - Job, except the "requested-attributes" operation attribute MAY, - but NEED NOT, be returned with the unsupported values. - successful-ok-conflicting-attributes: same as Print-Job. - - For the error status codes, Group 3 is returned containing no - attributes or is not returned at all: - - client-error-not-possible: Same as Print-Job, in addition the - Printer object is not accepting any requests. - client-error-request-entity-too-large: same as Print-job, except - that no print data is involved. - client-error-attributes-or-values-not-supported: not applicable, - since unsupported operation attributes MUST be ignored and ' - successful-ok-ignored-or-substituted-attributes' returned. - client-error-conflicting-attributes: same as Print-Job, except - that "ipp-attribute-fidelity" is not involved. - server-error-operation-not-supported: not applicable (since Get- - Printer-Attributes is REQUIRED). - server-error-device-error: same as Print-Job, except that no - document data is involved. - server-error-temporary-error: same as Print-Job, except that no - document data is involved. - server-error-not-accepting-jobs: not applicable. - - - - -Hastings & Manros Informational [Page 41] - -RFC 2639 IPP/1.0: Implementer's Guide July 1999 - - - server-error-busy: same as Print-Job, except the IPP object is - too busy to accept even query requests. - server-error-job-canceled: not applicable. - -2.3.1.6 Get-Jobs - - All of the Print-Job status codes described in Section 3.2.1.2 - Print-Job Response are applicable to the Get-Jobs operation with the - following specializations and differences. See Section 14 for a - more complete description of each status code. - - For the following success status codes, the requested attributes are - returned in Group 3 in the response: - - successful-ok: no request attributes were substituted or ignored - (same as Print-Job) and no requested attributes were - unsupported. - successful-ok-ignored-or-substituted-attributes: same as Print- - Job, except the "requested-attributes" operation attribute MAY, - but NEED NOT, be returned with the unsupported values. - successful-ok-conflicting-attributes: same as Print-Job. - - For any error status codes, Group 3 is returned containing no - attributes or is not returned at all. The following brief error - status code descriptions contain unique information for use with - Get-Jobs operation. See section 14 for the other error status codes - that apply uniformly to all operations: - - client-error-not-possible: Same as Print-Job, in addition the - Printer object is not accepting any requests. - client-error-request-entity-too-large: same as Print-job, except - that no print data is involved. - client-error-document-format-not-supported: not applicable. - client-error-attributes-or-values-not-supported: not applicable, - since unsupported operation attributes MUST be ignored and ' - successful-ok-ignored-or-substituted-attributes' returned. - client-error-conflicting-attributes: same as Print-Job, except - that "ipp-attribute-fidelity" is not involved. - server-error-operation-not-supported: not applicable (since Get- - Jobs is REQUIRED). - server-error-device-error: same as Print-Job, except that no - document data is involved. - server-error-temporary-error: same as Print-Job, except that no - document data is involved. - server-error-not-accepting-jobs: not applicable. - server-error-job-canceled: not applicable. - - - - - -Hastings & Manros Informational [Page 42] - -RFC 2639 IPP/1.0: Implementer's Guide July 1999 - - -2.3.2 Job Operations - -2.3.2.1 Send-Document - - All of the Print-Job status codes described in Section 3.2.1.2 - Print-Job Response are applicable to the Get-Printer-Attributes - operation with the following specializations and differences. See - Section 14 for a more complete description of each status code. - - For the following success status codes, the document has been added - to the specified Job object and the job's "number-of-documents" - attribute has been incremented: - - successful-ok: no request attributes were substituted or ignored - (same as Print-Job). - successful-ok-ignored-or-substituted-attributes: same as Print- - Job. - successful-ok-conflicting-attributes: same as Print-Job. - - For the error status codes, no document has been added to the Job - object and the job's "number-of-documents" attribute has not been - incremented: - - client-error-not-possible: Same as Print-Job, except that the - Printer's "printer-is-accepting-jobs" attribute is not - involved, so that the client is able to finish submitting a - multi-document job after this attribute has been set to 'true'. - Another condition is that the state of the job precludes Send- - Document, i.e., the job has already been closed out by the - client. However, if the IPP Printer closed out the job due to - timeout, the 'client-error-timeout' error status SHOULD be - returned instead. - client-error-timeout: This request was sent after the Printer - closed the job, because it has not received a Send-Document or - Send-URI operation within the Printer's "multiple-operation- - time-out" period. - client-error-request-entity-too-large: same as Print-Job. - client-error-conflicting-attributes: same as Print-Job, except - that "ipp-attributes-fidelity" operation attribute is not - involved. - server-error-operation-not-supported: the Send-Document request - is not supported. - server-error-not-accepting-jobs: not applicable. - server-error-job-canceled: the job has been canceled by an - operator or the system while the client was transmitting the - data. - - - - - -Hastings & Manros Informational [Page 43] - -RFC 2639 IPP/1.0: Implementer's Guide July 1999 - - -2.3.2.2 Send-URI - - All of the Print-Job status code descriptions in Section 3.2.1.2 - Print-Job Response with the specializations described for Send- - Document are applicable to Send-URI. See Section 14 for a more - complete description of each status code. - - server-error-uri-scheme-not-supported: the URI scheme supplied in - the "document-uri" operation attribute is not supported and the - "document-uri" attribute MUST be returned in the Unsupported - Attributes group. - -2.3.2.3 Cancel-Job - - All of the Print-Job status codes described in Section 3.2.1.2 - Print-Job Response are applicable to Cancel-Job with the following - specializations and differences. See Section 14 for a more complete - description of each status code. - - For the following success status codes, the Job object is being - canceled or has been canceled: - - successful-ok: no request attributes were substituted or ignored - (same as Print-Job). - successful-ok-ignored-or-substituted-attributes: same as Print- - Job. - successful-ok-conflicting-attributes: same as Print-Job. - - For any of the error status codes, the Job object has not been - canceled or was previously canceled. - - client-error-not-possible: The request cannot be carried out - because of the state of the Job object ('completed', ' - canceled', or 'aborted') or the state of the system. - client-error-not-found: the target Printer and/or Job object does - not exist. - client-error-gone: the target Printer and/or Job object no longer - exists and no forwarding address is known. - client-error-request-entity-too-large: same as Print-Job, except - no document data is involved. - client-error-document-format-not-supported: not applicable. - client-error-attributes-or-values-not-supported: not applicable, - since unsupported operation attributes and values MUST be - ignored. - client-error-conflicting-attributes: same as Print-Job, except - that the Printer's "printer-is-accepting-jobs" attribute is not - involved. - - - - -Hastings & Manros Informational [Page 44] - -RFC 2639 IPP/1.0: Implementer's Guide July 1999 - - - server-error-operation-not-supported: not applicable (Cancel-Job - is REQUIRED). - server-error-device-error: same as Print-Job, except no document - data is involved. - server-error-temporary-error: same as Print-Job, except no - document data is involved. - server-error-not-accepting-jobs: not applicable. - server-error-job-canceled: not applicable. - -2.3.2.4 Get-Job-Attributes - - All of the Print-Job status codes described in Section 3.2.1.2 - Print-Job Response are applicable to Get-Job-Attributes with the - following specializations and differences. See Section 14 for a more - complete description of each status code. - - For the following success status codes, the requested attributes are - returned in Group 3 in the response: - - successful-ok: no request attributes were substituted or ignored - (same as Print-Job) and no requested attributes were - unsupported. - successful-ok-ignored-or-substituted-attributes: same as Print- - Job, except the "requested-attributes" operation attribute MAY, - but NEED NOT, be returned with the unsupported values. - successful-ok-conflicting-attributes: same as Print-Job. - - For the error status codes, Group 3 is returned containing no - attributes or is not returned at all. - - client-error-not-possible: Same as Print-Job, in addition the - Printer object is not accepting any requests. - client-error-document-format-not-supported: not applicable. - client-error-attributes-or-values-not-supported: not applicable. - client-error-uri-scheme-not-supported: not applicable. - client-error-conflicting-attributes: not applicable - server-error-operation-not-supported: not applicable (since Get- - Job-Attributes is REQUIRED). - server-error-device-error: same as Print-Job, except no document - data is involved. - server-error-temporary-error: sane as Print-Job, except no - document data is involved. - server-error-not-accepting-jobs: not applicable. server-error- - job-canceled: not applicable. - - - - - - - -Hastings & Manros Informational [Page 45] - -RFC 2639 IPP/1.0: Implementer's Guide July 1999 - - -2.4 Validate-Job - - The Validate-Job operation has been designed so that its - implementation may be a part of the Print-Job operation. Therefore, - requiring Validate-Job is not a burden on implementers. Also it is - useful for client's to be able to count on its presence in all - conformance implementations, so that the client can determine before - sending a long document, whether the job will be accepted by the IPP - Printer or not. - -2.5 Case Sensitivity in URIs - - IPP client and server implementations must be aware of the diverse - uppercase/lowercase nature of URIs. RFC 2396 defines URL schemes and - Host names as case insensitive but reminds us that the rest of the - URL may well demonstrate case sensitivity. When creating URL's for - fields where the choice is completely arbitrary, it is probably best - to select lower case. However, this cannot be guaranteed and - implementations MUST NOT rely on any fields being case-sensitive or - case-insensitive in the URL beyond the URL scheme and host name - fields. - - The reason that the IPP specification does not make any restrictions - on URIs, is so that implementations of IPP may use off-the-shelf - components that conform to the standards that define URIs, such as - RFC 2396 and the HTTP/1.1 specifications [RFC2068]. See these - specifications for rules of matching, comparison, and case- - sensitivity. - - It is also recommended that System Administrators and implementations - avoid creating URLs for different printers that differ only in their - case. For example, don't have Printer1 and printer1 as two different - IPP Printers. - - The HTTP/1.1 specification [RFC2068] contains more details on - comparing URLs. - -2.6 Character Sets, natural languages, and internationalization - - This section discusses character set support, natural language - support and internationalization. - -2.6.1 Character set code conversion support - - IPP clients and IPP objects are REQUIRED to support UTF-8. They MAY - support additional charsets. It is RECOMMENDED that an IPP object - also support US-ASCII, since many clients support US-ASCII, and - indicate that UTF-8 and US-ASCII are supported by populating the - - - -Hastings & Manros Informational [Page 46] - -RFC 2639 IPP/1.0: Implementer's Guide July 1999 - - - Printer's "charset-supported" with 'utf-8' and 'us-ascii' values. An - IPP object is required to code covert with as little loss as possible - between the charsets that it supports, as indicated in the Printer's - "charsets-supported" attribute. - - How should the server handle the situation where the "attributes- - charset" of the response itself is "us-ascii", but one or more - attributes in that response is in the "utf-8" format? - - Example: Consider a case where a client sends a Print-Job request - with "utf-8" as the value of "attributes-charset" and with the "job- - name" attribute supplied. Later another client submits a Get-Job- - Attribute or Get-Jobs request. This second request contains the - "attributes-charset" with value "us-ascii" and "requested-attributes" - attribute with exactly one value "job-name". - - According to the RFC2566 document (section 3.1.4.2), the value of the - "attributes-charset" for the response of the second request must be - "us-ascii" since that is the charset specified in the request. The - "job-name" value, however, is in "utf-8" format. Should the request - be rejected even though both "utf-8" and "us-ascii" charsets are - supported by the server? or should the "job-name" value be converted - to "us-ascii" and return "successful-ok-conflicting-attributes" - (0x0002) as the status code? - - Answer: An IPP object that supports both utf-8 (REQUIRED) and us- - ascii, the second paragraph of section 3.1.4.2 applies so that the - IPP object MUST accept the request, perform code set conversion - between these two charsets with "the highest fidelity possible" and - return 'successful-ok', rather than a warning 'successful-ok- - conflicting-attributes, or an error. The printer will do the best it - can to convert between each of the character sets that it supports-- - even if that means providing a string of question marks because none - of the characters are representable in US ASCII. If it can't perform - such conversion, it MUST NOT advertise us-ascii as a value of its - "attributes-charset-supported" and MUST reject any request that - requests 'us-ascii'. - - One IPP object implementation strategy is to convert all request text - and name values to a Unicode internal representation. This is 16-bit - and virtually universal. Then convert to the specified operation - attributes-charset on output. - - Also it would be smarter for a client to ask for 'utf-8', rather than - 'us-ascii' and throw away characters that it doesn't understand, - rather than depending on the code conversion of the IPP object. - - - - - -Hastings & Manros Informational [Page 47] - -RFC 2639 IPP/1.0: Implementer's Guide July 1999 - - -2.6.2 What charset to return when an unsupported charset is requested? - - Section 3.1.4.1 Request Operation attributes was clarified in - November 1998 as follows: - - All clients and IPP objects MUST support the 'utf-8' charset - [RFC2044] and MAY support additional charsets provided that they - are registered with IANA [IANA-CS]. If the Printer object does - not support the client supplied charset value, the Printer object - MUST reject the request, set the "attributes-charset" to 'utf-8' - in the response, and return the 'client-error-charset-not- - supported' status code and any 'text' or 'name' attributes using - the 'utf-8' charset. - - Since the client and IPP object MUST support UTF-8, returning any - text or name attributes in UTF-8 when the client requests a charset - that is not supported should allow the client to display the text or - name. - - Since such an error is a client error, rather than a user error, the - client should check the status code first so that it can avoid - displaying any other returned 'text' and 'name' attributes that are - not in the charset requested. - - Furthermore, [RFC2566] section 14.1.4.14 client-error-charset-not- - supported (0x040D) was clarified in November 1998 as follows: - - For any operation, if the IPP Printer does not support the charset - supplied by the client in the "attributes-charset" operation - attribute, the Printer MUST reject the operation and return this - status and any 'text' or 'name' attributes using the 'utf-8' - charset (see Section 3.1.4.1). - -2.6.3 Natural Language Override (NLO) - - The 'text' and 'name' attributes each have two forms. One has an - implicit natural language, and the other has an explicit natural - language. The 'textWithoutLanguage' and 'textWithoutLanguage' are - the two 'text' forms. The 'nameWithoutLanguage" and ' - nameWithLanguage are the two 'name' forms. If a receiver (IPP object - or IPP client) supports an attribute with attribute syntax 'text', it - MUST support both forms in a request and a response. A sender (IPP - client or IPP object) MAY send either form for any such attribute. - When a sender sends a WithoutLanguage form, the implicit natural - language is specified in the "attributes-natural-language" operation - attribute which all senders MUST include in every request and - response. - - - - -Hastings & Manros Informational [Page 48] - -RFC 2639 IPP/1.0: Implementer's Guide July 1999 - - - When a sender sends a WithLanguage form, it MAY be different from the - implicit natural language supplied by the sender or it MAY be the - same. The receiver MUST treat either form equivalently. - - There is an implementation decision for senders, whether to always - send the WithLanguage forms or use the WithoutLanguage form when the - attribute's natural language is the same as the request or response. - The former approach makes the sender implementation simpler. The - latter approach is more efficient on the wire and allows inter- - working with non-conforming receivers that fail to support the - WithLanguage forms. As each approach have advantages, the choice is - completely up to the implementer of the sender. - - Furthermore, when a client receives a 'text' or 'name' job attribute - that it had previously supplied, that client MUST NOT expect to see - the attribute in the same form, i.e., in the same WithoutLanguage or - WithLanguage form as the client supplied when it created the job. - The IPP object is free to transform the attribute from the - WithLanguage form to the WithoutLanguage form and vice versa, as long - as the natural language is preserved. However, in order to meet this - latter requirement, it is usually simpler for the IPP object - implementation to store the natural language explicitly with the - attribute value, i.e., to store using an internal representation that - resembles the WithLanguage form. - - The IPP Printer MUST copy the natural language of a job, i.e., the - value of the "attributes-natural-language" operation attribute - supplied by the client in the create operation, to the Job object as - a Job Description attribute, so that a client is able to query it. - In returning a Get-Job-Attributes response, the IPP object MAY return - one of three natural language values in the response's "attributes- - natural-language" operation attribute: (1) that requested by the - requester, (2) the natural language of the job, or (3) the configured - natural language of the IPP Printer, if the requested language is not - supported by the IPP Printer. - - This "attributes-natural-language" Job Description attribute is - useful for an IPP object implementation that prints start sheets in - the language of the user who submitted the job. This same Job - Description attribute is useful to a multi-lingual operator who has - to communicate with different job submitters in different natural - languages. This same Job Description attribute is expected to be - used in the future to generate notification messages in the natural - language of the job submitter. - - Early drafts of [RFC2566] contained a job-level natural language - override (NLO) for the Get-Jobs response. A job-level (NLO) is an - (unrequested) Job Attribute which then specified the implicit natural - - - -Hastings & Manros Informational [Page 49] - -RFC 2639 IPP/1.0: Implementer's Guide July 1999 - - - language for any other WithoutLanguage job attributes returned in the - response for that job. Interoperability testing of early - implementations showed that no one was implementing the job-level NLO - in Get-Job responses. So the job-level NLO was eliminated from the - Get- Jobs response. This simplification makes all requests and - responses consistent in that the implicit natural language for any - WithoutLanguage 'text' or 'name' form is always supplied in the - request's or response's "attributes-natural-language" operation - attribute. - -2.7 The "queued-job-count" Printer Description attribute - -2.7.1 Why is "queued-job-count" RECOMMENDED? - - The reason that "queued-job-count" is RECOMMENDED, is that some - clients look at that attribute alone when summarizing the status of a - list of printers, instead of doing a Get-Jobs to determine the number - of jobs in the queue. Implementations that fail to support the - "queued-job-count" will cause that client to display 0 jobs when - there are actually queued jobs. - - We would have made it a REQUIRED Printer attribute, but some - implementations had already been completed before the issue was - raised, so making it a SHOULD was a compromise. - -2.7.2 Is "queued-job-count" a good measure of how busy a printer is? - - The "queued-job-count" is not a good measure of how busy the printer - is when there are held jobs. A future registration could be to add a - "held-job-count" (or an "active-job-count") Printer Description - attribute if experience shows that such an attribute (combination) is - needed to quickly indicate how busy a printer really is. - -2.8 Sending empty attribute groups - - The [RFC2566] and [RFC2565] specifications RECOMMEND that a sender - not send an empty attribute group in a request or a response. - However, they REQUIRE a receiver to accept an empty attribute group - as equivalent to the omission of that group. So a client SHOULD omit - the Job Template Attributes group entirely in a create operation that - is not supplying any Job Template attributes. Similarly, an IPP - object SHOULD omit an empty Unsupported Attributes group if there are - no unsupported attributes to be returned in a response. - - - - - - - - -Hastings & Manros Informational [Page 50] - -RFC 2639 IPP/1.0: Implementer's Guide July 1999 - - - The [RFC2565] specification REQUIRES a receiver to be able to receive - either an empty attribute group or an omitted attribute group and - treat them equivalently. The term "receiver" means an IPP object for - a request and a client for a response. The term "sender' means a - client for a request and an IPP object for a response. - - There is an exception to the rule for Get-Jobs when there are no - attributes to be returned. [RFC2565] contains the following - paragraph: - - The syntax allows an xxx-attributes-tag to be present when the - xxx-attribute-sequence that follows is empty. The syntax is - defined this way to allow for the response of Get-Jobs where no - attributes are returned for some job-objects. Although it is - RECOMMENDED that the sender not send an xxx-attributes-tag if - there are no attributes (except in the Get-Jobs response just - mentioned), the receiver MUST be able to decode such syntax. - -2.9 Returning unsupported attributes in Get-Xxxx responses - - In the Get-Printer-Attributes, Get-Jobs, or Get-Job-Attributes - responses, the client cannot depend on getting unsupported attributes - returned in the Unsupported Attributes group that the client - requested, but are not supported by the IPP object. However, such - unsupported requested attributes will not be returned in the Job - Attributes or Printer Attributes group (since they are unsupported). - Furthermore, the IPP object is REQUIRED to return the 'successful- - ok-ignored-or-substituted-attributes' status code, so that the client - knows that not all that was requested has been returned. - -2.10 Returning job-state in Print-Job response - - An IPP client submits a small job via Print-Job. By the time the IPP - printer/print server is putting together a response to the operation, - the job has finished printing and been removed as an object from the - print system. What should the job-state be in the response? - - The Model suggests that the Printer return a response before it even - accepts the document content. The Job Object Attributes are returned - only if the IPP object returns one of the success status codes. Then - the job-state would always be "pending" or "pending-held". - - This issue comes up for the implementation of an IPP Printer object - as a server that forwards jobs to devices that do not provide job - status back to the server. If the server is reasonably certain that - the job completed successfully, then it should return the job-state - as 'completed'. Also the server can keep the job in its "job - history" long after the job is no longer in the device. Then a user - - - -Hastings & Manros Informational [Page 51] - -RFC 2639 IPP/1.0: Implementer's Guide July 1999 - - - could query the server and see that the job was in the 'completed' - state and completed as specified by the job's "time-at-completed" - time which would be the same as the server submitted the job to the - device. - - An alternative is for the server to respond to the client before or - while sending the job to the device, instead of waiting until the - server has finished sending the job to the device. In this case, the - server can return the job's state as 'pending' with the 'job- - outgoing' value in the job's "job-state-reasons" attribute. - - If the server doesn't know for sure whether the job completed - successfully (or at all), it could return the (out-of-band) 'unknown' - value. - - On the other hand, if the server is able to query the device and/or - setup some sort of event notification that the device initiates when - the job makes state transitions, then the server can return the - current job state in the Print-Job response and in subsequent queries - because the server knows what the job state is in the device (or can - query the device). - - All of these alternatives depend on implementation of the server and - the device. - -2.11 Flow controlling the data portion of a Print-Job request - - A paused printer (or one that is stopped due to paper out or jam or - spool space full or buffer space full, may flow control the data of a - Print-Job operation (at the TCP/IP layer), so that the client is not - able to send all the document data. Consequently, the Printer will - not return a response until the condition is changed. - - The Printer should not return a Print-Job response with an error code - in any of these conditions, since either the printer will be resumed - and/or the condition will be freed either by human intervention or as - jobs print. - - In writing test scripts to test IPP Printers, the script must also be - written not to expect a response, if the printer has been paused, - until the printer is resumed, in order to work with all possible - implementations. - -2.12 Multi-valued attributes - - What is the attribute syntax for a multi-valued attribute? Since - some attributes support values in more than one data type, such as - "media", "job-hold-until", and "job-sheets", IPP semantics associate - - - -Hastings & Manros Informational [Page 52] - -RFC 2639 IPP/1.0: Implementer's Guide July 1999 - - - the attribute syntax with each value, not with the attribute as a - whole. The protocol associates the attribute syntax tag with each - value. Don't be fooled, just because the attribute syntax tag comes - before the attribute keyword. All attribute values after the first - have a zero length attribute keyword as the indication of a - subsequent value of the same attribute. - -2.13 Querying jobs with IPP that were submitted using other job - submission protocols - - The following clarification was added to [RFC2566] section 8.5: - - 8.5 Queries on jobs submitted using non-IPP protocols - - If the device that an IPP Printer is representing is able to - accept jobs using other job submission protocols in addition to - IPP, it is RECOMMEND that such an implementation at least allow - such "foreign" jobs to be queried using Get-Jobs returning "job- - id" and "job-uri" as 'unknown'. Such an implementation NEED NOT - support all of the same IPP job attributes as for IPP jobs. The - IPP object returns the 'unknown' out-of-band value for any - requested attribute of a foreign job that is supported for IPP - jobs, but not for foreign jobs. - - It is further RECOMMENDED, that the IPP Printer generate "job-id" - and "job-uri" values for such "foreign jobs", if possible, so that - they may be targets of other IPP operations, such as Get-Job- - Attributes and Cancel-Job. Such an implementation also needs to - deal with the problem of authentication of such foreign jobs. One - approach would be to treat all such foreign jobs as belonging to - users other than the user of the IPP client. Another approach - would be for the foreign job to belong to 'anonymous'. Only if - the IPP client has been authenticated as an operator or - administrator of the IPP Printer object, could the foreign jobs be - queried by an IPP request. Alternatively, if the security policy - is to allow users to query other users' jobs, then the foreign - jobs would also be visible to an end-user IPP client using Get- - Jobs and Get-Job-Attributes. - - Thus IPP MAY be implemented as a "universal" protocol that provides - access to jobs submitted with any job submission protocol. As IPP - becomes widely implemented, providing a more universal access makes - sense. - - - - - - - - -Hastings & Manros Informational [Page 53] - -RFC 2639 IPP/1.0: Implementer's Guide July 1999 - - -2.14 The 'none' value for empty sets - - [RFC2566] states that the 'none' value should be used as the value of - a 1SetOf when the set is empty. In most cases, sets that are - potentially empty contain keywords so the keyword 'none' is used, but - for the 3 finishings attributes, the values are enums and thus the - empty set is represented by the enum 3. Currently there are no other - attributes with 1SetOf values which can be empty and can contain - values that are not keywords. This exception requires special code - and is a potential place for bugs. It would have been better if we - had chosen an out-of-band value, either "no-value" or some new value, - such as 'none'. Since we didn't, implementations have to deal with - the different representations of 'none', depending on the attribute - syntax. - -2.15 Get-Jobs, my-jobs='true', and 'requesting-user-name'? - - In [RFC2566] section 3.2.6.1 'Get-Jobs Request', if the attribute ' - my-jobs' is present and set to TRUE, MUST the 'requesting-user-name' - attribute be there to, and if it's not present what should the IPP - printer do? - - [RFC2566] Section 8.3 describes the various cases of "requesting- - user-name" being present or not for any operation. If the client - does not supply a value for "requesting-user-name", the printer MUST - assume that the client is supplying some anonymous name, such as - "anonymous". - -2.16 The "multiple-document-handling" Job Template attribute and support - of multiple document jobs - - ISSUE: IPP/1.0 is silent on which of the four effects an - implementation would perform if it supports Create-Job, but does not - support "multiple-document-handling". - - A fix to IPP/1.0 would be to require implementing all four values of - "multiple-document-handling" if Create-Job is supported at all. Or - at least 'single-document-new-sheet' and 'separate-documents- - uncollated-copies'. In any case, an implementation that supports - Create-Job SHOULD also support "multiple-document-handling". Support - for all four values is RECOMMENDED, but at least the 'single- - document-new-sheet' and 'separate-documents-uncollated-copies' - values, along with the "multiple-document-handling-default" - indicating the default behavior and "multiple-document-handling- - supported" values. If an implementation spools the data, it should - also support the 'separate-documents-collated-copies' value as well. - - - - - -Hastings & Manros Informational [Page 54] - -RFC 2639 IPP/1.0: Implementer's Guide July 1999 - - -3 Encoding and Transport - - This section discusses various aspects of IPP/1.0 Encoding and - Transport [RFC2565]. - - A server is not required to send a response until after it has - received the client.s entire request. Hence, a client must not - expect a response until after it has sent the entire request. - However, we recommend that the server return a response as soon as - possible if an error is detected while the client is still sending - the data, rather than waiting until all of the data is received. - Therefore, we also recommend that a client listen for an error - response that an IPP server MAY send before it receives all the data. - In this case a client, if chunking the data, can send a premature - zero-length chunk to end the request before sending all the data (and - so the client can keep the connection open for other requests, rather - than closing it). If the request is blocked for some reason, a client - MAY determine the reason by opening another connection to query the - server using Get-Printer-Attributes. - - In the following sections, there are a tables of all HTTP headers - which describe their use in an IPP client or server. The following - is an explanation of each column in these tables. - - - the .header. column contains the name of a header. - - the .request/client. column indicates whether a client sends the - header. - - the .request/ server. column indicates whether a server supports - the header when received. - - the .response/ server. column indicates whether a server sends - the header. - - the .response /client. column indicates whether a client - supports the header when received. - - the .values and conditions. column specifies the allowed header - values and the conditions for the header to be present in a - request/response. - - The table for .request headers. does not have columns for responses, - and the table for .response headers. does not have columns for - requests. - - The following is an explanation of the values in the .request/client. - and .response/ server. columns. - - - must: the client or server MUST send the header, - - must-if: the client or server MUST send the header when the - condition described in the .values and conditions. column is - met, - - - -Hastings & Manros Informational [Page 55] - -RFC 2639 IPP/1.0: Implementer's Guide July 1999 - - - - may: the client or server MAY send the header - - not: the client or server SHOULD NOT send the header. It is not - relevant to an IPP implementation. - - The following is an explanation of the values in the - .response/client. and .request/ server. columns. - - - must: the client or server MUST support the header, - - may: the client or server MAY support the header - - not: the client or server SHOULD NOT support the header. It is - not relevant to an IPP implementation. - -3.1 General Headers - - - The following is a table for the general headers. - - - General- Request Response Values and Conditions - Header - - Client Server Server Client - - Cache- must not must not .no-cache. only - Control - - Connection must-if must must- must .close. only. Both - if client and server - SHOULD keep a - connection for the - duration of a sequence - of operations. The - client and server MUST - include this header - for the last operation - in such a sequence. - - Date may may must may per RFC 1123 [RFC1123] - from RFC 2068 - [RFC2068] - - Pragma must not must not .no-cache. only - - Transfer- must-if must must- must .chunked. only . - Encoding if Header MUST be present - if Content-Length is - absent. - - - - -Hastings & Manros Informational [Page 56] - -RFC 2639 IPP/1.0: Implementer's Guide July 1999 - - - Upgrade not not not not - - Via not not not not - -3.2 Request Headers - - - The following is a table for the request headers. - - - Request-Header Client Server Request Values and Conditions - - Accept may must .application/ipp. only. This - value is the default if the - - Request-Header Client Server Request Values and Conditions - - client omits it - - Accept-Charset not not Charset information is within - the application/ipp entity - - Accept-Encoding may must empty and per RFC 2068 [RFC2068] - and IANA registry for content- - codings - - Accept-Language not not language information is within - the application/ipp entity - - Authorization must-if must per RFC 2068. A client MUST send - this header when it receives a - 401 .Unauthorized. response and - does not receive a .Proxy- - Authenticate. header. - - From not not per RFC 2068. Because RFC - recommends sending this header - only with the user.s approval, it - is not very useful - - Host must must per RFC 2068 - - If-Match not not - - If-Modified- not not - Since - - If-None-Match not not - - - -Hastings & Manros Informational [Page 57] - -RFC 2639 IPP/1.0: Implementer's Guide July 1999 - - - If-Range not not - - If-Unmodified- not not - Since - - Max-Forwards not not - - Proxy- must-if not per RFC 2068. A client MUST send - Authorization this header when it receives a - 401 .Unauthorized. response and a - .Proxy-Authenticate. header. - - Range not not - - Referer not not - - User-Agent not not - - -3.3 Response Headers - - - The following is a table for the request headers. - - - Response- Server Client Response Values and Conditions - Header - - Accept-Ranges not not - - Age not not - - Location must-if may per RFC 2068. When URI needs - redirection. - - Proxy- not must per RFC 2068 - Authenticate - - Public may may per RFC 2068 - - Retry-After may may per RFC 2068 - - Server not not - - Vary not not - - Warning may may per RFC 2068 - - - - -Hastings & Manros Informational [Page 58] - -RFC 2639 IPP/1.0: Implementer's Guide July 1999 - - - WWW- must-if must per RFC 2068. When a server needs to - Authenticate authenticate a client. - -3.4 Entity Headers - - - The following is a table for the entity headers. - - - Entity-Header Request Response Values and Conditions - - Client Server Server Client - - Allow not not not not - - Content-Base not not not not - - Content- may must must must per RFC 2068 and IANA - Encoding registry for content - codings. - - Content- not not not not Application/ipp - Language handles language - - Content- must-if must must-if must the length of the - Length message-body per RFC - 2068. Header MUST be - present if Transfer- - - Entity-Header Request Response Values and Conditions - - Client Server Server Client - - Encoding is absent. - - Content- not not not not - Location - - Content-MD5 may may may may per RFC 2068 - - Content-Range not not not not - - Content-Type must must must must .application/ipp. - only - - ETag not not not not - - Expires not not not not - - - -Hastings & Manros Informational [Page 59] - -RFC 2639 IPP/1.0: Implementer's Guide July 1999 - - - Last-Modified not not not not - - -3.5 Optional support for HTTP/1.0 - - IPP implementations consist of an HTTP layer and an IPP layer. In - the following discussion, the term "client" refers to the HTTP client - layer and the term "server" refers to the HTTP server layer. The - Encoding and Transport document [RFC2565] requires that HTTP 1.1 MUST - be supported by all clients and all servers. However, a client - and/or a server implementation may choose to also support HTTP 1.0. - - - This option means that a server may choose to communicate with a - (non-conforming) client that only supports HTTP 1.0. In such cases - the server should not use any HTTP 1.1 specific parameters or - features and should respond using HTTP version number 1.0. - - - This option also means that a client may choose to communicate with - a (non-conforming) server that only supports HTTP 1.0. In such - cases, if the server responds with an HTTP .unsupported version - number. to an HTTP 1.1 request, the client should retry using HTTP - version number 1.0. - -3.6 HTTP/1.1 Chunking - -3.6.1 Disabling IPP Server Response Chunking - - Clients MUST anticipate that the HTTP/1.1 server may chunk responses - and MUST accept them in responses. However, a (non-conforming) HTTP - client that is unable to accept chunked responses may attempt to - request an HTTP 1.1 server not to use chunking in its response to an - operation by using the following HTTP header: - - TE: identity - - This mechanism should not be used by a server to disable a client - from chunking a request, since chunking of document data is an - important feature for clients to send long documents. - -3.6.2 Warning About the Support of Chunked Requests - - This section describes some problems with the use of chunked requests - and HTTP/1.1 servers. - - The HTTP/1.1 standard [HTTP] requires that conforming servers support - chunked requests for any method. However, in spite of this - requirement, some HTTP/1.1 implementations support chunked responses - in the GET method, but do not support chunked POST method requests. - - - -Hastings & Manros Informational [Page 60] - -RFC 2639 IPP/1.0: Implementer's Guide July 1999 - - - Some HTTP/1.1 implementations that support CGI scripts [CGI] and/or - servlets [Servlet] require that the client supply a Content-Length. - These implementations might reject a chunked POST method and return a - 411 status code (Length Required), might attempt to buffer the - request and run out of room returning a 413 status code (Request - Entity Too Large), or might successfully accept the chunked request. - - Because of this lack of conformance of HTTP servers to the HTTP/1.1 - standard, the IPP standard [RFC2565] REQUIRES that a conforming IPP - Printer object implementation support chunked requests and that - conforming clients accept chunked responses. Therefore, IPP object - implementers are warned to seek HTTP server implementations that - support chunked POST requests in order to conform to the IPP standard - and/or use implementation techniques that support chunked POST - requests. - -4 References - - [CGI] Coar, K. and D. Robinson, "The WWW Common Gateway Interface - Version 1.1 (CGI/1.1)", Work in Progress. - - [HTTP] Fielding, R., Gettys,J., Mogul, J., Frystyk,, H., Masinter, - L., Leach, P. and T. Berners-Lee, "Hypertext Transfer - Protocol -- HTTP/1.1", RFC 2616, June 1999. - - [RFC2569] Herriot, R., Hastings, T., Jacobs, N. and J. Martin, - "Mapping between LPD and IPP Protocols", RFC 2569, April - 1999. - - [RFC2566] deBry, R., Hastings, T., Herriot, R., Isaacson, S. and P. - Powell, "Internet Printing Protocol/1.0: Model and - Semantics", RFC 2566, April 1999. - - [RFC2565] Herriot, R., Butler, S., Moore, P. and R. Tuner, "Internet - Printing Protocol/1.0: Encoding and Transport", RFC 2565, - April 1999. - - [RFC2568] Zilles, S., "Rationale for the Structure and Model and - Protocol for the Internet Printing Protocol", RFC 2568, - April 1999. - - [RFC2567] Wright, D., "Design Goals for an Internet Printing - Protocol", RFC 2567, April 1999. - - [RFC1123] Braden, S., "Requirements for Internet Hosts - Application - and Support", STD 3, RFC 1123, October 1989. - - - - - -Hastings & Manros Informational [Page 61] - -RFC 2639 IPP/1.0: Implementer's Guide July 1999 - - - [RFC2026] Bradner, S., "The Internet Standards Process -- Revision - 3", BCP 9, RFC 2026, October 1996. - - [RFC2068] Fielding, R., Gettys, J., Mogul, J., Frystyk, H. and T. - Berners-Lee, "Hypertext Transfer Protocol -- HTTP/1.1", RFC - 2068, January 1997. - - [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate - Requirement Levels", BCP 14, RFC 2119, March 1997. - - [RFC2396] Berners-Lee, T., Fielding, R. and L. Masinter, "Uniform - Resource Identifiers (URI): Generic Syntax", RFC 2396, - August 1998. - - [Servlet] Servlet Specification Version 2.1 - (http://java.sun.com/products/servlet/2.1/index.html). - - [SSL] Netscape, The SSL Protocol, Version 3, (Text version 3.02), - November 1996. - -4.1 Authors' Addresses - - Thomas N. Hastings - Xerox Corporation - 701 Aviation Blvd. - El Segundo, CA 90245 - - EMail: hastings@cp10.es.xerox.com - - - Carl-Uno Manros - Xerox Corporation - 701 Aviation Blvd. - El Segundo, CA 90245 - - EMail: manros@cp10.es.xerox.com - -5 Security Considerations - - Security issues are discussed in sections 2.2, 2.3.1, and 8.5. - -6 Notices - - The IETF takes no position regarding the validity or scope of any - intellectual property or other rights that might be claimed to - pertain to the implementation or use of the technology described in - this document or the extent to which any license under such rights - might or might not be available; neither does it represent that it - - - -Hastings & Manros Informational [Page 62] - -RFC 2639 IPP/1.0: Implementer's Guide July 1999 - - - has made any effort to identify any such rights. Information on the - IETF's procedures with respect to rights in standards-track and - standards-related documentation can be found in BCP-11 [BCP-11]. - Copies of claims of rights made available for publication and any - assurances of licenses to be made available, or the result of an - attempt made to obtain a general license or permission for the use of - such proprietary rights by implementers or users of this - specification can be obtained from the IETF Secretariat. - - The IETF invites any interested party to bring to its attention any - copyrights, patents or patent applications, or other proprietary - rights which may cover technology that may be required to practice - this standard. Please address the information to the IETF Executive - Director. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Hastings & Manros Informational [Page 63] - -RFC 2639 IPP/1.0: Implementer's Guide July 1999 - - -Full Copyright Statement - - Copyright (C) The Internet Society (1999). All Rights Reserved. - - This document and translations of it may be copied and furnished to - others, and derivative works that comment on or otherwise explain it - or assist in its implementation may be prepared, copied, published - and distributed, in whole or in part, without restriction of any - kind, provided that the above copyright notice and this paragraph are - included on all such copies and derivative works. However, this - document itself may not be modified in any way, such as by removing - the copyright notice or references to the Internet Society or other - Internet organizations, except as needed for the purpose of - developing Internet standards in which case the procedures for - copyrights defined in the Internet Standards process must be - followed, or as required to translate it into languages other than - English. - - The limited permissions granted above are perpetual and will not be - revoked by the Internet Society or its successors or assigns. - - This document and the information contained herein is provided on an - "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING - TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING - BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION - HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF - MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - -Acknowledgement - - Funding for the RFC Editor function is currently provided by the - Internet Society. - - - - - - - - - - - - - - - - - - - -Hastings & Manros Informational [Page 64] - diff --git a/standards/rfc3196.txt b/standards/rfc3196.txt new file mode 100644 index 000000000..50b7c2d97 --- /dev/null +++ b/standards/rfc3196.txt @@ -0,0 +1,5379 @@ + + + + + + +Network Working Group T. Hastings +Request for Comments: 3196 C. Manros +Obsoletes: 2639 P. Zehler +Category: Informational Xerox Corporation + C. Kugler + IBM Printing Systems Co + H. Holst + i-data Printing Systems + November 2001 + + + Internet Printing Protocol/1.1: Implementor's Guide + +Status of this Memo + + This memo provides information for the Internet community. It does + not specify an Internet standard of any kind. Distribution of this + memo is unlimited. + +Copyright Notice + + Copyright (C) The Internet Society (2001). All Rights Reserved. + +Abstract + + This document is one of a set of documents, which together describe + all aspects of a new Internet Printing Protocol (IPP). + +Table of Contents + + 1 Introduction................................................... 4 + 1.1 Conformance language........................................ 5 + 1.2 Other terminology........................................... 6 + 1.3 Issues Raised from Interoperability Testing Events.......... 6 + 2 IPP Objects.................................................... 6 + 3 IPP Operations................................................. 7 + 3.1 Common Semantics............................................ 7 + 3.1.1 Summary of Operation Attributes............................ 8 + 3.1.2 Suggested Operation Processing Steps for IPP Objects....... 16 + 3.1.2.1 Suggested Operation Processing Steps for all Operations. 17 + 3.1.2.1.1 Validate version number............................... 18 + 3.1.2.1.2 Validate operation identifier......................... 20 + 3.1.2.1.3 Validate the request identifier....................... 20 + 3.1.2.1.4 Validate attribute group and attribute presence and + order................................................. 20 + 3.1.2.1.4.1 Validate the presence and order of attribute groups. 20 + 3.1.2.1.4.2 Ignore unknown attribute groups in the expected + position............................................ 21 + + + +Hastings, et al. Informational [Page 1] + +RFC 3196 Internet Printing Protocol/1.1 November 2001 + + + 3.1.2.1.4.3 Validate the presence of a single occurrence of + required Operation attributes....................... 21 + 3.1.2.1.5 Validate the values of the REQUIRED Operation + attributes............................................ 29 + 3.1.2.1.6 Validate the values of the OPTIONAL Operation + attributes............................................ 33 + 3.1.2.2 Suggested Additional Processing Steps for Operations + that Create/Validate Jobs and Add Documents............. 37 + 3.1.2.2.1 Default "ipp-attribute-fidelity" if not supplied...... 37 + 3.1.2.2.2 Check that the Printer object is accepting jobs....... 38 + 3.1.2.2.3 Validate the values of the Job Template attributes.... 38 + 3.1.2.3 Algorithm for job validation............................ 39 + 3.1.2.3.1 Check for conflicting Job Template attributes values.. 45 + 3.1.2.3.2 Decide whether to REJECT the request.................. 46 + 3.1.2.3.3 For the Validate-Job operation, RETURN one of the + success status codes.................................. 48 + 3.1.2.3.4 Create the Job object with attributes to support...... 48 + 3.1.2.3.5 Return one of the success status codes................ 50 + 3.1.2.3.6 Accept appended Document Content...................... 50 + 3.1.2.3.7 Scheduling and Starting to Process the Job............ 50 + 3.1.2.3.8 Completing the Job.................................... 50 + 3.1.2.3.9 Destroying the Job after completion................... 51 + 3.1.2.3.10 Interaction with "ipp-attribute-fidelity"............. 51 + 3.1.2.3.11 Character set code conversion support................. 51 + 3.1.2.3.12 What charset to return when an unsupported charset is + requested (Issue 1.19)?....... ....................... 52 + 3.1.2.3.13 Natural Language Override (NLO)....................... 53 + 3.1.3 Status codes returned by operation......................... 55 + 3.1.3.1 Printer Operations...................................... 55 + 3.1.3.1.1 Print-Job............................................. 55 + 3.1.3.1.2 Print-URI............................................. 58 + 3.1.3.1.3 Validate-Job.......................................... 58 + 3.1.3.1.4 Create-Job............................................ 58 + 3.1.3.1.5 Get-Printer-Attributes................................ 59 + 3.1.3.1.6 Get-Jobs.............................................. 60 + 3.1.3.1.7 Pause-Printer......................................... 61 + 3.1.3.1.8 Resume-Printer........................................ 62 + 3.1.3.1.8.1 What about Printers unable to change state due to + an error condition?................................. 63 + 3.1.3.1.8.2 How is "printer-state" handled on Resume-Printer?... 63 + 3.1.3.1.9 Purge-Printer......................................... 63 + 3.1.3.2 Job Operations.......................................... 64 + 3.1.3.2.1 Send-Document......................................... 64 + 3.1.3.2.2 Send-URI.............................................. 65 + 3.1.3.2.3 Cancel-Job............................................ 65 + 3.1.3.2.4 Get-Job-Attributes.................................... 67 + 3.1.3.2.5 Hold-Job.............................................. 68 + 3.1.3.2.6 Release-Job........................................... 69 + + + +Hastings, et al. Informational [Page 2] + +RFC 3196 Internet Printing Protocol/1.1 November 2001 + + + 3.1.3.2.7 Restart-Job........................................... 69 + 3.1.3.2.7.1 Can documents be added to a restarted job?.......... 69 + 3.1.4 Returning unsupported attributes in Get-Xxxx responses + (Issue 1.18)............................................... 70 + 3.1.5 Sending empty attribute groups............................. 70 + 3.2 Printer Operations.......................................... 71 + 3.2.1 Print-Job operation........................................ 71 + 3.2.1.1 Flow controlling the data portion of a Print-Job + request (Issue 1.22).................................... 71 + 3.2.1.2 Returning job-state in Print-Job response (Issue 1.30).. 71 + 3.2.2 Get-Printer-Attributes operation........................... 72 + 3.2.3 Get-Jobs operation......................................... 72 + 3.2.3.1 Get-Jobs, my-jobs='true', and 'requesting-user-name' + (Issue 1.39)?.......................................... 72 + 3.2.3.2 Why is there a "limit" attribute in the Get-Jobs + operation?.............................................. 73 + 3.2.4 Create-Job operation....................................... 73 + 3.3 Job Operations.............................................. 74 + 3.3.1 Validate-Job............................................... 74 + 3.3.2 Restart-Job................................................ 74 + 4 Object Attributes.............................................. 74 + 4.1 Attribute Syntax's.......................................... 74 + 4.1.1 The 'none' value for empty sets (Issue 1.37)............... 74 + 4.1.2 Multi-valued attributes (Issue 1.31)....................... 75 + 4.1.3 Case Sensitivity in URIs (issue 1.6)....................... 75 + 4.1.4 Maximum length for xxxWithLanguage and xxxWithoutLanguage.. 76 + 4.2 Job Template Attributes..................................... 76 + 4.2.1 multiple-document-handling(type2 keyword).................. 76 + 4.2.1.1 Support of multiple document jobs....................... 76 + 4.3 Job Description Attributes.................................. 76 + 4.3.1 Getting the date and time of day........................... 76 + 4.4 Printer Description Attributes.............................. 77 + 4.4.1 queued-job-count (integer(0:MAX)).......................... 77 + 4.4.1.1 Why is "queued-job-count" RECOMMENDED (Issue 1.14)?..... 77 + 4.4.1.2 Is "queued-job-count" a good measure of how busy a + printer is (Issue 1.15)?................................ 77 + 4.4.2 printer-current-time (dateTime)............................ 78 + 4.4.3 Printer-uri................................................ 78 + 4.5 Empty Jobs.................................................. 79 + 5 Directory Considerations....................................... 79 + 5.1 General Directory Schema Considerations..................... 79 + 5.2 IPP Printer with a DNS name................................. 79 + 6 Security Considerations........................................ 80 + 6.1 Querying jobs with IPP that were submitted using other job + submission protocols (Issue 1.32)........................... 80 + 7 Encoding and Transport......................................... 81 + 7.1 General Headers............................................. 83 + 7.2 Request Headers............................................ 84 + + + +Hastings, et al. Informational [Page 3] + +RFC 3196 Internet Printing Protocol/1.1 November 2001 + + + 7.3 Response Headers............................................ 86 + 7.4 Entity Headers............................................. 87 + 7.5 Optional support for HTTP/1.0............................... 88 + 7.6 HTTP/1.1 Chunking........................................... 88 + 7.6.1 Disabling IPP Server Response Chunking..................... 88 + 7.6.2 Warning About the Support of Chunked Requests.............. 88 + 8 References..................................................... 89 + 9 Authors' Addresses............................................. 91 + 10 Description of the Base IPP Documents.......................... 94 + 11 Full Copyright Statement....................................... 96 + +Tables + + Table 1 - Summary of Printer operation attributes that sender MUST + supply ................................................. 8 + Table 2 - Summary of Printer operation attributes that sender MAY + supply ................................................. 10 + Table 3 - Summary of Job operation attributes that sender MUST + supply.................................................. 12 + Table 4 - Summary of Job operation attributes that sender MAY + supply.................................................. 14 + Table 5 - Printer operation response attributes................... 16 + Table 6 - Examples of validating IPP version...................... 19 + Table 7 - Rules for validating single values X against Z.......... 40 + +1. Introduction + + IPP is an application level protocol that can be used for distributed + printing using Internet tools and technologies. This document + contains information that supplements the IPP Model and Semantics + [RFC2911] and the IPP Transport and Encoding [RFC2910] documents. It + is intended to help implementers understand IPP/1.1, as well as + IPP/1.0 [RFC2565, RFC2566], and some of the considerations that may + assist them in the design of their client and/or IPP object + implementation. For example, a typical order of processing requests + is given, including error checking. Motivation for some of the + specification decisions is also included. + + This document obsoletes RFC 2639 which was the Implementor's Guide + for IPP/1.0. The IPP Implementor's Guide (IIG) (this document) + contains information that supplements the IPP Model and Semantics + [RFC2911] and the IPP Transport and Encoding [RFC2910] documents. + This document is just one of a suite of documents that fully define + IPP. The base set of IPP documents includes: + + Design Goals for an Internet Printing Protocol [RFC2567] + Rationale for the Structure and Model and Protocol for the + Internet Printing Protocol [RFC2568] + + + +Hastings, et al. Informational [Page 4] + +RFC 3196 Internet Printing Protocol/1.1 November 2001 + + + Internet Printing Protocol/1.1: Model and Semantics [RFC2911] + Internet Printing Protocol/1.1: Encoding and Transport [RFC2910] + Internet Printing Protocol/1.1: Implementor's Guide (this + document) + Mapping between LPD and IPP Protocols [RFC2569] + + See section 10 for a description of these base IPP documents. Anyone + reading these documents for the first time is strongly encouraged to + read the IPP documents in the above order. + + As such the information in this document is not part of the formal + specification of IPP/1.1. Instead information is presented to help + implementers understand IPP/1.1, as well as IPP/1.0 [RFC2565, + RFC2566], including some of the motivation for decisions taken by the + committee in developing the specification. Some of the + implementation considerations are intended to help implementers + design their client and/or IPP object implementations. If there are + any contradictions between this document and [RFC2911] or [RFC2910], + those documents take precedence over this document. + + Platform-specific implementation considerations will be included in + this guide as they become known. + + Note: In order to help the reader of the IIG and the IPP Model and + Semantics document, the sections in this document parallel the + corresponding sections in the Model document and are numbered the + same for ease of cross reference. The sections that correspond to + the IPP Transport and Encoding are correspondingly offset. + +1.1 Conformance language + + Usually, this document does not contain the terminology MUST, MUST + NOT, MAY, NEED NOT, SHOULD, SHOULD NOT, REQUIRED, and OPTIONAL. + However, when those terms do appear in this document, their intent is + to repeat what the [RFC2911] and [RFC2910] documents require and + allow, rather than specifying additional conformance requirements. + These terms are defined in section 12 on conformance terminology in + [RFC2911], most of which is taken from RFC 2119 [RFC2119]. + + Implementers should read section 12 (APPENDIX A) in [RFC2911] in + order to understand these capitalized words. The words MUST, MUST + NOT, and REQUIRED indicate what implementations are required to + support in a client or IPP object in order to be conformant to + [RFC2911] and [RFC2910]. MAY, NEED NOT, and OPTIONAL indicate was is + merely allowed as an implementer option. The verbs SHOULD and SHOULD + NOT indicate suggested behavior, but which is not required or + disallowed, respectively, in order to conform to the specification. + + + + +Hastings, et al. Informational [Page 5] + +RFC 3196 Internet Printing Protocol/1.1 November 2001 + + +1.2 Other terminology + + This document uses other terms, such as "attributes", "operation", + and "Printer" as defined in [RFC2911] section 12. In addition, the + term "sender" refers to the client that sends a request or an IPP + object that returns a response. The term "receiver" refers to the + IPP object that receives a request and to a client that receives a + response. + +1.3 Issues Raised from Interoperability Testing Events + + The IPP WG has conducted three open Interoperability Testing Events. + The first one was held in September 1998, the second one was held in + March 1999, and the third one was held in October 2000. See the + summary reports in: + + ftp://ftp.pwg.org/pub/pwg/ipp/new_TES/ + + The issues raised from the first Interoperability Testing Event are + numbered 1.n in this document and have been incorporated into + "IPP/1.0 Model and Semantics" [RFC2566] and the "IPP/1.0 Encoding and + Transport" [RFC2565] documents. However, some of the discussion is + left here in the Implementor's Guide to help understanding. + + The issues raised from the second Interoperability Testing Event are + numbered 2.n in this document have been incorporated into "IPP/1.1 + Model and Semantics" [RFC2911] and the "IPP/1.1 Encoding and + Transport" [RFC2910] documents. However, some of the discussion is + left here in the Implementor's Guide to help understanding. + + The issues raised from the third Interoperability Testing Event are + numbered 3.n in this document and are described in: + + ftp://ftp.pwg.org/pub/pwg/ipp/Issues/Issues-raised-at-Bake- + Off3.pdf + + ftp://ftp.pwg.org/pub/pwg/ipp/Issues/Issues-raised-at-Bake- + Off3.doc + + ftp://ftp.pwg.org/pub/pwg/ipp/Issues/Issues-raised-at-Bake- + Off3.txt + + + + + + + + + + +Hastings, et al. Informational [Page 6] + +RFC 3196 Internet Printing Protocol/1.1 November 2001 + + +2. IPP Objects + + The term "client" in IPP is intended to mean any client that issues + IPP operation requests and accepts IPP operation responses, whether + it be a desktop or a server. In other words, the term "client" does + not just mean end-user clients, such as those associated with + desktops. + + The term "IPP Printer" in IPP is intended to mean an object that + accepts IPP operation requests and returns IPP operation responses, + whether implemented in a server or a device. An IPP Printer object + MAY, if implemented in a server, turn around and forward received + jobs (and other requests) to other devices and print + servers/services, either using IPP or some other protocol. + +3 IPP Operations + + This section corresponds to Section 3 "IPP Operations" in the + IPP/1.1 Model and Semantics document [RFC2911]. + +3.1 Common Semantics + + This section discusses semantics common to all operations. + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Hastings, et al. Informational [Page 7] + +RFC 3196 Internet Printing Protocol/1.1 November 2001 + + +3.1.1 Summary of Operation Attributes + + Table 1 - Summary of Printer operation attributes that sender MUST + supply + +Printer Operations + + Requests Responses + Operation PJ, PU CJ GPA GJ PP, All + Attributes VJ (O) (O) (R) (R) RP, Operations + (R) PP + (O+) + + Operation parameters--REQUIRED to be supplied by the sender: + + operation-id R R R R R R + + status-code R + + request-id R R R R R R R + + version-number R R R R R R R + + Operation attributes--REQUIRED to be supplied by the sender: + + attributes- R R R R R R R + charset + + attributes- R R R R R R R + natural- + language + + document-uri R + + job-id* + + job-uri* + + + + + + + + + + + + + + +Hastings, et al. Informational [Page 8] + +RFC 3196 Internet Printing Protocol/1.1 November 2001 + + +Printer Operations + + Requests Responses + + Operation PJ, PU CJ GPA GJ PP, All + Attributes VJ (O) (O) (R) (R) RP, Operations + (R) PP + (O+) + last-document + + printer-uri R R R R R R + + Operation attributes--RECOMMENDED to be supplied by the + sender: + + job-name R R R + + requesting-user- R R R R R R + name + + Legend: + + PJ, VJ: Print-Job, Validate-Job + PU: Print-URI + CJ: Create-Job + GPA: Get-Printer-Attributes + GJ: Get-Jobs + PP, RP, PP: Pause-Printer, Resume-Printer, Purge-Printer + R indicates a REQUIRED operation that MUST be supported by the IPP + object (Printer or Job). For attributes, R indicates that the + attribute MUST be supported by the IPP object that supports the + associated operation. + O indicates an OPTIONAL operation or attribute that MAY be supported + by the IPP object (Printer or Job). + + indicates that this is not an IPP/1.0 feature, but is only a part + of IPP/1.1 and future versions of IPP. + + + + + + + + + + + + + + + +Hastings, et al. Informational [Page 9] + +RFC 3196 Internet Printing Protocol/1.1 November 2001 + + + Table 2 - Summary of Printer operation attributes that sender MAY + supply + +Printer Operations + + Requests Respon- + ses + Operation Attributes PJ, PU CJ GPA GJ PP, All + VJ (O) (O) (R) (R) RP, Opera + (R) PP tions + (O+) + + Operation attributes--OPTIONAL to be supplied by the sender: + + status-message O + + detailed-status- O + message + + document-access- O** + error + + compression R R + + document-format R R R + + document-name O O + + document-natural- O O + language + + ipp-attribute- R R R + fidelity + + job-impressions O O O + + job-k-octets O O O + + job-media-sheets O O O + + + + + + + + + + + + +Hastings, et al. Informational [Page 10] + +RFC 3196 Internet Printing Protocol/1.1 November 2001 + + +Printer Operations + + Requests Respon- + ses + Operation Attributes PJ, PU CJ GPA GJ PP, All + VJ (O) (O) (R) (R) RP, Opera + (R) PP tions + (O+) + + limit R + + message + + my-jobs R + + requested-attributes R R + + which-jobs R + + Legend: + + PJ, VJ: Print-Job, Validate-Job + PU: Print-URI + CJ: Create-Job + GPA: Get-Printer-Attributes + GJ: Get-Jobs + PP, RP, PP: Pause-Printer, Resume-Printer, Purge-Printer + R indicates a REQUIRED operation that MUST be supported by the IPP + object (Printer or Job). For attributes, R indicates that the + attribute MUST be supported by the IPP object that supports the + associated operation. + O indicates an OPTIONAL operation or attribute that MAY be supported + by the IPP object (Printer or Job). + + indicates that this is not an IPP/1.0 feature, but is only a part + of IPP/1.1 and future versions of IPP. + * "job-id" is REQUIRED only if used together with "printer-uri" to + identify the target job; otherwise, "job-uri" is REQUIRED. + ** "document-access-error" applies to the Print-URI response only. + + + + + + + + + + + + + +Hastings, et al. Informational [Page 11] + +RFC 3196 Internet Printing Protocol/1.1 November 2001 + + + Table 3 - Summary of Job operation attributes that sender MUST supply + +Job Operations + + Requests Responses + Operation SD SU CJ GJA HJ All + Attributes (O) (O) (R) (R) RJ, RJ Opera- + (O+) tions + + Operation parameters--REQUIRED to be supplied by the sender: + + operation-id R R R R R + + status-code R + + request-id R R R R R R + + version-number R R R R R R + + Operation attributes--REQUIRED to be supplied by the sender: + + attributes-charset R R R R R R + + attributes-natural- R R R R R R + language + + document-uri R + + job-id* R R R R R + + job-uri* R R R R R + + last-document R R + + printer-uri R R R R R + + Operation attributes--RECOMMENDED to be supplied by the sender: + + job-name + + + + + + + + + + + + +Hastings, et al. Informational [Page 12] + +RFC 3196 Internet Printing Protocol/1.1 November 2001 + + +Job Operations + + Requests Responses + + Operation SD SU CJ GJA HJ All + Attributes (O) (O) (R) (R) RJ, RJ Opera- + (O+) tions + + requesting-user- R R R R R + name + + Legend: + + SD: Send-Document + SU: Send-URI + CJ: Cancel-Job + GJA: Get-Job-Attributes + HJ, RJ, RJ: Hold-Job, Release-Job, Restart-Job + R indicates a REQUIRED operation that MUST be supported by the IPP + object (Printer or Job). For attributes, R indicates that the + attribute MUST be supported by the IPP object that supports the + associated operation. + O indicates an OPTIONAL operation or attribute that MAY be supported + by the IPP object (Printer or Job). + + indicates that this is not an IPP/1.0 feature, but is only a part + of IPP/1.1 and future versions of IPP. + * "job-id" is REQUIRED only if used together with "printer-uri" to + identify the target job; otherwise, "job-uri" is REQUIRED. + + + + + + + + + + + + + + + + + + + + + + + +Hastings, et al. Informational [Page 13] + +RFC 3196 Internet Printing Protocol/1.1 November 2001 + + + Table 4 - Summary of Job operation attributes that sender MAY supply + +Job Operations + + Requests Responses + + Operation SD SU CJ GJA HJ, SD All + Attributes (O) (O) (R) (R) RJ, (O) Opera- + RJ tions + (O+) + + Operation attributes--OPTIONAL to be supplied by the sender: + + status-message O + + detailed-status- O + message + + document-access- O** + error + + compression R R + + document-format R R + + document-name O O + + document-natural- O O + language + + ipp-attribute- + fidelity + + job-impressions + + job-k-octets + + job-media-sheets + + + + + + + + + + + + + +Hastings, et al. Informational [Page 14] + +RFC 3196 Internet Printing Protocol/1.1 November 2001 + + +Job Operations + + Requests Responses + + Operation SD SU CJ GJA HJ, SD All + Attributes (O) (O) (R) (R) RJ, (O) Opera- + RJ tions + (O+) + + limit + + message O O O + + job-hold-until R + + my-jobs + + requested- R + attributes + + which-jobs + + Legend: + + SD: Send-Document + SU: Send-URI + CJ: Cancel-Job + GJA: Get-Job-Attributes + HJ, RJ, RJ: Hold-Job, Release-Job, Restart-Job + R indicates a REQUIRED operation that MUST be supported by the IPP + object (Printer or Job). For attributes, R indicates that the + attribute MUST be supported by the IPP object that supports the + associated operation. + O indicates an OPTIONAL operation or attribute that MAY be supported + by the IPP object (Printer or Job). + + indicates that this is not an IPP/1.0 feature, but is only a part + of IPP/1.1 and future versions of IPP. + * "job-id" is REQUIRED only if used together with "printer-uri" to + identify the target job; otherwise, "job-uri" is REQUIRED. + ** "document-access-error" applies to the Send-URI operation only + + + + + + + + + + + +Hastings, et al. Informational [Page 15] + +RFC 3196 Internet Printing Protocol/1.1 November 2001 + + + Table 5 - Printer operation response attributes + +Printer Operations + + Response + + Operation PJ (R) VJ (R) PU (O) CJ (O) GPA GJ (R) PP, + Attributes SD (O) SU (O) (R) RP, PP + (O+) + + job-uri R R R + + job-id R R R + + job-state R R R + + job-state- R+ R+ R+ + reasons + + number-of- O O O + intervening- + jobs + + document- O + access- + error+ + + Legend: + + PJ, SJ: Print-Job, Send-Document + VJ: Validate-Job + PU, SU: Print-URI, Send-URI + CJ: Create-Job + GPA: Get-Printer-Attributes + GJ: Get-Jobs + PP, RP, PP: Pause-Printer, Resume-Printer, Purge-Printer + R indicates a REQUIRED operation that MUST be supported by the IPP + object (Printer or Job). For attributes, R indicates that the + attribute MUST be supported by the IPP object that supports the + associated operation. + O indicates an OPTIONAL operation or attribute that MAY be supported + by the IPP object (Printer or Job). + +3.1.2 Suggested Operation Processing Steps for IPP Objects + + This section suggests the steps and error checks that an IPP object + MAY perform when processing requests and returning responses. An IPP + object MAY perform some or all of the error checks. However, some + + + +Hastings, et al. Informational [Page 16] + +RFC 3196 Internet Printing Protocol/1.1 November 2001 + + + implementations MAY choose to be more forgiving than the error checks + shown here, in order to be able to accept requests from non- + conforming clients. Not performing all of these error checks is a + so-called "forgiving" implementation. On the other hand, clients + that successfully submit requests to IPP objects that do perform all + the error checks will be more likely to be able to interoperate with + other IPP object implementations. Thus an implementer of an IPP + object needs to decide whether to be a "forgiving" or a "strict" + implementation. Therefore, the error status codes returned may + differ between implementations. Consequentially, client SHOULD NOT + expect exactly the error code processing described in this section. + + When an IPP object receives a request, the IPP object either accepts + or rejects the request. In order to determine whether or not to + accept or reject the request, the IPP object SHOULD execute the + following steps. The order of the steps may be rearranged and/or + combined, including making one or multiple passes over the request. + + A client MUST supply requests that would pass all of the error checks + indicated here in order to be a conforming client. Therefore, a + client SHOULD supply requests that are conforming, in order to avoid + being rejected by some IPP object implementations and/or risking + different semantics by different implementations of forgiving + implementations. For example, a forgiving implementation that + accepts multiple occurrences of the same attribute, rather than + rejecting the request might use the first occurrences, while another + might use the last occurrence. Thus such a non-conforming client + would get different results from the two forgiving implementations. + + In the following, processing continues step by step until a "RETURNS + the xxx status code ..." statement is encountered. Error returns are + indicated by the verb: "REJECTS". Since clients have difficulty + getting the status code before sending all of the document data in a + Print-Job request, clients SHOULD use the Validate-Job operation + before sending large documents to be printed, in order to validate + whether the IPP Printer will accept the job or not. + + It is assumed that security authentication and authorization has + already taken place at a lower layer. + +3.1.2.1 Suggested Operation Processing Steps for all Operations + + This section is intended to apply to all operations. The next + section contains the additional steps for the Print-Job, Validate- + Job, Print-URI, Create-Job, Send-Document, and Send-URI operations + that create jobs, adds documents, and validates jobs. + + + + + +Hastings, et al. Informational [Page 17] + +RFC 3196 Internet Printing Protocol/1.1 November 2001 + + + IIG Sect # Flow IPP error status codes + ---------- ---- ---------------------- + | + v err + 3.1.2.1.1 <Validate version> --> server-error-version-not- + supported + ok| + v err + 3.1.2.1.2 <Validate operation> --> server-error-operation-not- + supported + ok| + v err + 3.1.2.1.4.1- <Validate presence> --> client-error-bad-request + 3.1.2.1.4.2 <of attributes> + ok| + v err + 3.1.2.1.4.3 <Validate presence> --> client-error-bad-request + <of operation attr> + ok| + v err + 3.1.2.1.5 <Validate values of> --> client-error-bad-request + <operation attrs> client-error-request-value- + too-long + <(length, tag, range,> + <multi-value)> + ok| + v err + 3.1.2.1.5 <Validate values> --> client-error-bad-request + <with supported values> client-error-charset-not- + supported + ok| client-error-attributes-or- + values- + | not-supported + v err + 3.1.2.1.6 <Validate optionally> --> client-error-bad-request + <operation attr> client-error-natural-language- + not-supported + | client-error-request-value- + too-long + | client-error-attributes-or- + values-not-supported + +3.1.2.1.1 Validate version number + + Every request and every response contains the "version-number" + attribute. The value of this attribute is the major and minor + version number of the syntax and semantics that the client and IPP + object is using, respectively. The "version-number" attribute + + + +Hastings, et al. Informational [Page 18] + +RFC 3196 Internet Printing Protocol/1.1 November 2001 + + + remains in a fixed position across all future versions so that all + clients and IPP object that support future versions can determine + which version is being used. The IPP object checks to see if the + major version number supplied in the request is supported. If not, + the Printer object REJECTS the request and RETURNS the 'server- + error-version-not-supported' status code in the response. The IPP + object returns in the "version-number" response attribute the major + and minor version for the error response. Thus the client can learn + at least one major and minor version that the IPP object supports. + The IPP object is encouraged to return the closest version number to + the one supplied by the client. + + The checking of the minor version number is implementation dependent, + however if the client-supplied minor version is explicitly supported, + the IPP object MUST respond using that identical minor version + number. If the major version number matches, but the minor version + number does not, the Printer SHOULD accept and attempt to process the + request, or MAY reject the request and return the 'server-error- + version-not-supported' status code. In all cases, the Printer MUST + return the nearest version number that it supports. For example, + suppose that an IPP/1.2 Printer supports versions '1.1' and '1.2'. + The following responses are conforming: + + Table 6 - Examples of validating IPP version + + Client supplies Printer Accept Request? Printer returns + + + 1.0 yes (SHOULD) 1.1 + + 1.0 no (SHOULD NOT) 1.1 + + 1.1 yes (MUST) 1.1 + + 1.2 yes (MUST) 1.2 + + 1.3 yes (SHOULD) 1.2 + + 1.3 no (SHOULD NOT) 1.2 + + It is advantageous for Printers to support both IPP/1.1 and IPP/1.0, + so that they can interoperate with either client implementations. + Some implementations may allow an Administrator to explicitly disable + support for one or the other by setting the "ipp-versions-supported" + Printer description attribute. + + + + + + +Hastings, et al. Informational [Page 19] + +RFC 3196 Internet Printing Protocol/1.1 November 2001 + + + Likewise, it is advantageous for clients to support both versions to + allow interoperability with new and legacy Printers. + +3.1.2.1.2 Validate operation identifier + + The Printer object checks to see if the "operation-id" attribute + supplied by the client is supported as indicated in the Printer + object's "operations-supported" attribute. If not, the Printer + REJECTS the request and returns the 'server-error-operation-not- + supported' status code in the response. + +3.1.2.1.3 Validate the request identifier + + The Printer object SHOULD NOT check to see if the "request-id" + attribute supplied by the client is in range: between 1 and 2**31 - 1 + (inclusive), but copies all 32 bits. + + Note: The "version-number", "operation-id", and the "request-id" + parameters are in fixed octet positions in the IPP/1.1 encoding. The + "version-number" parameter will be the same fixed octet position in + all versions of the protocol. These fields are validated before + proceeding with the rest of the validation. + +3.1.2.1.4 Validate attribute group and attribute presence and order + + The order of the following validation steps depends on + implementation. + +3.1.2.1.4.1 Validate the presence and order of attribute groups + + Client requests and IPP object responses contain attribute groups + that Section 3 requires to be present and in a specified order. An + IPP object verifies that the attribute groups are present and in the + correct order in requests supplied by clients (attribute groups + without an * in the following tables). + + If an IPP object receives a request with (1) required attribute + groups missing, or (2) the attributes groups are out of order, or (3) + the groups are repeated, the IPP object REJECTS the request and + RETURNS the 'client-error-bad-request' status code. For example, it + is an error for the Job Template Attributes group to occur before the + Operation Attributes group, for the Operation Attributes group to be + omitted, or for an attribute group to occur more than once, except in + the Get-Jobs response. + + Since this kind of attribute group error is most likely to be an + error detected by a client developer rather than by a customer, the + IPP object NEED NOT return an indication of which attribute group was + + + +Hastings, et al. Informational [Page 20] + +RFC 3196 Internet Printing Protocol/1.1 November 2001 + + + in error in either the Unsupported Attributes group or the Status + Message. Also, the IPP object NEED NOT find all attribute group + errors before returning this error. + +3.1.2.1.4.2 Ignore unknown attribute groups in the expected position + + Future attribute groups may be added to the specification at the end + of requests just before the Document Content and at the end of + response, except for the Get-Jobs response, where it maybe there or + before the first job attributes returned. If an IPP object receives + an unknown attribute group in these positions, it ignores the entire + group, rather than returning an error, since that group may be a new + group in a later minor version of the protocol that can be ignored. + (If the new attribute group cannot be ignored without confusing the + client, the major version number would have been increased in the + protocol document and in the request). If the unknown group occurs + in a different position, the IPP object REJECTS the request and + RETURNS the 'client-error-bad-request' status code. + + Clients also ignore unknown attribute groups returned in a response. + + Note: By validating that requests are in the proper form, IPP + objects force clients to use the proper form which, in turn, + increases the chances that customers will be able to use such clients + from multiple vendors with IPP objects from other vendors. + +3.1.2.1.4.3 Validate the presence of a single occurrence of required + Operation attributes + + Client requests and IPP object responses contain Operation attributes + that [RFC2911] Section 3 requires to be present. Attributes within a + group may be in any order, except for the ordering of target, + charset, and natural languages attributes. These attributes MUST be + first, and MUST be supplied in the following order: charset, natural + language, and then target. An IPP object verifies that the + attributes that Section 4 requires to be supplied by the client have + been supplied in the request (attributes without an * in the + following tables). An asterisk (*) indicates groups and Operation + attributes that the client may omit in a request or an IPP object may + omit in a response. + + If an IPP object receives a request with required attributes missing + or repeated from a group or in the wrong position, the behavior of + the IPP object is IMPLEMENTATION DEPENDENT. Some of the possible + implementations are: + + REJECTS the request and RETURNS the 'client-error-bad-request' + status code + + + +Hastings, et al. Informational [Page 21] + +RFC 3196 Internet Printing Protocol/1.1 November 2001 + + + accepts the request and uses the first occurrence of the attribute + no matter where it is + + accepts the request and uses the last occurrence of the attribute + no matter where it is + + accept the request and assume some default value for the missing + attribute + + Therefore, client MUST send conforming requests, if they want to + receive the same behavior from all IPP object implementations. For + example, it is an error for the "attributes-charset" or "attributes- + natural-language" attribute to be omitted in any operation request, + or for an Operation attribute to be supplied in a Job Template group + or a Job Template attribute to be supplied in an Operation Attribute + group in a create request. It is also an error to supply the + "attributes-charset" attribute twice. + + Since these kinds of attribute errors are most likely to be detected + by a client developer rather than by a customer, the IPP object NEED + NOT return an indication of which attribute was in error in either + the Unsupported Attributes group or the Status Message. Also, the + IPP object NEED NOT find all attribute errors before returning this + error. + + The following tables list all the attributes for all the operations + by attribute group in each request and each response. The order of + the groups is the order that the client supplies the groups as + specified in [RFC2911] Section 3. The order of the attributes within + a group is arbitrary, except as noted for some of the special + operation attributes (charset, natural language, and target). The + tables below use the following notation: + + R indicates a REQUIRED attribute or operation that an IPP + object MUST support + O indicates an OPTIONAL attribute or operation that an IPP + object NEED NOT support + * indicates that a client MAY omit the attribute in a request + and that an IPP object MAY omit the attribute in a response. + The absence of an * means that a client MUST supply the + attribute in a request and an IPP object MUST supply the + attribute in a response. + + indicates that this is not a IPP/1.0 operation, but is only + a part of IPP/1.1 and future versions of IPP. + + + + + + + +Hastings, et al. Informational [Page 22] + +RFC 3196 Internet Printing Protocol/1.1 November 2001 + + + Operation Requests + + The tables below show the attributes in their proper attribute groups + for operation requests: + + Note: All operation requests contain "version-number", "operation- + id", and "request-id" parameters. + + Print-Job Request (R): + Group 1: Operation Attributes (R) + attributes-charset (R) + attributes-natural-language (R) + printer-uri (R) + requesting-user-name (R*) + job-name (R*) + ipp-attribute-fidelity (R*) + document-name (R*) + document-format (R*) + document-natural-language (O*) + compression (R*) + job-k-octets (O*) + job-impressions (O*) + job-media-sheets (O*) + Group 2: Job Template Attributes (R*) + <Job Template attributes> (O*) + (see [RFC2911] Section 4.2) + Group 3: Document Content (R) + <document content> + + Validate-Job Request (R): + Group 1: Operation Attributes (R) + attributes-charset (R) + attributes-natural-language (R) + printer-uri (R) + requesting-user-name (R*) + job-name (R*) + ipp-attribute-fidelity (R*) + document-name (R*) + document-format (R*) + document-natural-language (O*) + compression (R*) + job-k-octets (O*) + job-impressions (O*) + job-media-sheets (O*) + Group 2: Job Template Attributes (R*) + <Job Template attributes> (O*) + (see [RFC2911] Section 4.2) + + + + +Hastings, et al. Informational [Page 23] + +RFC 3196 Internet Printing Protocol/1.1 November 2001 + + + Print-URI Request (O): + Group 1: Operation Attributes (R) + attributes-charset (R) + attributes-natural-language (R) + printer-uri (R) + document-uri (R) + requesting-user-name (R*) + job-name (R*) + ipp-attribute-fidelity (R*) + document-name (R*) + document-format (R*) + document-natural-language (O*) + compression (R*) + job-k-octets (O*) + job-impressions (O*) + job-media-sheets (O*) + Group 2: Job Template Attributes (R*) + <Job Template attributes> (O*) (see + (see [RFC2911] Section 4.2) + + Create-Job Request (O): + Group 1: Operation Attributes (R) + attributes-charset (R) + attributes-natural-language (R) + printer-uri (R) + requesting-user-name (R*) + job-name (R*) + ipp-attribute-fidelity (R*) + job-k-octets (O*) + job-impressions (O*) + job-media-sheets (O*) + Group 2: Job Template Attributes (R*) + <Job Template attributes> (O*) (see + (see [RFC2911] Section 4.2) + + Get-Printer-Attributes Request (R): + Group 1: Operation Attributes (R) + attributes-charset (R) + attributes-natural-language (R) + printer-uri (R) + requesting-user-name (R*) + requested-attributes (R*) + document-format (R*) + + Get-Jobs Request (R): + Group 1: Operation Attributes (R) + attributes-charset (R) + attributes-natural-language (R) + + + +Hastings, et al. Informational [Page 24] + +RFC 3196 Internet Printing Protocol/1.1 November 2001 + + + printer-uri (R) + requesting-user-name (R*) + limit (R*) + requested-attributes (R*) + which-jobs (R*) + my-jobs (R*) + + Send-Document Request (O): + Group 1: Operation Attributes (R) + attributes-charset (R) + attributes-natural-language (R) + (printer-uri & job-id) | job-uri (R) + last-document (R) + requesting-user-name (R*) + document-name (R*) + document-format (R*) + document-natural-language (O*) + compression (R*) + Group 2: Document Content (R*) + <document content> + + Send-URI Request (O): + Group 1: Operation Attributes (R) + attributes-charset (R) + attributes-natural-language (R) + (printer-uri & job-id) | job-uri (R) + last-document (R) + document-uri (R) + requesting-user-name (R*) + document-name (R*) + document-format (R*) + document-natural-language (O*) + compression (R*) + + Cancel-Job Request (R): + Release-Job Request (O+): + Group 1: Operation Attributes (R) + attributes-charset (R) + attributes-natural-language (R) + (printer-uri & job-id) | job-uri (R) + requesting-user-name (R*) + message (O*) + + + + + + + + + +Hastings, et al. Informational [Page 25] + +RFC 3196 Internet Printing Protocol/1.1 November 2001 + + + Get-Job-Attributes Request (R): + Group 1: Operation Attributes (R) + attributes-charset (R) + attributes-natural-language (R) + (printer-uri & job-id) | job-uri (R) + requesting-user-name (R*) + requested-attributes (R*) + + Pause-Printer Request (O+): + Resume-Printer Request (O+): + Purge-Printer Request (O+): + Group 1: Operation Attributes (R) + attributes-charset (R) + attributes-natural-language (R) + printer-uri (R) + requesting-user-name (R*) + + Hold-Job Request (O+): + Restart-Job Request (O+): + Group 1: Operation Attributes (R) + attributes-charset (R) + attributes-natural-language (R) + (printer-uri & job-id) | job-uri (R) + requesting-user-name (R*) + job-hold-until (R*) + message (O*) + + Operation Responses + + The tables below show the response attributes in their proper + attribute groups for responses. + + Note: All operation responses contain "version-number", "status- + code", and "request-id" parameters. + + Print-Job Response (R): + Create-Job Response (O): + Send-Document Response (O): + Group 1: Operation Attributes (R) + attributes-charset (R) + attributes-natural-language (R) + status-message (O*) + detailed-status-message (O*) + Group 2: Unsupported Attributes (R*) (see Note 3) + n <unsupported attributes> (R*) + Group 3: Job Object Attributes(R*) (see Note 2) + job-uri (R) + job-id (R) + + + +Hastings, et al. Informational [Page 26] + +RFC 3196 Internet Printing Protocol/1.1 November 2001 + + + job-state (R) + job-state-reasons (O* | R+) + job-state-message (O*) + number-of-intervening-jobs (O*) + + Validate-Job Response (R): + Cancel-Job Response (R): + Hold-Job Response (O+): + Release-Job Response (O+): + Restart-Job Response (O+): + Group 1: Operation Attributes (R) + attributes-charset (R) + attributes-natural-language (R) + status-message (O*) + detailed-status-message (O*) + Group 2: Unsupported Attributes (R*) (see Note 3) + <unsupported attributes> (R*) + + Print-URI Response (O): + Send-URI Response (O): + Group 1: Operation Attributes (R) + attributes-charset (R) + attributes-natural-language (R) + status-message (O*) + detailed-status-message (O*) + document-access-error (O*) + Group 2: Unsupported Attributes (R*) (see Note 3) + <unsupported attributes> (R*) + Group 3: Job Object Attributes(R*) (see Note 2) + job-uri (R) + job-id (R) + job-state (R) + job-state-reasons (O* | R+) + job-state-message (O*) + number-of-intervening-jobs (O*) + + Get-Printer-Attributes Response (R): + Group 1: Operation Attributes (R) + attributes-charset (R) + attributes-natural-language (R) + status-message (O*) + detailed-status-message (O*) + Group 2: Unsupported Attributes (R*) (see Note 4) + <unsupported attributes> (R*) + Group 3: Printer Object Attributes(R*) (see Note 2) + <requested attributes> (R*) + + + + + +Hastings, et al. Informational [Page 27] + +RFC 3196 Internet Printing Protocol/1.1 November 2001 + + + Get-Jobs Response (R): + Group 1: Operation Attributes (R) + attributes-charset (R) + attributes-natural-language (R) + status-message (O*) + detailed-status-message (O*) + Group 2: Unsupported Attributes (R*) (see Note 4) + <unsupported attributes> (R*) + Group 3: Job Object Attributes(R*) (see Note 2, 5) + <requested attributes> (R*) + + Get-Job-Attributes Response (R): + Group 1: Operation Attributes (R) + attributes-charset (R) + attributes-natural-language (R) + status-message (O*) + detailed-status-message (O*) + Group 2: Unsupported Attributes (R*) (see Note 4) + <unsupported attributes> (R*) + Group 3: Job Object Attributes(R*) (see Note 2) + <requested attributes> (R*) + + Pause-Printer Response (O+): + Resume-Printer Response (O+): + Purge-Printer Response (O+): + Group 1: Operation Attributes (R) + attributes-charset (R) + attributes-natural-language (R) + status-message (O*) + detailed-status-message (O*) + Group 2: Unsupported Attributes (R*) (see Note 4) + <unsupported attributes> (R*) + + Note 2 - the Job Object Attributes and Printer Object Attributes are + returned only if the IPP object returns one of the success status + codes. + + Note 3 - the Unsupported Attributes Group is present only if the + client included some Operation and/or Job Template attributes or + values that the Printer doesn't support whether a success or an error + return. + + Note 4 - the Unsupported Attributes Group is present only if the + client included some Operation attributes that the Printer doesn't + support whether a success or an error return. + + + + + + +Hastings, et al. Informational [Page 28] + +RFC 3196 Internet Printing Protocol/1.1 November 2001 + + + Note 5: for the Get-Jobs operation the response contains a separate + Job Object Attributes group 3 to N containing requested-attributes + for each job object in the response. + +3.1.2.1.5 Validate the values of the REQUIRED Operation attributes + + An IPP object validates the values supplied by the client of the + REQUIRED Operation attribute that the IPP object MUST support. The + next section specifies the validation of the values of the OPTIONAL + Operation attributes that IPP objects MAY support. + + The IPP object performs the following syntactic validation checks of + each Operation attribute value: + + a) that the length of each Operation attribute value is correct + for the attribute syntax tag supplied by the client according + to [RFC2911] Section 4.1, + + b) that the attribute syntax tag is correct for that Operation + attribute according to [RFC2911] Section 3, + + c) that the value is in the range specified for that Operation + attribute according to [RFC2911] Section 3, + + d) that multiple values are supplied by the client only for + operation attributes that are multi-valued, i.e., that are + 1setOf X according to [RFC2911] Section 3. + + If any of these checks fail, the IPP object REJECTS the request and + RETURNS the 'client-error-bad-request' or the 'client-error-request- + value-too-long' status code. Since such an error is most likely to + be an error detected by a client developer, rather than by an end- + user, the IPP object NEED NOT return an indication of which attribute + had the error in either the Unsupported Attributes Group or the + Status Message. The description for each of these syntactic checks + is explicitly expressed in the first IF statement in the following + table. + + In addition, the IPP object checks each Operation attribute value + against some Printer object attribute or some hard-coded value if + there is no "xxx-supported" Printer object attribute defined. If its + value is not among those supported or is not in the range supported, + then the IPP object REJECTS the request and RETURNS the error status + code indicated in the table by the second IF statement. If the value + of the Printer object's "xxx-supported" attribute is 'no-value' + (because the system administrator hasn't configured a value), the + check always fails. + + + + +Hastings, et al. Informational [Page 29] + +RFC 3196 Internet Printing Protocol/1.1 November 2001 + + + ----------------------------------------------- + + attributes-charset (charset) + + IF NOT a single non-empty 'charset' value, REJECT/RETURN 'client- + error-bad-request'. + + IF the value length is greater than 63 octets, REJECT/RETURN + 'client-error-request-value-too-long'. + + IF NOT in the Printer object's "charset-supported" attribute, + REJECT/RETURN "client-error-charset-not-supported". + + attributes-natural-language(naturalLanguage) + + IF NOT a single non-empty 'naturalLanguage' value, REJECT/RETURN + 'client-error-bad-request'. + + IF the value length is greater than 63 octets, REJECT/RETURN + 'client-error-request-value-too-long'. + + ACCEPT the request even if not a member of the set in the Printer + object's "generated-natural-language-supported" attribute. If the + supplied value is not a member of the Printer object's + "generated-natural-language-supported" attribute, use the Printer + object's "natural-language- configured" value. + + requesting-user-name + + IF NOT a single 'name' value, REJECT/RETURN 'client-error-bad- + request'. + + IF the value length is greater than 255 octets, REJECT/RETURN + 'client-error-request-value-too-long'. + + IF the IPP object can obtain a better-authenticated name, use it + instead. + + job-name(name) + + IF NOT a single 'name' value, REJECT/RETURN 'client-error-bad- + request'. + + IF the value length is greater than 255 octets, REJECT/RETURN + 'client-error-request-value-too-long'. + + IF NOT supplied by the client, the Printer object creates a name + from the document-name or document-uri. + + + +Hastings, et al. Informational [Page 30] + +RFC 3196 Internet Printing Protocol/1.1 November 2001 + + + document-name (name) + + IF NOT a single 'name' value, REJECT/RETURN 'client-error-bad- + request'. + + IF the value length is greater than 255 octets, REJECT/RETURN + 'client-error-request-value-too-long'. + + ipp-attribute-fidelity (boolean) + + IF NEITHER a single 'true' NOR a single 'false' 'boolean' value, + REJECT/RETURN 'client-error-bad-request'. + + IF the value length is NOT equal to 1 octet, REJECT/RETURN + 'client-error-request-value-too-long' + + IF NOT supplied by the client, the IPP object assumes the value + 'false'. + + document-format (mimeMediaType) + + IF NOT a single non-empty 'mimeMediaType' value, REJECT/RETURN + 'client-error-bad-request'. + + IF the value length is greater than 255 octets, REJECT/RETURN + 'client-error-request-value-too-long'. + + IF NOT in the Printer object's "document-format-supported" + attribute, REJECT/RETURN 'client-error-document-format-not- + supported' + + IF NOT supplied by the client, the IPP object assumes the value of + the Printer object's "document-format-default" attribute. + + document-uri (uri) + + IF NOT a single non-empty 'uri' value, REJECT/RETURN 'client- + error-bad-request'. + + IF the value length is greater than 1023 octets, REJECT/RETURN + 'client-error-request-value-too-long'. + + IF the URI syntax is not valid, REJECT/RETURN 'client-error-bad- + request'. + + If the client-supplied URI scheme is not supported, i.e., the + value is not in the Printer object's referenced-uri-scheme- + supported" attribute, the Printer object MUST reject the request + + + +Hastings, et al. Informational [Page 31] + +RFC 3196 Internet Printing Protocol/1.1 November 2001 + + + and return the 'client-error-uri-scheme-not-supported' status + code. The Printer object MAY check to see if the document exists + and is accessible. If the document is not found or is not + accessible, REJECT/RETURN 'client-error-not found'. + + last-document (boolean) + + IF NEITHER a single 'true' NOR a single 'false' 'boolean' value, + REJECT/RETURN 'client-error-bad-request'. + + IF the value length is NOT equal to 1 octet, REJECT/RETURN + 'client-error-request-value-too-long' + + job-id (integer(1:MAX)) + + IF NOT an single 'integer' value equal to 4 octets AND in the + range 1 to MAX, REJECT/RETURN 'client-error-bad-request'. + + IF NOT a job-id of an existing Job object, REJECT/RETURN 'client- + error-not-found' or 'client-error-gone' status code, if keep track + of recently deleted jobs. + + requested-attributes (1setOf keyword) + + IF NOT one or more 'keyword' values, REJECT/RETURN 'client- + error-bad-request'. + + IF the value length is greater than 255 octets, REJECT/RETURN + 'client-error-request-value-too-long'. + + Ignore unsupported values, which are the keyword names of + unsupported attributes. Don't bother to copy such requested + (unsupported) attributes to the Unsupported Attribute response + group since the response will not return them. + + which-jobs (type2 keyword) + + IF NOT a single 'keyword' value, REJECT/RETURN 'client-error-bad- + request'. + + IF the value length is greater than 255 octets, REJECT/RETURN + 'client-error-request-value-too-long'. + + IF NEITHER 'completed' NOR 'not-completed', copy the attribute and + the unsupported value to the Unsupported Attributes response group + and REJECT/RETURN 'client-error-attributes-or-values-not- + supported'. + + + + +Hastings, et al. Informational [Page 32] + +RFC 3196 Internet Printing Protocol/1.1 November 2001 + + + Note: a Printer still supports the 'completed' value even if it + keeps no completed/canceled/aborted jobs: by returning no jobs + when so queried. + + IF NOT supplied by the client, the IPP object assumes the 'not- + completed' value. + + my-jobs (boolean) + + IF NEITHER a single 'true' NOR a single 'false' 'boolean' value, + REJECT/RETURN 'client-error-bad-request'. + + IF the value length is NOT equal to 1 octet, REJECT/RETURN + 'client-error-request-value-too-long' + + IF NOT supplied by the client, the IPP object assumes the 'false' + value. + + limit (integer(1:MAX)) + + IF NOT a single 'integer' value equal to 4 octets AND in the range + 1 to MAX, REJECT/RETURN 'client-error-bad-request'. + + IF NOT supplied by the client, the IPP object returns all jobs, no + matter how many. + + ----------------------------------------------- + +3.1.2.1.6 Validate the values of the OPTIONAL Operation attributes + + OPTIONAL Operation attributes are those that an IPP object MAY + support. An IPP object validates the values of the OPTIONAL + attributes supplied by the client. The IPP object performs the same + syntactic validation checks for each OPTIONAL attribute value as in + Section 3.1.2.1.5. As in Section 3.1.2.1.5, if any fail, the IPP + object REJECTS the request and RETURNS the 'client-error-bad-request' + or the 'client-error-request-value-too-long' status code. + + In addition, the IPP object checks each Operation attribute value + against some Printer attribute or some hard-coded value if there is + no "xxx-supported" Printer attribute defined. If its value is not + among those supported or is not in the range supported, then the IPP + object REJECTS the request and RETURNS the error status code + indicated in the table. If the value of the Printer object's "xxx- + supported" attribute is 'no-value' (because the system administrator + hasn't configured a value), the check always fails. + + + + + +Hastings, et al. Informational [Page 33] + +RFC 3196 Internet Printing Protocol/1.1 November 2001 + + + If the IPP object doesn't recognize/support an attribute, the IPP + object treats the attribute as an unknown or unsupported attribute + (see the last row in the table below). + + ----------------------------------------------- + + document-natural-language (naturalLanguage) + + IF NOT a single non-empty 'naturalLanguage' value, REJECT/RETURN + 'client-error-bad-request'. + + IF the value length is greater than 63 octets, REJECT/RETURN + 'client-error-request-value-too-long'. + + IF NOT a value that the Printer object supports in document + formats, (no corresponding "xxx-supported" Printer attribute), + REJECT/RETURN 'client-error-natural-language-not-supported'. + + compression (type3 keyword) + + IF NOT a single 'keyword' value, REJECT/RETURN 'client-error-bad- + request'. + + IF the value length is greater than 255 octets, REJECT/RETURN + 'client-error-request-value-too-long'. + + IF NOT in the Printer object's "compression-supported" attribute, + REJECT/RETURN 'client-error-compression-not-supported'. + + Note to IPP/1.0 implementers: Support for the "compression" + attribute was optional in IPP/1.0 and was changed to REQUIRED in + IPP/1.1. However, an IPP/1.0 object SHOULD at least check for the + "compression" attribute being present and reject the create + request, if they don't support "compression". Not checking is a + bug, since the data will be unintelligible. + + job-k-octets (integer(0:MAX)) + + IF NOT a single 'integer' value equal to 4 octets, REJECT/RETURN + 'client-error-bad-request'. + + IF NOT in the range of the Printer object's "job-k-octets- + supported" attribute, copy the attribute and the unsupported value + to the Unsupported Attributes response group and REJECT/RETURN + 'client-error-attributes-or-values-not-supported'. + + + + + + +Hastings, et al. Informational [Page 34] + +RFC 3196 Internet Printing Protocol/1.1 November 2001 + + + job-impressions (integer(0:MAX)) + + IF NOT a single 'integer' value equal to 4 octets, REJECT/RETURN + 'client-error-bad-request'. + + IF NOT in the range of the Printer object's "job-impressions- + supported" attribute, copy the attribute and the unsupported value + to the Unsupported Attributes response group and REJECT/RETURN + 'client-error-attributes-or-values-not-supported'. + + job-media-sheets (integer(0:MAX)) + + IF NOT a single 'integer' value equal to 4 octets, REJECT/RETURN + 'client-error-bad-request'. + + IF NOT in the range of the Printer object's "job-media-sheets- + supported" attribute, copy the attribute and the unsupported value + to the Unsupported Attributes response group and REJECT/RETURN + 'client-error-attributes-or-values-not-supported'. + + message (text(127)) + + IF NOT a single 'text' value, REJECT/RETURN 'client-error-bad- + request'. + + IF the value length is greater than 127 octets, REJECT/RETURN + 'client-error-request-value-too-long'. + + unknown or unsupported attribute + + IF the attribute syntax supplied by the client is supported but + the length is not legal for that attribute syntax, REJECT/RETURN + 'client-error-request-value-too-long'. + + ELSE copy the attribute and value to the Unsupported Attributes + response group and change the attribute value to the "out-of-band" + 'unsupported' value, but otherwise ignore the attribute. + + Note: Future Operation attributes may be added to the protocol + specification that may occur anywhere in the specified group. When + the operation is otherwise successful, the IPP object returns the + 'successful-ok-ignored-or-substituted-attributes' status code. + Ignoring unsupported Operation attributes in all operations is + analogous to the handling of unsupported Job Template attributes in + the create and Validate-Job operations when the client supplies the + "ipp-attribute-fidelity" Operation attribute with the 'false' value. + This last rule is so that we can add OPTIONAL Operation attributes to + future versions of IPP so that older clients can inter-work with new + + + +Hastings, et al. Informational [Page 35] + +RFC 3196 Internet Printing Protocol/1.1 November 2001 + + + IPP objects and newer clients can inter-work with older IPP objects. + (If the new attribute cannot be ignored without performing + unexpectedly, the major version number would have been increased in + the protocol document and in the request). This rule for Operation + attributes is independent of the value of the "ipp-attribute- + fidelity" attribute. For example, if an IPP object doesn't support + the OPTIONAL "job-k-octets" attribute', the IPP object treats "job- + k-octets" as an unknown attribute and only checks the length for the + 'integer' attribute syntax supplied by the client. If it is not four + octets, the IPP object REJECTS the request and RETURNS the 'client- + error-bad-request' status code, else the IPP object copies the + attribute to the Unsupported Attribute response group, setting the + value to the "out-of-band" 'unsupported' value, but otherwise ignores + the attribute. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Hastings, et al. Informational [Page 36] + +RFC 3196 Internet Printing Protocol/1.1 November 2001 + + +3.1.2.2 Suggested Additional Processing Steps for Operations that + Create/Validate Jobs and Add Documents + + This section in combination with the previous section recommends the + processing steps for the Print-Job, Validate-Job, Print-URI, Create- + Job, Send-Document, and Send-URI operations that IPP objects SHOULD + use. These are the operations that create jobs, validate a Print-Job + request, and add documents to a job. + + IIG Sect # Flow IPP error status codes + ---------- ---- ---------------------- + | + v No + 3.1.2.2.1 <ipp-attribute-fidelity> ------------------+ + <supplied?> | + Yes| | + | ipp-attribute-fidelity = no | + |<------------------------------+ + v No + 3.1.2.2.2 <Printer is> --> server-error-not-accepting-jobs + <accepting jobs?> + Yes| + v err + 3.1.2.3 <Validate values of> --> client-error-bad-request + <Job template attributes> client-error-request-value-too- + long + <(length, tag, range,> + <multi-value)> + ok| + v err + 3.1.2.3 <Validate values with> --> client-error-bad-request + <supported values> client-error-attributes-or- + | values-not-supported + v err + 3.1.2.3.1 <Any conflicting> --> client-error-conflicting- + attributes + <Job Template attr values> client-error-attributes-or- + values-not-supported + v + +3.1.2.2.1 Default "ipp-attribute-fidelity" if not supplied + + The Printer object checks to see if the client supplied an "ipp- + attribute-fidelity" Operation attribute. If the attribute is not + supplied by the client, the IPP object assumes that the value is + 'false'. + + + + + +Hastings, et al. Informational [Page 37] + +RFC 3196 Internet Printing Protocol/1.1 November 2001 + + +3.1.2.2.2 Check that the Printer object is accepting jobs + + If the value of the Printer objects "printer-is-accepting-jobs" is + 'false', the Printer object REJECTS the request and RETURNS the + 'server-error-not-accepting-jobs' status code. + +3.1.2.2.3 Validate the values of the Job Template attributes + + An IPP object validates the values of all Job Template attribute + supplied by the client. The IPP object performs the analogous + syntactic validation checks of each Job Template attribute value that + it performs for Operation attributes (see Section 3.1.2.1.5.): + + a) that the length of each value is correct for the attribute + syntax tag supplied by the client according to [RFC2911] + Section 4.1. + + b) that the attribute syntax tag is correct for that attribute + according to [RFC2911] Sections 4.2 to 4.4. + + c) that multiple values are supplied only for multi-valued + attributes, i.e., that are 1setOf X according to [RFC2911] + Sections 4.2 to 4.4. + + As in Section 3.1.2.1.5, if any of these syntactic checks fail, the + IPP object REJECTS the request and RETURNS the 'client-error-bad- + request' or 'client-error-request-value-too-long' status code as + appropriate, independent of the value of the "ipp-attribute- + fidelity". Since such an error is most likely to be an error + detected by a client developer, rather than by an end-user, the IPP + object NEED NOT return an indication of which attribute had the error + in either the Unsupported Attributes Group or the Status Message. + The description for each of these syntactic checks is explicitly + expressed in the first IF statement in the following table. + + Each Job Template attribute MUST occur no more than once. If an IPP + Printer receives a create request with multiple occurrences of a Job + Template attribute, it MAY: + + 1. reject the operation and return the 'client-error-bad-request' + error status code + + 2. accept the operation and use the first occurrence of the + attribute + + 3. accept the operation and use the last occurrence of the + attribute + + + + +Hastings, et al. Informational [Page 38] + +RFC 3196 Internet Printing Protocol/1.1 November 2001 + + + depending on implementation. Therefore, clients MUST NOT supply + multiple occurrences of the same Job Template attribute in the Job + Attributes group in the request. + +3.1.2.3 Algorithm for job validation + + The process of validating a Job-Template attribute "xxx" against a + Printer attribute "xxx-supported" can use the following validation + algorithm (see section 3.2.1.2 in [RFC2911]). + + To validate the value U of Job-Template attribute "xxx" against the + value V of Printer "xxx-supported", perform the following algorithm: + + 1. If U is multi-valued, validate each value X of U by performing the + algorithm in Table 7 with each value X. Each validation is + separate from the standpoint of returning unsupported values. + Example: If U is "finishings" that the client supplies with + 'staple', 'bind' values, then X takes on the successive values: + 'staple', then 'bind' + + 2. If V is multi-valued, validate X against each Z of V by performing + the algorithm in Table 7 with each value Z. If a value Z + validates, the validation for the attribute value X succeeds. If + it fails, the algorithm is applied to the next value Z of V. If + there are no more values Z of V, validation fails. Example" If V + is "sides-supported" with values: 'one- sided', 'two-sided-long', + and 'two-sided-short', then Z takes on the successive values: + 'one-sided', 'two-sided-long', and 'two-sided-short'. If the + client supplies "sides" with 'two-sided- long', the first + comparison fails ('one-sided' is not equal to 'two-sided-long'), + the second comparison succeeds ('two-sided-long' is equal to + 'two-sided-long"), and the third comparison ('two-sided-short' + with 'two-sided-long') is not even performed. + + 3. If both U and V are single-valued, let X be U and Z be V and use + the validation rules in Table 7. + + + + + + + + + + + + + + + +Hastings, et al. Informational [Page 39] + +RFC 3196 Internet Printing Protocol/1.1 November 2001 + + + Table 7 - Rules for validating single values X against Z + + Attribute syntax attribute syntax validated if: + of X of Z + + integer rangeOfInteger X is within the range of Z + + uri uriScheme the uri scheme in X is equal to + Z + + any boolean the value of Z is TRUE + + any any X and Z are of the same type + and are equal. + + If the value of the Printer object's "xxx-supported" attribute is + 'no-value' (because the system administrator hasn't configured a + value), the check always fails. If the check fails, the IPP object + copies the attribute to the Unsupported Attributes response group + with its unsupported value. If the attribute contains more than one + value, each value is checked and each unsupported value is separately + copied, while supported values are not copied. If an IPP object + doesn't recognize/support a Job Template attribute, i.e., there is no + corresponding Printer object "xxx-supported" attribute, the IPP + object treats the attribute as an unknown or unsupported attribute + (see the last row in the table below). + + If some Job Template attributes are supported for some document + formats and not for others or the values are different for different + document formats, the IPP object SHOULD take that into account in + this validation using the value of the "document-format" supplied by + the client (or defaulted to the value of the Printer's "document- + format-default" attribute, if not supplied by the client). For + example, if "number-up" is supported for the 'text/plain' document + format, but not for the 'application/postscript' document format, the + check SHOULD (though it NEED NOT) depend on the value of the + "document-format" operation attribute. See "document-format" in + [RFC2911] section 3.2.1.1 and 3.2.5.1. + + Note: whether the request is accepted or rejected is determined by + the value of the "ipp-attribute-fidelity" attribute in a subsequent + step, so that all Job Template attribute supplied are examined and + all unsupported attributes and/or values are copied to the + Unsupported Attributes response group. + + ----------------------------------------------- + + + + + +Hastings, et al. Informational [Page 40] + +RFC 3196 Internet Printing Protocol/1.1 November 2001 + + + job-priority (integer(1:100)) + + IF NOT a single 'integer' value with a length equal to 4 octets, + REJECT/RETURN 'client-error-bad-request'. + + IF NOT supplied by the client, use the value of the Printer + object's "job-priority-default" attribute at job submission time. + + IF NOT in the range 1 to 100, inclusive, copy the attribute and + the unsupported value to the Unsupported Attributes response + group. + + Map the value to the nearest supported value in the range 1:100 as + specified by the number of discrete values indicated by the value + of the Printer's "job-priority-supported" attribute. See the + formula in [RFC2911] Section 4.2.1. + + job-hold-until (type3 keyword | name) + + IF NOT a single 'keyword' or 'name' value, REJECT/RETURN 'client- + error-bad-request'. + + IF the value length is greater than 255 octets, REJECT/RETURN + 'client-error-request-value-too-long'. + + IF NOT supplied by the client, use the value of the Printer + object's "job-hold-until" attribute at job submission time. + + IF NOT in the Printer object's "job-hold-until-supported" + attribute, copy the attribute and the unsupported value to the + Unsupported Attributes response group. + + job-sheets (type3 keyword | name) + + IF NOT a single 'keyword' or 'name' value, REJECT/RETURN 'client- + error-bad-request'. + + IF the value length is greater than 255 octets, REJECT/RETURN + 'client-error-request-value-too-long'. + + IF NOT in the Printer object's "job-sheets-supported" attribute, + copy the attribute and the unsupported value to the Unsupported + Attributes response group. + + multiple-document-handling (type2 keyword) + + IF NOT a single 'keyword' value, REJECT/RETURN 'client-error-bad- + request'. + + + +Hastings, et al. Informational [Page 41] + +RFC 3196 Internet Printing Protocol/1.1 November 2001 + + + IF the value length is greater than 255 octets, REJECT/RETURN + 'client-error-request-value-too-long'. + + IF NOT in the Printer object's "multiple-document-handling- + supported" attribute, copy the attribute and the unsupported value + to the Unsupported Attributes response group. + + copies (integer(1:MAX)) + + IF NOT a single 'integer' value with a length equal to 4 octets, + REJECT/RETURN 'client-error-bad-request'. + + IF NOT in range of the Printer object's "copies-supported" + attribute + + copy the attribute and the unsupported value to the Unsupported + Attributes response group. + + finishings (1setOf type2 enum) + + IF NOT an 'enum' value(s) each with a length equal to 4 octets, + REJECT/RETURN 'client-error-bad-request'. + + IF NOT in the Printer object's "finishings-supported" attribute, + copy the attribute and the unsupported value(s), but not any + supported values, to the Unsupported Attributes response group. + + page-ranges (1setOf rangeOfInteger(1:MAX)) + + IF NOT a 'rangeOfInteger' value(s) each with a length equal to 8 + octets, REJECT/RETURN 'client-error-bad-request'. + + IF first value is greater than second value in any range, the + ranges are not in ascending order, or ranges overlap, + REJECT/RETURN 'client-error-bad-request'. + + IF the value of the Printer object's "page-ranges-supported" + attribute is 'false', copy the attribute to the Unsupported + Attributes response group and set the value to the "out-of-band" + 'unsupported' value. + + sides (type2 keyword) + + IF NOT a single 'keyword' value, REJECT/RETURN 'client-error-bad- + request'. + + IF the value length is greater than 255 octets, REJECT/RETURN + 'client-error-request-value-too-long'. + + + +Hastings, et al. Informational [Page 42] + +RFC 3196 Internet Printing Protocol/1.1 November 2001 + + + IF NOT in the Printer object's "sides-supported" attribute, copy + the attribute and the unsupported value to the Unsupported + Attributes response group. + + number-up (integer(1:MAX)) + + IF NOT a single 'integer' value with a length equal to 4 octets, + REJECT/RETURN 'client-error-bad-request'. + + IF NOT a value or in the range of one of the values of the Printer + object's "number-up-supported" attribute, copy the attribute and + value to the Unsupported Attribute response group. + + orientation-requested (type2 enum) + + IF NOT a single 'enum' value with a length equal to 4 octets, + REJECT/RETURN 'client-error-bad-request'. + + IF NOT in the Printer object's "orientation-requested-supported" + attribute, copy the attribute and the unsupported value to the + Unsupported Attributes response group. + + media (type3 keyword | name) + + IF NOT a single 'keyword' or 'name' value, REJECT/RETURN 'client- + error-bad-request'. + + IF the value length is greater than 255 octets, REJECT/RETURN + 'client-error-request-value-too-long'. + + IF NOT in the Printer object's "media-supported" attribute, copy + the attribute and the unsupported value to the Unsupported + Attributes response group. + + printer-resolution (resolution) + + IF NOT a single 'resolution' value with a length equal to 9 + octets, REJECT/RETURN 'client-error-bad-request'. + + IF NOT in the Printer object's "printer-resolution-supported" + attribute, copy the attribute and the unsupported value to the + Unsupported Attributes response group. + + print-quality (type2 enum) + + IF NOT a single 'enum' value with a length equal to 4 octets, + REJECT/RETURN 'client-error-bad-request'. + + + + +Hastings, et al. Informational [Page 43] + +RFC 3196 Internet Printing Protocol/1.1 November 2001 + + + IF NOT in the Printer object's "print-quality-supported" + attribute, copy the attribute and the unsupported value to the + Unsupported Attributes response group. + + unknown or unsupported attribute (i.e., there is no corresponding + Printer object "xxx-supported" attribute) + + IF the attribute syntax supplied by the client is supported but + the length is not legal for that attribute syntax, + + REJECT/RETURN 'client-error-bad-request' if the length of the + attribute syntax is fixed or 'client-error-request-value-too-long' + if the length of the attribute syntax is variable. + + ELSE copy the attribute and value to the Unsupported Attributes + response group and change the attribute value to the "out-of-band" + 'unsupported' value. Any remaining Job Template Attributes are + either unknown or unsupported Job Template attributes and are + validated algorithmically according to their attribute syntax for + proper length (see below). + + ----------------------------------------------- + + If the attribute syntax is supported AND the length check fails, + the IPP object REJECTS the request and RETURNS the 'client-error- + bad-request' if the length of the attribute syntax is fixed or the + 'client-error-request-value-too-long' status code if the length of + the attribute syntax is variable. Otherwise, the IPP object copies + the unsupported Job Template attribute to the Unsupported + Attributes response group and changes the attribute value to the + "out-of-band" 'unsupported' value. The following table shows the + length checks for all attribute syntaxes. In the following table: + "<=" means less than or equal, "=" means equal to: + + + + + + + + + + + + + + + + + + +Hastings, et al. Informational [Page 44] + +RFC 3196 Internet Printing Protocol/1.1 November 2001 + + + Name Octet length check for read-write attributes + ---------- --------------------------------------------- + + 'textWithLanguage <= 1023 AND 'naturalLanguage' <= 63 + 'textWithoutLanguage' <= 1023 + 'nameWithLanguage' <= 255 AND 'naturalLanguage' <= 63 + 'nameWithoutLanguage' <= 255 + 'keyword' <= 255 + 'enum' = 4 + 'uri' <= 1023 + 'uriScheme' <= 63 + 'charset' <= 63 + 'naturalLanguage' <= 63 + 'mimeMediaType' <= 255 + 'octetString' <= 1023 + 'boolean' = 1 + 'integer' = 4 + 'rangeOfInteger' = 8 + 'dateTime' = 11 + 'resolution' = 9 + '1setOf X' + + Note: It's possible for a Printer to receive a zero length keyword + in a request. Since this is a keyword, its value needs to be + compared with the supported values. Assuming that the printer + doesn't have any values in its corresponding "xxx-supported" + attribute that are keywords of zero length, the comparison will fail. + Then the request will be accepted or rejected depending on the value + of "ipp-attributes-fidelity" being 'false' or 'true', respectively. + No special handling is required for + +3.1.2.3.1 Check for conflicting Job Template attributes values + + Once all the Operation and Job Template attributes have been checked + individually, the Printer object SHOULD check for any conflicting + values among all the supported values supplied by the client. For + example, a Printer object might be able to staple and to print on + transparencies, however due to physical stapling constraints, the + Printer object might not be able to staple transparencies. The IPP + object copies the supported attributes and their conflicting + attribute values to the Unsupported Attributes response group. The + Printer object only copies over those attributes that the Printer + object either ignores or substitutes in order to resolve the + conflict, and it returns the original values which were supplied by + the client. For example suppose the client supplies "finishings" + equals 'staple' and "media" equals 'transparency', but the Printer + object does not support stapling transparencies. If the Printer + chooses to ignore the stapling request in order to resolve the + + + +Hastings, et al. Informational [Page 45] + +RFC 3196 Internet Printing Protocol/1.1 November 2001 + + + conflict, the Printer objects returns "finishings" equal to 'staple' + in the Unsupported Attributes response group. If any attributes are + multi-valued, only the conflicting values of the attributes are + copied. + + Note: The decisions made to resolve the conflict (if there is a + choice) is implementation dependent. + +3.1.2.3.2 Decide whether to REJECT the request + + If there were any unsupported Job Template attributes or + unsupported/conflicting Job Template attribute values and the client + supplied the "ipp-attribute-fidelity" attribute with the 'true' + value, the Printer object REJECTS the request and return the status + code: + + 1.'client-error-conflicting-attributes' status code, if there were + any conflicts between attributes supplied by the client. + + 2.'client-error-attributes-or-values-not-supported' status code, + otherwise. + + Note: Unsupported Operation attributes or values that are returned + do not affect the status returned in this step. If the unsupported + Operation attribute was a serious error, the above already rejected + the request in a previous step. If control gets to this step with + unsupported Operation attributes being returned, they are not serious + errors. + + In general, the final results of Job processing are unknown at Job + submission time. The client has to rely on notifications or polling + to find out what happens at Job processing time. However, there are + cases in which some Printers can determine at Job submission time + that Job processing is going to fail. As an optimization, we'd like + to have the Printer reject the Job in these cases. + + There are three types of "processing" errors that might be detectable + at Job submission time: + + 1. 'client-error-document-format-not-supported' : For the Print- + Job, Send-Document, Print-URI, and Send-URI operations, if all these + conditions are true: + + - the Printer supports auto-sensing, + - the request "document-format" operation attribute is + 'application/octet-stream', + - the Printer receives document data before responding, + - the Printer auto-senses the document format before responding, + + + +Hastings, et al. Informational [Page 46] + +RFC 3196 Internet Printing Protocol/1.1 November 2001 + + + - the sensed document format is not supported by the Printer + + then the Printer should respond with 'client-error-document-format- + not-supported' status. + + 2. 'client-error-compression-error': For the Print-Job, Send- + Document, Print-URI, and Send-URI operations, if all these + conditions are true: + + - the client supplies a supported value for the "compression" + operation attribute in the request + - the Printer receives document data before responding, + - the Printer attempts to decompress the document data before + responding, + - the document data cannot be decompressed using the algorithm + specified by the "compression" operation attribute + + then the Printer should respond with 'client-error-compression-error' + status. + + 3. 'client-error-document-access-error': For the Print-URI, and + Send-URI operations, if the Printer attempts and fails to pull the + referenced document data before responding, it should respond with + 'client-error-document-access-error' status. + + Some Printers are not able to detect these errors until Job + processing time. In that case, the errors are recorded in the + corresponding job-state and job-state reason attributes. (There is + no standard way for a client to determine whether a Printer can + detect these errors at Job submission time.) For example, if auto- + sensing happens AFTER the job is accepted (as opposed to auto-sensing + at submit time before returning the response), the implementation + aborts the job, puts the job in the 'aborted' state and sets the + 'unsupported-document-format' value in the job's "job-state-reasons". + + A client should always provide a valid "document-format" operation + attribute whenever practical. In the absence of other information, a + client itself may sniff the document data to determine document + format. + + Auto sensing at Job submission time may be more difficult for the + Printer when combined with compression. For auto-sensed Jobs, a + client may be better off deferring compression to the transfer + protocol layer, e.g.; by using the HTTP Content-Encoding header. + + + + + + + +Hastings, et al. Informational [Page 47] + +RFC 3196 Internet Printing Protocol/1.1 November 2001 + + +3.1.2.3.3 For the Validate-Job operation, RETURN one of the success + status codes + + If the requested operation is the Validate-Job operation, the Printer + object returns: + + 1. the "successful-ok" status code, if there are no unsupported or + conflicting Job Template attributes or values. + 2. the "successful-ok-conflicting-attributes, if there are any + conflicting Job Template attribute or values. + 3. the "successful-ok-ignored-or-substituted-attributes, if there + are only unsupported Job Template attributes or values. + + Note: Unsupported Operation attributes or values that are returned + do not affect the status returned in this step. If the unsupported + Operation attribute was a serious error, the above already rejected + the request in a previous step. If control gets to this step with + unsupported Operation attributes being returned, they are not serious + errors. + +3.1.2.3.4 Create the Job object with attributes to support + + If "ipp-attribute-fidelity" is set to 'false' (or it was not supplied + by the client), the Printer object: + + 1. creates a Job object, assigns a unique value to the job's + "job-uri" and "job-id" attributes, and initializes all of the + job's other supported Job Description attributes. + 2. removes all unsupported attributes from the Job object. + 3. for each unsupported value, removes either the unsupported + value or substitutes the unsupported attribute value with some + supported value. If an attribute has no values after removing + unsupported values from it, the attribute is removed from the + Job object (so that the normal default behavior at job + processing time will take place for that attribute). + 4. for each conflicting value, removes either the conflicting + value or substitutes the conflicting attribute value with some + other supported value. If an attribute has no values after + removing conflicting values from it, the attribute is removed + from the Job object (so that the normal default behavior at job + processing time will take place for that attribute). + + If there were no attributes or values flagged as unsupported, or the + value of 'ipp-attribute-fidelity" was 'false', the Printer object is + able to accept the create request and create a new Job object. If + the "ipp-attribute-fidelity" attribute is set to 'true', the Job + Template attributes that populate the new Job object are necessarily + all the Job Template attributes supplied in the create request. If + + + +Hastings, et al. Informational [Page 48] + +RFC 3196 Internet Printing Protocol/1.1 November 2001 + + + the "ipp-attribute-fidelity" attribute is set to 'false', the Job + Template attributes that populate the new Job object are all the + client supplied Job Template attributes that are supported or that + have value substitution. Thus, some of the requested Job Template + attributes will not appear in the Job object because the Printer + object did not support those attributes. The attributes that + populate the Job object are persistently stored with the Job object + for that Job. A Get-Job-Attributes operation on that Job object will + return only those attributes that are persistently stored with the + Job object. + + Note: All Job Template attributes that are persistently stored with + the Job object are intended to be "override values"; that is, they + that take precedence over whatever other embedded instructions might + be in the document data itself. However, it is not possible for all + Printer objects to realize the semantics of "override". End users + may query the Printer's "pdl-override-supported" attribute to + determine if the Printer either attempts or does not attempt to + override document data instructions with IPP attributes. + + There are some cases, where a Printer supports a Job Template + attribute and has an associated default value set for that attribute. + In the case where a client does not supply the corresponding + attribute, the Printer does not use its default values to populate + Job attributes when creating the new Job object; only Job Template + attributes actually in the create request are used to populate the + Job object. The Printer's default values are only used later at Job + processing time if no other IPP attribute or instruction embedded in + the document data is present. + + Note: If the default values associated with Job Template attributes + that the client did not supply were to be used to populate the Job + object, then these values would become "override values" rather than + defaults. If the Printer supports the 'attempted' value of the + "pdl-override-supported" attribute, then these override values could + replace values specified within the document data. This is not the + intent of the default value mechanism. A default value for an + attribute is used only if the create request did not specify that + attribute (or it was ignored when allowed by "ipp-attribute-fidelity" + being 'false') and no value was provided within the content of the + document data. + + If the client does not supply a value for some Job Template + attribute, and the Printer does not support that attribute, as far as + IPP is concerned, the result of processing that Job (with respect to + the missing attribute) is undefined. + + + + + +Hastings, et al. Informational [Page 49] + +RFC 3196 Internet Printing Protocol/1.1 November 2001 + + +3.1.2.3.5 Return one of the success status codes + + Once the Job object has been created, the Printer object accepts the + request and returns to the client: + + 1. the 'successful-ok' status code, if there are no unsupported or + conflicting Job Template attributes or values. + 2. the 'successful-ok-conflicting-attributes' status code, if + there are any conflicting Job Template attribute or values. + 3. the 'successful-ok-ignored-or-substituted-attributes' status + code, if there are only unsupported Job Template attributes or + values. + + Note: Unsupported Operation attributes or values that are returned + do not affect the status returned in this step. If the unsupported + Operation attribute was a serious error, the above already rejected + the request in a previous step. If control gets to this step with + unsupported Operation attributes being returned, they are not serious + errors. + + The Printer object also returns Job status attributes that indicate + the initial state of the Job ('pending', 'pending-held', + 'processing', etc.), etc. See Print-Job Response, [RFC2911] section + 3.2.1.2. + +3.1.2.3.6 Accept appended Document Content + + The Printer object accepts the appended Document Content data and + either starts it printing, or spools it for later processing. + +3.1.2.3.7 Scheduling and Starting to Process the Job + + The Printer object uses its own configuration and implementation + specific algorithms for scheduling the Job in the correct processing + order. Once the Printer object begins processing the Job, the + Printer changes the Job's state to 'processing'. If the Printer + object supports PDL override (the "pdl-override-supported" attribute + set to 'attempted'), the implementation does its best to see that IPP + attributes take precedence over embedded instructions in the document + data. + +3.1.2.3.8 Completing the Job + + The Printer object continues to process the Job until it can move the + Job into the 'completed' state. If an Cancel-Job operation is + received, the implementation eventually moves the Job into the + 'canceled' state. If the system encounters errors during processing + that do not allow it to progress the Job into a completed state, the + + + +Hastings, et al. Informational [Page 50] + +RFC 3196 Internet Printing Protocol/1.1 November 2001 + + + implementation halts all processing, cleans up any resources, and + moves the Job into the 'aborted' state. + +3.1.2.3.9 Destroying the Job after completion + + Once the Job moves to the 'completed', 'aborted', or 'canceled' + state, it is an implementation decision as to when to destroy the Job + object and release all associated resources. Once the Job has been + destroyed, the Printer would return either the "client-error-not- + found" or "client-error-gone" status codes for operations directed at + that Job. + + Note: the Printer object SHOULD NOT re-use a "job-uri" or "job-id" + value for a sufficiently long time after a job has been destroyed, so + that stale references kept by clients are less likely to access the + wrong (newer) job. + +3.1.2.3.10 Interaction with "ipp-attribute-fidelity" + + Some Printer object implementations may support "ipp-attribute- + fidelity" set to 'true' and "pdl-override-supported" set to + 'attempted' and yet still not be able to realize exactly what the + client specifies in the create request. This is due to legacy + decisions and assumptions that have been made about the role of job + instructions embedded within the document data and external job + instructions that accompany the document data and how to handle + conflicts between such instructions. The inability to be 100% + precise about how a given implementation will behave is also + compounded by the fact that the two special attributes, "ipp- + attribute-fidelity" and "pdl-"override-supported", apply to the whole + job rather than specific values for each attribute. For example, some + implementations may be able to override almost all Job Template + attributes except for "number-up". Character Sets, natural + languages, and internationalization + + This section discusses character set support, natural language + support and internationalization. + +3.1.2.3.11 Character set code conversion support + + IPP clients and IPP objects are REQUIRED to support UTF-8. They MAY + support additional charsets. It is RECOMMENDED that an IPP object + also support US-ASCII, since many clients support US-ASCII, and + indicate that UTF-8 and US-ASCII are supported by populating the + Printer's "charset-supported" with 'utf-8' and 'us-ascii' values. An + IPP object is required to code covert with as little loss as possible + between the charsets that it supports, as indicated in the Printer's + "charsets-supported" attribute. + + + +Hastings, et al. Informational [Page 51] + +RFC 3196 Internet Printing Protocol/1.1 November 2001 + + + How should the server handle the situation where the "attributes- + charset" of the response itself is "us-ascii", but one or more + attributes in that response is in the "utf-8" format? + + Example: Consider a case where a client sends a Print-Job request + with "utf-8" as the value of "attributes-charset" and with the "job- + name" attribute supplied. Later another client submits a Get-Job- + Attribute or Get-Jobs request. This second request contains the + "attributes-charset" with value "us-ascii" and "requested-attributes" + attribute with exactly one value "job-name". + + According to the RFC2911 document (section 3.1.4.2), the value of the + "attributes-charset" for the response of the second request must be + "us-ascii" since that is the charset specified in the request. The + "job-name" value, however, is in "utf-8" format. Should the request + be rejected even though both "utf-8" and "us-ascii" charsets are + supported by the server? or should the "job-name" value be converted + to "us-ascii" and return "successful-ok-conflicting-attributes" + (0x0002) as the status code? + + Answer: An IPP object that supports both utf-8 (REQUIRED) and us- + ascii, the second paragraph of section 3.1.4.2 applies so that the + IPP object MUST accept the request, perform code set conversion + between these two charsets with "the highest fidelity possible" and + return 'successful-ok', rather than a warning 'successful-ok- + conflicting-attributes, or an error. The printer will do the best it + can to convert between each of the character sets that it supports -- + even if that means providing a string of question marks because none + of the characters are representable in US ASCII. If it can't perform + such conversion, it MUST NOT advertise us-ascii as a value of its + "attributes-charset-supported" and MUST reject any request that + requests 'us-ascii'. + + One IPP object implementation strategy is to convert all request text + and name values to a Unicode internal representation. This is 16-bit + and virtually universal. Then convert to the specified operation + attributes-charset on output. + + Also it would be smarter for a client to ask for 'utf-8', rather than + 'us-ascii' and throw away characters that it doesn't understand, + rather than depending on the code conversion of the IPP object. + +3.1.2.3.12 What charset to return when an unsupported charset is + requested (Issue 1.19)? + + Section 3.1.4.1 Request Operation attributes was clarified in + November 1998 as follows: + + + + +Hastings, et al. Informational [Page 52] + +RFC 3196 Internet Printing Protocol/1.1 November 2001 + + + All clients and IPP objects MUST support the 'utf-8' charset + [RFC2044] and MAY support additional charsets provided that they are + registered with IANA [IANA-CS]. If the Printer object does not + support the client supplied charset value, the Printer object MUST + reject the request, set the "attributes-charset" to 'utf-8' in the + response, and return the 'client-error-charset-not-supported' status + code and any 'text' or 'name' attributes using the 'utf-8' charset. + + Since the client and IPP object MUST support UTF-8, returning any + text or name attributes in UTF-8 when the client requests a charset + that is not supported should allow the client to display the text or + name. + + Since such an error is a client error, rather than a user error, the + client should check the status code first so that it can avoid + displaying any other returned 'text' and 'name' attributes that are + not in the charset requested. + + Furthermore, [RFC2911] section 14.1.4.14 client-error-charset-not- + supported (0x040D) was clarified in November 1998 as follows: + + For any operation, if the IPP Printer does not support the charset + supplied by the client in the "attributes-charset" operation + attribute, the Printer MUST reject the operation and return this + status and any 'text' or 'name' attributes using the 'utf-8' charset + (see Section 3.1.4.1). + +3.1.2.3.13 Natural Language Override (NLO) + + The 'text' and 'name' attributes each have two forms. One has an + implicit natural language, and the other has an explicit natural + language. The 'textWithoutLanguage' and 'textWithLanguage' are the + two 'text' forms. The 'nameWithoutLanguage" and 'nameWithLanguage + are the two 'name' forms. If a receiver (IPP object or IPP client) + supports an attribute with attribute syntax 'text', it MUST support + both forms in a request and a response. A sender (IPP client or IPP + object) MAY send either form for any such attribute. When a sender + sends a WithoutLanguage form, the implicit natural language is + specified in the "attributes-natural-language" operation attribute, + which all senders MUST include in every request and response. + + When a sender sends a WithLanguage form, it MAY be different from the + implicit natural language supplied by the sender or it MAY be the + same. The receiver MUST treat either form equivalently. + + There is an implementation decision for senders, whether to always + send the WithLanguage forms or use the WithoutLanguage form when the + attribute's natural language is the same as the request or response. + + + +Hastings, et al. Informational [Page 53] + +RFC 3196 Internet Printing Protocol/1.1 November 2001 + + + The former approach makes the sender implementation simpler. The + latter approach is more efficient on the wire and allows inter- + working with non-conforming receivers that fail to support the + WithLanguage forms. As each approach have advantages, the choice is + completely up to the implementer of the sender. + + Furthermore, when a client receives a 'text' or 'name' job attribute + that it had previously supplied, that client MUST NOT expect to see + the attribute in the same form, i.e., in the same WithoutLanguage or + WithLanguage form as the client supplied when it created the job. + The IPP object is free to transform the attribute from the + WithLanguage form to the WithoutLanguage form and vice versa, as long + as the natural language is preserved. However, in order to meet this + latter requirement, it is usually simpler for the IPP object + implementation to store the natural language explicitly with the + attribute value, i.e., to store using an internal representation that + resembles the WithLanguage form. + + The IPP Printer MUST copy the natural language of a job, i.e., the + value of the "attributes-natural-language" operation attribute + supplied by the client in the create operation, to the Job object as + a Job Description attribute, so that a client is able to query it. + In returning a Get-Job-Attributes response, the IPP object MAY return + one of three natural language values in the responses "attributes- + natural-language" operation attribute: (1) that requested by the + requester, (2) the natural language of the job, or (3) the configured + natural language of the IPP Printer, if the requested language is not + supported by the IPP Printer. + + This "attributes-natural-language" Job Description attribute is + useful for an IPP object implementation that prints start sheets in + the language of the user who submitted the job. This same Job + Description attribute is useful to a multi-lingual operator who has + to communicate with different job submitters in different natural + languages. This same Job Description attribute is expected to be + used in the future to generate notification messages in the natural + language of the job submitter. + + Early drafts of [RFC2911] contained a job-level natural language + override (NLO) for the Get-Jobs response. A job-level (NLO) is an + (unrequested) Job Attribute which then specified the implicit natural + language for any other WithoutLanguage job attributes returned in the + response for that job. Interoperability testing of early + implementations showed that no one was implementing the job-level NLO + in Get-Job responses. So the job-level NLO was eliminated from the + Get-Jobs response. This simplification makes all requests and + responses consistent in that the implicit natural language for any + + + + +Hastings, et al. Informational [Page 54] + +RFC 3196 Internet Printing Protocol/1.1 November 2001 + + + WithoutLanguage 'text' or 'name' form is always supplied in the + request's or response's "attributes-natural-language" operation + attribute. + +3.1.3 Status codes returned by operation + + This section corresponds to [RFC2911] section 3.1.6 "Operation + Response Status Codes and Status Messages". This section lists all + status codes once in the first operation (Print-Job). Then it lists + the status codes that are different or specialized for subsequent + operations under each operation. + +3.1.3.1 Printer Operations + +3.1.3.1.1 Print-Job + + The Printer object MUST return one of the following "status-code" + values for the indicated reason. Whether all of the document data + has been accepted or not before returning the success or error + response depends on implementation. See Section 13 in [RFC2911] for + a more complete description of each status code. + + For the following success status codes, the Job object has been + created and the "job-id", and "job-uri" assigned and returned in the + response: + + successful-ok: no request attributes were substituted or ignored. + + successful-ok-ignored-or-substituted-attributes: some supplied + (1) attributes were ignored or (2) unsupported attribute syntaxes + or values were substituted with supported values or were ignored. + Unsupported attributes, attribute syntax's, or values MUST be + returned in the Unsupported Attributes group of the response. + + successful-ok-conflicting-attributes: some supplied attribute + values conflicted with the values of other supplied attributes and + were either substituted or ignored. Attributes or values which + conflict with other attributes and have been substituted or + ignored MUST be returned in the Unsupported Attributes group of + the response as supplied by the client. + + [RFC2911] section 3.1.6 Operation Status Codes and Messages states: + + If the Printer object supports the "status-message" operation + attribute, it SHOULD use the REQUIRED 'utf-8' charset to return a + status message for the following error status codes (see section + 13 in [RFC2911]): 'client-error-bad-request', 'client-error- + charset-not-supported', 'server-error-internal-error', 'server- + + + +Hastings, et al. Informational [Page 55] + +RFC 3196 Internet Printing Protocol/1.1 November 2001 + + + error-operation-not-supported', and 'server-error-version-not- + supported'. In this case, it MUST set the value of the + "attributes-charset" operation attribute to 'utf-8' in the error + response. + + For the following error status codes, no job is created and no + "job-id" or "job-uri" is returned: + + client-error-bad-request: The request syntax does not conform + to the specification. + + client-error-forbidden: The request is being refused for + authorization or authentication reasons. The implementation + security policy is to not reveal whether the failure is one of + authentication or authorization. + + client-error-not-authenticated: Either the request requires + authentication information to be supplied or the authentication + information is not sufficient for authorization. + + client-error-not-authorized: The requester is not authorized + to perform the request on the target object. + + client-error-not-possible: The request cannot be carried out + because of the state of the system. See also 'server-error- + not-accepting-jobs' status code, which MUST take precedence if + the Printer object's "printer-accepting-jobs" attribute is + 'false'. + + client-error-timeout: not applicable. + + client-error-not-found: the target object does not exist. + + client-error-gone: the target object no longer exists and no + forwarding address is known. + + client-error-request-entity-too-large: the size of the request + and/or print data exceeds the capacity of the IPP Printer to + process it. + + client-error-request-value-too-long: the size of request + variable length attribute values, such as 'text' and 'name' + attribute syntax's, exceed the maximum length specified in + [RFC2911] for the attribute and MUST be returned in the + Unsupported Attributes Group. + + + + + + +Hastings, et al. Informational [Page 56] + +RFC 3196 Internet Printing Protocol/1.1 November 2001 + + + supplied is not supported. The "document-format" attribute + with the unsupported value MUST be returned in the Unsupported + Attributes Group. This error SHOULD take precedence over any + other 'xxx-not-supported' error, except 'client-error-charset- + not-supported'. + + client-error-attributes-or-values-not-supported: one or more + supplied attributes, attribute syntax's, or values are not + supported and the client supplied the "ipp-attributes- + fidelity" operation attribute with a 'true' value. They MUST + be returned in the Unsupported Attributes Group as explained + below. + + client-error-uri-scheme-not-supported: not applicable. + + client-error-charset-not-supported: the charset supplied in + the "attributes-charset" operation attribute is not supported. + The Printer's "configured-charset" MUST be returned in the + response as the value of the "attributes-charset" operation + attribute and used for any 'text' and 'name' attributes + returned in the error response. This error SHOULD take + precedence over any other error, unless the request syntax is + so bad that the client's supplied "attributes-charset" cannot + be determined. + + client-error-conflicting-attributes: one or more supplied + attribute values conflicted with each other and the client + supplied the "ipp-attributes-fidelity" operation attribute with + a 'true' value. They MUST be returned in the Unsupported + Attributes Group as explained below. + + server-error-internal-error: an unexpected condition prevents + the request from being fulfilled. + + server-error-operation-not-supported: not applicable (since + Print-Job is REQUIRED). + + server-error-service-unavailable: the service is temporarily + overloaded. + + server-error-version-not-supported: the version in the request + is not supported. The "closest" version number supported MUST + be returned in the response. + + server-error-device-error: a device error occurred while + receiving or spooling the request or document data or the IPP + Printer object can only accept one job at a time. + + + + +Hastings, et al. Informational [Page 57] + +RFC 3196 Internet Printing Protocol/1.1 November 2001 + + + server-error-temporary-error: a temporary error such as a + buffer full write error, a memory overflow, or a disk full + condition occurred while receiving the request and/or the + document data. + + server-error-not-accepting-jobs: the Printer object's + "printer-is-not-accepting-jobs" attribute is 'false'. + + server-error-busy: the Printer is too busy processing jobs to + accept another job at this time. + + server-error-job-canceled: the job has been canceled by an + operator or the system while the client was transmitting the + document data. + +3.1.3.1.2 Print-URI + + All of the Print-Job status codes described in Section 3.1.3.1.1 + Print-Job Response are applicable to Print-URI with the following + specializations and differences. See Section 14 for a more complete + description of each status code. + + client-error-uri-scheme-not-supported: the URI scheme supplied + in the "document-uri" operation attribute is not supported and + is returned in the Unsupported Attributes group. + + server-error-operation-not-supported: the Print-URI operation + is not supported. + +3.1.3.1.3 Validate-Job + + All of the Print-Job status codes described in Section 3.1.3.1.1 + Print-Job Response are applicable to Validate-Job. See Section 13 in + [RFC2911] for a more complete description of each status code. + +3.1.3.1.4 Create-Job + + All of the Print-Job status codes described in Section 3.1.3.1.1 + Print-Job Response are applicable to Create-Job with the following + specializations and differences. See Section 13 in [RFC2911] for a + more complete description of each status code. + + server-error-operation-not-supported: the Create-Job operation + is not supported. + + + + + + + +Hastings, et al. Informational [Page 58] + +RFC 3196 Internet Printing Protocol/1.1 November 2001 + + + client-error-multiple-document-jobs-not-supported: while the + Create-Job and Send-Document operations are supported, this + implementation doesn't support more than one document with + data. + +3.1.3.1.5 Get-Printer-Attributes + + All of the Print-Job status codes described in Section + 3.1.3.1.1 Print-Job Response are applicable to the Get- + Printer-Attributes operation with the following + specialization's and differences. See Section 13 in [RFC2911] + for a more complete description of each status code. + + For the following success status codes, the requested + attributes are returned in Group 3 in the response: + + successful-ok: no operation attributes or values were + substituted or ignored (same as Print-Job) and no requested + attributes were unsupported. + + successful-ok-ignored-or-substituted-attributes: The + "requested-attributes" operation attribute MAY, but NEED NOT, + be returned with the unsupported values. + + successful-ok-conflicting-attributes: same as Print-Job. + + For the error status codes, Group 3 is returned containing no + attributes or is not returned at all: + + client-error-not-possible: Same as Print-Job, in addition the + Printer object is not accepting any requests. + + client-error-request-entity-too-large: same as Print-job, + except that no print data is involved. + + client-error-attributes-or-values-not-supported: not + applicable, since unsupported operation attributes and/or + values MUST be ignored and an appropriate success code returned + (see above). + + client-error-conflicting-attributes: same as Print-Job, except + that "ipp-attribute-fidelity" is not involved. + + server-error-operation-not-supported: not applicable (since + Get-Printer-Attributes is REQUIRED). + + server-error-device-error: same as Print-Job, except that no + document data is involved. + + + +Hastings, et al. Informational [Page 59] + +RFC 3196 Internet Printing Protocol/1.1 November 2001 + + + server-error-temporary-error: same as Print-Job, except that + no document data is involved. + + server-error-not-accepting-jobs: not applicable. + + server-error-busy: same as Print-Job, except the IPP object is + too busy to accept even query requests. + + server-error-job-canceled: not applicable. + +3.1.3.1.6 Get-Jobs + + All of the Print-Job status codes described in Section 3.1.3.1.1 + Print-Job Response are applicable to the Get-Jobs operation with the + following specialization's and differences. See Section 13 in + [RFC2911] for a more complete description of each status code. + + For the following success status codes, the requested attributes are + returned in Group 3 in the response: + + successful-ok: same as Get-Printer-Attributes (see section + 3.1.3.1.5). + + successful-ok-ignored-or-substituted-attributes: same as Get- + Printer-Attributes (see section 3.1.3.1.5). + + successful-ok-conflicting-attributes: same as Get-Printer- + Attributes (see section 3.1.3.1.5). + + For any error status codes, Group 3 is returned containing no + attributes or is not returned at all. The following brief error + status code descriptions contain unique information for use with + Get-Jobs operation. See section 14 for the other error status codes + that apply uniformly to all operations: + + client-error-not-possible: Same as Print-Job, in addition the + Printer object is not accepting any requests. + + client-error-request-entity-too-large: same as Print-job, + except that no print data is involved. + + client-error-document-format-not-supported: not applicable. + + client-error-attributes-or-values-not-supported: not + applicable, since unsupported operation attributes and/or + values MUST be ignored and an appropriate success code returned + (see above). + + + + +Hastings, et al. Informational [Page 60] + +RFC 3196 Internet Printing Protocol/1.1 November 2001 + + + client-error-conflicting-attributes: same as Print-Job, except + that "ipp-attribute-fidelity" is not involved. + + server-error-operation-not-supported: not applicable (since + Get-Jobs is REQUIRED). + + server-error-device-error: same as Print-Job, except that no + document data is involved. + + server-error-temporary-error: same as Print-Job, except that + no document data is involved. + + server-error-not-accepting-jobs: not applicable. + + server-error-job-canceled: not applicable. + +3.1.3.1.7 Pause-Printer + + All of the Print-Job status codes described in Section 3.1.3.1.1 + Print-Job Response are applicable to Pause-Printer with the following + specializations and differences. See Section 13 in [RFC2911] for a + more complete description of each status code. + + For the following success status codes, the Printer object is being + stopped from scheduling jobs on all its devices. + + successful-ok: no request attributes were substituted or + ignored (same as Print-Job). + + successful-ok-ignored-or-substituted-attributes: same as + Print-Job. + + successful-ok-conflicting-attributes: same as Print-Job. + + For any of the error status codes, the Printer object has not been + stopped from scheduling jobs on all its devices. + + client-error-not-possible: not applicable. + + client-error-not-found: the target Printer object does not + exist. + + client-error-gone: the target Printer object no longer exists + and no forwarding address is known. + + client-error-request-entity-too-large: same as Print-Job, + except no document data is involved. + + + + +Hastings, et al. Informational [Page 61] + +RFC 3196 Internet Printing Protocol/1.1 November 2001 + + + client-error-document-format-not-supported: not applicable. + + client-error-conflicting-attributes: same as Print-Job, except + that the Printer's "printer-is-accepting-jobs" attribute is not + involved. + + server-error-operation-not-supported: the Pause-Printer + operation is not supported. + + server-error-device-error: not applicable. + + server-error-temporary-error: same as Print-Job, except no + document data is involved. + + server-error-not-accepting-jobs: not applicable. + + server-error-job-canceled: not applicable. + +3.1.3.1.8 Resume-Printer + + All of the Print-Job status code descriptions in Section 3.1.3.1.1 + Print-Job Response with the specialization's described for Pause- + Printer are applicable to Resume-Printer. See Section 13 in + [RFC2911] for a more complete description of each status code. + + For the following success status codes, the Printer object resumes + scheduling jobs on all its devices. + + successful-ok: no request attributes were substituted or + ignored (same as Print-Job). + + successful-ok-ignored-or-substituted-attributes: same as + Print-Job. + + successful-ok-conflicting-attributes: same as Print-Job. + + For any of the error status codes, the Printer object does not resume + scheduling jobs. + + server-error-operation-not-supported: the Resume-Printer + operation is not supported. + + + + + + + + + + +Hastings, et al. Informational [Page 62] + +RFC 3196 Internet Printing Protocol/1.1 November 2001 + + +3.1.3.1.8.1 What about Printers unable to change state due to an error + condition? + + If, in case, the IPP printer is unable to change its state due to + some problem with the actual printer device (say, it is shut down or + there is a media-jam as indicated in [RFC2911]), what should be the + result of the "Resume-Printer" operation? Should it still change the + 'printer-state-reasons' and return success or should it fail ? + + The Resume-Printer operation must clear the 'paused' or 'moving-to- + paused' 'printer-state-message'. The operation must return a + 'successful-ok' status code. + +3.1.3.1.8.2 How is "printer-state" handled on Resume-Printer? + + If the Resume-Printer operation succeeds, what should be the value of + "printer-state" and who should take care of the "printer-state" + attribute value later on ? + + The Resume-Printer operation may change the "printer-state-reasons" + value. + + The "printer-state" will change to one of three states: + + 1. 'idle' - no additional jobs and no error conditions present + + 2. 'processing' - job available and no error conditions present + + 3. current state (i.e. no change) an error condition is present + (e.g. media jam) + + In the third case the "printer-state-reason" will be cleared by + automata when it detects the error condition no longer exists. The + "printer-state" will move to 'idle' or 'processing' when conditions + permit. (i.e. no more error conditions) + +3.1.3.1.9 Purge-Printer + + All of the Print-Job status code descriptions in Section 3.1.3.1.1 + Print-Job Response with the specialization's described for Pause- + Printer are applicable to Purge-Printer. See Section 13 in [RFC2911] + for a more complete description of each status code. + + For the following success status codes, the Printer object purges all + it's jobs. + + successful-ok: no request attributes were substituted or + ignored (same as Print-Job). + + + +Hastings, et al. Informational [Page 63] + +RFC 3196 Internet Printing Protocol/1.1 November 2001 + + + successful-ok-ignored-or-substituted-attributes: same as + Print-Job. + + successful-ok-conflicting-attributes: same as Print-Job. + + For any of the error status codes, the Printer object does not purge + any jobs. + + server-error-operation-not-supported: the Purge-Printer + operation is not supported. + +3.1.3.2 Job Operations + +3.1.3.2.1 Send-Document + + All of the Print-Job status codes described in Section 3.1.3.1.1 + Print-Job Response are applicable to the Get-Printer-Attributes + operation with the following specialization's and differences. See + Section 13 in [RFC2911] for a more complete description of each + status code. + + For the following success status codes, the document has been added + to the specified Job object and the job's "number-of-documents" + attribute has been incremented: + + successful-ok: no request attributes were substituted or + ignored (same as Print-Job). + + successful-ok-ignored-or-substituted-attributes: same as + Print-Job. + + successful-ok-conflicting-attributes: same as Print-Job. + + For the error status codes, no document has been added to the Job + object and the job's "number-of-documents" attribute has not been + incremented: + + client-error-not-possible: Same as Print-Job, except that the + Printer's "printer-is-accepting-jobs" attribute is not + involved, so that the client is able to finish submitting a job + that was created with a Create-Job operation after this + attribute has been set to 'true'. Another condition is that + the state of the job precludes Send-Document, i.e., the job has + + + + + + + + +Hastings, et al. Informational [Page 64] + +RFC 3196 Internet Printing Protocol/1.1 November 2001 + + + already been closed out by the client. However, if the IPP + Printer closed out the job due to timeout, the 'client-error- + timeout' error status SHOULD be returned instead. + + client-error-timeout: This request was sent after the Printer + closed the job, because it has not received a Send-Document or + Send-URI operation within the Printer's "multiple-operation- + time-out" period . + + client-error-request-entity-too-large: same as Print-Job. + + client-error-conflicting-attributes: same as Print-Job, except + that "ipp-attributes-fidelity" operation attribute is not + involved.. + + server-error-operation-not-supported: the Send-Document + request is not supported. + + server-error-not-accepting-jobs: not applicable. + + server-error-job-canceled: the job has been canceled by an + operator or the system while the client was transmitting the + data. + +3.1.3.2.2 Send-URI + + All of the Print-Job status code descriptions in Section 3.1.3.1.1 + Print-Job Response with the specialization's described for Send- + Document are applicable to Send-URI. See Section 13 in [RFC2911] for + a more complete description of each status code. + + client-error-uri-scheme-not-supported: the URI scheme supplied + in the "document-uri" operation attribute is not supported and + the "document-uri" attribute MUST be returned in the + Unsupported Attributes group. + + server-error-operation-not-supported: the Send-URI operation is + not supported. + +3.1.3.2.3 Cancel-Job + + All of the Print-Job status codes described in Section 3.1.3.1.1 + Print-Job Response are applicable to Cancel-Job with the following + specializations and differences. See Section 13 in [RFC2911] for a + more complete description of each status code. + + For the following success status codes, the Job object is being + canceled or has been canceled: + + + +Hastings, et al. Informational [Page 65] + +RFC 3196 Internet Printing Protocol/1.1 November 2001 + + + successful-ok: no request attributes were substituted or + ignored (same as Print-Job). + + successful-ok-ignored-or-substituted-attributes: same as + Print-Job. + + successful-ok-conflicting-attributes: same as Print-Job. + + For any of the error status codes, the Job object has not been + canceled or was previously canceled. + + client-error-not-possible: The request cannot be carried out + because of the state of the Job object ('completed', + 'canceled', or 'aborted') or the state of the system. + + client-error-not-found: the target Printer and/or Job object + does not exist. + + client-error-gone: the target Printer and/or Job object no + longer exists and no forwarding address is known. + + client-error-request-entity-too-large: same as Print-Job, + except no document data is involved. + + client-error-document-format-not-supported: not applicable. + + client-error-attributes-or-values-not-supported: not + applicable, since unsupported operation attributes and values + MUST be ignored. + + client-error-conflicting-attributes: same as Print-Job, except + that the Printer's "printer-is-accepting-jobs" attribute is not + involved. + + server-error-operation-not-supported: not applicable (Cancel- + Job is REQUIRED). + + server-error-device-error: same as Print-Job, except no + document data is involved. + + server-error-temporary-error: same as Print-Job, except no + document data is involved. + + server-error-not-accepting-jobs: not applicable. + + server-error-job-canceled: not applicable. + + + + + +Hastings, et al. Informational [Page 66] + +RFC 3196 Internet Printing Protocol/1.1 November 2001 + + +3.1.3.2.4 Get-Job-Attributes + + All of the Print-Job status codes described in Section 3.1.3.1.1 + Print-Job Response are applicable to Get-Job-Attributes with the + following specializations and differences. See Section 13 in + [RFC2911] for a more complete description of each status code. + + For the following success status codes, the requested attributes are + returned in Group 3 in the response: + + successful-ok: same as Get-Printer-Attributes (see section + 3.1.3.1.5). + + successful-ok-ignored-or-substituted-attributes: same as Get- + Printer-Attributes (see section 3.1.3.1.5). + + successful-ok-conflicting-attributes: same as Get-Printer- + Attributes (see section 3.1.3.1.5). + + For the error status codes, Group 3 is returned containing no + attributes or is not returned at all. + + client-error-not-possible: Same as Print-Job, in addition the + Printer object is not accepting any requests. + + client-error-document-format-not-supported: not applicable. + + client-error-attributes-or-values-not-supported: not + applicable. + + client-error-uri-scheme-not-supported: not applicable. + + client-error-attributes-or-values-not-supported: not + applicable, since unsupported operation attributes and/or + values MUST be ignored and an appropriate success code returned + (see above). + + client-error-conflicting-attributes: not applicable + + server-error-operation-not-supported: not applicable (since + Get-Job-Attributes is REQUIRED). + + server-error-device-error: same as Print-Job, except no + document data is involved. + + server-error-temporary-error: sane as Print-Job, except no + document data is involved.. + + + + +Hastings, et al. Informational [Page 67] + +RFC 3196 Internet Printing Protocol/1.1 November 2001 + + + server-error-not-accepting-jobs: not applicable. + + server-error-job-canceled: not applicable. + +3.1.3.2.5 Hold-Job + + All of the Print-Job status codes described in Section 3.1.3.1.1 + Print-Job Response are applicable to Hold-Job with the following + specializations and differences. See Section 13 in [RFC2911] for a + more complete description of each status code. + + For the following success status codes, the Job object is being held + or has been held: + + successful-ok: no request attributes were substituted or + ignored (same as Print-Job). + + successful-ok-ignored-or-substituted-attributes: same as + Print-Job. + + successful-ok-conflicting-attributes: same as Print-Job. + + For any of the error status codes, the Job object has not been held + or was previously held. + + client-error-not-possible: The request cannot be carried out + because of the state of the Job object ('completed', + 'canceled', or 'aborted') or the state of the system. + + client-error-not-found: the target Printer and/or Job object + does not exist. + + client-error-gone: the target Printer and/or Job object no + longer exists and no forwarding address is known. + + client-error-request-entity-too-large: same as Print-Job, + except no document data is involved. + + client-error-document-format-not-supported: not applicable. + + client-error-conflicting-attributes: same as Print-Job, except + that the Printer's "printer-is-accepting-jobs" attribute is not + involved. + + server-error-operation-not-supported: the Hold-Job operation is + not supported. + + server-error-device-error: not applicable. + + + +Hastings, et al. Informational [Page 68] + +RFC 3196 Internet Printing Protocol/1.1 November 2001 + + + server-error-temporary-error: same as Print-Job, except no + document data is involved. + + server-error-not-accepting-jobs: not applicable. + + server-error-job-canceled: not applicable. + +3.1.3.2.6 Release-Job + + All of the Print-Job status code descriptions in Section 3.1.3.1.1 + Print-Job Response with the specialization's described for Hold-Job + are applicable to Release-Job. See Section 13 in [RFC2911] for a + more complete description of each status code. + + server-error-operation-not-supported: the Release-Job operation + is not supported. + +3.1.3.2.7 Restart-Job + + All of the Print-Job status code descriptions in Section 3.1.3.1.1 + Print-Job Response with the specialization's described for Hold-Job + are applicable to Restart-Job. See Section 13 in [RFC2911] for a + more complete description of each status code. + + server-error-operation-not-supported: the Restart-Job operation + is not supported. + +3.1.3.2.7.1 Can documents be added to a restarted job? + + Assume I give a Create-Job request along with a set of 5 documents. + All the documents get printed and the job state is moved to + completed. I issue a Restart-Job request on the job. Now the issue + is that, if I try to add new documents to the restarted job, will the + IPP Server permit me to do so or return "client-error-not-possible " + and again print those 5 jobs? + + A job can not move to the 'completed' state until all the documents + have been processed. The 'last-document' flag indicates when the + last document for a job is being sent from the client. This is the + semantic equivalent of closing a job. No documents may be added once + a job is closed. Section 3.3.7 of the IPP/1.1 model states "The job + is moved to the 'pending' job state and restarts the beginning on the + same IPP Printer object with the same attribute values." 'number- + of-documents' is a job attribute. + + + + + + + +Hastings, et al. Informational [Page 69] + +RFC 3196 Internet Printing Protocol/1.1 November 2001 + + +3.1.4 Returning unsupported attributes in Get-Xxxx responses (Issue + 1.18) + + In the Get-Printer-Attributes, Get-Jobs, or Get-Job-Attributes + responses, the client cannot depend on getting unsupported attributes + returned in the Unsupported Attributes group that the client + requested, but are not supported by the IPP object. However, such + unsupported requested attributes will not be returned in the Job + Attributes or Printer Attributes group (since they are unsupported). + Furthermore, the IPP object is REQUIRED to return the 'successful- + ok-ignored-or-substituted-attributes' status code, so that the client + knows that not all that was requested has been returned. + +3.1.5 Sending empty attribute groups + + The [RFC2911] and [RFC2910] specifications RECOMMEND that a sender + not send an empty attribute group in a request or a response. + However, they REQUIRE a receiver to accept an empty attribute group + as equivalent to the omission of that group. So a client SHOULD omit + the Job Template Attributes group entirely in a create operation that + is not supplying any Job Template attributes. Similarly, an IPP + object SHOULD omit an empty Unsupported Attributes group if there are + no unsupported attributes to be returned in a response. + + The [RFC2910] specification REQUIRES a receiver to be able to receive + either an empty attribute group or an omitted attribute group and + treat them equivalently. The term "receiver" means an IPP object for + a request and a client for a response. The term "sender' means a + client for a request and an IPP object for a response. + + There is an exception to the rule for Get-Jobs when there are no + attributes to be returned. [RFC2910] contains the following + paragraph: + + The syntax allows an xxx-attributes-tag to be present when the xxx- + attribute-sequence that follows is empty. The syntax is defined this + way to allow for the response of Get-Jobs where no attributes are + returned for some job-objects. Although it is RECOMMENDED that the + sender not send an xxx-attributes-tag if there are no attributes + (except in the Get-Jobs response just mentioned), the receiver MUST + be able to decode such syntax. + + + + + + + + + + +Hastings, et al. Informational [Page 70] + +RFC 3196 Internet Printing Protocol/1.1 November 2001 + + +3.2 Printer Operations + +3.2.1 Print-Job operation + +3.2.1.1 Flow controlling the data portion of a Print-Job request (Issue + 1.22) + + A paused printer, or one that is stopped due to paper out or jam or + spool space full or buffer space full, may flow control the data of a + Print-Job operation (at the TCP/IP layer), so that the client is not + able to send all the document data. Consequently, the Printer will + not return a response until the condition is changed. + + The Printer should not return a Print-Job response with an error code + in any of these conditions, since either the printer will be resumed + and/or the condition will be freed either by human intervention or as + jobs print. + + In writing test scripts to test IPP Printers, the script must also be + written not to expect a response, if the printer has been paused, + until the printer is resumed, in order to work with all possible + implementations. + +3.2.1.2 Returning job-state in Print-Job response (Issue 1.30) + + An IPP client submits a small job via Print-Job. By the time the IPP + printer/print server is putting together a response to the operation, + the job has finished printing and been removed as an object from the + print system. What should the job-state be in the response? + + The Model suggests that the Printer return a response before it even + accepts the document content. The Job Object Attributes are returned + only if the IPP object returns one of the success status codes. Then + the job-state would always be "pending" or "pending-held". + + This issue comes up for the implementation of an IPP Printer object + as a server that forwards jobs to devices that do not provide job + status back to the server. If the server is reasonably certain that + the job completed successfully, then it should return the job-state + as 'completed'. Also the server can keep the job in its "job + history" long after the job is no longer in the device. Then a user + could query the server and see that the job was in the 'completed' + state and completed as specified by the jobs "time-at-completed" + time, which would be the same as the server submitted the job to the + device. + + + + + + +Hastings, et al. Informational [Page 71] + +RFC 3196 Internet Printing Protocol/1.1 November 2001 + + + An alternative is for the server to respond to the client before or + while sending the job to the device, instead of waiting until the + server has finished sending the job to the device. In this case, the + server can return the job's state as 'pending' with the 'job- + outgoing' value in the job's "job-state-reasons" attribute. + + If the server doesn't know for sure whether the job completed + successfully (or at all), it could return the (out-of-band) 'unknown' + value. + + On the other hand, if the server is able to query the device and/or + setup some sort of event notification that the device initiates when + the job makes state transitions, then the server can return the + current job state in the Print-Job response and in subsequent queries + because the server knows what the job state is in the device (or can + query the device). + + All of these alternatives depend on implementation of the server and + the device. + +3.2.2 Get-Printer-Attributes operation + + If a Printer supports the "printer-make-and-model" attribute and + returns the .INF file model name of the printer in that attribute, + the Microsoft client will automatically install the correct driver + (if available). + + Clients which poll periodically for printer status or queued-job- + count should use the "requested-attributes" operation attribute to + limit the scope of the query in order to save Printer and network + resources. + +3.2.3 Get-Jobs operation + +3.2.3.1 Get-Jobs, my-jobs='true', and 'requesting-user-name' (Issue + 1.39)? + + In [RFC2911] section 3.2.6.1 'Get-Jobs Request', if the attribute + 'my-jobs' is present and set to TRUE, MUST the 'requesting-user-name' + attribute be there too, and if it's not present what should the IPP + printer do? + + [RFC2911] Section 8.3 describes the various cases of "requesting- + user-name" being present or not for any operation. If the client + does not supply a value for "requesting-user-name", the printer MUST + assume that the client is supplying some anonymous name, such as + "anonymous". + + + + +Hastings, et al. Informational [Page 72] + +RFC 3196 Internet Printing Protocol/1.1 November 2001 + + +3.2.3.2 Why is there a "limit" attribute in the Get-Jobs operation? + + When using the Get-Jobs operation a client implementer might choose + to limit the number of jobs that the client shows on the first + screenful. For example, if its UI can only display 50 jobs, it can + defend itself against a printer that would otherwise return 500 jobs, + perhaps taking a long time on a slow dial-up line. The client can + then go and ask for a larger number of jobs in the background, while + showing the user the first 50 jobs. Since the job history is returned + in reverse order, namely the most recently completed jobs are + returned first, the user is most likely interested in the first jobs + that are returned. Limiting the number of jobs may be especially + useful for a client that is requesting 'completed' jobs from a + printer that keeps a long job history. Clients that don't mind + sometimes getting very large responses, can omit the "limit" + attribute in their Get-Jobs requests. + +3.2.4 Create-Job operation + + A Printer may respond to a Create-Job operation with "job-state" + 'pending' or 'pending-held' and " job-state-reason" 'job-data- + insufficient' to indicate that operation has been accepted by the + Printer, but the Printer is expecting additional document data before + it can move the job into the 'processing' state. Alternatively, it + may respond with "job-state" 'processing' and "job-state-reason" + 'job-incoming' to indicate that the Create-Job operation has been + accepted by the Printer, but the Printer is expecting additional + Send-Document and/or Send-URI operations and/or is + accessing/accepting document data. The second alternative is for + non-spooling Printers that don't implement the 'pending' state. + + Should the server wait for the "last-document" operation attribute + set to 'true' before starting to "process" the job? + + It depends on implementation. Some servers spool the entire job, + including all document data, before starting to process, so such an + implementation would wait for the "last-document" before starting to + process the job. If the time-out occurs without the "last-document", + then the server takes one of the indicated actions in section 3.3.1 + in the [RFC2911] document. Other servers will start to process + document data as soon as they have some. These are the so-called + "non-spooling" printers. Currently, there isn't a way for a client to + determine whether the Printer will spool all the data or will start + to process (and print) as soon as it has some data. + + + + + + + +Hastings, et al. Informational [Page 73] + +RFC 3196 Internet Printing Protocol/1.1 November 2001 + + +3.3 Job Operations + +3.3.1 Validate-Job + + The Validate-Job operation has been designed so that its + implementation may be a part of the Print-Job operation. Therefore, + requiring Validate-Job is not a burden on implementers. Also it is + useful for client's to be able to count on its presence in all + conformance implementations, so that the client can determine before + sending a long document, whether the job will be accepted by the IPP + Printer or not. + +3.3.2 Restart-Job + + The Restart-Job operation allows the reprocessing of a completed job. + Some jobs store the document data on the printer. Jobs created using + the Print-Job operation are an example. It is required that the + printer retains the job data after the job has moved to a 'completed + state' in order for the Restart-Job operation to succeed. + + Some jobs contain only a reference to the job data. A job created + using the Print-URI is an example of such a job. When the Restart- + Job operation is issued the job is reprocessed. The job data MUST be + retrieved again to print the job. + + It is possible that a job fails while attempting to access the print + data. When such a job is the target of a Restart-Job the Printer + SHALL attempt to retrieve the job data again. + +4 Object Attributes + +4.1 Attribute Syntax's + +4.1.1 The 'none' value for empty sets (Issue 1.37) + + [RFC2911] states that the 'none' value should be used as the value of + a 1setOf when the set is empty. In most cases, sets that are + potentially empty contain keywords so the keyword 'none' is used, but + for the 3 finishings attributes, the values are enums and thus the + empty set is represented by the enum 3. Currently there are no other + attributes with 1setOf values, which can be empty and can contain + values that are not keywords. This exception requires special code + and is a potential place for bugs. It would have been better if we + had chosen an out-of-band value, either "no-value" or some new value, + such as 'none'. Since we didn't, implementations have to deal with + the different representations of 'none', depending on the attribute + syntax. + + + + +Hastings, et al. Informational [Page 74] + +RFC 3196 Internet Printing Protocol/1.1 November 2001 + + +4.1.2 Multi-valued attributes (Issue 1.31) + + What is the attribute syntax for a multi-valued attribute? Since + some attributes support values in more than one data type, such as + "media", "job-hold-until", and "job-sheets", IPP semantics associate + the attribute syntax with each value, not with the attribute as a + whole. The protocol associates the attribute syntax tag with each + value. Don't be fooled, just because the attribute syntax tag comes + before the attribute keyword. All attribute values after the first + have a zero length attribute keyword as the indication of a + subsequent value of the same attribute. + +4.1.3 Case Sensitivity in URIs (issue 1.6) + + IPP client and server implementations must be aware of the diverse + uppercase/lowercase nature of URIs. RFC 2396 defines URL schemes and + Host names as case insensitive but reminds us that the rest of the + URL may well demonstrate case sensitivity. When creating URL's for + fields where the choice is completely arbitrary, it is probably best + to select lower case. However, this cannot be guaranteed and + implementations MUST NOT rely on any fields being case-sensitive or + case-insensitive in the URL beyond the URL scheme and host name + fields. + + The reason that the IPP specification does not make any restrictions + on URIs, is so that implementations of IPP may use off-the-shelf + components that conform to the standards that define URIs, such as + RFC 2396 and the HTTP/1.1 specifications [RFC2616]. See these + specifications for rules of matching, comparison, and case- + sensitivity. + + It is also recommended that System Administrators and implementations + avoid creating URLs for different printers that differ only in their + case. For example, don't have Printer1 and printer1 as two different + IPP Printers. + + Example of equivalent URI's + + http://abc.com:80/~smith/home.html + + http://ABC.com/%7Esmith/home.html + + http:/ABC.com:/%7esmith/home.html + + Example of equivalent URI's using the IPP scheme + + ipp://abc.com:631/~smith/home.html + + + + +Hastings, et al. Informational [Page 75] + +RFC 3196 Internet Printing Protocol/1.1 November 2001 + + + ipp://ABC.com/%7Esmith/home.html + + http:/ABC.com:631/%7esmith/home.html + + The HTTP/1.1 specification [RFC2616] contains more details on + comparing URLs. + +4.1.4 Maximum length for xxxWithLanguage and xxxWithoutLanguage + + The 'textWithLanguage' and 'nameWithLanguage' are compound syntaxes + that have two components. The first component is the 'language' + component that can contain up to 63 octets. The second component is + the 'text' or 'name' component. The maximum length of these are 1023 + octets and 255 octets respectively. The definition of attributes + with either syntax may further restrict the length (e.g., printer- + name (name(127))). + + The length of the 'language' component has no effect on the allowable + length of 'text' in 'textWithLanguage' or the length of 'name' in + 'nameWithLanguage' + +4.2 Job Template Attributes + +4.2.1 multiple-document-handling(type2 keyword) + +4.2.1.1 Support of multiple document jobs + + IPP/1.0 is silent on which of the four effects an implementation + would perform if it supports Create-Job, but does not support + "multiple-document-handling" or multiple documents per job. IPP/1.1 + was changed so that a Printer could support Create-Job without having + to support multiple document jobs. The "multiple-document-jobs- + supported" (boolean) Printer description attribute was added to + IPP/1.1 along with the 'server-error-multiple-document-jobs-not- + supported' status code for a Printer to indicate whether or not it + supports multiple document jobs, when it supports the Create-Job + operation. Also IPP/1.1 was clarified that the Printer MUST support + the "multiple-document-handling" (type2 keyword) Job Template + attribute with at least one value if the Printer supports multiple + documents per job. + +4.3 Job Description Attributes + +4.3.1 Getting the date and time of day + + The "date-time-at-creation", "date-time-at-processing", and "date- + time-at-completed" attributes are returned as dateTime syntax. These + attributes are OPTIONAL for a Printer to support. However, there are + + + +Hastings, et al. Informational [Page 76] + +RFC 3196 Internet Printing Protocol/1.1 November 2001 + + + various ways for a Printer to get the date and time of day. Some + suggestions: + + 1. A Printer can get time from an NTP timeserver if there's one + reachable on the network . See RFC 1305. Also DHCP option 32 + in RFC 2132 returns the IP address of the NTP server. + + 2. Get the date and time at startup from a human operator + + 3. Have an operator set the date and time using a web + administrative interface + + 4. Get the date and time from incoming HTTP requests, though the + problems of spoofing need to be considered. Perhaps comparing + several HTTP requests could reduce the chances of spoofing. + + 5. Internal date time clock battery driven. + + 6. Query "http://tycho.usno.navy.mil/cgi-bin/timer.pl" + +4.4 Printer Description Attributes + +4.4.1 queued-job-count (integer(0:MAX)) + +4.4.1.1 Why is "queued-job-count" RECOMMENDED (Issue 1.14)? + + The reason that "queued-job-count" is RECOMMENDED, is that some + clients look at that attribute alone when summarizing the status of a + list of printers, instead of doing a Get-Jobs to determine the number + of jobs in the queue. Implementations that fail to support the + "queued-job-count" will cause that client to display 0 jobs when + there are actually queued jobs. + + We would have made it a REQUIRED Printer attribute, but some + implementations had already been completed before the issue was + raised, so making it a SHOULD was a compromise. + +4.4.1.2 Is "queued-job-count" a good measure of how busy a printer is + (Issue 1.15)? + + The "queued-job-count" is not a good measure of how busy the printer + is when there are held jobs. A future registration could be to add a + "held-job-count" (or an "active-job-count") Printer Description + attribute if experience shows that such an attribute (combination) is + needed to quickly indicate how busy a printer really is. + + + + + + +Hastings, et al. Informational [Page 77] + +RFC 3196 Internet Printing Protocol/1.1 November 2001 + + +4.4.2 printer-current-time (dateTime) + + A Printer implementation MAY support this attribute by obtaining the + date and time by any number of implementation-dependent means at + startup or subsequently. Examples include: + + 1. an internal date time clock, + + 2. from the operator at startup using the console, + + 3. from an operator using an administrative web page, + + 4. from HTTP headers supplied in client requests, + + 5. use HTTP to query "http://tycho.usno.navy.mil/cgi-bin/timer.pl" + + 6. from the network, using NTP [RFC1305] or DHCP option 32 + [RFC2132] that returns the IP address of the NTP server. + + If an implementation supports this attribute by obtaining the current + time from the network (at startup or later), but the time is not + available, then the implementation MUST return the value of this + attribute using the out-of-band 'no-value' meaning not configured. + See the beginning of section 4.1. + + Since the new "date-and-time-at-xxx" Job Description attributes refer + to the "printer-current-time", they will be covered also. + +4.4.3 Printer-uri + + Must the operational attribute for printer-uri match one of the + values in "printer-uri-supported"? + + A forgiving printer implementation would not reject the operation. + But the implementation has its rights to reject a printer or job + operation if the operational attribute printer-uri is not a value of + the printer-uri-supported. The printer might not be improperly + configured. The request obviously reached the printer. The printer + could treat the printer-uri as the logical equivalent of a value in + the printer-uri-supported. It would be implementation dependent for + which value, and associated security policy, would apply. This does + also apply to a job object specified with a printer-uri and job-id, + or with a job-uri. See section 4.1.3 for how to compare URI's. + + + + + + + + +Hastings, et al. Informational [Page 78] + +RFC 3196 Internet Printing Protocol/1.1 November 2001 + + +4.5 Empty Jobs + + The IPP object model does not prohibit a job that contains no + documents. Such a job may be created in a number of ways including a + 'create-job' followed by an 'add-document' that contains no data and + has the 'last-document' flag set. + + An empty job is processed just as any other job. The operation that + "closes" an empty job is not rejected because the job is empty. If + no other conditions exist, other than the job is empty, the response + to the operation will indicate success. After the job is scheduled + and processed, the job state SHALL be 'completed'. + + There will be some variation in the value(s) of the "job-state- + reasons" attribute. It is required that if no conditions, other than + the job being empty, exist the "job-state-reasons" SHALL include the + + 'completed-successfully'. If other conditions existed, the + 'completed-with-warnings' or 'completed-with-errors' values may be + used. + +5 Directory Considerations + +5.1 General Directory Schema Considerations + + The [RFC2911] document lists RECOMMENDED and OPTIONAL Printer object + attributes for directory schemas. See [RFC2911] APPENDIX E: Generic + Directory Schema. + + The SLP printer template is defined in the "Definition of the Printer + Abstract Service Type v2.0" document [svrloc-printer]. The LDAP + printer template is defined in the "Internet Printing Protocol (IPP): + LDAP Schema for Printer Services" document [ldap-printer]. Both + documents systematically add "printer-" to any attribute that doesn't + already start with "printer-" in order to keep the printer directory + attributes distinct from other directory attributes. Also, instead + of using "printer-uri-supported", "uri-authentication-supported", and + "uri-security-supported", they use a "printer-xri-supported" + attribute with special syntax to contain all of the same information + in a single attribute. + +5.2 IPP Printer with a DNS name + + If the IPP printer has a DNS name should there be at least two values + for the printer-uri-supported attribute. One URL with the fully + qualified DNS name the other with the IP address in the URL? + + + + + +Hastings, et al. Informational [Page 79] + +RFC 3196 Internet Printing Protocol/1.1 November 2001 + + + The printer may contain one or the other or both. It's up to the + administrator to configure this attribute. + +6 Security Considerations + + The security considerations given in [RFC2911] Section 8 "Security + Considerations" all apply to this document. In addition, the + following sub-sections describes security consideration that have + arisen as a result of implementation testing. + +6.1 Querying jobs with IPP that were submitted using other job + submission protocols (Issue 1.32) + + The following clarification was added to [RFC2911] section 8.5: + + 8.5 Queries on jobs submitted using non-IPP protocols If the + device that an IPP Printer is representing is able to accept jobs + using other job submission protocols in addition to IPP, it is + RECOMMEND that such an implementation at least allow such + "foreign" jobs to be queried using Get-Jobs returning "job-id" and + "job-uri" as 'unknown'. Such an implementation NEED NOT support + all of the same IPP job attributes as for IPP jobs. The IPP + object returns the 'unknown' out-of-band value for any requested + attribute of a foreign job that is supported for IPP jobs, but not + for foreign jobs. + + It is further RECOMMENDED, that the IPP Printer generate "job-id" + and "job-uri" values for such "foreign jobs", if possible, so that + they may be targets of other IPP operations, such as Get-Job- + Attributes and Cancel-Job. Such an implementation also needs to + deal with the problem of authentication of such foreign jobs. One + approach would be to treat all such foreign jobs as belonging to + users other than the user of the IPP client. Another approach + would be for the foreign job to belong to 'anonymous'. Only if + the IPP client has been authenticated as an operator or + administrator of the IPP Printer object, could the foreign jobs be + queried by an IPP request. Alternatively, if the security policy + were to allow users to query other users' jobs, then the foreign + jobs would also be visible to an end-user IPP client using Get- + Jobs and Get-Job- Attributes. + + Thus IPP MAY be implemented as a "universal" protocol that + provides access to jobs submitted with any job submission + protocol. As IPP becomes widely implemented, providing a more + universal access makes sense. + + + + + + +Hastings, et al. Informational [Page 80] + +RFC 3196 Internet Printing Protocol/1.1 November 2001 + + +7 Encoding and Transport + + This section discusses various aspects of IPP/1.1 Encoding and + Transport [RFC2910]. + + A server is not required to send a response until after it has + received the client's entire request. Hence, a client must not + expect a response until after it has sent the entire request. + However, we recommend that the server return a response as soon as + possible if an error is detected while the client is still sending + the data, rather than waiting until all of the data is received. + Therefore, we also recommend that a client listen for an error + response that an IPP server MAY send before it receives all the data. + In this case a client, if chunking the data, can send a premature + zero-length chunk to end the request before sending all the data (and + so the client can keep the connection open for other requests, rather + than closing it). If the request is blocked for some reason, a + client MAY determine the reason by opening another connection to + query the server using Get-Printer-Attributes. + + IPP, by design, uses TCP's built-in flow control mechanisms [RFC 793] + to throttle clients when Printers are busy. Therefore, it is + perfectly normal for an IPP client transmitting a Job to be blocked + for a really long time. Accordingly, socket timeouts must be + avoided. Some socket implementations have a timeout option, which + specifies how long a write operation on a socket can be blocked + before it times out and the blocking ends. A client should set this + option for infinite timeout when transmitting Job submissions. + + Some IPP client applications might be able to perform other useful + work while a Job transmission is blocked. For example, the client + may have other jobs that it could transmit to other Printers + simultaneously. A client may have a GUI, which must remain + responsive to the user while the Job transmission is blocked. These + clients should be designed to spawn a thread to handle the Job + transmission at its own pace, leaving the main application free to do + other work. Alternatively, single-threaded applications could use + non-blocking I/O. + + Some Printer conditions, such as jam or lack of paper, could cause a + client to be blocked indefinitely. Clients may open additional + connections to the Printer to Get-Printer-Attributes, determine the + state of the device, alert a user if the printer is stopped, and let + a user decide whether to abort the job transmission or not. + + In the following sections, there are tables of all HTTP headers, + which describe their use in an IPP client or server. The following + is an explanation of each column in these tables. + + + +Hastings, et al. Informational [Page 81] + +RFC 3196 Internet Printing Protocol/1.1 November 2001 + + + - the "header" column contains the name of a header + - the "request/client" column indicates whether a client sends the + header. + - the "request/ server" column indicates whether a server supports + the header when received. + - the "response/ server" column indicates whether a server sends + the header. + - the "response /client" column indicates whether a client + supports the header when received. + - the "values and conditions" column specifies the allowed header + values and the conditions for the header to be present in a + request/response. + + The table for "request headers" does not have columns for responses, + and the table for "response headers" does not have columns for + requests. + + The following is an explanation of the values in the "request/client" + and "response/ server" columns. + + - must: the client or server MUST send the header, + - must-if: the client or server MUST send the header when the + condition described in the "values and conditions" column is + met, + - may: the client or server MAY send the header + - not: the client or server SHOULD NOT send the header. It is not + relevant to an IPP implementation. + + The following is an explanation of the values in the + "response/client" and "request/ server" columns. + + - must: the client or server MUST support the header, + - may: the client or server MAY support the header + - not: the client or server SHOULD NOT support the header. It is + not relevant to an IPP implementation. + + + + + + + + + + + + + + + + +Hastings, et al. Informational [Page 82] + +RFC 3196 Internet Printing Protocol/1.1 November 2001 + + +7.1 General Headers + + The following is a table for the general headers. + + General- Request Response Values and Conditions + Header + + Client Server Server Client + + + Cache- not must not "no-cache" only + Control must + + Connection must- must must- must "close" only. Both + if if client and server + SHOULD keep a + connection for the + duration of a sequence + of operations. The + client and server MUST + include this header + for the last operation + in such a sequence. + + Date may may must may per RFC 1123 [RFC1123] + from RFC 2616 + [RFC2616] + + Pragma must not must not "no-cache" only + + Transfer- must- must must- must "chunked" only. Header + Encoding if if MUST be present if + Content-Length is + absent. + + Upgrade not not not not + + Via not not not not + + + + + + + + + + + + + +Hastings, et al. Informational [Page 83] + +RFC 3196 Internet Printing Protocol/1.1 November 2001 + + +7.2 Request Headers + + The following is a table for the request headers. + + Request- Client Server Request Values and Conditions + Header + + Accept may must "application/ipp" only. This + value is the default if the + client omits it + + Accept- not not Charset information is within the + Charset application/ipp entity + + Accept- may must empty and per RFC 2616 [RFC2616] + Encoding and IANA registry for content- + codings + + Accept- not not language information is within the + Language application/ipp entity + + Authorization must- must per RFC 2616. A client MUST send + if this header when it receives a + 401 "Unauthorized" response and + does not receive a "Proxy- + Authenticate" header. + + From not not per RFC 2616. Because RFC + recommends sending this header + only with the user's approval, + it is not very useful + + Host must must per RFC 2616 + + If-Match not not + + If-Modified- not not + Since + + If-None-Match not not + + If-Range not not + + If- not not + Unmodified- + Since + + + + + +Hastings, et al. Informational [Page 84] + +RFC 3196 Internet Printing Protocol/1.1 November 2001 + + + Request- Client Server Request Values and Conditions + Header + + Max-Forwards not not + + Proxy- must- not per RFC 2616. A client MUST send + Authorizati if this header when it receives a + on 401 "Unauthorized" response and + a "Proxy-Authenticate" header. + + Range not not + + Referrer not not + + User-Agent not not + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Hastings, et al. Informational [Page 85] + +RFC 3196 Internet Printing Protocol/1.1 November 2001 + + +7.3 Response Headers + + The following is a table for the request headers. + + Response- Server Client Response Values and Conditions + Header + + + Accept-Ranges not not + + Age not not + + Location must- may per RFC 2616. When URI needs + if redirection. + + Proxy- must per RFC 2616 + Authenticat + e not + + Public may may per RFC 2616 + + Retry-After may may per RFC 2616 + + Server not not + + Vary not not + + Warning may may per RFC 2616 + + WWW- must- must per RFC 2616. When a server needs + Authenticate if to authenticate a client. + + + + + + + + + + + + + + + + + + + + +Hastings, et al. Informational [Page 86] + +RFC 3196 Internet Printing Protocol/1.1 November 2001 + + +7.4 Entity Headers + + The following is a table for the entity headers. + + Entity-Header Request Response Values and + Conditions + + Client Server Server Client + + Allow not not not not + + Content-Base not not not not + + Content- may must must must per RFC 2616 and + Encoding IANA registry for + content codings. + + Content- not not not not Application/ipp + Language handles language + + Content- must- must must- must the length of the + Length if if message-body per + RFC 2616. Header + MUST be present + if Transfer- + Encoding is + absent.. + + Content- not not not not + Location + + Content-MD5 may may may may per RFC 2616 + + Content-Range not not not not + + Content-Type must must must must "application/ipp" + only + + ETag not not not not + + Expires not not not not + + Last-Modified not not not not + + + + + + + + +Hastings, et al. Informational [Page 87] + +RFC 3196 Internet Printing Protocol/1.1 November 2001 + + +7.5 Optional support for HTTP/1.0 + + IPP implementations consist of an HTTP layer and an IPP layer. In + the following discussion, the term "client" refers to the HTTP client + layer and the term "server" refers to the HTTP server layer. The + Encoding and Transport document [RFC2910] requires that HTTP 1.1 MUST + be supported by all clients and all servers. However, a client + and/or a server implementation may choose to also support HTTP 1.0. + + This option means that a server may choose to communicate with a + (non-conforming) client that only supports HTTP 1.0. In such cases + the server should not use any HTTP 1.1 specific parameters or + features and should respond using HTTP version number 1.0. + + This option also means that a client may choose to communicate with a + (non-conforming) server that only supports HTTP 1.0. In such cases, + if the server responds with an HTTP 'unsupported version number' to + an HTTP 1.1 request, the client should retry using HTTP version + number 1.0. + +7.6 HTTP/1.1 Chunking + +7.6.1 Disabling IPP Server Response Chunking + + Clients MUST anticipate that the HTTP/1.1 server may chunk responses + and MUST accept them in responses. However, a (non-conforming) HTTP + client that is unable to accept chunked responses may attempt to + request an HTTP 1.1 server not to use chunking in its response to an + operation by using the following HTTP header: + + TE: identity + + This mechanism should not be used by a server to disable a client + from chunking a request, since chunking of document data is an + important feature for clients to send long documents. + +7.6.2 Warning About the Support of Chunked Requests + + This section describes some problems with the use of chunked requests + and HTTP/1.1 servers. + + The HTTP/1.1 standard [RFC2616] requires that conforming servers + support chunked requests for any method. However, in spite of this + requirement, some HTTP/1.1 implementations support chunked responses + in the GET method, but do not support chunked POST method requests. + Some HTTP/1.1 implementations that support CGI scripts [CGI] and/or + servlets [Servlet] require that the client supply a Content-Length. + These implementations might reject a chunked POST method and return a + + + +Hastings, et al. Informational [Page 88] + +RFC 3196 Internet Printing Protocol/1.1 November 2001 + + + 411 status code (Length Required), might attempt to buffer the + request and run out of room returning a 413 status code (Request + Entity Too Large), or might successfully accept the chunked request. + + Because of this lack of conformance of HTTP servers to the HTTP/1.1 + standard, the IPP standard [RFC2910] REQUIRES that a conforming IPP + Printer object implementation support chunked requests and that + conforming clients accept chunked responses. Therefore, IPP object + implementers are warned to seek HTTP server implementations that + support chunked POST requests in order to conform to the IPP standard + and/or use implementation techniques that support chunked POST + requests. + +8 References + + [CGI] CGI/1.1 (http://www.w3.org/CGI/). + + [IANA-CS] IANA Registry of Coded Character Sets: + http://www.iana.org/assignments/character-sets + + [ldap-printer] Fleming, P., Jones, K., Lewis, H. and I. McDonald, + "Internet Printing Protocol (IPP): LDAP Schema for + Printer Services", Work in Progress. + + [RFC793] Postel, J., "Transmission Control Protocol", STD 7, + RFC 793, September 1981. + + [RFC1123] Braden, R., "Requirements for Internet Hosts - + Application and Support", RFC 1123, October, 1989. + + [RFC2026] Bradner, S., "The Internet Standards Process -- + Revision 3", BCP 9, RFC 2026, October 1996. + + [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate + Requirement Levels", BCP 14, RFC 2119 , March 1997. + + [RFC2396] Berners-Lee, T., Fielding, R. and L. Masinter, + "Uniform Resource Identifiers (URI): Generic + Syntax", RFC 2396, August 1998. + + [RFC2565] DeBry, R., Hastings, T., Herriot, R., Isaacson, S. + and P. Powell, "Internet Printing Protocol/1.0: + Model and Semantics", RFC 2566, April 1999. + + + + + + + + +Hastings, et al. Informational [Page 89] + +RFC 3196 Internet Printing Protocol/1.1 November 2001 + + + [RFC2566] Herriot, R., Butler, S., Moore, P. and R. Turner, + "Internet Printing Protocol/1.0: Encoding and + Transport", RFC 2565, April 1999. + + [RFC2567] Wright, D., "Design Goals for an Internet Printing + Protocol", RFC 2567, April 1999. + + [RFC2568] Zilles, S., "Rationale for the Structure and Model + and Protocol for the Internet Printing Protocol", + RFC 2568, April 1999. + + [RFC2569] Herriot, R., Hastings, T., Jacobs, N. and J. + Martin, "Mapping between LPD and IPP Protocols", + RFC 2569, April 1999. + + [RFC2616] Fielding, R., Gettys, J., Mogul, J., Frystyk, H., + Masinter, L., Leach, P. and T. Berners-Lee, + "Hypertext Transfer Protocol - HTTP/1.1", RFC 2616, + June 1999. + + [RFC2910] Herriot, R., Butler, S., Moore, P. and R. Turner, + "Internet Printing Protocol/1.0: Encoding and + Transport", RFC 2910, September, 2000. + + [RFC2911] DeBry, R., Hastings, T., Herriot, R., Isaacson, S. + and P. Powell, "Internet Printing Protocol/1.0: + Model and Semantics", RFC 2911, September, 2000. + + [Servlet] Servlet Specification Version 2.1 + (http://java.sun.com/products/servlet/2.1/ + index.html). + + [svrloc-printer] St. Pierre, P., Isaacson, S., McDonald, I., + "Definition of the Printer Abstract Service Type + v2.0", http://www.isi.edu/in- + notes/iana/assignments/svrloc- + templates/printer.2.0.en (IANA Registered, May 27, + 2000). + + [SSL] Netscape, The SSL Protocol, Version 3, (Text + version 3.02), November 1996. + + + + + + + + + + +Hastings, et al. Informational [Page 90] + +RFC 3196 Internet Printing Protocol/1.1 November 2001 + + +9. Authors' Addresses + + Thomas N. Hastings + Xerox Corporation + 701 Aviation Blvd. + El Segundo, CA 90245 + + EMail: hastings@cp10.es.xerox.com + + + Carl-Uno Manros + Independent Consultant + 1601 N. Sepulveda Blvd. #505 + Manhattan Beach, CA 90266 + + Email: carl@manros.com + + + Carl Kugler + Mail Stop 003G + IBM Printing Systems Co + 6300 Diagonal Hwy + Boulder CO 80301 + + EMail: Kugler@us.ibm.com + + + Henrik Holst + i-data Printing Systems + Vadstrupvej 35-43 + 2880 Bagsvaerd, Denmark + + EMail: hh@I-data.com + + + Peter Zehler + Xerox Corporation + 800 Philips Road + Webster, NY 14580 + + EMail: PZehler@crt.xerox.com + + + + + + + + + + +Hastings, et al. Informational [Page 91] + +RFC 3196 Internet Printing Protocol/1.1 November 2001 + + + IPP Web Page: http://www.pwg.org/ipp/ + IPP Mailing List: ipp@pwg.org + + To subscribe to the ipp mailing list, send the following email: + + 1) send it to majordomo@pwg.org + 2) leave the subject line blank + 3) put the following two lines in the message body: + subscribe ipp + end + + Implementers of this specification document are encouraged to join + the IPP Mailing List in order to participate in any discussions of + clarification issues and review of registration proposals for + additional attributes and values. In order to reduce spam the + mailing list rejects mail from non-subscribers, so you must subscribe + to the mailing list in order to send a question or comment to the + mailing list. + + Other Participants: + + Chuck Adams - Tektronix Shivaun Albright - HP + + Stefan Andersson - Axis Jeff Barnett - IBM + + Ron Bergman - Hitachi Koki Dennis Carney - IBM + Imaging Systems + + Keith Carter - IBM Angelo Caruso - Xerox + + Rajesh Chawla - TR Computing Nancy Chen - Okidata + Solutions + + Josh Cohen - Microsoft Jeff Copeland - QMS + + Andy Davidson - Tektronix Roger deBry - IBM + + Maulik Desai - Auco Mabry Dozier - QMS + + Lee Farrell - Canon Information Satoshi Fujitami - Ricoh + Systems + + Steve Gebert - IBM Sue Gleeson - Digital + + Charles Gordon - Osicom Brian Grimshaw - Apple + + Jerry Hadsell - IBM Richard Hart - Digital + + + + +Hastings, et al. Informational [Page 92] + +RFC 3196 Internet Printing Protocol/1.1 November 2001 + + + Tom Hastings - Xerox Henrik Holst - I-data + + Stephen Holmstead Zhi-Hong Huang - Zenographics + + Scott Isaacson - Novell Babek Jahromi - Microsoft + + Swen Johnson - Xerox David Kellerman - Northlake + Software + + Robert Kline - TrueSpectra Charles Kong - Panasonic + + Carl Kugler - IBM Dave Kuntz - Hewlett-Packard + + Takami Kurono - Brother Rick Landau - Digital + + Scott Lawrence - Agranot Systems Greg LeClair - Epson + + Dwight Lewis - Lexmark Harry Lewis - IBM + + Tony Liao - Vivid Image Roy Lomicka - Digital + + Pete Loya - HP Ray Lutz - Cognisys + + Mike MacKay - Novell, Inc. David Manchala - Xerox + + Carl-Uno Manros - Xerox Jay Martin - Underscore + + Stan McConnell - Xerox Larry Masinter - Xerox + + Sandra Matts - Hewlett Packard Peter Michalek - Shinesoft + + Ira McDonald - High North Inc. Mike Moldovan - G3 Nova + + Tetsuya Morita - Ricoh Yuichi Niwa - Ricoh + + Pat Nogay - IBM Ron Norton - Printronics + + Hugo Parra, Novell Bob Pentecost - Hewlett-Packard + + Patrick Powell - Astart Jeff Rackowitz - Intermec + Technologies + + Eric Random - Peerless Rob Rhoads - Intel + + Xavier Riley - Xerox Gary Roberts - Ricoh + + David Roach - Unisys Stuart Rowley - Kyocera + + + + +Hastings, et al. Informational [Page 93] + +RFC 3196 Internet Printing Protocol/1.1 November 2001 + + + Yuji Sasaki - Japan Computer Richard Schneider - Epson + Industry + + Kris Schoff - HP Katsuaki Sekiguchi - Canon + + Bob Setterbo - Adobe Gail Songer - Peerless + + Hideki Tanaka - Canon Devon Taylor - Novell, Inc. + + Mike Timperman - Lexmark Atsushi Uchino - Epson + + Shigeru Ueda - Canon Bob Von Andel - Allegro Software + + William Wagner - NetSilicon/DPI Jim Walker - DAZEL + + Chris Wellens - Interworking Labs Trevor Wells - Hewlett Packard + + Craig Whittle - Sharp Labs Rob Whittle - Novell, Inc. + + Jasper Wong - Xionics Don Wright - Lexmark + + Michael Wu - Heidelberg Digital Rick Yardumian - Xerox + + Michael Yeung - Toshiba Lloyd Young - Lexmark + + Atsushi Yuki - Kyocera Peter Zehler - Xerox + + William Zhang- Canon Information Frank Zhao - Panasonic + Systems + + Steve Zilles - Adobe Rob Zirnstein - Canon + Information Systems + +10. Description of the Base IPP Documents + + In addition to this document, the base set of IPP documents includes: + + Design Goals for an Internet Printing Protocol [RFC2567] + Rationale for the Structure and Model and Protocol for the + Internet + Printing Protocol [RFC2568] + Internet Printing Protocol/1.1: Model and Semantics [RFC2911] + Internet Printing Protocol/1.1: Encoding and Transport [RFC2910] + Mapping between LPD and IPP Protocols [RFC2569] + + The "Design Goals for an Internet Printing Protocol" document takes a + broad look at distributed printing functionality, and it enumerates + real-life scenarios that help to clarify the features that need to be + + + +Hastings, et al. Informational [Page 94] + +RFC 3196 Internet Printing Protocol/1.1 November 2001 + + + included in a printing protocol for the Internet. It identifies + requirements for three types of users: end users, operators, and + administrators. It calls out a subset of end user requirements that + are satisfied in IPP/1.0 [RFC2566, RFC2565]. A few OPTIONAL operator + operations have been added to IPP/1.1 [RFC2911, RFC2910]. + + The "Rationale for the Structure and Model and Protocol for the + Internet Printing Protocol" document describes IPP from a high level + view, defines a roadmap for the various documents that form the suite + of IPP specification documents, and gives background and rationale + for the IETF IPP working group's major decisions. + + The "Internet Printing Protocol/1.1: Model and Semantics" document + describes a simplified model with abstract objects, their attributes, + and their operations. The model introduces a Printer and a Job. The + Job supports multiple documents per Job. The model document also + addresses how security, internationalization, and directory issues + are addressed. + + The "Internet Printing Protocol/1.1: Encoding and Transport" document + is a formal mapping of the abstract operations and attributes defined + in the model document onto HTTP/1.1 [RFC2616]. It also defines the + encoding rules for a new Internet MIME media type called + "application/ipp". This document also defines the rules for + transporting a message body over HTTP whose Content-Type is + "application/ipp". This document defines the 'ipp' scheme for + identifying IPP printers and jobs. + + The "Mapping between LPD and IPP Protocols" document gives some + advice to implementers of gateways between IPP and LPD (Line Printer + Daemon) implementations. + + + + + + + + + + + + + + + + + + + + +Hastings, et al. Informational [Page 95] + +RFC 3196 Internet Printing Protocol/1.1 November 2001 + + +11 Full Copyright Statement + + Copyright (C) The Internet Society (2001). All Rights Reserved. + + This document and translations of it may be copied and furnished to + others, and derivative works that comment on or otherwise explain it + or assist in its implementation may be prepared, copied, published + and distributed, in whole or in part, without restriction of any + kind, provided that the above copyright notice and this paragraph are + included on all such copies and derivative works. However, this + document itself may not be modified in any way, such as by removing + the copyright notice or references to the Internet Society or other + Internet organizations, except as needed for the purpose of + developing Internet standards in which case the procedures for + copyrights defined in the Internet Standards process must be + followed, or as required to translate it into languages other than + English. + + The limited permissions granted above are perpetual and will not be + revoked by the Internet Society or its successors or assigns. + + This document and the information contained herein is provided on an + "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING + TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING + BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION + HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF + MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + +Acknowledgement + + Funding for the RFC Editor function is currently provided by the + Internet Society. + + + + + + + + + + + + + + + + + + + +Hastings, et al. Informational [Page 96] + diff --git a/standards/rfc3391.txt b/standards/rfc3391.txt new file mode 100644 index 000000000..00f43d587 --- /dev/null +++ b/standards/rfc3391.txt @@ -0,0 +1,1403 @@ + + + + + + +Network Working Group R. Herriot +Request for Comments: 3391 December 2002 +Category: Informational + + + The MIME Application/Vnd.pwg-multiplexed Content-Type + +Status of this Memo + + This memo provides information for the Internet community. It does + not specify an Internet standard of any kind. Distribution of this + memo is unlimited. + +Copyright Notice + + Copyright (C) The Internet Society (2002). All Rights Reserved. + +IESG Note + + The IESG believes use of this media type is only appropriate in + situations where the producer is fully aware of the capabilities and + limitations of the consumer. In particular, this mechanism is very + dependent on the producer knowing when the consumer will need a + particular component of a multipart object. But consumers + potentially work in many different ways and different consumers may + need different things at different times. This mechanism provides no + means for a producer to determine the needs of a particular consumer + and how they are to be accommodated. + + Alternative mechanisms, such as a protocol based on BEEP which is + capable of bidirectional communication between the producer and + consumer, should be considered when the capabilities of the consumer + are not known by the producer. + +Abstract + + The Application/Vnd.pwg-multiplexed content-type, like the + Multipart/Related content-type, provides a mechanism for representing + objects that consist of multiple components. An + Application/Vnd.pwg-multiplexed entity contains a sequence of chunks. + Each chunk contains a MIME message or a part of a MIME message. Each + MIME message represents a component of the compound object, just as a + body part of a Multipart/Related entity represents a component. With + a Multipart/Related entity, a body part and its reference in some + other body part may be separated by many octets. With an + Application/Vnd.pwg-multiplexed entity, a message and its reference + in some other message can be made quite close by chunking the message + containing the reference. For example, if a long message contains + + + +Herriot Informational [Page 1] + +RFC 3391 Application/Multiplexed December 2002 + + + references to images and the producer does not know of the need for + each image until it generates the reference, then + Application/Vnd.pwg-multiplexed allows the consumer to process the + reference to the image and the image before it consumes the entire + long message. This ability is important in printing and scanning + applications. This document defines the Application/Vnd.pwg- + multiplexed content-type. It also provides examples of its use. + +Table of Contents + + 1. Introduction....................................................2 + 2. Terminology.....................................................7 + 3. Details.........................................................9 + 3.1 Syntax of Application/Vnd.pwg-multiplexed Contents...........10 + 3.2 Parameters for Application/Vnd.pwg-multiplexed...............12 + 3.2.1 The "type" Parameter.......................................12 + 3.2.2 Syntax.....................................................12 + 4. Handling Application/Vnd.pwg-multiplexed Entities..............12 + 5. Examples.......................................................13 + 5.1 Example With Multipart/Related...............................14 + 5.2 Examples with Application/Vnd.pwg-multiplexed................15 + 5.2.1 Example Where Each Chunk Has a Complete Message............15 + 5.2.2 Example of Chunking the Root Message.......................17 + 5.2.3 Example of Chunking the Several Messages...................18 + 5.2.4 Example of Chunks with Empty Payloads......................20 + 6. Security Considerations........................................22 + 7. Registration Information for Application/Vnd.pwg-multiplexed...22 + 8. Acknowledgments................................................23 + 9. References.....................................................23 + 10. Author's Address..............................................24 + 11. Full Copyright Statement......................................25 + +1. Introduction + + The simple MIME content-types, such as "text/plain" provide a + mechanism for representing a simple object, such as a text document. + The Multipart/Related [RFC2387] content-type provides a mechanism for + representing a compound object, such as a text document with two gif + images. + + A compound object consists of multiple components. One such + component is the root component, which contains references to other + components of the compound object. These components may, in turn, + contain references to other components of the compound object. For + example, a compound object could consist of a root html text + component and two gif image components -- each referenced by the root + component. + + + + +Herriot Informational [Page 2] + +RFC 3391 Application/Multiplexed December 2002 + + + A compound object and a component are both abstractions. For + transmission over the wire or writing to storage, each needs a + representation. A "Multipart/Related entity" is one possible + representation of a compound object, and a "body part" is one + possible representation of a component. + + However, the Multipart/Related content-type is not a good solution + for applications that require each component to be close to its + corresponding reference in the root component. This document defines + a new MIME content-type Application/Vnd.pwg-multiplexed that provides + a better solution for some applications. The Application/Vnd.pwg- + multiplexed content-type, like the Multipart/Related content-type, + provides a common mechanism for representing a compound object. A + Multipart/Related entity consists of a sequence of body parts + separated by boundary strings. Each body part represents a component + of the compound object. An Application/Vnd.pwg-multiplexed entity + consists of a sequence of chunks, each of whose length is specified + in the chunk header. Each chunk contains a message or a part of a + message. Each message represents a component of the compound object. + Chunks from different messages can be interleaved. HTTP is the + typical transport for an Application/Vnd.pwg-multiplexed entity over + the wire. An Application/Vnd.pwg-multiplexed entity could be stored + in a Microsoft HTML (message/rfc822) file whose suffix is .mht. + + The following paragraphs contain three examples of applications. For + each application, there is a discussion of its solution with the + Application/Vnd.pwg-multiplexed content-type, the Multipart/Related + content-type and BEEP [RFC3080]. + + Example 1: a printing application. A Producer creates a print stream + that consists of a very long series of page descriptions, each of + which references one or more images. The root component is the long + series of page descriptions. An image may be referenced from + multiple pages descriptions, and there is a mechanism to indicate + when there are no additional references to an image (i.e., the image + is out of scope). The Producer does not know what images to include + with a page until it generates that page. The Consumer is presumed + to have enough storage to hold all in-scope images and enough of the + root component to process at least one page. The Producer doesn't + need any knowledge of the Consumer's storage capabilities in order to + create an entity that the Consumer can successfully process. + However, the Producer needs to be prudent about the number of images + that are in-scope at any time. Of course, a malicious Producer may + try to exceed the storage capabilities of the Consumer, and the + Consumer must guard against such entities (see section 6). Here are + ways to represent this compound object. + + + + + +Herriot Informational [Page 3] + +RFC 3391 Application/Multiplexed December 2002 + + + With the Application/Vnd.pwg-multiplexed content-type, each image + is a message and the root component is a message. The Producer + breaks the root component message into chunks with each image + message occurring shortly before its first reference. When the + Consumer encounters a reference, it can assume that it has already + received the referenced image in an earlier chunk. + + With the Multipart/Related content-type, each image must either + precede or follow the root component. + + If images follow the root component, the Consumer must read all + remaining pages of the root component before it can print the + first page that references such images. The Consumer must wait + to print such a page until it has received the entire root + component, and the Consumer may not have the space to hold the + remaining pages. + + If images precede the root component, the Producer must + determine and send all such images before it sends the root + component. The Consumer must, in the best case, wait some + additional time before it receives the first page of the root + component. In the worse case, the Consumer may not have enough + storage for all the images. + + The Multipart/Related solution is not a good solution because + of the wait time and because, in some cases, the Consumer may + not have sufficient storage for all of the images. + + With BEEP, the images and root component can be sent in separate + channels. The Producer can push each image when it encounters the + first reference or the Consumer can request it when it encounters + the first reference. The over-the-wire stream of octets is + similar to an Application/Vnd.pwg-multiplexed entity. However, + there is a substantial difference in behavior for a printing + application. With the Application/Vnd.pwg-multiplexed content- + type, the Producer puts each image message before its first + reference so that when the Consumer encounters a reference, the + image is guaranteed to be present on the printer. With BEEP, if + the Consumer pulls the image, the Consumer has to wait while the + image comes over the network. If the Producer pushes the image, + BEEP may put the image message after its first reference and the + Consumer may still have to wait for the image. A high-speed + printer should not have to risk waiting for images; otherwise it + cannot run at full speed. + + Example 2: a scanning (fax-like) application. The Producer is a + scanner, which scans pages and sends them along with a vnd.pwg- + xhtml-print+xml root component that contains references to each page + + + +Herriot Informational [Page 4] + +RFC 3391 Application/Multiplexed December 2002 + + + image. Each page is referenced exactly once in the root-component. + The Consumer is a printer that consumes vnd.pwg-xhtml-print+xml + entities and their attachments. That is, the Consumer is not limited + to print jobs that come from scanners. A Producer and Consumer are + each presumed to have enough storage to hold a few page images and + most if not all of the root component. The Producer doesn't need any + additional knowledge of the Consumer's storage capabilities in order + to create an entity that the Consumer can successfully process. Of + course, a malicious Producer may try to exceed the storage + capabilities of the Consumer and the Consumer must guard against such + entities (see section 6). Here are ways to represent this compound + object. + + With the Application/Vnd.pwg-multiplexed content-type, each page + image is a message and the root component is a message. The + Producer breaks the root component message into chunks with each + image message just before or just after its reference. + + With the Multipart/Related content-type, the images cannot precede + the root component because the Consumer might not have enough + space to store them until the root component arrived. In this + case, the printer could fail to print the job correctly and the + Producer might not know. Therefore the images must follow the + root component, and the Producer must scan all pages before it can + send the first page. At the very least, this solution delays the + printing of the pages until all have been scanned. In the worst + case, the Producer does not have sufficient memory to buffer the + images, and the job fails. + + With BEEP, the issues are the same as in the previous example, + except that speed is not as important in this case. So BEEP is a + viable alternative for this example. + + Example 3: a printing application. A Producer creates a print stream + that consists of a series of pages, each of which references zero or + more images. Each image is referenced exactly once. The Producer + does not know what images to include with a page until it generates + that page, and the Producer doesn't know the layout details; the + Consumer handles layout. The Producer has enough storage to send the + root component and all images. However, it may not have enough + storage to hold the entire root component or all octets of any of the + images. The Consumer is presumed to have enough storage to render + the root component and to render each image. It may not have enough + storage to hold the entire root component or all octets of any of the + images. The Producer doesn't determine the Consumer's storage + capabilities. Rather it arranges the components so that the Consumer + is mostly likely to succeed. Of course, a malicious Producer may try + + + + +Herriot Informational [Page 5] + +RFC 3391 Application/Multiplexed December 2002 + + + to exceed the storage capabilities of the Consumer, and the Consumer + must guard against such entities (see section 6). Here are ways to + represent this compound object. + + With the Application/Vnd.pwg-multiplexed content-type, each image + is a message and the root component is a message. The Producer + breaks the root component message into chunks with each image + message just after its reference. The references appear first so + that the Consumer knows the location of each image before it + processes the image. This strategy minimizes storage needs for + Producer and Consumer and provides a good strategy in case of + failure. Here are the cases to consider. + + a) When the document consists of vertically aligned blocks where + each block contains either lines of text or a single image, the + sequence of chunks is the same as the sequence of printable + blocks, thus minimizing Consumer buffering needs. + + b) When a block can contain N side-by-side images, the Consumer + must buffer N-1 images unless the Producer interleaves the + images. If the Producer doesn't interleave the images, and the + Consumer runs out of storage before it has received N-1, + images, it can print what it has and print the remaining images + below; not what the Producer intended, but better than nothing. + If the Producer interleaves images, and the Consumer runs out + of storage before it has received the bands of N images, the + Consumer would print portions of images interleaved with + portions of other images. So, a Producer should not interleave + images. + + c) When a block contains text and image side-by-side (i.e., run- + around text), there are additional buffering requirements. + When the Consumer processes the text that follows the + reference, it will place some of it next to the image (run- + around text) and will place the remaining text after the image. + The Producer doesn't know where the run-around ends, and thus + doesn't know where to end the text chunk and start the image + chunk. If the Producer ends the text too soon, then the + Consumer either has to process the entire image (if it has + enough storage) in order to get the remaining run-around text, + or it ends the run-around text prematurely. If the Producer + ends the text too late, then the Consumer may have to store too + much text and possibly put the image later than the Producer + requested. Because text data requires significantly less + storage than image data, a good strategy for Producer is to err + on the side of sending too much rather than too little text + before the image data. + + + + +Herriot Informational [Page 6] + +RFC 3391 Application/Multiplexed December 2002 + + + d) When a block contains text and multiple side-by-side images, + the problem becomes a combination of items b) and c) above. + + The Application/Vnd.pwg-multiplexed content-type can be made to + work in this example, but a Consumer must have failure strategies + and the result may not be quite what the producer intended. With + the Multipart/Related content-type, the images cannot precede the + root component because the Consumer might not have enough space to + store them until the root component arrived. Also, the images + cannot follow the root component because the Consumer might not + have enough storage for the root component before the first image + arrives. So the Multipart/Related content-type is not an + acceptable solution for this example. + + With BEEP, the Producer can send the root component on channel 1 + and the Consumer can request images on even numbered channels when + it encounters a reference. This solution allows more flexibility + than the Application/Vnd.pwg-multiplexed content-type. If there + are side-by-side images and/or run-around text, the Consumer can + request bands of each image or run-around text over separate + channels. + + In all of these examples, the Application/Vnd.pwg-multiplexed + content-type provides a much better solution than Multipart/Related. + However, it is evenly matched with BEEP. For applications where + speed is important and ordering of the chunks is important in order + to avoid printing delays, the Application/Vnd.pwg-multiplexed + content-type is best. For applications, where the Consumer needs + more control over the ordering of received octets, BEEP is best. + +2. Terminology + + This document uses some of the MIME terms that are defined in + [RFC2045]. The following are the terms used in this document: + + Entity: the headers and the content. In this document, the term + "entity" describes all the octets that represent a compound + object. + + Message: an entity as in [RFC2045]. In this document, the term + "message" describes all octets that represent one component of a + compound object. That is, it has MIME headers and content. + + Body Part: an entity inside a multipart. That is, a body part is + the headers and content (i.e., octets) between the multipart + boundary strings not including the CRLF at the beginning and end. + This document never uses "entity" to mean "body part". + + + + +Herriot Informational [Page 7] + +RFC 3391 Application/Multiplexed December 2002 + + + Headers: the initial lines of an entity, message or body part. An + empty line (i.e., two adjacent CRLFs) terminates the headers. + Sometimes the term "MIME header" is used instead of just "header". + + Content: the part of an entity, message or body part that follows + the headers (i.e., follows the two adjacent CRLFs). The content + of a body part ends at the octet preceding the CRLF before the + multipart boundary string. The content of a message ends at the + octets specified by the length field in the Chunk Header. + + This document uses the following additional terms. + + Chunk: a chunk of data, consisting of a chunk header, a chunk + payload and a CRLF. + + Chunk Header: the first line of a chunk. The line consists of the + "CHK" keyword, the message number, the length and the continuation + indicator, each separated by a single space character (ASCII 32). + A CRLF terminates the line. Each message in an + Application/Vnd.pwg-multiplexed entity has a message number that + normally differs from the message numbers of all other messages in + the Application/Vnd.pwg-multiplexed entity. The message number 0 + is reserved for final Chunk Header in the Application/Vnd.pwg- + multiplexed entity. + + Chunk Payload: the octets between the Chunk Header and the Chunk + Header of the next chunk. The length field in the header's length + field specifies the number of octets in the Chunk Payload. The + Chunk Payload is either a complete message or a part of a message. + The continuation field in the header specifies whether the chunk + is the last chunk of the message. + + CRLF: the sequence of octets corresponding to the two US-ASCII + characters CR (decimal value 13) and LF (decimal value 10) which, + taken together, in this order, denote a line break. A CRLF + terminates each chunk in order to provide visual separation from + the next chunk header. + + Consumer: the software that receives and processes a MIME entity, + e.g., software in a printer or software that reads a file. + + Producer: the software that creates and sends a MIME entity, e.g., + software in a scanner or software that writes a file. + + + + + + + + +Herriot Informational [Page 8] + +RFC 3391 Application/Multiplexed December 2002 + + +3. Details + + The Application/Vnd.pwg-multiplexed content-type, like + Multipart/Related, is intended to represent a compound object + consisting of several inter-related components. This document does + not specify the representation of these relationships, but [RFC2557] + contains examples of Multipart/Related entities that use the + Content-ID and Content-Location headers to identify body parts and + URLs (including the "cid" URL) to reference body parts. It is + expected that Application/Vnd.pwg-multiplexed entities would use the + patterns described in [RFC2557]. + + For an Application/Vnd.pwg-multiplexed entity, there is one parameter + for the Content-Type header. It is a "type" parameter, and it is + like the "type" parameter for the Multipart/Related content-type. + The value of the "type" parameter must be the content-type of the + root message and it effectively specifies the type of the compound + object. + + An Application/Vnd.pwg-multiplexed entity contains a sequence of + chunks. Each chunk consists of a chunk header, a chunk payload and a + CRLF. + + - The chunk header consists of a "CHK" keyword followed by the + message number, the chunk payload length, whether the chunk is + the last chunk of a message and, finally, a CRLF. The length + field removes the need for boundary strings that Multipart uses. + (See section 3.1 for the syntax of a chunk header). + + - The chunk payload is a sequence of octets that is either a + complete message or a part of a message. + + - The CRLF provides visual separation from the following chunk. + + Each message represents a component of the compound object, and a + message is intended to have exactly the same representation, octet + for octet, as a body part of a Multipart/Related entity that + represents the same component. When a message is split across + multiple chunks, the chunks need not be contiguous. + + The contents of an Application/Vnd.pwg-multiplexed entity have the + following properties: + + 1) The first chunk contains a complete or partial message that (in + either case) represents the root component of the compound + object. + + + + + +Herriot Informational [Page 9] + +RFC 3391 Application/Multiplexed December 2002 + + + 2) Additional chunks contain messages or partial messages that + represent some component of the compound object. + + 3) The final chunk's header contains a message number of 0, a + length of 0 and a last-chunk-of-message mark (i.e., the chunk + header line is "CHK 0 0 LAST"). The final chunk contains no + chunk payload. + + 4) A message can be broken into multiple parts and each break can + occur anywhere within the message. Each part of the message is + zero or more bytes in length and each part of the message is + the contents of its own chunk. The order of the chunks within + the Application/Vnd.pwg-multiplexed entity must be the same as + the order of the parts within the message. + + 5) A message represents a component of a compound object, and it + is intended that it have exactly the same representation, octet + for octet, as a body part of a Multipart/Related entity that + represents the same component. In particular, the message may + contain a Content-Type header to specify the content-type of + the message content. Also, the message may contain a Content- + ID header and/or Content-Location header to identify a message + that is referenced from within another message. If a message + contains no Content-Type header, then the message has an + implicit content-type of "text/plain; charset=us-ascii", cf. + [RFC2045]. + + See section 4 for a discussion displaying an Application/Vnd.pwg- + multiplexed entity. + +3.1 Syntax of Application/Vnd.pwg-multiplexed Contents + + The ABNF [RFC2234] for the contents of an Application/Vnd.pwg- + multiplexed entity is: + + contents = *chunk finalChunk + chunk = header payload CRLF + header = "CHK" SP messageNumber SP length SP isMore CRLF + messageNumber = 1..2147483647 + length = 0..2147483647 + isMore = "MORE" / "LAST" + payload = *OCTET + finalChunk = finalHeader CRLF + finalHeader = "CHK" SP "0" SP "0" SP "LAST" CRLF + + + + + + + +Herriot Informational [Page 10] + +RFC 3391 Application/Multiplexed December 2002 + + + The messageNumber field specifies the message that the chunk is + associated with. See the end of this section for more details. + + The length field specifies the number of octets in the chunk payload + (represented in ABNF as "payload"). The first octet of the chunk + payload is the one immediately following the LF (i.e., final octet) + of the chunk header. The last octet of the chunk payload is the one + immediately preceding the two octets CRLF that end the chunk. + + The isMore field has a value of "LAST" for the last chunk of a + message and "MORE" for all other chunks of a message. + + Normally each message in an Application/Vnd.pwg-multiplexed entity + has a unique message number, and a message consists of the + concatenation of all the octets from the one or more chunks with the + same message number. The isMore field of the chunk header of the + last chunk of each message must have a value of "LAST" and the isMore + field of the chunk header of all other chunks must have a value of + "MORE". + + Two or more messages may have the same message number, though such + reuse of message numbers is not recommended. The chunks with the + same message number represent a sequence of one or more messages + where the isMore field of the chunk header of the last chunk of each + message has a value of "LAST". All chunks whose isMore field of the + chunk header has the value of "MORE" belong to the same message as + the next chunk (in sequence) whose isMore field of the chunk header + has the value of "LAST". In other words, if two messages have the + same message number, the last chunk of the first message must occur + before the first chunk of the second message. + + The behavior of the Consumer is undefined if the final Chunk (i.e., + the Chunk whose chunk header is "CHK 0 0 LAST") occurs before the + last chunk of every message occurs. + + Two adjacent chunks usually have different message numbers. However, + they may have the same message number. If two adjacent chunks have + the same message number, the two chunks could be combined into a + single chunk, but they need not be combined. + + The number of octets in a chunk payload may be zero, and an + Application/Vnd.pwg-multiplexed entity may contain any number of + chunks with zero octets of chunk payload. For example, the last + chunk of each message may contain zero octets for programming + convenience. As another example, suppose that a particular compound + object format requires that referenced messages occur before the root + message. This document requires that the first chunk of an + Application/Vnd.pwg-multiplexed entity contain the root message or a + + + +Herriot Informational [Page 11] + +RFC 3391 Application/Multiplexed December 2002 + + + part of it. So, the first chunk contains a chunk payload of zero + octets with the first octet of the root message in the second chunk. + That is, all of the message headers of the root message are in the + second chunk. As an extreme but unlikely example, it would be + possible to have a message broken into ten chunks with zero octet + chunk payloads in all chunks except for chunks 4 and 7. + +3.2 Parameters for Application/Vnd.pwg-multiplexed + + This section defines additional parameters for Application/Vnd.pwg- + multiplexed. + +3.2.1 The "type" Parameter + + The type parameter must be specified. Its value is the content-type + of the "root" message. It permits a Consumer to determine the + content-type without reference to the enclosed message. If the value + of the type parameter differs from the content-type of the root + message, the Consumer's behavior is undefined. + +3.2.2 Syntax + + The syntax for "parameter" is: + + parameter := "type" "=" type "/" subtype ; cf. [RFC2045] + +4. Handling Application/Vnd.pwg-multiplexed Entities + + The application that handles the Application/Vnd.pwg-multiplexed + entity has the responsibility for displaying the entity. However, + Application/Vnd.pwg-multiplexed messages may contain Content- + Disposition headers that provide suggestions for the display and + storage of a message, and in some cases the application may pay + attention to such headers. + + As a reminder, Content-Disposition headers [RFC1806] allow the sender + to suggest presentation styles for MIME messages. There are two + presentation styles, 'inline' and 'attachment'. Content-Disposition + headers have a parameter for specifying a suggested file name for + storage. + + There are three cases to consider for handling Application/Vnd.pwg- + multiplexed entities: + + a) The Consumer recognizes Application/Vnd.pwg-multiplexed and the + content-type of the root. The Consumer determines the + presentation style for the compound object; it handles the + display of the components of the compound object in the context + + + +Herriot Informational [Page 12] + +RFC 3391 Application/Multiplexed December 2002 + + + of the compound object. In this case, the Content-Disposition + header information is redundant or even misleading, and the + Consumer shall ignore them for purposes of display. The + Consumer may use the suggested file name if the entity is + stored. + + b) The Consumer recognizes Application/Vnd.pwg-multiplexed, but + not the content-type of the root. The Consumer will give the + user the choice of suppressing the entire Application/Vnd.pwg- + multiplexed entity or treating the Application/Vnd.pwg- + multiplexed entity as a Multipart/Mixed entity where each + message is a body part of the Multipart/Mixed entity. In this + case (where the entity is not suppressed), the Consumer may + find the Content-Disposition information useful for displaying + each body part of the resulting Multipart/Mixed entity. If a + body part has no Content-Disposition header, the Consumer + should display the body part as an attachment. + + c) The Consumer does not recognize Application/Vnd.pwg- + multiplexed. The Consumer treats the Application/Vnd.pwg- + multiplexed entity as opaque and can do nothing with it. + +5. Examples + + This section contains five examples. Each example is a different + representation of the same compound object. The compound object has + four components: an XHTML text component and three image components. + The images are encoded in binary. The string "<<binary data>>" and + "<<part of binary data>>" in each example represents all or part of + the binary data of each image. Two of the images are potentially + side by side and the third image is displayed later in the document. + All of the images are identified by Content-Id and two of the images + are also identified by a Content-Location. One of the images + references the Content-Location. + + The first example shows a Multipart/Related representation of the + compound object in order to provide a representation that the reader + is familiar with. The remaining examples show Application/Vnd.pwg- + multiplexed representations of the same compound object. In the + second example, each chunk contains a whole message. In the third + example, the XHTML message is split across 3 chunks, and these chunks + are interleaved among the three image messages. In the fourth + example, the XHTML message is split across 4 chunks, and the two + side-by-side images are each split across two chunks. The XHTML + chunks are interleaved among the image chunks. In the fifth example, + there are chunks with empty payloads and adjacent chunks with the + same message number. + + + + +Herriot Informational [Page 13] + +RFC 3391 Application/Multiplexed December 2002 + + + The last example may seem to address useless cases, but sometimes it + is easier to write software if these cases are allowed. For example, + when a buffer fills, it may be easiest to write a chunk and not worry + if the previous chunk had the same message number. Likewise, it may + be easiest to end a message with an empty chunk. Finally, the + Application/Vnd.pwg-multiplexed content-type requires that the first + chunk be part of the root message. Sometimes, it is more convenient + for the Producer if the root message starts after the occurrence of + some attachments. Since a chunk can be empty, the first chunk of the + root message can be empty, i.e., it doesn't even contain any headers. + Then the first chunk contains a part of the root message, but the + Producer doesn't generate any octets for that chunk. + + Each body part of the Multipart/Related entity and each message of + the Application/Vnd.pwg-multiplexed entity contain a content- + disposition, which the Consumer uses according to the rules in + section 4. Note the location of the content-disposition headers in + the examples. + +5.1 Example With Multipart/Related + + In this example, the compound object is represented as a + Multipart/Related entity so that the reader can compare it with the + Application/Vnd.pwg-multiplexed entities. + + Content-Type: multipart/related; boundary="boundary-example"; + type="text/xhtml+xml" + + --boundary-example + Content-ID: <49568.44343xxx@foo.com> + Content-Type: application/vnd.pwg-xhtml-print+xml + Content-Disposition: inline + + <?xml version="1.0"?> + <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + <html xmlns="http://www.w3.org/TR/xhtml1"> + <body> + <p>some text + <img src="cid:49568.45876xxx@foo.com"/> + <img src="http://foo.com/images/image2.gif"/> + some more text after the images + </p> + <p>some more text without images + </p> + <p>some more text + <img src="cid:49568.47333xxx@foo.com"/> + </p> + + + +Herriot Informational [Page 14] + +RFC 3391 Application/Multiplexed December 2002 + + + <p>some final text + </p> + </body> + </html> + --boundary-example + Content-ID: <49568.45876xxx@foo.com> + Content-Location: http://foo.com/images/image1.gif + Content-Type: image/gif + Content-Disposition: attachment + + <<binary data>> + --boundary-example + Content-ID: <49568.46000xxx@foo.com> + Content-Location: http://foo.com/images/image2.gif + Content-Type: image/gif + Content-Disposition: attachment + + <<binary data>> + --boundary-example + Content-ID: <49568.47333xxx@foo.com> + Content-Type: image/gif + Content-Disposition: attachment + + <<binary data>> + --boundary-example-- + +5.2 Examples with Application/Vnd.pwg-multiplexed + + The four examples in this section show Application/Vnd.pwg- + multiplexed representations of the same compound object. Note that + each CRLF is represented by a visual line break. + +5.2.1 Example Where Each Chunk Has a Complete Message + + In this example, the compound object is represented as an + Application/Vnd.pwg-multiplexed entity. Each chunk contains an + entire message, i.e., none of the messages are split across multiple + chunks. Each message in this example is identical to the + corresponding body part in the preceding Multipart/Relate example. + + Content-Type: application/vnd.pwg-multiplexed; + type="application/vnd.pwg-xhtml-print+xml" + + CHK 1 550 LAST + Content-ID: <49568.44343xxx@foo.com> + Content-Type: application/vnd.pwg-xhtml-print+xml + Content-Disposition: inline + + + + +Herriot Informational [Page 15] + +RFC 3391 Application/Multiplexed December 2002 + + + <?xml version="1.0"?> + <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + <html xmlns="http://www.w3.org/TR/xhtml1"> + <body> + <p>some text + <img src="cid:49568.45876xxx@foo.com"/> + <img src="http://foo.com/images/image2.gif"/> + some more text after the images + </p> + <p>some more text without images + </p> + <p>some more text + <img src="cid:49568.47333xxx@foo.com"/> + </p> + <p>some final text + </p> + </body> + </html> + + CHK 2 6346 LAST + Content-ID: <49568.45876xxx@foo.com> + Content-Location: http://foo.com/images/image1.gif + Content-Type: image/gif + Content-Disposition: attachment + + <<binary data>> + CHK 3 6401 LAST + Content-ID: <49568.46000xxx@foo.com> + Content-Location: http://foo.com/images/image2.gif + Content-Type: image/gif + Content-Disposition: attachment + + <<binary data>> + CHK 4 7603 LAST + Content-ID: <49568.47333xxx@foo.com> + Content-Type: image/gif + Content-Disposition: attachment + + <<binary data>> + CHK 0 0 LAST + + + + + + + + + + +Herriot Informational [Page 16] + +RFC 3391 Application/Multiplexed December 2002 + + +5.2.2 Example of Chunking the Root Message + + In this example, the compound object is represented as an + Application/Vnd.pwg-multiplexed entity. The message containing the + XHTML component is split into 3 pieces so that the reference to an + image is as close as possible to the beginning of the chunk. The + chunk containing the referenced image message occurs just before the + chunk with the reference. This minimizes the distance between + reference and referenced message. + + Note that there are other possible arrangements (see the third + example in section 5.2.3). For example, a sender could split the + XHTML message so that the reference to an image is as close as + possible to the end of the chunk. Then the chunk containing the + referenced image message should occur just after the chunk with the + reference. The sender could mix this strategy with the one used in + this example. + + Content-Type: application/vnd.pwg-multiplexed; + type=" application/vnd.pwg-xhtml-print+xml" + + CHK 1 267 MORE + Content-ID: <49568.44343xxx@foo.com> + Content-Type: application/vnd.pwg-xhtml-print+xml + Content-Disposition: inline + + <?xml version="1.0"?> + <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + <html xmlns="http://www.w3.org/TR/xhtml1"> + <body> + <p>some text + + CHK 2 6346 LAST + Content-ID: <49568.45876xxx@foo.com> + Content-Location: http://foo.com/images/image1.gif + Content-Type: image/gif + Content-Disposition: attachment + + <<binary data>> + CHK 3 6401 LAST + Content-ID: <49568.46000xxx@foo.com> + Content-Location: http://foo.com/images/image2.gif + Content-Type: image/gif + Content-Disposition: attachment + + + + + + +Herriot Informational [Page 17] + +RFC 3391 Application/Multiplexed December 2002 + + + <<binary data>> + CHK 1 166 MORE + <img src="cid:49568.45876xxx@foo.com"/> + <img src="http://foo.com/images/image2.gif"/> + some more text after the images + </p> + <p>some more text without images + </p> + <p>some more text + + CHK 4 7603 LAST + Content-ID: <49568.47333xxx@foo.com> + Content-Type: image/gif + Content-Disposition: attachment + + <<binary data>> + CHK 1 80 LAST + <img src="cid:49568.47333xxx@foo.com"/> + </p> + <p>some final text + </p> + </body> + </html> + + CHK 0 0 LAST + +5.2.3 Example of Chunking the Several Messages + + In this example, the compound object is represented as an + Application/Vnd.pwg-multiplexed entity. The message containing the + XHTML component is split into 4 pieces so that the reference to an + image is as close as possible to either the beginning or the end of + the chunk. The references to the first and second images closely + follow the referenced images. The reference to the third image + closely precedes the referenced image. This minimizes the distance + between reference and referenced message. In addition, the first two + image messages are split into two chunks each. + + Content-Type: application/vnd.pwg-multiplexed; + type=" application/vnd.pwg-xhtml-print+xml" + + CHK 1 303 MORE + Content-ID: <49568.44343xxx@foo.com> + Content-Type: application/vnd.pwg-xhtml-print+xml + Content-Disposition: inline + + + + + + +Herriot Informational [Page 18] + +RFC 3391 Application/Multiplexed December 2002 + + + <?xml version="1.0"?> + <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + <html xmlns="http://www.w3.org/TR/xhtml1"> + <body> + <p>some text + + CHK 2 184 MORE + Content-ID: <49568.45876xxx@foo.com> + Content-Location: http://foo.com/images/image1.gif + Content-Type: image/gif + Content-Disposition: attachment + + <<part of binary data>> + CHK 3 200 MORE + Content-ID: <49568.46000xxx@foo.com> + Content-Location: http://foo.com/images/image2.gif + Content-Type: image/gif + Content-Disposition: attachment + + <<part of binary data>> + CHK 1 78 MORE + <img src="cid:49568.45876xxx@foo.com"/> + <img src="http://foo.com/images/image2.gif"/> + + CHK 2 6162 LAST + <<part of binary data>> + CHK 3 6201 LAST + <<part of binary data>> + CHK 1 127 MORE + some more text after the images + </p> + <p>some more text without images + </p> + <p>some more text + <img src="cid:49568.47333xxx@foo.com"/> + + CHK 4 7603 LAST + Content-ID: <49568.47333xxx@foo.com> + Content-Type: image/gif + Content-Disposition: attachment + + + + + + + + + + +Herriot Informational [Page 19] + +RFC 3391 Application/Multiplexed December 2002 + + + <<binary data>> + CHK 1 41 LAST + </p> + <p>some final text + </p> + </body> + </html> + + CHK 0 0 LAST + +5.2.4 Example of Chunks with Empty Payloads + + This example is identical to the previous one, except that some + chunks have a chunk payload of zero octets. The root message starts + with a chunk whose payload is empty and every message ends with a + chunk whose payload is empty. This example also shows two adjacent + chunks that are from the same message. These two chunks could be + coalesced into a single chunk, but they might be kept separate for + programming convenience. + + Content-Type: application/vnd.pwg-multiplexed; + type=" application/vnd.pwg-xhtml-print+xml" + + CHK 1 0 MORE + + CHK 2 184 MORE + Content-ID: <49568.45876xxx@foo.com> + Content-Location: http://foo.com/images/image1.gif + Content-Type: image/gif + Content-Disposition: attachment + + <<part of binary data>> + CHK 3 200 MORE + Content-ID: <49568.46000xxx@foo.com> + Content-Location: http://foo.com/images/image2.gif + Content-Type: image/gif + Content-Disposition: attachment + + <<part of binary data>> + CHK 1 303 MORE + Content-ID: <49568.44343xxx@foo.com> + Content-Type: application/vnd.pwg-xhtml-print+xml + Content-Disposition: inline + + + + + + + + +Herriot Informational [Page 20] + +RFC 3391 Application/Multiplexed December 2002 + + + <?xml version="1.0"?> + <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + <html xmlns="http://www.w3.org/TR/xhtml1"> + <body> + <p>some text + + CHK 2 6162 MORE + <<part of binary data>> + CHK 3 6201 MORE + <<part of binary data>> + CHK 2 0 LAST + + CHK 3 0 LAST + + CHK 1 78 MORE + <img src="cid:49568.45876xxx@foo.com"/> + <img src="http://foo.com/images/image2.gif"/> + + CHK 4 7603 MORE + Content-ID: <49568.47333xxx@foo.com> + Content-Type: image/gif + Content-Disposition: attachment + + <<binary data>> + CHK 4 0 LAST + + CHK 1 127 MORE + some more text after the images + </p> + <p>some more text without images + </p> + <p>some more text + <img src="cid:49568.47333xxx@foo.com"/> + + CHK 1 41 MORE + </p> + <p>some final text + </p> + </body> + </html> + + CHK 1 0 LAST + + CHK 0 0 LAST + + + + + + +Herriot Informational [Page 21] + +RFC 3391 Application/Multiplexed December 2002 + + +6. Security Considerations + + There are security considerations that pertain to each message of an + Application/Vnd.pwg-multiplexed entity. Those security + considerations are described by the document that defines the + content-type of the message. They are not addressed in this + document. + + There are also security considerations that pertain to the + Application/Vnd.pwg-multiplexed entity as a whole. A Producer that + is buggy or malicious may send an Application/Vnd.pwg-multiplexed + entity that could cause a Consumer to request more storage than it + has, even if it has a large amount of storage. A Consumer must be + able to deal gracefully with the following scenarios and combinations + of them: + + - The chunks of one or more messages are separated by a very large + number of octets. In the extreme case some or all of the + messages don't terminate, i.e., they don't contain a closing + chunk. + - A very large number of messages are started and interleaved + before their final chunk occurs. + - A message contains one or more references to other messages that + never occur or don't occur for a large number of octets. + - A very large number of referenced messages occur before the + Consumer knows that it can discard them. + +7. Registration Information for Application/Vnd.pwg-multiplexed + + The following form is copied from RFC 1590, Appendix A. + + To: iana@iana.org + + Subject: Registration of new Media Type + application/Vnd.pwg-multiplexed + Media Type name: Application + Media subtype name: Vendor Tree - vnd.pwg-multiplexed + Required parameters: Type, a media type/subtype. + Optional parameters: No optional parameters + Encoding considerations: Each message of an + Application/Vnd.pwg-multiplexed entity can be + encoded in any manner allowed by the Content- + Type of the message. However, using the + reasoning of Multipart, the + Application/Vnd.pwg-multiplexed entity cannot + be encoded. Otherwise, a message would be + + + + + +Herriot Informational [Page 22] + +RFC 3391 Application/Multiplexed December 2002 + + + encoded twice, once at the message level and + once at the Application/Vnd.pwg-multiplexed + level. + Security considerations: See section 6 (Security + Considerations) of RFC 3391. + Published specification: RFC 3391. + Person & email address to contact for further information: + + Robert Herriot + 706 Colorado Ave. + Palo Alto, CA 94303 + USA + Phone: 1-650-327-4466 + Fax: 1-650-327-4466 + EMail: bob@herriot.com + +8. Acknowledgments + + The author gratefully acknowledges the contributions of: Ugo Corda, + Dave Crocker, Melinda Sue Grant, Graham Klyne, Carl-Uno Manros, Larry + Masinter, Ira McDonald, Chris Newman, Henrik Frystyk Nielsen and Dale + R. Worley. In particular, Chris Newman provided invaluable help. + +9. References + + [RFC1806] Troost, R. and S. Dorner, "Communicating Presentation + Information in Internet Messages: The Content-Disposition + Header", RFC 1806, June 1995. + + [RFC1873] Levinson, E. and J. Clark, "Message/External-Body Content- + ID Access Type", RFC 1873, December 1995. + Levinson, E., "Message/External-Body Content-ID Access + Type", Work in Progress. + + [RFC2045] Freed, N. and N. Borenstein, "Multipurpose Internet Mail + Extensions (MIME) Part One: Format of Internet Message + Bodies", RFC 2045, November 1996. + + [RFC2046] Freed, N. and N. Borenstein, "Multipurpose Internet Mail + Extensions (MIME) Part Two: Media Types", RFC 2046, + November 1996. + + [RFC2234] Crocker, D. and P. Overell, "Augmented BNF for + SyntaxSpecifications: ABNF", RFC 2234, November 1997. + + [RFC2387] Levinson, E., "The MIME Multipart/Related Content-type", + RFC 2387, August 1998. + + + + +Herriot Informational [Page 23] + +RFC 3391 Application/Multiplexed December 2002 + + + [RFC2392] Levinson, E., "Content-ID and Message-ID Uniform Resource + Locators", RFC 2392, August 1998. + + [RFC2557] Palme, J., "MIME Encapsulation of Aggregate Documents, such + as HTML (MHTML", RFC 2557, March 1999. + + [RFC2822] Resnick, P., Editor, "Internet Message Format", RFC 2822, + April 2001. + + [RFC3080] Rose, M., "The Blocks Extensible Exchange Protocol Core", + RFC 3080, March 2001. + +10. Author's Address + + Robert Herriot + 706 Colorado Ave. + Palo Alto, CA 94303 + USA + + Phone: 1-650-327-4466 + Fax: 1-650-327-4466 + EMail: bob@herriot.com + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Herriot Informational [Page 24] + +RFC 3391 Application/Multiplexed December 2002 + + +11. Full Copyright Statement + + Copyright (C) The Internet Society (2002). All Rights Reserved. + + This document and translations of it may be copied and furnished to + others, and derivative works that comment on or otherwise explain it + or assist in its implementation may be prepared, copied, published + and distributed, in whole or in part, without restriction of any + kind, provided that the above copyright notice and this paragraph are + included on all such copies and derivative works. However, this + document itself may not be modified in any way, such as by removing + the copyright notice or references to the Internet Society or other + Internet organizations, except as needed for the purpose of + developing Internet standards in which case the procedures for + copyrights defined in the Internet Standards process must be + followed, or as required to translate it into languages other than + English. + + The limited permissions granted above are perpetual and will not be + revoked by the Internet Society or its successors or assigns. + + This document and the information contained herein is provided on an + "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING + TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING + BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION + HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF + MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + +Acknowledgement + + Funding for the RFC Editor function is currently provided by the + Internet Society. + + + + + + + + + + + + + + + + + + + +Herriot Informational [Page 25] + diff --git a/standards/rfc3712.txt b/standards/rfc3712.txt new file mode 100644 index 000000000..f5bb966ea --- /dev/null +++ b/standards/rfc3712.txt @@ -0,0 +1,1851 @@ + + + + + + +Network Working Group P. Fleming +Request for Comments: 3712 IBM +Category: Informational I. McDonald + High North + February 2004 + + + Lightweight Directory Access Protocol (LDAP): + Schema for Printer Services + +Status of this Memo + + This memo provides information for the Internet community. It does + not specify an Internet standard of any kind. Distribution of this + memo is unlimited. + +Copyright Notice + + Copyright (C) The Internet Society (2004). All Rights Reserved. + +Abstract + + This document defines a schema, object classes and attributes, for + printers and printer services, for use with directories that support + Lightweight Directory Access Protocol v3 (LDAP-TS). This document is + based on the printer attributes listed in Appendix E of Internet + Printing Protocol/1.1 (IPP) (RFC 2911). A few additional printer + attributes are based on definitions in the Printer MIB (RFC 1759). + +Table of Contents + + 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 3 + 1.1. Rationale for using DirectoryString Syntax . . . . . . . 3 + 1.2. Rationale for using caseIgnoreMatch. . . . . . . . . . . 4 + 1.3. Rationale for using caseIgnoreSubstringsMatch. . . . . . 5 + 2. Terminology and Conventions. . . . . . . . . . . . . . . . . . 5 + 3. Definition of Object Classes . . . . . . . . . . . . . . . . . 6 + 3.1. slpServicePrinter. . . . . . . . . . . . . . . . . . . . 6 + 3.2. printerAbstract. . . . . . . . . . . . . . . . . . . . . 7 + 3.3. printerService . . . . . . . . . . . . . . . . . . . . . 8 + 3.4. printerServiceAuxClass . . . . . . . . . . . . . . . . . 8 + 3.5. printerIPP . . . . . . . . . . . . . . . . . . . . . . . 8 + 3.6. printerLPR . . . . . . . . . . . . . . . . . . . . . . . 9 + 4. Definition of Attribute Types. . . . . . . . . . . . . . . . . 9 + 4.1. printer-uri. . . . . . . . . . . . . . . . . . . . . . . 11 + 4.2. printer-xri-supported. . . . . . . . . . . . . . . . . . 11 + 4.3. printer-name . . . . . . . . . . . . . . . . . . . . . . 13 + 4.4. printer-natural-language-configured. . . . . . . . . . . 13 + + + +Fleming & McDonald Informational [Page 1] + +RFC 3712 LDAP Schema for Printer Services February 2004 + + + 4.5. printer-location . . . . . . . . . . . . . . . . . . . . 14 + 4.6. printer-info . . . . . . . . . . . . . . . . . . . . . . 14 + 4.7. printer-more-info. . . . . . . . . . . . . . . . . . . . 14 + 4.8. printer-make-and-model . . . . . . . . . . . . . . . . . 15 + 4.9. printer-ipp-versions-supported . . . . . . . . . . . . . 15 + 4.10. printer-multiple-document-jobs-supported . . . . . . . . 16 + 4.11. printer-charset-configured . . . . . . . . . . . . . . . 16 + 4.12. printer-charset-supported. . . . . . . . . . . . . . . . 16 + 4.13. printer-generated-natural-language-supported . . . . . . 17 + 4.14. printer-document-format-supported. . . . . . . . . . . . 17 + 4.15. printer-color-supported. . . . . . . . . . . . . . . . . 18 + 4.16. printer-compression-supported. . . . . . . . . . . . . . 18 + 4.17. printer-pages-per-minute . . . . . . . . . . . . . . . . 18 + 4.18. printer-pages-per-minute-color . . . . . . . . . . . . . 19 + 4.19. printer-finishings-supported . . . . . . . . . . . . . . 19 + 4.20. printer-number-up-supported. . . . . . . . . . . . . . . 19 + 4.21. printer-sides-supported. . . . . . . . . . . . . . . . . 20 + 4.22. printer-media-supported. . . . . . . . . . . . . . . . . 20 + 4.23. printer-media-local-supported. . . . . . . . . . . . . . 20 + 4.24. printer-resolution-supported . . . . . . . . . . . . . . 21 + 4.25. printer-print-quality-supported. . . . . . . . . . . . . 22 + 4.26. printer-job-priority-supported . . . . . . . . . . . . . 22 + 4.27. printer-copies-supported . . . . . . . . . . . . . . . . 22 + 4.28. printer-job-k-octets-supported . . . . . . . . . . . . . 23 + 4.29. printer-current-operator . . . . . . . . . . . . . . . . 23 + 4.30. printer-service-person . . . . . . . . . . . . . . . . . 24 + 4.31. printer-delivery-orientation-supported . . . . . . . . . 24 + 4.32. printer-stacking-order-supported . . . . . . . . . . . . 24 + 4.33. printer-output-features-supported. . . . . . . . . . . . 25 + 4.34. printer-aliases. . . . . . . . . . . . . . . . . . . . . 25 + 5. Definition of Syntaxes . . . . . . . . . . . . . . . . . . . . 26 + 6. Definition of Matching Rules . . . . . . . . . . . . . . . . . 26 + 7. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 26 + 7.1. Registration of Object Classes . . . . . . . . . . . . . 26 + 7.2. Registration of Attribute Types. . . . . . . . . . . . . 27 + 8. Internationalization Considerations. . . . . . . . . . . . . . 28 + 9. Security Considerations. . . . . . . . . . . . . . . . . . . . 29 + 10. References . . . . . . . . . . . . . . . . . . . . . . . . . . 29 + 10.1. Normative References . . . . . . . . . . . . . . . . . . 29 + 10.2. Informative References . . . . . . . . . . . . . . . . . 30 + 11. Acknowledgments. . . . . . . . . . . . . . . . . . . . . . . . 32 + 12. Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . 32 + 13. Full Copyright Statement . . . . . . . . . . . . . . . . . . . 33 + + + + + + + + +Fleming & McDonald Informational [Page 2] + +RFC 3712 LDAP Schema for Printer Services February 2004 + + +1. Introduction + + This document defines several object classes to provide Lightweight + Directory Access Protocol v3 [LDAP-TS] applications with flexible + options in defining printer information using LDAP schema. Classes + are provided for defining directory entries with common printer + information as well as for extending existing directory entries with + SLPv2 [RFC2608], IPP/1.1 [RFC2911], and LPR [RFC1179] specific + information. + + The schema defined in this document is based on the printer + attributes listed in Appendix E 'Generic Directory Schema' of + Internet Printing Protocol/1.1 (IPP) [RFC2911]. A few additional + printer attributes are based on definitions in the Printer MIB + [RFC1759]. + + The schema defined in this document is technically aligned with the + stable IANA-registered 'service:printer:' v2.0 template [SLP-PRT], + for compatibility with already deployed Service Location Protocol + (SLPv2) [RFC2608] service advertising and discovery infrastructure. + The attribute syntaxes are technically aligned with the + 'service:printer:' v2.0 template - therefore simpler types are + sometimes used (for example, 'DirectoryString' [RFC2252] rather than + 'labeledURI' [RFC2079] for the 'printer-uri' attribute). + + Please send comments directly to the authors at the addresses listed + in Section 13 "Authors' Addresses". + +1.1. Rationale for using DirectoryString Syntax + + The attribute syntax 'DirectoryString' (UTF-8 [RFC2279]) defined in + [RFC2252] is specified for several groups of string attributes that + are defined in this document: + + 1) URI + - printer-uri, printer-xri-supported, printer-more-info + + The UTF-8 encoding is forward compatible with any future + deployment of (UTF-8 based) IRI (Internationalized Resource + Identifiers) [W3C-IRI] currently being developed by the W3C + Internationalization Working Group. + + 2) Description + - printer-name, printer-location, printer-info, + printer-make-and-model + + + + + + +Fleming & McDonald Informational [Page 3] + +RFC 3712 LDAP Schema for Printer Services February 2004 + + + The UTF-8 encoding supports descriptions in any language, + conformant with the "IETF Policy on Character Sets and Languages" + [RFC2277]. + + Note: The printer-natural-language-configured attribute contains + a language tag [RFC3066] for these description attributes (for + example, to support text-to-speech conversions). + + 3) Keyword + - printer-compression-supported, printer-finishings-supported, + printer-media-supported, printer-media-local-supported, + printer-print-quality-supported + + The UTF-8 encoding is compatible with the current IPP/1.1 + [RFC2911] definition of the equivalent attributes, most of which + have the IPP/1.1 union syntax 'keyword or name'. The keyword + attributes defined in this document are extensible by + site-specific or vendor-specific 'names' which behave like new + 'keywords' + + Note: In IPP/1.1, each value is strongly typed over-the-wire as + either 'keyword' or 'name'. This union selector is not preserved + in the definitions of these equivalent LDAP attributes. + +1.2. Rationale for using caseIgnoreMatch + + The EQUALITY matching rule 'caseIgnoreMatch' defined in [RFC2252] is + specified for several groups of string attributes that are defined in + this document: + + 1) URI + + These URI attributes specify EQUALITY matching with + 'caseIgnoreMatch' (rather than with 'caseExactMatch') in order to + conform to the spirit of [RFC2396], which requires case + insensitive matching on the host part of a URI versus case + sensitive matching on the remainder of a URI. + + These URI attributes follow existing practice of supporting case + insensitive equality matching for host names in the + associatedDomain attribute defined in [RFC1274]. + + Either equality matching rule choice would be a compromise: + a) case sensitive whole URI matching may lead to false negative + matches and has been shown to be fragile (given deployed client + applications that 'pretty up' host names displayed and + transferred in URI); + + + + +Fleming & McDonald Informational [Page 4] + +RFC 3712 LDAP Schema for Printer Services February 2004 + + + b) case insensitive whole URI matching may lead to false positive + matches, although it is a dangerous practice to publish URI that + differ only by case (for example, in the path elements). + + 2) Description + + Case insensitive equality matching is more user-friendly for + description attributes. + + 3) Keyword + + Case insensitive equality matching is more user-friendly for + keyword attributes. + +1.3. Rationale for using caseIgnoreSubstringsMatch + + The SUBSTR matching rule 'caseIgnoreSubstringsMatch' defined in + [RFC2252] is specified for several groups of string attributes that + are defined in this document: + + 1) URI + + These URI attributes follow existing practice of supporting case + insensitive equality matching for host names in the + associatedDomain attribute defined in [RFC1274]. + + 2) Description + + Support for case insensitive substring matching is more + user-friendly for description attributes. + + 3) Keyword + + Support for case insensitive substring matching is more + user-friendly for keyword attributes. + +2. Terminology and Conventions + + The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", + "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this + document are to be interpreted as described in BCP 14 [RFC2119]. + + Schema definitions are provided using LDAPv3 [LDAP-TS] description + formats. Definitions provided here are formatted (line wrapped) for + readability. + + + + + + +Fleming & McDonald Informational [Page 5] + +RFC 3712 LDAP Schema for Printer Services February 2004 + + +3. Definition of Object Classes + + We define the following LDAP object classes for use with both generic + printer related information and services specific to SLPv2 [RFC2608], + IPP/1.1 [RFC2911], and LPR [RFC1179]. + + slpServicePrinter - auxiliary class for SLP registered printers + printerAbstract - abstract class for all printer classes + printerService - structural class for printers + printerServiceAuxClass - auxiliary class for printers + printerIPP - auxiliary class for IPP printers + printerLPR - auxiliary class for LPR printers + + The following are some examples of how applications may choose to use + these classes when creating directory entries: + + 1) Use printerService for directory entries containing common + printer information. + + 2) Use both printerService and slpServicePrinter for directory + entries containing common printer information for SLP registered + printers. + + 3) Use printerService, printerLPR and printerIPP for directory + entries containing common printer information for printers that + support both LPR and IPP. + + 4) Use printerServiceAuxClass and object classes not defined by this + document for directory entries containing common printer + information. In this example, printerServiceAuxClass is used for + extending other structural classes defining printer information + with common printer information defined in this document. + + Refer to Section 4 for definition of attribute types referenced by + these object classes. We use attribute names instead of OIDs in + object class definitions for clarity. Some attribute names described + in [RFC2911] have been prefixed with 'printer-' as recommended in + [RFC2926] and [SLP-PRT]. + +3.1. slpServicePrinter + + ( 1.3.18.0.2.6.254 + NAME 'slpServicePrinter' + DESC 'Service Location Protocol (SLP) information.' + AUXILIARY + SUP slpService + ) + + + + +Fleming & McDonald Informational [Page 6] + +RFC 3712 LDAP Schema for Printer Services February 2004 + + + This auxiliary class defines Service Location Protocol (SLPv2) + [RFC2608] specific information. It should be used with a structural + class such as printerService. It may be used to create new or extend + existing directory entries with SLP 'service:printer' abstract + service type information as defined in [SLP-PRT]. This object class + is derived from 'slpService', the parent class for all SLP services, + defined in [RFC2926]. + +3.2. printerAbstract + + ( 1.3.18.0.2.6.258 + NAME 'printerAbstract' + DESC 'Printer related information.' + ABSTRACT + SUP top + MAY ( printer-name $ + printer-natural-language-configured $ + printer-location $ printer-info $ printer-more-info $ + printer-make-and-model $ + printer-multiple-document-jobs-supported $ + printer-charset-configured $ printer-charset-supported $ + printer-generated-natural-language-supported $ + printer-document-format-supported $ printer-color-supported $ + printer-compression-supported $ printer-pages-per-minute $ + printer-pages-per-minute-color $ + printer-finishings-supported $ printer-number-up-supported $ + printer-sides-supported $ printer-media-supported $ + printer-media-local-supported $ + printer-resolution-supported $ + printer-print-quality-supported $ + printer-job-priority-supported $ printer-copies-supported $ + printer-job-k-octets-supported $ printer-current-operator $ + printer-service-person $ + printer-delivery-orientation-supported $ + printer-stacking-order-supported $ + printer-output-features-supported ) + ) + + This abstract class defines printer information. It is a base class + for deriving other printer related classes, such as, but not limited + to, classes defined in this document. It defines a common set of + printer attributes that are not specific to any one type of service, + protocol or operating system. + + + + + + + + +Fleming & McDonald Informational [Page 7] + +RFC 3712 LDAP Schema for Printer Services February 2004 + + +3.3. printerService + + ( 1.3.18.0.2.6.255 + NAME 'printerService' + DESC 'Printer information.' + STRUCTURAL + SUP printerAbstract + MAY ( printer-uri $ printer-xri-supported ) + ) + + This structural class defines printer information. It is derived + from class printerAbstract and thus inherits common printer + attributes. This class can be used with or without auxiliary classes + to define printer information. Auxiliary classes can be used to + extend the common printer information with protocol, service or + operating system specific information. + + Note: When extending other structural classes with auxiliary + classes, printerService should not be used. + +3.4. printerServiceAuxClass + + ( 1.3.18.0.2.6.257 + NAME 'printerServiceAuxClass' + DESC 'Printer information.' + AUXILIARY + SUP printerAbstract + MAY ( printer-uri $ printer-xri-supported ) + ) + + This auxiliary class defines printer information. It is derived from + class printerAbstract and thus inherits common printer attributes. + This class should be used with a structural class. + +3.5. printerIPP + + ( 1.3.18.0.2.6.256 + NAME 'printerIPP' + DESC 'Internet Printing Protocol (IPP) information.' + AUXILIARY + SUP top + MAY ( printer-ipp-versions-supported $ + printer-multiple-document-jobs-supported ) + ) + + + + + + + +Fleming & McDonald Informational [Page 8] + +RFC 3712 LDAP Schema for Printer Services February 2004 + + + This auxiliary class defines Internet Printing Protocol (IPP/1.1) + [RFC2911] information. It should be used with a structural class + such as printerService. It is used to extend structural classes with + IPP specific printer information. + +3.6. printerLPR + + ( 1.3.18.0.2.6.253 + NAME 'printerLPR' + DESC 'LPR information.' + AUXILIARY + SUP top + MUST ( printer-name ) + MAY ( printer-aliases) + ) + + This auxiliary class defines LPR [RFC1179] information. It should be + used with a structural class such as printerService. It is used to + identify directory entries that support LPR. + +4. Definition of Attribute Types + + The following attribute types are referenced by the object classes + defined in Section 3. + + The following attribute types reference syntax OIDs defined in + Section 6 of [RFC2252] (see Section 5 'Definition of Syntaxes' + below). + + The following attribute types reference matching rule names (instead + of OIDs) for clarity (see Section 6 below). For optional attributes, + if the printer information is not known, the attribute value should + not be set. In the following definitions, referenced matching rules + are defined in Section 8 of [RFC2252] and/or Section 2 of [RFC3698] + (see Section 6 'Definition of Matching Rules' below). + + The following table is a summary of the attribute names defined by + this document and their corresponding names from [RFC2911]. Some + attribute names described in [RFC2911] have been prefixed with + 'printer-' as recommended in [RFC2926], to address the flat namespace + for LDAP identifiers. + + + + + + + + + + +Fleming & McDonald Informational [Page 9] + +RFC 3712 LDAP Schema for Printer Services February 2004 + + + LDAP & SLP Printer Schema IPP Model [RFC2911] + ------------------------------ ------------------------------------- + printer-uri + printer-xri-supported + [IPP printer-uri-supported] + [IPP uri-authentication-supported] + [IPP uri-security-supported] + printer-name printer-name + printer-natural-language-configured + natural-language-configured + printer-location printer-location + printer-info printer-info + printer-more-info printer-more-info + printer-make-and-model printer-make-and-model + printer-ipp-versions-supported ipp-versions-supported + printer-multiple-document-jobs-supported + multiple-document-jobs-supported + printer-charset-configured charset-configured + printer-charset-supported charset-supported + printer-generated-natural-language-supported + generated-natural-language-supported + printer-document-format-supported + document-format-supported + printer-color-supported color-supported + printer-compression-supported compression-supported + printer-pages-per-minute pages-per-minute + printer-pages-per-minute-color pages-per-minute-color + printer-finishings-supported finishings-supported + printer-number-up-supported number-up-supported + printer-sides-supported sides-supported + printer-media-supported media-supported + printer-media-local-supported [site names from IPP media-supported] + printer-resolution-supported printer-resolution-supported + printer-print-quality-supported print-quality-supported + printer-job-priority-supported job-priority-supported + printer-copies-supported copies-supported + printer-job-k-octets-supported job-k-octets-supported + printer-current-operator + printer-service-person + printer-delivery-orientation-supported + printer-stacking-order-supported + printer-output-features-supported + printer-aliases + + + + + + + + +Fleming & McDonald Informational [Page 10] + +RFC 3712 LDAP Schema for Printer Services February 2004 + + +4.1. printer-uri + + ( 1.3.18.0.2.4.1140 + NAME 'printer-uri' + DESC 'A URI supported by this printer.' + EQUALITY caseIgnoreMatch + SUBSTR caseIgnoreSubstringsMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 + SINGLE-VALUE + ) + + If the printer-xri-supported LDAP attribute is implemented, then this + printer-uri value should be listed in printer-xri-supported. + + Values of URI should conform to [RFC2396], although URI schemes may + be defined which do not conform to [RFC2396] (see [RFC2717] and + [RFC2718]). + + Note: LDAP application clients should not attempt to use malformed + URI values read from this attribute. LDAP administrative clients + should not write malformed URI values into this attribute. + + Note: For SLP registered printers, the LDAP printer-uri attribute + should be set to the value of the SLP-registered URL of the printer, + for interworking with SLPv2 [RFC2608] service discovery. + + Note: See Sections 1.1, 1.2, and 1.3 for rationale for design + choices. + +4.2. printer-xri-supported + + ( 1.3.18.0.2.4.1107 + NAME 'printer-xri-supported' + DESC 'The unordered list of XRI (extended resource identifiers) + supported by this printer.' + EQUALITY caseIgnoreMatch + SUBSTR caseIgnoreSubstringsMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 + ) + + A list of XRI (extended resource identifiers) supported by this + printer. Each value of this list should consist of a URI (uniform + resource identifier) followed by (optional) authentication and + security fields. + + Values of URI should conform to [RFC2396], although URI schemes may + be defined which do not conform to [RFC2396] (see [RFC2717] and + [RFC2718]). + + + +Fleming & McDonald Informational [Page 11] + +RFC 3712 LDAP Schema for Printer Services February 2004 + + + Note: LDAP application clients should not attempt to use malformed + URI values read from this attribute. LDAP administrative clients + should not write malformed URI values into this attribute. + + Note: This attribute is based on 'printer-uri-supported', 'uri- + authentication-supported', and `'uri-security-supported' (called the + 'Three Musketeers' because they are parallel ordered attributes) + defined in IPP/1.1 [RFC2911]. This attribute unfolds those IPP/1.1 + attributes and thus avoids the ordering (and same number of values) + constraints of the IPP/1.1 separate attributes. + + Defined keywords for fields include: + + 'uri' (IPP 'printer-uri-supported') + 'auth' (IPP 'uri-authentication-supported') + 'sec' (IPP 'uri-security-supported') + + A missing 'auth' field should be interpreted to mean 'none'. Per + IPP/1.1 [RFC2911], defined values of the 'auth' field include: + + 'none' (no authentication for this URI) + 'requesting-user-name' (from operation request) + 'basic' (HTTP/1.1 Basic [RFC2617]) + 'digest' (HTTP/1.1 Basic, [RFC2617]) + 'certificate' (from certificate) + + A missing 'sec' field should be interpreted to mean 'none'. Per + IPP/1.1 [RFC2911], defined values of the 'sec' field include: + + 'none' (no security for this URI) + 'ssl3' (Netscape SSL3) + 'tls' (IETF TLS/1.0, [RFC2246]) + + Each XRI field should be delimited by '<'. For example: + + 'uri=ipp://foo.com< auth=digest< sec=tls<' + 'uri=lpr://bar.com< auth=none< sec=none<' + 'uri=mailto:printer@foobar.com< auth=none< sec=none<' + + Note: The syntax and delimiter for this attribute are aligned with + the equivalent attribute in the 'service:printer:' v2.0 template + [SLP-PRT]. Whitespace is permitted after (but not before) the + delimiter '<'. Note that this delimiter differs from printer- + resolution-supported. + + Note: See Sections 1.1, 1.2, and 1.3 for rationale for design + choices. + + + + +Fleming & McDonald Informational [Page 12] + +RFC 3712 LDAP Schema for Printer Services February 2004 + + +4.3. printer-name + + ( 1.3.18.0.2.4.1135 + NAME 'printer-name' + DESC 'The site-specific administrative name of this printer.' + EQUALITY caseIgnoreMatch + SUBSTR caseIgnoreSubstringsMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{127} + SINGLE-VALUE + ) + + Values of this attribute should be specified in the language + specified in printer-natural-language-configured (for example, to + support text-to-speech conversions), although the printer's name may + be specified in any language. This name may be the last part of the + printer's URI or it may be completely unrelated. This name may + contain characters that are not allowed in a conventional URI (see + [RFC2396]). + +4.4. printer-natural-language-configured + + ( 1.3.18.0.2.4.1119 + NAME 'printer-natural-language-configured' + DESC 'The configured natural language in which error and status + messages will be generated (by default) by this printer.' + EQUALITY caseIgnoreMatch + SUBSTR caseIgnoreSubstringsMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{127} + SINGLE-VALUE + ) + + Also, a possible natural language for printer string attributes set + by operator, system administrator, or manufacturer. Also, the + (declared) natural language of the printer-name, printer-location, + printer-info, and printer-make-and-model attributes of this printer. + + Values of language tags should conform to "Tags for the + Identification of Languages" [RFC3066]. For example: + + 'en-us' (English as spoken in the US) + 'fr-fr' (French as spoken in France) + + For consistency with IPP/1.1 [RFC2911], language tags in this + attribute should be lowercase normalized. + + + + + + + +Fleming & McDonald Informational [Page 13] + +RFC 3712 LDAP Schema for Printer Services February 2004 + + +4.5. printer-location + + ( 1.3.18.0.2.4.1136 + NAME 'printer-location' + DESC 'The physical location of this printer.' + EQUALITY caseIgnoreMatch + SUBSTR caseIgnoreSubstringsMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{127} + SINGLE-VALUE + ) + + For example: + + 'Room 123A' + 'Second floor of building XYZ' + +4.6. printer-info + + ( 1.3.18.0.2.4.1139 + NAME 'printer-info' + DESC 'Descriptive information about this printer.' + EQUALITY caseIgnoreMatch + SUBSTR caseIgnoreSubstringsMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{127} + SINGLE-VALUE + ) + + For example: + + 'This printer can be used for printing color transparencies for + HR presentations' + 'Out of courtesy for others, please print only small (1-5 page) + jobs at this printer' + 'This printer is going away on July 1, 1997, please find a new + printer' + +4.7. printer-more-info + + ( 1.3.18.0.2.4.1134 + NAME 'printer-more-info' + DESC 'A URI for more information about this specific printer.' + EQUALITY caseIgnoreMatch + SUBSTR caseIgnoreSubstringsMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 + SINGLE-VALUE + ) + + + + + +Fleming & McDonald Informational [Page 14] + +RFC 3712 LDAP Schema for Printer Services February 2004 + + + For example, this could be an HTTP type URI referencing an HTML page + accessible to a Web Browser. The information obtained from this URI + is intended for end user consumption. + + Values of URI should conform to [RFC2396], although URI schemes may + be defined which do not conform to [RFC2396] (see [RFC2717] and + [RFC2718]). + + Note: LDAP application clients should not attempt to use malformed + URI values read from this attribute. LDAP administrative clients + should not write malformed URI values into this attribute. + + Note: See Sections 1.1, 1.2, and 1.3 for rationale for design + choices. + +4.8. printer-make-and-model + + ( 1.3.18.0.2.4.1138 + NAME 'printer-make-and-model' + DESC 'Make and model of this printer.' + EQUALITY caseIgnoreMatch + SUBSTR caseIgnoreSubstringsMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{127} + SINGLE-VALUE + ) + + Note: The printer manufacturer may initially populate this + attribute. + +4.9. printer-ipp-versions-supported + + ( 1.3.18.0.2.4.1133 + NAME 'printer-ipp-versions-supported' + DESC 'IPP protocol version(s) that this printer supports.' + EQUALITY caseIgnoreMatch + SUBSTR caseIgnoreSubstringsMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{127} + ) + + The IPP protocol version(s) should include major and minor versions, + i.e., the exact version numbers for which this Printer implementation + meets the IPP version-specific conformance requirements. + + + + + + + + + +Fleming & McDonald Informational [Page 15] + +RFC 3712 LDAP Schema for Printer Services February 2004 + + +4.10. printer-multiple-document-jobs-supported + + ( 1.3.18.0.2.4.1132 + NAME 'printer-multiple-document-jobs-supported' + DESC 'Indicates whether or not this printer supports more than one + document per job.' + EQUALITY booleanMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 + SINGLE-VALUE + ) + +4.11. printer-charset-configured + + ( 1.3.18.0.2.4.1109 + NAME 'printer-charset-configured' + DESC 'The configured charset in which error and status messages will + be generated (by default) by this printer.' + EQUALITY caseIgnoreMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{63} + SINGLE-VALUE + ) + + Also, a possible charset for printer string attributes set by + operator, system administrator, or manufacturer. For example: + + 'utf-8' (ISO 10646/Unicode in UTF-8 transform [RFC2279]) + 'iso-8859-1' (Latin1) + + Values of charset tags should be defined in the IANA Registry of + Coded Character Sets [IANA-CHAR] (see also [RFC2978]) and the + '(preferred MIME name)' should be used as the charset tag in this + attribute. + + For consistency with IPP/1.1 [RFC2911], charset tags in this + attribute should be lowercase normalized. + +4.12. printer-charset-supported + + ( 1.3.18.0.2.4.1131 + NAME 'printer-charset-supported' + DESC 'Set of charsets supported for the attribute values of syntax + DirectoryString for this directory entry.' + EQUALITY caseIgnoreMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{63} + ) + + + + + + +Fleming & McDonald Informational [Page 16] + +RFC 3712 LDAP Schema for Printer Services February 2004 + + + For example: + + 'utf-8' (ISO 10646/Unicode in UTF-8 transform [RFC2279]) + 'iso-8859-1' (Latin1) + + Values of charset tags should be defined in the IANA Registry of + Coded Character Sets [IANA-CHAR] (see also [RFC2978]) and the + '(preferred MIME name)' should be used as the charset tag in this + attribute. + + For consistency with IPP/1.1 [RFC2911], charset tags in this + attribute should be lowercase normalized. + +4.13. printer-generated-natural-language-supported + + ( 1.3.18.0.2.4.1137 + NAME 'printer-generated-natural-language-supported' + DESC 'Natural language(s) supported for this directory entry.' + EQUALITY caseIgnoreMatch + SUBSTR caseIgnoreSubstringsMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{63} + ) + + Values of language tags should conform to "Tags for the + Identification of Languages" [RFC3066]. For example: + + 'en-us' (English as spoken in the US) + 'fr-fr' (French as spoken in France) + + For consistency with IPP/1.1 [RFC2911], language tags in this + attribute should be lowercase normalized. + +4.14. printer-document-format-supported + + ( 1.3.18.0.2.4.1130 + NAME 'printer-document-format-supported' + DESC 'The possible source document formats which may be interpreted + and printed by this printer.' + EQUALITY caseIgnoreMatch + SUBSTR caseIgnoreSubstringsMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{127} + ) + + Values of document formats should be MIME media types defined in the + IANA Registry of MIME Media Types [IANA-MIME] (see also [RFC2048]). + + + + + + +Fleming & McDonald Informational [Page 17] + +RFC 3712 LDAP Schema for Printer Services February 2004 + + +4.15. printer-color-supported + + ( 1.3.18.0.2.4.1129 + NAME 'printer-color-supported' + DESC 'Indicates whether this printer is capable of any type of color + printing at all, including highlight color.' + EQUALITY booleanMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 + SINGLE-VALUE + ) + +4.16. printer-compression-supported + + ( 1.3.18.0.2.4.1128 + NAME 'printer-compression-supported' + DESC 'Compression algorithms supported by this printer.' + EQUALITY caseIgnoreMatch + SUBSTR caseIgnoreSubstringsMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{255} + ) + + Values defined in IPP/1.1 [RFC2911] include: + + 'none' (no compression is used) + 'deflate' (public domain ZIP described in [RFC1951]) + 'gzip' (GNU ZIP described in [RFC1952]) + 'compress' (UNIX compression described in [RFC1977]) + +4.17. printer-pages-per-minute + + ( 1.3.18.0.2.4.1127 + NAME 'printer-pages-per-minute' + DESC 'The nominal number of pages per minute which may be output by + this printer.' + EQUALITY integerMatch + ORDERING integerOrderingMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 + SINGLE-VALUE + ) + + This attribute is informative, not a service guarantee. Typically, + it is the value used in marketing literature to describe this + printer. For example, the value for a simplex or black-and-white + print mode. + + + + + + + +Fleming & McDonald Informational [Page 18] + +RFC 3712 LDAP Schema for Printer Services February 2004 + + +4.18. printer-pages-per-minute-color + + ( 1.3.18.0.2.4.1126 + NAME 'printer-pages-per-minute-color' + DESC 'The nominal number of color pages per minute which may be + output by this printer.' + EQUALITY integerMatch + ORDERING integerOrderingMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 + SINGLE-VALUE + ) + + This attribute is informative, not a service guarantee. Typically, + it is the value used in marketing literature to describe this + printer. + + +4.19. printer-finishings-supported + + ( 1.3.18.0.2.4.1125 + NAME 'printer-finishings-supported' + DESC 'The possible finishing operations supported by this printer.' + EQUALITY caseIgnoreMatch + SUBSTR caseIgnoreSubstringsMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{255} + ) + + Values defined in IPP/1.1 [RFC2911] include: 'none', 'staple', + 'punch', 'cover', 'bind', 'saddle-stitch', 'edge-stitch', + 'staple-top-left', 'staple-bottom-left', 'staple-top-right', + 'staple-bottom-right', 'edge-stitch-left', 'edge-stitch-top', + 'edge-stitch-right', 'edge-stitch-bottom', 'staple-dual-left', + 'staple-dual-top', 'staple-dual-right', 'staple-dual-bottom'. + + Note: Implementations may support other values. + +4.20. printer-number-up-supported + + ( 1.3.18.0.2.4.1124 + NAME 'printer-number-up-supported' + DESC 'The possible numbers of print-stream pages to impose upon a + single side of an instance of a selected medium.' + EQUALITY integerMatch + ORDERING integerOrderingMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 + ) + + + + + +Fleming & McDonald Informational [Page 19] + +RFC 3712 LDAP Schema for Printer Services February 2004 + + + Values defined in IPP/1.1 [RFC2911] include: '1', '2', and '4'. + + Note: Implementations may support other values. + +4.21. printer-sides-supported + + ( 1.3.18.0.2.4.1123 + NAME 'printer-sides-supported' + DESC 'The number of impression sides (one or two) and the two-sided + impression rotations supported by this printer.' + EQUALITY caseIgnoreMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{127} + ) + + Values defined in IPP/1.1 [RFC2911] include: 'one-sided', 'two- + sided-long-edge', 'two-sided-short-edge'.' + +4.22. printer-media-supported + + ( 1.3.18.0.2.4.1122 + NAME 'printer-media-supported' + DESC 'The standard names/types/sizes (and optional color suffixes) of + the media supported by this printer.' + EQUALITY caseIgnoreMatch + SUBSTR caseIgnoreSubstringsMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{255} + ) + + Values are defined in IPP/1.1 [RFC2911] or any IANA registered + extensions. For example: + + 'iso-a4' + 'envelope' + 'na-letter-white' + +4.23. printer-media-local-supported + + ( 1.3.18.0.2.4.1117 + NAME 'printer-media-local-supported' + DESC 'Site-specific names of media supported by this printer.' + EQUALITY caseIgnoreMatch + SUBSTR caseIgnoreSubstringsMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{255} + ) + + Values should be in the natural language specified by printer- + natural-language-configured. + + + + +Fleming & McDonald Informational [Page 20] + +RFC 3712 LDAP Schema for Printer Services February 2004 + + + For example: + + 'purchasing-form' (site-specific name) + + as opposed to 'na-letter' (standard keyword from IPP/1.1 [RFC2911]) + in the printer-media-supported attribute. + +4.24. printer-resolution-supported + + ( 1.3.18.0.2.4.1121 + NAME 'printer-resolution-supported' + DESC 'List of resolutions supported for printing documents by this + printer.' + EQUALITY caseIgnoreMatch + SUBSTR caseIgnoreSubstringsMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{255} + ) + + Each resolution value should be a string containing 3 fields: + 1) Cross feed direction resolution (positive integer); + 2) Feed direction resolution (positive integer); + 3) Unit - 'dpi' (dots per inch) or 'dpcm' (dots per centimeter). + + Each resolution field should be delimited by '>'. For example: + + '300> 300> dpi>' + '600> 600> dpi>' + + Note: This attribute is based on 'printer-resolution-supported' + defined in IPP/1.1 [RFC2911] (which has a binary complex encoding) + derived from 'prtMarkerAddressabilityFeedDir', + 'prtMarkerAddressabilityXFeedDir', and 'prtMarkerAddressabilityUnit' + defined in the Printer MIB [RFC1759] (which have integer encodings). + + Note: The syntax and delimiter for this attribute are aligned with + the equivalent attribute in the 'service:printer:' v2.0 template + [SLP-PRT]. Whitespace is permitted after (but not before) the + delimiter '>'. Note that this delimiter differs from printer-xri- + supported. + + + + + + + + + + + + +Fleming & McDonald Informational [Page 21] + +RFC 3712 LDAP Schema for Printer Services February 2004 + + +4.25. printer-print-quality-supported + + ( 1.3.18.0.2.4.1120 + NAME 'printer-print-quality-supported' + DESC 'List of print qualities supported for printing documents on + this printer.' + EQUALITY caseIgnoreMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{127} + ) + + Values defined in IPP/1.1 [RFC2911] include: + + 'unknown' + 'draft' + 'normal' + 'high' + +4.26. printer-job-priority-supported + + ( 1.3.18.0.2.4.1110 + NAME 'printer-job-priority-supported' + DESC 'Indicates the number of job priority levels supported by this + printer.' + EQUALITY integerMatch + ORDERING integerOrderingMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 + SINGLE-VALUE + ) + + An IPP/1.1 [RFC2911] conformant Printer, which supports job priority, + always supports a full range of priorities from '1' to '100' (to + ensure consistent behavior), therefore this attribute describes the + 'granularity' of priority supported. Values of this attribute are + from '1' to '100'. + +4.27. printer-copies-supported + + ( 1.3.18.0.2.4.1118 + NAME 'printer-copies-supported' + DESC 'The maximum number of copies of a document that may be printed + as a single job on this printer.' + EQUALITY integerMatch + ORDERING integerOrderingMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 + SINGLE-VALUE + ) + + + + + +Fleming & McDonald Informational [Page 22] + +RFC 3712 LDAP Schema for Printer Services February 2004 + + + A positive value indicates the maximum supported copies. A value of + '0' indicates no maximum limit. A value of '-1' indicates 'unknown'. + + Note: The syntax and values for this attribute are aligned with the + equivalent attribute in the 'service:printer:' v2.0 template [SLP- + PRT]. + +4.28. printer-job-k-octets-supported + + ( 1.3.18.0.2.4.1111 + NAME 'printer-job-k-octets-supported' + DESC 'The maximum size in kilobytes (1,024 octets actually) incoming + print job that this printer will accept.' + EQUALITY integerMatch + ORDERING integerOrderingMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 + SINGLE-VALUE + ) + + A positive value indicates the maximum supported job size. A value + of '0' indicates no maximum limit. A value of '-1' indicates + 'unknown'. + + Note: The syntax and values for this attribute are aligned with the + equivalent attribute in the 'service:printer:' v2.0 template [SLP- + PRT]. + +4.29. printer-current-operator + + ( 1.3.18.0.2.4.1112 + NAME 'printer-current-operator' + DESC 'The identity of the current human operator responsible for + operating this printer.' + EQUALITY caseIgnoreMatch + SUBSTR caseIgnoreSubstringsMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{127} + SINGLE-VALUE + ) + + The value of this attribute should include information that would + enable other humans to reach the operator, such as a telephone + number. + + + + + + + + + +Fleming & McDonald Informational [Page 23] + +RFC 3712 LDAP Schema for Printer Services February 2004 + + +4.30. printer-service-person + + ( 1.3.18.0.2.4.1113 + NAME 'printer-service-person' + DESC 'The identity of the current human service person responsible + for servicing this printer.' + EQUALITY caseIgnoreMatch + SUBSTR caseIgnoreSubstringsMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{127} + SINGLE-VALUE + ) + + The value of this attribute should include information that would + enable other humans to reach the service person, such as a telephone + number. + +4.31. printer-delivery-orientation-supported + + ( 1.3.18.0.2.4.1114 + NAME 'printer-delivery-orientation-supported' + DESC 'The possible delivery orientations of pages as they are printed + and ejected from this printer.' + EQUALITY caseIgnoreMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{127} + ) + + Values defined include: + + 'unknown' + 'face-up' + 'face-down' + + Note: The syntax and values for this attribute are aligned with the + equivalent attribute in the 'service:printer:' v2.0 template [SLP- + PRT]. + +4.32. printer-stacking-order-supported + + ( 1.3.18.0.2.4.1115 + NAME 'printer-stacking-order-supported' + DESC 'The possible stacking order of pages as they are printed and + ejected from this printer.' + EQUALITY caseIgnoreMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{127} + ) + + + + + + +Fleming & McDonald Informational [Page 24] + +RFC 3712 LDAP Schema for Printer Services February 2004 + + + Values defined include: + + 'unknown' + 'first-to-last' + 'last-to-first' + + Note: The syntax and values for this attribute are aligned with the + equivalent attribute in the 'service:printer:' v2.0 template [SLP- + PRT]. + +4.33. printer-output-features-supported + + ( 1.3.18.0.2.4.1116 + NAME 'printer-output-features-supported' + DESC 'The possible output features supported by this printer.' + EQUALITY caseIgnoreMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{127} + ) + + Values defined include: + + 'unknown' + 'bursting' + 'decollating' + 'page-collating' + 'offset-stacking' + + Note: The syntax and values for this attribute are aligned with the + equivalent attribute in the 'service:printer:' v2.0 template [SLP- + PRT]. + + Note: Implementations may support other values. + +4.34. printer-aliases + + ( 1.3.18.0.2.4.1108 + NAME 'printer-aliases' + DESC 'List of site-specific administrative names of this printer in + addition to the value specified for printer-name.' + EQUALITY caseIgnoreMatch + SUBSTR caseIgnoreSubstringsMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{127} + ) + + Values of this attribute should be specified in the language + specified in printer-natural-language-configured (for example, to + support text-to-speech conversions), although the printer's alias may + be specified in any language. + + + +Fleming & McDonald Informational [Page 25] + +RFC 3712 LDAP Schema for Printer Services February 2004 + + +5. Definition of Syntaxes + + No new attribute syntaxes are defined by this document. + + The attribute types defined in Section 4 of this document reference + syntax OIDs defined in Section 6 of [RFC2252], which are summarized + below: + + Syntax OID Syntax Description + ------------------------------ ------------------ + 1.3.6.1.4.1.1466.115.121.1.7 Boolean + 1.3.6.1.4.1.1466.115.121.1.15 DirectoryString (UTF-8 [RFC2279]) + 1.3.6.1.4.1.1466.115.121.1.27 Integer + +6. Definition of Matching Rules + + No new matching rules are defined by this document. + + The attribute types defined in Section 4 of this document reference + matching rules defined in Section 8 of [RFC2252] and/or Section 2 of + [RFC3698], which are summarized below: + + Matching Rule OID Matching Rule Name Usage + ------------------------------ ------------------ ----- + 2.5.13.13 booleanMatch EQUALITY + 2.5.13.2 caseIgnoreMatch EQUALITY + 2.5.13.14 integerMatch EQUALITY + 2.5.13.15 integerOrderingMatch ORDERING + 2.5.13.4 caseIgnoreSubstringsMatch SUBSTR + +7. IANA Considerations + + This document does not define any new syntaxes or matching rules. + + This document does define the following Object Identifier + Descriptors. They have been registered by the IANA: + +7.1. Registration of Object Classes + + Subject: Request for LDAP Descriptor Registration + + Descriptor (short name): see table below + + Object Identifier: see table below + + Person & email address to contact for further information: see below + + Usage: object class + + + +Fleming & McDonald Informational [Page 26] + +RFC 3712 LDAP Schema for Printer Services February 2004 + + + Specification: RFC3712 + + Author/Change Controller: + + Pat Fleming + IBM + Highway 52 N + Rochester, MN 55901 + USA + Phone: +1 507-253-7583 + EMail: flemingp@us.ibm.com + + Comments: + + Object Class OID + ------------------------------------ --------------------- + slpServicePrinter 1.3.18.0.2.6.254 + printerAbstract 1.3.18.0.2.6.258 + printerService 1.3.18.0.2.6.255 + printerServiceAuxClass 1.3.18.0.2.6.257 + printerIPP 1.3.18.0.2.6.256 + printerLPR 1.3.18.0.2.6.253 + +7.2. Registration of Attribute Types + + Subject: Request for LDAP Descriptor Registration + + Descriptor (short name): see table below + + Object Identifier: see table below + + Person & email address to contact for further information: see below + + Usage: attribute type + + Specification: RFC3712 + + Author/Change Controller: + + Pat Fleming + IBM + Highway 52 N + Rochester, MN 55901 + USA + Phone: +1 507-253-7583 + EMail: flemingp@us.ibm.com + + + + + +Fleming & McDonald Informational [Page 27] + +RFC 3712 LDAP Schema for Printer Services February 2004 + + + Comments: + + Attribute Type OID + ------------------------------------ --------------------- + printer-uri 1.3.18.0.2.4.1140 + printer-xri-supported 1.3.18.0.2.4.1107 + printer-name 1.3.18.0.2.4.1135 + printer-natural-language-configured 1.3.18.0.2.4.1119 + printer-location 1.3.18.0.2.4.1136 + printer-info 1.3.18.0.2.4.1139 + printer-more-info 1.3.18.0.2.4.1134 + printer-make-and-model 1.3.18.0.2.4.1138 + printer-ipp-versions-supported 1.3.18.0.2.4.1133 + printer-multiple-document-jobs-supported 1.3.18.0.2.4.1132 + printer-charset-configured 1.3.18.0.2.4.1109 + printer-charset-supported 1.3.18.0.2.4.1131 + printer-generated-natural-language-supported 1.3.18.0.2.4.1137 + printer-document-format-supported 1.3.18.0.2.4.1130 + printer-color-supported 1.3.18.0.2.4.1129 + printer-compression-supported 1.3.18.0.2.4.1128 + printer-pages-per-minute 1.3.18.0.2.4.1127 + printer-pages-per-minute-color 1.3.18.0.2.4.1126 + printer-finishings-supported 1.3.18.0.2.4.1125 + printer-number-up-supported 1.3.18.0.2.4.1124 + printer-sides-supported 1.3.18.0.2.4.1123 + printer-media-supported 1.3.18.0.2.4.1122 + printer-media-local-supported 1.3.18.0.2.4.1117 + printer-resolution-supported 1.3.18.0.2.4.1121 + printer-print-quality-supported 1.3.18.0.2.4.1120 + printer-job-priority-supported 1.3.18.0.2.4.1110 + printer-copies-supported 1.3.18.0.2.4.1118 + printer-job-k-octets-supported 1.3.18.0.2.4.1111 + printer-current-operator 1.3.18.0.2.4.1112 + printer-service-person 1.3.18.0.2.4.1113 + printer-delivery-orientation-supported 1.3.18.0.2.4.1114 + printer-stacking-order-supported 1.3.18.0.2.4.1115 + printer-output-features-supported 1.3.18.0.2.4.1116 + printer-aliases 1.3.18.0.2.4.1108 + +8. Internationalization Considerations + + All text string attributes defined in this document of syntax + [RFC2279], as required by [RFC2252]. + + A language tag [RFC3066] for all of the text string attributes + defined in this document is contained in the printer-natural- + language-configured attribute. + + + + +Fleming & McDonald Informational [Page 28] + +RFC 3712 LDAP Schema for Printer Services February 2004 + + + Therefore, all object classes defined in this document conform to the + "IETF Policy on Character Sets and Languages" [RFC2277]. + +9. Security Considerations + + See [RFC2829] for detailed guidance on authentication methods for + LDAP. See [RFC2830] for detailed guidance of using TLS/1.0 [RFC2246] + to supply connection confidentiality and data integrity for LDAP + sessions. + + As with any LDAP schema, it is important to protect specific entries + and attributes with the appropriate access control. It is + particularly important that only administrators can modify entries + defined in this LDAP printer schema. Otherwise, an LDAP client might + be fooled into diverting print service requests from the original + printer (or spooler) to a malicious intruder's host system, thus + exposing the information in printed documents. + + For additional security considerations of deploying printers in an + IPP environment, see Section 8 of [RFC2911]. + +10. References + +10.1. Normative References + + [IANA-CHAR] IANA Registry of Character Sets + http://www.iana.org/assignments/charset-reg/... + + [IANA-MIME] IANA Registry of MIME Media Types + http://www.iana.org/assignments/media-types/... + + [LDAP-TS] Hodges, J. and R. Morgan, "Lightweight Directory Access + Protocol (v3): Technical Specification", RFC 3377, + September 2002. + + [RFC1274] Barker, P. and S. Kille, "The COSINE and Internet X.500 + Schema", RFC 1274, November 1991. + + [RFC1759] Smith, R., Wright, F., Hastings, T., Zilles, S. and J. + Gyllenskog, "Printer MIB", RFC 1759, March 1995. + + [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate + Requirement Levels", BCP 14, RFC 2119, March 1997. + + [RFC2252] Wahl, M., Coulbeck, T., Howes, T. and S. Kille, + "Lightweight Directory Access Protocol (v3): Attribute + Syntax Definitions", RFC 2252, December 1997. + + + + +Fleming & McDonald Informational [Page 29] + +RFC 3712 LDAP Schema for Printer Services February 2004 + + + [RFC2396] Berners-Lee. T., Fielding, R. and L. Masinter, "URI + Generic Syntax", RFC 2396, August 1998. + + [RFC2829] Wahl, M., Alvestrand, H., Hodges, J. and R. Morgan, + "Authentication Methods for LDAP", RFC 2829, May 2000. + + [RFC2830] Hodges, J., Morgan, R. and M. Wahl, "Lightweight + Directory Access Protocol (v3): Extension for Transport + Layer Security", RFC 2830, May 2000. + + [RFC2911] Hastings, T., Ed.., Herrito, R., deBry, R., Isaacson, S. + and P. Powell, "Internet Printing Protocol/1.1: Model and + Semantics", RFC 2911, September 2000. + + [RFC2926] Kempf, J., Moats, R. and P. St. Pierre, "Conversion of + LDAP Schemas to and from SLP Templates", RFC 2926, + September 2000. + + [RFC3066] Alvestrand, H., "Tags for the Identification of + Languages", BCP 47, RFC 3066, January 2001. + + [RFC3698] Zeilenga, K., Ed., "Lightweight Directory Access Protocol + (LDAP): Additional Matching Rules", RFC 3698, February + 2004. + +10.2. Informative References + + [IANA-SLPT] IANA Registry of SLP Templates + http://www.iana.org/assignments/svrloc-templates/... + + [RFC1179] McLaughlin, L., "Line Printer Daemon Protocol", RFC 1179, + August 1990. + + [RFC1951] Deutsch, P., "DEFLATE Compressed Data Format + Specification Version 1.3", RFC 1951, May 1996. + + [RFC1952] Deutsch, P., "GZIP File Format Specification Version + 4.3", RFC 1952, May 1996. + + [RFC1977] Schryver, V., "PPP BSD Compression Protocol", RFC 1977, + August 1996. + + [RFC2048] Freed, N., Klensin, J. and J. Postel, "Multipurpose + Internet Mail Extensions (MIME) Part Four: Registration + Procedures", BCP 13, RFC 2048, November 1996. + + + + + + +Fleming & McDonald Informational [Page 30] + +RFC 3712 LDAP Schema for Printer Services February 2004 + + + [RFC2079] Smith, M., "Definition of an X.500 Attribute Type and an + Object Class to Hold Uniform Resource Identifiers + (URIs)", RFC 2079, January 1997. + + [RFC2246] Dierks, T. and C. Allen, "TLS Protocol Version 1.0", RFC + 2246, January 1999. + + [RFC2277] Alvestrand, H., "IETF Policy on Character Sets and + Languages", RFC 2277, January 1998. + + [RFC2279] Yergeau, F., "UTF-8, a Transformation Format of ISO + 10646", RFC 2279, January 1998. + + [RFC2608] Guttman, E., Perkins, C., Veizades, J. and M. Day, + "Service Location Protocol v2", RFC 2608, June 1999. + + [RFC2609] Guttman, E., Perkins, C. and J. Kempf, "Service Templates + and Service: Schemes", RFC 2609, June 1999. + + [RFC2617] Franks, J., Hallam-Baker, P., Hostetler, J., Lawrence, + S., Leach, P., Luotonen, A. and L. Stewart, "HTTP + Authentication: Basic and Digest Access Authentication", + RFC 2617, June 1999. + + [RFC2717] Petke, R. and I. King, "Registration Procedures for URL + Scheme Names", RFC 2717, November 1999. + + [RFC2718] Masinter, L., Alvestrand, H., Zigmond, D. and R. Petke, + "Guidelines for new URL Schemes", BCP 19, RFC 2718, + November 1999. + + [RFC2978] Freed, N. and J.Postel, "IANA Charset Registration + Procedures", RFC2978, October 2000. + + [SLP-PRT] St. Pierre, Isaacson, McDonald. Definition of the + Printer Abstract Service Type v2.0, <durable URL below>, + May 2000. Reviewed and approved by IETF SLP Designated + Expert, according to Section 5 'IANA Considerations' in + [RFC2609]. + + Archived in the IANA Registry of SLP Templates [IANA- + SLPT] at: http://www.iana.org/assignments/svrloc- + templates/printer.2.0.en + + [W3C-IRI] Duerst, Suignard, "Internationalized Resource Identifiers + (IRI), Work in Progress. + + + + + +Fleming & McDonald Informational [Page 31] + +RFC 3712 LDAP Schema for Printer Services February 2004 + + +11. Acknowledgments + + The editors wish to acknowledge the very significant contributions of + Ken Jones (Bytemobile) and Harry Lewis (IBM) during the development + of this document. + + Thanks to Patrik Faltstrom (Cisco), Ryan Moats (Lemur Networks), + Robert Moore (IBM), Lee Rafalow (IBM), Kimberly Reger (IBM), Kurt + Zeilenga (OpenLDAP), and the members of the IETF IPP Working Group, + for review comments and help in preparing this document. + +12. Authors' Addresses + + Please send comments to the authors at the addresses listed below. + + Pat Fleming + IBM + Highway 52 N + Rochester, MN 55901 + USA + + Phone: +1 507-253-7583 + EMail: flemingp@us.ibm.com + + + Ira McDonald + High North Inc + 221 Ridge Ave + Grand Marais, MI 49839 + USA + + Phone: +1 906-494-2434 + Email: imcdonald@sharplabs.com + + + + + + + + + + + + + + + + + + +Fleming & McDonald Informational [Page 32] + +RFC 3712 LDAP Schema for Printer Services February 2004 + + +13. Full Copyright Statement + + Copyright (C) The Internet Society (2004). This document is subject + to the rights, licenses and restrictions contained in BCP 78 and + except as set forth therein, the authors retain all their rights. + + This document and the information contained herein are provided on an + "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE + REPRESENTS OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY AND THE + INTERNET ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF + THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED + WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + +Intellectual Property + + The IETF takes no position regarding the validity or scope of any + Intellectual Property Rights or other rights that might be claimed + to pertain to the implementation or use of the technology + described in this document or the extent to which any license + under such rights might or might not be available; nor does it + represent that it has made any independent effort to identify any + such rights. Information on the procedures with respect to + rights in RFC documents can be found in BCP 78 and BCP 79. + + Copies of IPR disclosures made to the IETF Secretariat and any + assurances of licenses to be made available, or the result of an + attempt made to obtain a general license or permission for the use + of such proprietary rights by implementers or users of this + specification can be obtained from the IETF on-line IPR repository + at http://www.ietf.org/ipr. + + The IETF invites any interested party to bring to its attention + any copyrights, patents or patent applications, or other + proprietary rights that may cover technology that may be required + to implement this standard. Please address the information to the + IETF at ietf-ipr@ietf.org. + +Acknowledgement + + Funding for the RFC Editor function is currently provided by the + Internet Society. + + + + + + + + + +Fleming & McDonald Informational [Page 33] + diff --git a/standards/rfctohtml.c b/standards/rfctohtml.c new file mode 100644 index 000000000..a13c1e922 --- /dev/null +++ b/standards/rfctohtml.c @@ -0,0 +1,497 @@ +/* + * "$Id: rfctohtml.c 4966 2006-01-23 00:41:22Z mike $" + * + * RFC file to HTML conversion program. + * + * Copyright 2006 by Easy Software Products. + * + * These coded instructions, statements, and computer programs are the + * property of Easy Software Products and are protected by Federal + * copyright law. Distribution and use rights are outlined in the file + * "LICENSE.txt" which should have been included with this file. If this + * file is missing or damaged please contact Easy Software Products + * at: + * + * Attn: CUPS Licensing Information + * Easy Software Products + * 44141 Airport View Drive, Suite 204 + * Hollywood, Maryland 20636 USA + * + * Voice: (301) 373-9600 + * EMail: cups-info@cups.org + * WWW: http://www.cups.org + * + * Contents: + * + */ + +/* + * Include necessary headers. + */ + +#include <cups/string.h> +#include <stdlib.h> +#include <cups/file.h> + + +/* + * Local functions... + */ + +void put_entity(cups_file_t *fp, int ch); +void put_line(cups_file_t *fp, const char *line); + + +/* + * 'main()' - Convert a man page to HTML. + */ + +int /* O - Exit status */ +main(int argc, /* I - Number of command-line args */ + char *argv[]) /* I - Command-line arguments */ +{ + cups_file_t *infile, /* Input file */ + *outfile; /* Output file */ + char line[1024], /* Line from file */ + *lineptr, /* Pointer into line */ + name[1024], /* Heading anchor name */ + *nameptr; /* Pointer into anchor name */ + int inheading, /* Inside a heading? */ + inpre, /* Inside preformatted text? */ + intoc, /* Inside table-of-contents? */ + toclevel, /* Current table-of-contents level */ + linenum; /* Current line on page */ + + + /* + * Check arguments... + */ + + if (argc > 3) + { + fputs("Usage: rfctohtml [rfcNNNN.txt [rfcNNNN.html]]\n", stderr); + return (1); + } + + /* + * Open files as needed... + */ + + if (argc > 1) + { + if ((infile = cupsFileOpen(argv[1], "r")) == NULL) + { + perror(argv[1]); + return (1); + } + } + else + infile = cupsFileOpenFd(0, "r"); + + if (argc > 2) + { + if ((outfile = cupsFileOpen(argv[2], "w")) == NULL) + { + perror(argv[2]); + cupsFileClose(infile); + return (1); + } + } + else + outfile = cupsFileOpenFd(1, "w"); + + /* + * Read from input and write the output... + */ + + cupsFilePuts(outfile, + "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\" " + "\"http://www.w3.org/TR/REC-html40/loose.dtd\">\n" + "<html>\n" + "<!-- SECTION: Specifications -->\n" + "<head>\n" + "\t<style type='text/css'><!--\n" + "\th1, h2, h3 { font-family: sans-serif; }\n" + "\tp, pre { font-family: monospace; }\n" + "\th1.title, h2.title, h3.title { border-bottom: solid " + "2px #000000; }\n" + "\t--></style>\n"); + + /* + * Skip the initial header stuff (working group ID, RFC #, authors, and + * copyright... + */ + + linenum = 0; + + while (cupsFileGets(infile, line, sizeof(line))) + { + linenum ++; + + if (line[0]) + break; + } + + while (cupsFileGets(infile, line, sizeof(line))) + { + linenum ++; + + if (!line[0]) + break; + } + + /* + * Read the document title... + */ + + while (cupsFileGets(infile, line, sizeof(line))) + { + linenum ++; + + if (line[0]) + break; + } + + for (lineptr = line; isspace(*lineptr & 255); lineptr ++); + + cupsFilePrintf(outfile, "<title>%s", lineptr); + + while (cupsFileGets(infile, line, sizeof(line))) + { + linenum ++; + + if (!line[0]) + break; + else + { + for (lineptr = line; isspace(*lineptr & 255); lineptr ++); + cupsFilePrintf(outfile, " %s", lineptr); + } + } + + cupsFilePuts(outfile, "</title>\n" + "</head>\n" + "<body>\n"); + + /* + * Read the rest of the file... + */ + + inheading = 0; + inpre = 0; + intoc = 0; + toclevel = 0; + + while (cupsFileGets(infile, line, sizeof(line))) + { + linenum ++; + + if (!line[0]) + { + if (linenum > 50) + continue; + + if (inpre) + { + cupsFilePuts(outfile, "</pre>\n"); + inpre = 0; + } + + if (inheading) + { + if (inheading < 0) + cupsFilePuts(outfile, "</h1>\n"); + else + cupsFilePrintf(outfile, "</a></h%d>\n", inheading); + + inheading = 0; + } + } + else if ((line[0] == ' ' || + (!isupper(line[0] & 255) && !isdigit(line[0] & 255) && + !strstr(line, "[Page "))) && !inheading) + { + if (inheading) + { + if (inheading < 0) + cupsFilePuts(outfile, "</h1>\n"); + else + cupsFilePrintf(outfile, "</a></h%d>\n", inheading); + + inheading = 0; + } + + for (lineptr = line; *lineptr == ' '; lineptr ++); + + if (intoc) + { + char *temp; /* Temporary pointer into line */ + int level; /* Heading level */ + + + if (isdigit(*lineptr & 255)) + { + strlcpy(name, lineptr, sizeof(name)); + + for (nameptr = name, level = -1; *nameptr;) + if (isdigit(*nameptr & 255)) + { + while (isdigit(*nameptr & 255)) + nameptr ++; + + level ++; + } + else if (*nameptr == ' ') + { + *nameptr = '\0'; + break; + } + else + nameptr ++; + + while (toclevel > level) + { + cupsFilePuts(outfile, "\n</ul>"); + toclevel --; + } + + while (toclevel < level) + { + cupsFilePuts(outfile, "\n<ul style=\"list-style-type: none;\">\n"); + toclevel ++; + } + + cupsFilePrintf(outfile, "\n<%s><a href=\"#s%s\">", toclevel ? "li" : "p", + name); + } + + temp = lineptr + strlen(lineptr) - 1; + + while (temp > lineptr) + if (*temp == ' ' || !isdigit(*temp & 255)) + break; + else + temp --; + + if (*temp == ' ') + { + while (temp > lineptr) + if (*temp != ' ' && *temp != '.') + break; + else + *temp-- = '\0'; + } + else + temp = NULL; + + if (isdigit(*lineptr & 255)) + put_line(outfile, lineptr); + else + put_line(outfile, lineptr - 1); + + if (temp) + cupsFilePuts(outfile, "</a>"); + } + else if (!inpre) + { + cupsFilePuts(outfile, "\n<pre>"); + put_line(outfile, line); + inpre = 1; + } + else + { + cupsFilePutChar(outfile, '\n'); + put_line(outfile, line); + } + } + else if (strstr(line, "[Page ")) + { + /* + * Skip page footer and header... + */ + + cupsFileGets(infile, line, sizeof(line)); + cupsFileGets(infile, line, sizeof(line)); + cupsFileGets(infile, line, sizeof(line)); + cupsFileGets(infile, line, sizeof(line)); + linenum = 3; + } + else if (isdigit(line[0] & 255) && !inheading) + { + int level; /* Heading level */ + + + if (intoc) + { + while (toclevel > 0) + { + cupsFilePuts(outfile, "\n</ul>"); + toclevel --; + } + + cupsFilePutChar(outfile, '\n'); + intoc = 0; + } + + if (inpre) + { + cupsFilePuts(outfile, "</pre>\n"); + inpre = 0; + } + + strlcpy(name, line, sizeof(name)); + for (nameptr = name, level = 0; *nameptr;) + if (isdigit(*nameptr & 255)) + { + while (isdigit(*nameptr & 255)) + nameptr ++; + + level ++; + } + else if (*nameptr == ' ') + { + *nameptr = '\0'; + break; + } + else + nameptr ++; + + cupsFilePrintf(outfile, "\n<h%d class='title'><a name='s%s'>", level, name); + put_line(outfile, line); + + intoc = 0; + inheading = level; + } + else + { + if (intoc) + { + while (toclevel > 0) + { + cupsFilePuts(outfile, "\n</ul>"); + toclevel --; + } + + cupsFilePutChar(outfile, '\n'); + intoc = 0; + } + + if (!inheading) + { + cupsFilePuts(outfile, "\n<h1 class='title'>"); + inheading = -1; + } + + put_line(outfile, line); + + intoc = !strcasecmp(line, "Table of Contents"); + toclevel = 0; + } + } + + if (inpre) + cupsFilePuts(outfile, "</pre>\n"); + + if (inheading) + { + if (inheading < 0) + cupsFilePuts(outfile, "</h1>\n"); + else + cupsFilePrintf(outfile, "</a></h%d>\n", inheading); + } + + cupsFilePuts(outfile, "</body>\n" + "</html>\n"); + + /* + * Close files... + */ + + cupsFileClose(infile); + cupsFileClose(outfile); + + /* + * Return with no errors... + */ + + return (0); +} + + +/* + * 'put_entity()' - Put a single character, using entities as needed. + */ + +void +put_entity(cups_file_t *fp, /* I - File */ + int ch) /* I - Character */ +{ + if (ch == '&') + cupsFilePuts(fp, "&"); + else if (ch == '<') + cupsFilePuts(fp, "<"); + else + cupsFilePutChar(fp, ch); +} + + +/* + * 'put_line()' - Put a whole string for a line. + */ + +void +put_line(cups_file_t *fp, /* I - File */ + const char *s) /* I - String */ +{ + int whitespace, /* Saw whitespace */ + i, /* Looping var */ + len; /* Length of keyword */ + static const char * const keywords[] =/* Special keywords to boldface */ + { + "MAY", + "MUST", + "NOT", + "SHALL", + "SHOULD" + }; + + + whitespace = 1; + + while (*s) + { + if (*s == ' ') + whitespace = 1; + + if (whitespace && isupper(*s & 255)) + { + whitespace = 0; + + for (i = 0; i < (int)(sizeof(keywords) / sizeof(sizeof(keywords[0]))); i ++) + { + len = strlen(keywords[i]); + if (!strncmp(s, keywords[i], len) && (isspace(s[len] & 255) || !*s)) + { + cupsFilePrintf(fp, "<b>%s</b>", keywords[i]); + s += len; + break; + } + } + + if (i >= (int)(sizeof(keywords) / sizeof(sizeof(keywords[0])))) + put_entity(fp, *s++); + } + else + { + if (*s != ' ') + whitespace = 0; + + put_entity(fp, *s++); + } + } +} + + +/* + * End of "$Id: rfctohtml.c 4966 2006-01-23 00:41:22Z mike $". + */ diff --git a/systemv/Dependencies b/systemv/Dependencies index c9b548b96..0d7585b86 100644 --- a/systemv/Dependencies +++ b/systemv/Dependencies @@ -9,6 +9,7 @@ cancel.o: ../cups/i18n.h ../cups/language.h ../cups/array.h cupsaddsmb.o: ../cups/string.h ../config.h ../cups/cups.h ../cups/ipp.h cupsaddsmb.o: ../cups/http.h ../cups/md5.h ../cups/ppd.h ../cups/file.h cupsaddsmb.o: ../cups/i18n.h ../cups/language.h ../cups/array.h +cupsaddsmb.o: ../cups/debug.h cupstestppd.o: ../cups/string.h ../config.h ../cups/cups.h ../cups/ipp.h cupstestppd.o: ../cups/http.h ../cups/md5.h ../cups/ppd.h ../cups/file.h cupstestppd.o: ../cups/i18n.h ../cups/language.h ../cups/array.h @@ -30,6 +31,6 @@ lpoptions.o: ../cups/i18n.h ../cups/language.h ../cups/array.h lppasswd.o: ../cups/string.h ../config.h ../cups/cups.h ../cups/ipp.h lppasswd.o: ../cups/http.h ../cups/md5.h ../cups/ppd.h ../cups/file.h lppasswd.o: ../cups/i18n.h ../cups/language.h ../cups/array.h ../cups/md5.h -lpstat.o: ../cups/cups.h ../cups/ipp.h ../cups/http.h ../cups/md5.h -lpstat.o: ../cups/ppd.h ../cups/file.h ../cups/i18n.h ../cups/language.h -lpstat.o: ../cups/array.h ../cups/debug.h ../cups/string.h ../config.h +lpstat.o: ../cups/string.h ../config.h ../cups/cups.h ../cups/ipp.h +lpstat.o: ../cups/http.h ../cups/md5.h ../cups/ppd.h ../cups/file.h +lpstat.o: ../cups/i18n.h ../cups/language.h ../cups/array.h ../cups/debug.h diff --git a/systemv/accept.c b/systemv/accept.c index ba65ca191..e0cc817d1 100644 --- a/systemv/accept.c +++ b/systemv/accept.c @@ -1,5 +1,5 @@ /* - * "$Id: accept.c 4906 2006-01-10 20:53:28Z mike $" + * "$Id: accept.c 4990 2006-01-26 02:21:45Z mike $" * * "accept", "disable", "enable", and "reject" commands for the Common * UNIX Printing System (CUPS). @@ -55,7 +55,6 @@ main(int argc, /* I - Number of command-line arguments */ ipp_t *request; /* IPP request */ ipp_t *response; /* IPP response */ ipp_op_t op; /* Operation */ - cups_lang_t *language; /* Language */ int cancel; /* Cancel jobs? */ @@ -68,8 +67,7 @@ main(int argc, /* I - Number of command-line arguments */ else command = argv[0]; - cancel = 0; - language = cupsLangDefault(); + cancel = 0; if (!strcmp(command, "accept")) op = CUPS_ACCEPT_JOBS; @@ -81,7 +79,7 @@ main(int argc, /* I - Number of command-line arguments */ op = IPP_RESUME_PRINTER; else { - _cupsLangPrintf(stderr, language, _("%s: Don't know what to do!\n"), + _cupsLangPrintf(stderr, _("%s: Don't know what to do!\n"), command); return (1); } @@ -104,12 +102,31 @@ main(int argc, /* I - Number of command-line arguments */ if (http) httpEncryption(http, HTTP_ENCRYPT_REQUIRED); #else - _cupsLangPrintf(stderr, language, + _cupsLangPrintf(stderr, _("%s: Sorry, no encryption support compiled in!\n"), command); #endif /* HAVE_SSL */ break; + case 'U' : /* Username */ + if (argv[i][2] != '\0') + cupsSetUser(argv[i] + 2); + else + { + i ++; + if (i >= argc) + { + _cupsLangPrintf(stderr, + _("%s: Error - expected username after " + "\'-U\' option!\n"), + command); + return (1); + } + + cupsSetUser(argv[i]); + } + break; + case 'c' : /* Cancel jobs */ cancel = 1; break; @@ -125,8 +142,9 @@ main(int argc, /* I - Number of command-line arguments */ i ++; if (i >= argc) { - _cupsLangPrintf(stderr, language, - _("%s: Expected server name after -h!\n"), + _cupsLangPrintf(stderr, + _("%s: Error - expected hostname after " + "\'-h\' option!\n"), command); return (1); } @@ -143,8 +161,9 @@ main(int argc, /* I - Number of command-line arguments */ i ++; if (i >= argc) { - _cupsLangPrintf(stderr, language, - _("%s: Expected reason text after -r!\n"), + _cupsLangPrintf(stderr, + _("%s: Error - expected reason text after " + "\'-r\' option!\n"), command); return (1); } @@ -154,7 +173,7 @@ main(int argc, /* I - Number of command-line arguments */ break; default : - _cupsLangPrintf(stderr, language, _("%s: Unknown option \'%c\'!\n"), + _cupsLangPrintf(stderr, _("%s: Error - unknown option \'%c\'!\n"), command, argv[i][1]); return (1); } @@ -169,7 +188,7 @@ main(int argc, /* I - Number of command-line arguments */ if (http == NULL) { - _cupsLangPrintf(stderr, language, + _cupsLangPrintf(stderr, _("%s: Unable to connect to server: %s\n"), command, strerror(errno)); return (1); @@ -185,22 +204,16 @@ main(int argc, /* I - Number of command-line arguments */ * printer-state-message [optional] */ - request = ippNew(); - - request->request.op.operation_id = op; - request->request.op.request_id = 1; - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET, - "attributes-charset", NULL, cupsLangEncoding(language)); - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE, - "attributes-natural-language", NULL, language->language); + request = ippNewRequest(op); httpAssembleURIf(uri, sizeof(uri), "ipp", NULL, "localhost", 0, "/printers/%s", argv[i]); ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, uri); + ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, + "requesting-user-name", NULL, cupsUser()); + if (reason != NULL) ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_TEXT, "printer-state-message", NULL, reason); @@ -213,7 +226,7 @@ main(int argc, /* I - Number of command-line arguments */ { if (response->request.status.status_code > IPP_OK_CONFLICT) { - _cupsLangPrintf(stderr, language, + _cupsLangPrintf(stderr, _("%s: Operation failed: %s\n"), command, ippErrorString(cupsLastError())); return (1); @@ -223,9 +236,7 @@ main(int argc, /* I - Number of command-line arguments */ } else { - _cupsLangPrintf(stderr, language, - _("%s: Operation failed: %s\n"), - command, ippErrorString(cupsLastError())); + _cupsLangPrintf(stderr, "%s: %s\n", command, cupsLastErrorString()); return (1); } @@ -244,18 +255,7 @@ main(int argc, /* I - Number of command-line arguments */ * printer-uri */ - request = ippNew(); - - request->request.op.operation_id = IPP_PURGE_JOBS; - request->request.op.request_id = 1; - - language = cupsLangDefault(); - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET, - "attributes-charset", NULL, cupsLangEncoding(language)); - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE, - "attributes-natural-language", NULL, language->language); + request = ippNewRequest(IPP_PURGE_JOBS); ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, uri); @@ -264,9 +264,7 @@ main(int argc, /* I - Number of command-line arguments */ { if (response->request.status.status_code > IPP_OK_CONFLICT) { - _cupsLangPrintf(stderr, language, - _("%s: Operation failed: %s\n"), - command, ippErrorString(cupsLastError())); + _cupsLangPrintf(stderr, "%s: %s\n", command, cupsLastErrorString()); return (1); } @@ -274,9 +272,7 @@ main(int argc, /* I - Number of command-line arguments */ } else { - _cupsLangPrintf(stderr, language, - _("%s: Operation failed: %s\n"), - command, ippErrorString(cupsLastError())); + _cupsLangPrintf(stderr, "%s: %s\n", command, cupsLastErrorString()); return (1); } } @@ -290,5 +286,5 @@ main(int argc, /* I - Number of command-line arguments */ /* - * End of "$Id: accept.c 4906 2006-01-10 20:53:28Z mike $". + * End of "$Id: accept.c 4990 2006-01-26 02:21:45Z mike $". */ diff --git a/systemv/cancel.c b/systemv/cancel.c index 06c6075c1..66394b9a3 100644 --- a/systemv/cancel.c +++ b/systemv/cancel.c @@ -1,5 +1,5 @@ /* - * "$Id: cancel.c 4906 2006-01-10 20:53:28Z mike $" + * "$Id: cancel.c 4948 2006-01-19 03:23:41Z mike $" * * "cancel" command for the Common UNIX Printing System (CUPS). * @@ -58,22 +58,20 @@ main(int argc, /* I - Number of command-line arguments */ ipp_t *request; /* IPP request */ ipp_t *response; /* IPP response */ ipp_op_t op; /* Operation */ - cups_lang_t *language; /* Language */ /* * Setup to cancel individual print jobs... */ - op = IPP_CANCEL_JOB; - purge = 0; - job_id = 0; - dest = NULL; - user = NULL; - http = NULL; - num_dests = 0; - dests = NULL; - language = cupsLangDefault(); + op = IPP_CANCEL_JOB; + purge = 0; + job_id = 0; + dest = NULL; + user = NULL; + http = NULL; + num_dests = 0; + dests = NULL; /* @@ -91,12 +89,31 @@ main(int argc, /* I - Number of command-line arguments */ if (http) httpEncryption(http, HTTP_ENCRYPT_REQUIRED); #else - _cupsLangPrintf(stderr, language, + _cupsLangPrintf(stderr, _("%s: Sorry, no encryption support compiled in!\n"), argv[0]); #endif /* HAVE_SSL */ break; + case 'U' : /* Username */ + if (argv[i][2] != '\0') + cupsSetUser(argv[i] + 2); + else + { + i ++; + if (i >= argc) + { + _cupsLangPrintf(stderr, + _("%s: Error - expected username after " + "\'-U\' option!\n"), + argv[0]); + return (1); + } + + cupsSetUser(argv[i]); + } + break; + case 'a' : /* Cancel all jobs */ purge = 1; op = IPP_PURGE_JOBS; @@ -114,9 +131,10 @@ main(int argc, /* I - Number of command-line arguments */ if (i >= argc) { - _cupsLangPuts(stderr, language, - _("cancel: Error - expected hostname after " - "\'-h\' option!\n")); + _cupsLangPrintf(stderr, + _("%s: Error - expected hostname after " + "\'-h\' option!\n"), + argv[0]); return (1); } else @@ -135,9 +153,10 @@ main(int argc, /* I - Number of command-line arguments */ if (i >= argc) { - _cupsLangPuts(stderr, language, - _("cancel: Error - expected username after " - "\'-u\' option!\n")); + _cupsLangPrintf(stderr, + _("%s: Error - expected username after " + "\'-u\' option!\n"), + argv[0]); return (1); } else @@ -146,8 +165,9 @@ main(int argc, /* I - Number of command-line arguments */ break; default : - _cupsLangPrintf(stderr, language, - _("cancel: Unknown option \'%c\'!\n"), argv[i][1]); + _cupsLangPrintf(stderr, + _("%s: Error - unknown option \'%c\'!\n"), + argv[0], argv[i][1]); return (1); } else @@ -203,8 +223,9 @@ main(int argc, /* I - Number of command-line arguments */ * Bad printer name! */ - _cupsLangPrintf(stderr, language, - _("cancel: Unknown destination \"%s\"!\n"), argv[i]); + _cupsLangPrintf(stderr, + _("%s: Error - unknown destination \"%s\"!\n"), + argv[0], argv[i]); return (1); } @@ -225,8 +246,9 @@ main(int argc, /* I - Number of command-line arguments */ if ((http = httpConnectEncrypt(cupsServer(), ippPort(), cupsEncryption())) == NULL) { - _cupsLangPuts(stderr, language, - _("cancel: Unable to contact server!\n")); + _cupsLangPrintf(stderr, + _("%s: Unable to contact server!\n"), + argv[0]); return (1); } @@ -240,16 +262,7 @@ main(int argc, /* I - Number of command-line arguments */ * [requesting-user-name] */ - request = ippNew(); - - request->request.op.operation_id = op; - request->request.op.request_id = 1; - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET, - "attributes-charset", NULL, cupsLangEncoding(language)); - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE, - "attributes-natural-language", NULL, language->language); + request = ippNewRequest(op); if (dest) { @@ -292,7 +305,7 @@ main(int argc, /* I - Number of command-line arguments */ if (response == NULL || response->request.status.status_code > IPP_OK_CONFLICT) { - _cupsLangPrintf(stderr, language, _("cancel: %s failed: %s\n"), + _cupsLangPrintf(stderr, _("%s: %s failed: %s\n"), argv[0], op == IPP_PURGE_JOBS ? "purge-jobs" : "cancel-job", response ? ippErrorString(response->request.status.status_code) : ippErrorString(cupsLastError())); @@ -316,7 +329,8 @@ main(int argc, /* I - Number of command-line arguments */ if ((http = httpConnectEncrypt(cupsServer(), ippPort(), cupsEncryption())) == NULL) { - _cupsLangPuts(stderr, language, _("cancel: Unable to contact server!\n")); + _cupsLangPrintf(stderr, _("%s: Unable to contact server!\n"), + argv[0]); return (1); } @@ -330,18 +344,7 @@ main(int argc, /* I - Number of command-line arguments */ * [requesting-user-name] */ - request = ippNew(); - - request->request.op.operation_id = op; - request->request.op.request_id = 1; - - language = cupsLangDefault(); - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET, - "attributes-charset", NULL, cupsLangEncoding(language)); - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE, - "attributes-natural-language", NULL, language->language); + request = ippNewRequest(op); ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, "ipp://localhost/printers/"); @@ -367,10 +370,9 @@ main(int argc, /* I - Number of command-line arguments */ if (response == NULL || response->request.status.status_code > IPP_OK_CONFLICT) { - _cupsLangPrintf(stderr, language, _("cancel: %s failed: %s\n"), + _cupsLangPrintf(stderr, _("%s: %s failed: %s\n"), argv[0], op == IPP_PURGE_JOBS ? "purge-jobs" : "cancel-job", - response ? ippErrorString(response->request.status.status_code) : - ippErrorString(cupsLastError())); + cupsLastErrorString()); if (response) ippDelete(response); @@ -386,5 +388,5 @@ main(int argc, /* I - Number of command-line arguments */ /* - * End of "$Id: cancel.c 4906 2006-01-10 20:53:28Z mike $". + * End of "$Id: cancel.c 4948 2006-01-19 03:23:41Z mike $". */ diff --git a/systemv/cupsaddsmb.c b/systemv/cupsaddsmb.c index 1ed9d26d6..77aa46c3f 100644 --- a/systemv/cupsaddsmb.c +++ b/systemv/cupsaddsmb.c @@ -1,5 +1,5 @@ /* - * "$Id: cupsaddsmb.c 4916 2006-01-11 21:42:55Z mike $" + * "$Id: cupsaddsmb.c 4933 2006-01-16 00:26:57Z mike $" * * "cupsaddsmb" command for the Common UNIX Printing System (CUPS). * @@ -307,7 +307,7 @@ convert_ppd(const char *src, /* I - Source (original) PPD */ { if ((ptr = strchr(line, ':')) == NULL) { - _cupsLangPrintf(stderr, NULL, + _cupsLangPrintf(stderr, _("cupsaddsmb: Missing value on line %d!\n"), linenum); fclose(srcfp); fclose(dstfp); @@ -318,7 +318,7 @@ convert_ppd(const char *src, /* I - Source (original) PPD */ if ((ptr = strchr(ptr, '\"')) == NULL) { - _cupsLangPrintf(stderr, NULL, + _cupsLangPrintf(stderr, _("cupsaddsmb: Missing double quote on line %d!\n"), linenum); fclose(srcfp); @@ -330,7 +330,7 @@ convert_ppd(const char *src, /* I - Source (original) PPD */ if (sscanf(line, "*%40s%*[ \t]%40[^/]", option, choice) != 2) { - _cupsLangPrintf(stderr, NULL, + _cupsLangPrintf(stderr, _("cupsaddsmb: Bad option + choice on line %d!\n"), linenum); fclose(srcfp); @@ -447,7 +447,7 @@ do_samba_command(const char *command, /* I - Command to run */ snprintf(temp, sizeof(temp), "%s%%%s", SAMBAUser, SAMBAPassword); if (Verbosity) - _cupsLangPrintf(stdout, NULL, + _cupsLangPrintf(stdout, _("Running command: %s %s -N -U \'%s%%%s\' -c \'%s\'\n"), command, address, SAMBAUser, SAMBAPassword, subcmd); @@ -476,7 +476,7 @@ do_samba_command(const char *command, /* I - Command to run */ { status = -1; - _cupsLangPrintf(stderr, NULL, _("cupsaddsmb: Unable to run \"%s\": %s\n"), + _cupsLangPrintf(stderr, _("cupsaddsmb: Unable to run \"%s\": %s\n"), command, strerror(errno)); } else @@ -491,7 +491,7 @@ do_samba_command(const char *command, /* I - Command to run */ DEBUG_printf(("status=%d\n", status)); if (Verbosity) - _cupsLangPuts(stdout, NULL, "\n"); + _cupsLangPuts(stdout, "\n"); if (status) { @@ -514,6 +514,7 @@ int /* O - 0 on success, non-zero on error */ export_dest(const char *dest) /* I - Destination to export */ { int status; /* Status of smbclient/rpcclient commands */ + int have_drivers; /* Have drivers? */ const char *ppdfile; /* PPD file for printer drivers */ char newppd[1024], /* New PPD file for printer drivers */ file[1024], /* File to test for */ @@ -522,7 +523,6 @@ export_dest(const char *dest) /* I - Destination to export */ subcmd[1024]; /* Sub-command */ const char *datadir; /* CUPS_DATADIR */ http_t *http; /* Connection to server */ - cups_lang_t *language; /* Default language */ ipp_t *request, /* IPP request */ *response; /* IPP response */ static const char *pattrs[] = /* Printer attributes we want */ @@ -543,15 +543,13 @@ export_dest(const char *dest) /* I - Destination to export */ if ((datadir = getenv("CUPS_DATADIR")) == NULL) datadir = CUPS_DATADIR; - language = cupsLangDefault(); - /* * Open a connection to the scheduler... */ if ((http = httpConnectEncrypt(cupsServer(), ippPort(), cupsEncryption())) == NULL) { - _cupsLangPrintf(stderr, language, + _cupsLangPrintf(stderr, _("cupsaddsmb: Unable to connect to server \"%s\" for " "%s - %s\n"), cupsServer(), dest, strerror(errno)); @@ -564,7 +562,7 @@ export_dest(const char *dest) /* I - Destination to export */ if ((ppdfile = cupsGetPPD2(http, dest)) == NULL) { - _cupsLangPrintf(stderr, language, + _cupsLangPrintf(stderr, _("cupsaddsmb: No PPD file for printer \"%s\" - " "skipping!\n"), dest); @@ -576,15 +574,7 @@ export_dest(const char *dest) /* I - Destination to export */ * Append the supported banner pages to the PPD file... */ - request = ippNew(); - request->request.op.operation_id = IPP_GET_PRINTER_ATTRIBUTES; - request->request.op.request_id = 1; - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET, - "attributes-charset", NULL, cupsLangEncoding(language)); - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE, - "attributes-natural-language", NULL, language->language); + request = ippNewRequest(IPP_GET_PRINTER_ATTRIBUTES); httpAssembleURIf(uri, sizeof(uri), "ipp", NULL, "localhost", 0, "/printers/%s", dest); @@ -603,13 +593,9 @@ export_dest(const char *dest) /* I - Destination to export */ { if (response->request.status.status_code > IPP_OK_CONFLICT) { - _cupsLangPrintf(stderr, language, - _("cupsaddsmb: get-printer-attributes failed for " - "\"%s\": %s\n"), - dest, - ippErrorString(response->request.status.status_code)); + _cupsLangPrintf(stderr, "cupsaddsmb: %s - %s\n", dest, + cupsLastErrorString()); ippDelete(response); - cupsLangFree(language); httpClose(http); unlink(ppdfile); return (2); @@ -617,11 +603,8 @@ export_dest(const char *dest) /* I - Destination to export */ } else { - _cupsLangPrintf(stderr, language, - _("cupsaddsmb: get-printer-attributes failed for " - "\"%s\": %s\n"), - dest, ippErrorString(cupsLastError())); - cupsLangFree(language); + _cupsLangPrintf(stderr, "cupsaddsmb: %s - %s\n", dest, + cupsLastErrorString()); httpClose(http); unlink(ppdfile); return (2); @@ -633,18 +616,16 @@ export_dest(const char *dest) /* I - Destination to export */ if (convert_ppd(ppdfile, newppd, sizeof(newppd), response)) { - _cupsLangPrintf(stderr, language, + _cupsLangPrintf(stderr, _("cupsaddsmb: Unable to convert PPD file for %s - %s\n"), dest, strerror(errno)); ippDelete(response); - cupsLangFree(language); httpClose(http); unlink(ppdfile); return (3); } ippDelete(response); - cupsLangFree(language); httpClose(http); /* @@ -667,9 +648,13 @@ export_dest(const char *dest) /* I - Destination to export */ * pscript5.dll */ + have_drivers = 0; + snprintf(file, sizeof(file), "%s/drivers/pscript5.dll", datadir); if (!access(file, 0)) { + have_drivers |= 1; + /* * Windows 2k driver is installed; do the smbclient commands needed * to copy the Win2k drivers over... @@ -688,7 +673,7 @@ export_dest(const char *dest) /* I - Destination to export */ if ((status = do_samba_command("smbclient", address, subcmd)) != 0) { - _cupsLangPrintf(stderr, language, + _cupsLangPrintf(stderr, _("cupsaddsmb: Unable to copy Windows 2000 printer " "driver files (%d)!\n"), status); @@ -715,7 +700,7 @@ export_dest(const char *dest) /* I - Destination to export */ if ((status = do_samba_command("smbclient", address, subcmd)) != 0) { - _cupsLangPrintf(stderr, language, + _cupsLangPrintf(stderr, _("cupsaddsmb: Unable to copy CUPS printer driver " "files (%d)!\n"), status); @@ -750,7 +735,7 @@ export_dest(const char *dest) /* I - Destination to export */ if ((status = do_samba_command("rpcclient", SAMBAServer, subcmd)) != 0) { - _cupsLangPrintf(stderr, language, + _cupsLangPrintf(stderr, _("cupsaddsmb: Unable to install Windows 2000 printer " "driver files (%d)!\n"), status); @@ -762,6 +747,8 @@ export_dest(const char *dest) /* I - Destination to export */ snprintf(file, sizeof(file), "%s/drivers/ADOBEPS4.DRV", datadir); if (!access(file, 0)) { + have_drivers |= 2; + /* * Do the smbclient commands needed for the Adobe Win9x drivers... */ @@ -780,7 +767,7 @@ export_dest(const char *dest) /* I - Destination to export */ if ((status = do_samba_command("smbclient", address, subcmd)) != 0) { - _cupsLangPrintf(stderr, language, + _cupsLangPrintf(stderr, _("cupsaddsmb: Unable to copy Windows 9x printer " "driver files (%d)!\n"), status); @@ -801,7 +788,7 @@ export_dest(const char *dest) /* I - Destination to export */ if ((status = do_samba_command("rpcclient", SAMBAServer, subcmd)) != 0) { - _cupsLangPrintf(stderr, language, + _cupsLangPrintf(stderr, _("cupsaddsmb: Unable to install Windows 9x printer " "driver files (%d)!\n"), status); @@ -812,6 +799,17 @@ export_dest(const char *dest) /* I - Destination to export */ unlink(ppdfile); + if (have_drivers == 0) + { + _cupsLangPuts(stderr, + _("cupsaddsmb: No Windows printer drivers are installed!\n")); + return (9); + } + else if (have_drivers == 2) + _cupsLangPuts(stderr, + _("cupsaddsmb: Warning, no Windows 2000 printer drivers " + "are installed!\n")); + /* * Finally, associate the drivers we just added with the queue... */ @@ -820,7 +818,7 @@ export_dest(const char *dest) /* I - Destination to export */ if ((status = do_samba_command("rpcclient", SAMBAServer, subcmd)) != 0) { - _cupsLangPrintf(stderr, language, + _cupsLangPrintf(stderr, _("cupsaddsmb: Unable to set Windows printer driver (%d)!\n"), status); return (8); @@ -903,7 +901,7 @@ ppd_gets(FILE *fp, /* I - File to read from*/ void usage(void) { - _cupsLangPuts(stdout, NULL, + _cupsLangPuts(stdout, _("Usage: cupsaddsmb [options] printer1 ... printerN\n" " cupsaddsmb [options] -a\n" "\n" @@ -1028,5 +1026,5 @@ write_option(FILE *dstfp, /* I - PPD file */ /* - * End of "$Id: cupsaddsmb.c 4916 2006-01-11 21:42:55Z mike $". + * End of "$Id: cupsaddsmb.c 4933 2006-01-16 00:26:57Z mike $". */ diff --git a/systemv/cupstestppd.c b/systemv/cupstestppd.c index cb16ec5b2..09f45d5ae 100644 --- a/systemv/cupstestppd.c +++ b/systemv/cupstestppd.c @@ -1,5 +1,5 @@ /* - * "$Id: cupstestppd.c 4906 2006-01-10 20:53:28Z mike $" + * "$Id: cupstestppd.c 4990 2006-01-26 02:21:45Z mike $" * * PPD test program for the Common UNIX Printing System (CUPS). * @@ -47,17 +47,34 @@ * Error codes... */ -#define ERROR_NONE 0 -#define ERROR_USAGE 1 -#define ERROR_FILE_OPEN 2 -#define ERROR_PPD_FORMAT 3 -#define ERROR_CONFORMANCE 4 +enum +{ + ERROR_NONE = 0, + ERROR_USAGE, + ERROR_FILE_OPEN, + ERROR_PPD_FORMAT, + ERROR_CONFORMANCE +}; + + +/* + * Line endings... + */ + +enum +{ + EOL_NONE = 0, + EOL_CR, + EOL_LF, + EOL_CRLF +}; /* * Local functions... */ +void check_basics(const char *filename); void show_conflicts(ppd_file_t *ppd); void usage(void); @@ -116,7 +133,7 @@ main(int argc, /* I - Number of command-line arguments */ case 'q' : /* Quiet mode */ if (verbose > 0) { - _cupsLangPuts(stderr, NULL, + _cupsLangPuts(stderr, _("cupstestppd: The -q option is incompatible " "with the -v option.\n")); return (1); @@ -132,7 +149,7 @@ main(int argc, /* I - Number of command-line arguments */ case 'v' : /* Verbose mode */ if (verbose < 0) { - _cupsLangPuts(stderr, NULL, + _cupsLangPuts(stderr, _("cupstestppd: The -v option is incompatible " "with the -q option.\n")); return (1); @@ -153,7 +170,7 @@ main(int argc, /* I - Number of command-line arguments */ */ if (files && verbose >= 0) - _cupsLangPuts(stdout, NULL, "\n"); + _cupsLangPuts(stdout, "\n"); files ++; @@ -189,7 +206,7 @@ main(int argc, /* I - Number of command-line arguments */ status = ERROR_FILE_OPEN; if (verbose >= 0) - _cupsLangPrintf(stdout, NULL, + _cupsLangPrintf(stdout, _(" FAIL\n" " **FAIL** Unable to open PPD file - %s\n"), strerror(errno)); @@ -200,7 +217,7 @@ main(int argc, /* I - Number of command-line arguments */ if (verbose >= 0) { - _cupsLangPrintf(stdout, NULL, + _cupsLangPrintf(stdout, _(" FAIL\n" " **FAIL** Unable to open PPD file - " "%s on line %d.\n"), @@ -209,58 +226,60 @@ main(int argc, /* I - Number of command-line arguments */ switch (error) { case PPD_MISSING_PPDADOBE4 : - _cupsLangPuts(stdout, NULL, + _cupsLangPuts(stdout, _(" REF: Page 42, section 5.2.\n")); break; case PPD_MISSING_VALUE : - _cupsLangPuts(stdout, NULL, + _cupsLangPuts(stdout, _(" REF: Page 20, section 3.4.\n")); break; case PPD_BAD_OPEN_GROUP : case PPD_NESTED_OPEN_GROUP : - _cupsLangPuts(stdout, NULL, + _cupsLangPuts(stdout, _(" REF: Pages 45-46, section 5.2.\n")); break; case PPD_BAD_OPEN_UI : case PPD_NESTED_OPEN_UI : - _cupsLangPuts(stdout, NULL, + _cupsLangPuts(stdout, _(" REF: Pages 42-45, section 5.2.\n")); break; case PPD_BAD_ORDER_DEPENDENCY : - _cupsLangPuts(stdout, NULL, + _cupsLangPuts(stdout, _(" REF: Pages 48-49, section 5.2.\n")); break; case PPD_BAD_UI_CONSTRAINTS : - _cupsLangPuts(stdout, NULL, + _cupsLangPuts(stdout, _(" REF: Pages 52-54, section 5.2.\n")); break; case PPD_MISSING_ASTERISK : - _cupsLangPuts(stdout, NULL, + _cupsLangPuts(stdout, _(" REF: Page 15, section 3.2.\n")); break; case PPD_LINE_TOO_LONG : - _cupsLangPuts(stdout, NULL, + _cupsLangPuts(stdout, _(" REF: Page 15, section 3.1.\n")); break; case PPD_ILLEGAL_CHARACTER : - _cupsLangPuts(stdout, NULL, + _cupsLangPuts(stdout, _(" REF: Page 15, section 3.1.\n")); break; case PPD_ILLEGAL_MAIN_KEYWORD : - _cupsLangPuts(stdout, NULL, + _cupsLangPuts(stdout, _(" REF: Pages 16-17, section 3.2.\n")); break; case PPD_ILLEGAL_OPTION_KEYWORD : - _cupsLangPuts(stdout, NULL, + _cupsLangPuts(stdout, _(" REF: Page 19, section 3.3.\n")); break; case PPD_ILLEGAL_TRANSLATION : - _cupsLangPuts(stdout, NULL, + _cupsLangPuts(stdout, _(" REF: Page 27, section 3.5.\n")); break; default : break; } + + check_basics(argv[i]); } } @@ -276,7 +295,7 @@ main(int argc, /* I - Number of command-line arguments */ ppdversion = 43; if (verbose > 0) - _cupsLangPuts(stdout, NULL, + _cupsLangPuts(stdout, _("\n DETAILED CONFORMANCE TEST RESULTS\n")); if ((attr = ppdFindAttr(ppd, "FormatVersion", NULL)) != NULL && @@ -303,7 +322,7 @@ main(int argc, /* I - Number of command-line arguments */ if (!strncmp(attr->name, "Default", 7) && !ppdFindOption(ppd, attr->name + 7)) - _cupsLangPrintf(stdout, NULL, + _cupsLangPrintf(stdout, _(" WARN %s has no corresponding " "options!\n"), attr->name); @@ -315,9 +334,9 @@ main(int argc, /* I - Number of command-line arguments */ if (verbose >= 0) { if (!errors && !verbose) - _cupsLangPuts(stdout, NULL, _(" FAIL\n")); + _cupsLangPuts(stdout, _(" FAIL\n")); - _cupsLangPuts(stdout, NULL, + _cupsLangPuts(stdout, _(" **FAIL** REQUIRED DefaultImageableArea\n" " REF: Page 102, section 5.15.\n")); } @@ -330,9 +349,9 @@ main(int argc, /* I - Number of command-line arguments */ if (verbose >= 0) { if (!errors && !verbose) - _cupsLangPuts(stdout, NULL, _(" FAIL\n")); + _cupsLangPuts(stdout, _(" FAIL\n")); - _cupsLangPrintf(stdout, NULL, + _cupsLangPrintf(stdout, _(" **FAIL** BAD DefaultImageableArea %s!\n" " REF: Page 102, section 5.15.\n"), attr->value); @@ -343,7 +362,7 @@ main(int argc, /* I - Number of command-line arguments */ else { if (verbose > 0) - _cupsLangPuts(stdout, NULL, _(" PASS DefaultImageableArea\n")); + _cupsLangPuts(stdout, _(" PASS DefaultImageableArea\n")); } if ((attr = ppdFindAttr(ppd, "DefaultPaperDimension", NULL)) == NULL) @@ -351,9 +370,9 @@ main(int argc, /* I - Number of command-line arguments */ if (verbose >= 0) { if (!errors && !verbose) - _cupsLangPuts(stdout, NULL, _(" FAIL\n")); + _cupsLangPuts(stdout, _(" FAIL\n")); - _cupsLangPuts(stdout, NULL, + _cupsLangPuts(stdout, _(" **FAIL** REQUIRED DefaultPaperDimension\n" " REF: Page 103, section 5.15.\n")); } @@ -366,9 +385,9 @@ main(int argc, /* I - Number of command-line arguments */ if (verbose >= 0) { if (!errors && !verbose) - _cupsLangPuts(stdout, NULL, _(" FAIL\n")); + _cupsLangPuts(stdout, _(" FAIL\n")); - _cupsLangPrintf(stdout, NULL, + _cupsLangPrintf(stdout, _(" **FAIL** BAD DefaultPaperDimension %s!\n" " REF: Page 103, section 5.15.\n"), attr->value); @@ -377,7 +396,7 @@ main(int argc, /* I - Number of command-line arguments */ errors ++; } else if (verbose > 0) - _cupsLangPuts(stdout, NULL, _(" PASS DefaultPaperDimension\n")); + _cupsLangPuts(stdout, _(" PASS DefaultPaperDimension\n")); for (j = 0, group = ppd->groups; j < ppd->num_groups; j ++, group ++) for (k = 0, option = group->options; k < group->num_options; k ++, option ++) @@ -394,9 +413,9 @@ main(int argc, /* I - Number of command-line arguments */ if (verbose >= 0) { if (!errors && !verbose) - _cupsLangPuts(stdout, NULL, _(" FAIL\n")); + _cupsLangPuts(stdout, _(" FAIL\n")); - _cupsLangPrintf(stdout, NULL, + _cupsLangPrintf(stdout, _(" **FAIL** BAD Default%s %s\n" " REF: Page 40, section 4.5.\n"), option->keyword, option->defchoice); @@ -405,7 +424,7 @@ main(int argc, /* I - Number of command-line arguments */ errors ++; } else if (verbose > 0) - _cupsLangPrintf(stdout, NULL, + _cupsLangPrintf(stdout, _(" PASS Default%s\n"), option->keyword); } @@ -414,9 +433,9 @@ main(int argc, /* I - Number of command-line arguments */ if (verbose >= 0) { if (!errors && !verbose) - _cupsLangPuts(stdout, NULL, _(" FAIL\n")); + _cupsLangPuts(stdout, _(" FAIL\n")); - _cupsLangPrintf(stdout, NULL, + _cupsLangPrintf(stdout, _(" **FAIL** REQUIRED Default%s\n" " REF: Page 40, section 4.5.\n"), option->keyword); @@ -429,16 +448,16 @@ main(int argc, /* I - Number of command-line arguments */ if (ppdFindAttr(ppd, "FileVersion", NULL) != NULL) { if (verbose > 0) - _cupsLangPuts(stdout, NULL, _(" PASS FileVersion\n")); + _cupsLangPuts(stdout, _(" PASS FileVersion\n")); } else { if (verbose >= 0) { if (!errors && !verbose) - _cupsLangPuts(stdout, NULL, _(" FAIL\n")); + _cupsLangPuts(stdout, _(" FAIL\n")); - _cupsLangPuts(stdout, NULL, + _cupsLangPuts(stdout, _(" **FAIL** REQUIRED FileVersion\n" " REF: Page 56, section 5.3.\n")); } @@ -449,16 +468,16 @@ main(int argc, /* I - Number of command-line arguments */ if (ppdFindAttr(ppd, "FormatVersion", NULL) != NULL) { if (verbose > 0) - _cupsLangPuts(stdout, NULL, _(" PASS FormatVersion\n")); + _cupsLangPuts(stdout, _(" PASS FormatVersion\n")); } else { if (verbose >= 0) { if (!errors && !verbose) - _cupsLangPuts(stdout, NULL, _(" FAIL\n")); + _cupsLangPuts(stdout, _(" FAIL\n")); - _cupsLangPuts(stdout, NULL, + _cupsLangPuts(stdout, _(" **FAIL** REQUIRED FormatVersion\n" " REF: Page 56, section 5.3.\n")); } @@ -469,16 +488,16 @@ main(int argc, /* I - Number of command-line arguments */ if (ppd->lang_encoding != NULL) { if (verbose > 0) - _cupsLangPuts(stdout, NULL, _(" PASS LanguageEncoding\n")); + _cupsLangPuts(stdout, _(" PASS LanguageEncoding\n")); } else if (ppdversion > 40) { if (verbose >= 0) { if (!errors && !verbose) - _cupsLangPuts(stdout, NULL, _(" FAIL\n")); + _cupsLangPuts(stdout, _(" FAIL\n")); - _cupsLangPuts(stdout, NULL, + _cupsLangPuts(stdout, _(" **FAIL** REQUIRED LanguageEncoding\n" " REF: Pages 56-57, section 5.3.\n")); } @@ -489,16 +508,16 @@ main(int argc, /* I - Number of command-line arguments */ if (ppd->lang_version != NULL) { if (verbose > 0) - _cupsLangPuts(stdout, NULL, _(" PASS LanguageVersion\n")); + _cupsLangPuts(stdout, _(" PASS LanguageVersion\n")); } else { if (verbose >= 0) { if (!errors && !verbose) - _cupsLangPuts(stdout, NULL, _(" FAIL\n")); + _cupsLangPuts(stdout, _(" FAIL\n")); - _cupsLangPuts(stdout, NULL, + _cupsLangPuts(stdout, _(" **FAIL** REQUIRED LanguageVersion\n" " REF: Pages 57-58, section 5.3.\n")); } @@ -514,9 +533,9 @@ main(int argc, /* I - Number of command-line arguments */ if (verbose >= 0) { if (!errors && !verbose) - _cupsLangPuts(stdout, NULL, _(" FAIL\n")); + _cupsLangPuts(stdout, _(" FAIL\n")); - _cupsLangPuts(stdout, NULL, + _cupsLangPuts(stdout, _(" **FAIL** BAD Manufacturer (should be " "\"HP\")\n" " REF: Page 211, table D.1.\n")); @@ -525,16 +544,16 @@ main(int argc, /* I - Number of command-line arguments */ errors ++; } else if (verbose > 0) - _cupsLangPuts(stdout, NULL, _(" PASS Manufacturer\n")); + _cupsLangPuts(stdout, _(" PASS Manufacturer\n")); } else if (ppdversion >= 43) { if (verbose >= 0) { if (!errors && !verbose) - _cupsLangPuts(stdout, NULL, _(" FAIL\n")); + _cupsLangPuts(stdout, _(" FAIL\n")); - _cupsLangPuts(stdout, NULL, + _cupsLangPuts(stdout, _(" **FAIL** REQUIRED Manufacturer\n" " REF: Pages 58-59, section 5.3.\n")); } @@ -553,9 +572,9 @@ main(int argc, /* I - Number of command-line arguments */ if (verbose >= 0) { if (!errors && !verbose) - _cupsLangPuts(stdout, NULL, _(" FAIL\n")); + _cupsLangPuts(stdout, _(" FAIL\n")); - _cupsLangPrintf(stdout, NULL, + _cupsLangPrintf(stdout, _(" **FAIL** BAD ModelName - \"%c\" not " "allowed in string.\n" " REF: Pages 59-60, section 5.3.\n"), @@ -565,16 +584,16 @@ main(int argc, /* I - Number of command-line arguments */ errors ++; } else if (verbose > 0) - _cupsLangPuts(stdout, NULL, _(" PASS ModelName\n")); + _cupsLangPuts(stdout, _(" PASS ModelName\n")); } else { if (verbose >= 0) { if (!errors && !verbose) - _cupsLangPuts(stdout, NULL, _(" FAIL\n")); + _cupsLangPuts(stdout, _(" FAIL\n")); - _cupsLangPuts(stdout, NULL, + _cupsLangPuts(stdout, _(" **FAIL** REQUIRED ModelName\n" " REF: Pages 59-60, section 5.3.\n")); } @@ -585,16 +604,16 @@ main(int argc, /* I - Number of command-line arguments */ if (ppd->nickname != NULL) { if (verbose > 0) - _cupsLangPuts(stdout, NULL, _(" PASS NickName\n")); + _cupsLangPuts(stdout, _(" PASS NickName\n")); } else { if (verbose >= 0) { if (!errors && !verbose) - _cupsLangPuts(stdout, NULL, _(" FAIL\n")); + _cupsLangPuts(stdout, _(" FAIL\n")); - _cupsLangPuts(stdout, NULL, + _cupsLangPuts(stdout, _(" **FAIL** REQUIRED NickName\n" " REF: Page 60, section 5.3.\n")); } @@ -605,16 +624,16 @@ main(int argc, /* I - Number of command-line arguments */ if (ppdFindOption(ppd, "PageSize") != NULL) { if (verbose > 0) - _cupsLangPuts(stdout, NULL, _(" PASS PageSize\n")); + _cupsLangPuts(stdout, _(" PASS PageSize\n")); } else { if (verbose >= 0) { if (!errors && !verbose) - _cupsLangPuts(stdout, NULL, _(" FAIL\n")); + _cupsLangPuts(stdout, _(" FAIL\n")); - _cupsLangPuts(stdout, NULL, + _cupsLangPuts(stdout, _(" **FAIL** REQUIRED PageSize\n" " REF: Pages 99-100, section 5.14.\n")); } @@ -625,16 +644,16 @@ main(int argc, /* I - Number of command-line arguments */ if (ppdFindOption(ppd, "PageRegion") != NULL) { if (verbose > 0) - _cupsLangPuts(stdout, NULL, _(" PASS PageRegion\n")); + _cupsLangPuts(stdout, _(" PASS PageRegion\n")); } else { if (verbose >= 0) { if (!errors && !verbose) - _cupsLangPuts(stdout, NULL, _(" FAIL\n")); + _cupsLangPuts(stdout, _(" FAIL\n")); - _cupsLangPuts(stdout, NULL, + _cupsLangPuts(stdout, _(" **FAIL** REQUIRED PageRegion\n" " REF: Page 100, section 5.14.\n")); } @@ -645,16 +664,16 @@ main(int argc, /* I - Number of command-line arguments */ if (ppd->pcfilename != NULL) { if (verbose > 0) - _cupsLangPuts(stdout, NULL, _(" PASS PCFileName\n")); + _cupsLangPuts(stdout, _(" PASS PCFileName\n")); } else { if (verbose >= 0) { if (!errors && !verbose) - _cupsLangPuts(stdout, NULL, _(" FAIL\n")); + _cupsLangPuts(stdout, _(" FAIL\n")); - _cupsLangPuts(stdout, NULL, + _cupsLangPuts(stdout, _(" **FAIL** REQUIRED PCFileName\n" " REF: Pages 61-62, section 5.3.\n")); } @@ -670,9 +689,9 @@ main(int argc, /* I - Number of command-line arguments */ if (verbose >= 0) { if (!errors && !verbose) - _cupsLangPuts(stdout, NULL, _(" FAIL\n")); + _cupsLangPuts(stdout, _(" FAIL\n")); - _cupsLangPuts(stdout, NULL, + _cupsLangPuts(stdout, _(" **FAIL** BAD Product - not \"(string)\".\n" " REF: Page 62, section 5.3.\n")); } @@ -680,16 +699,16 @@ main(int argc, /* I - Number of command-line arguments */ errors ++; } else if (verbose > 0) - _cupsLangPuts(stdout, NULL, _(" PASS Product\n")); + _cupsLangPuts(stdout, _(" PASS Product\n")); } else { if (verbose >= 0) { if (!errors && !verbose) - _cupsLangPuts(stdout, NULL, _(" FAIL\n")); + _cupsLangPuts(stdout, _(" FAIL\n")); - _cupsLangPuts(stdout, NULL, + _cupsLangPuts(stdout, _(" **FAIL** REQUIRED Product\n" " REF: Page 62, section 5.3.\n")); } @@ -709,9 +728,9 @@ main(int argc, /* I - Number of command-line arguments */ if (verbose >= 0) { if (!errors && !verbose) - _cupsLangPuts(stdout, NULL, _(" FAIL\n")); + _cupsLangPuts(stdout, _(" FAIL\n")); - _cupsLangPuts(stdout, NULL, + _cupsLangPuts(stdout, _(" **FAIL** BAD PSVersion - not \"(string) " "int\".\n" " REF: Pages 62-64, section 5.3.\n")); @@ -720,16 +739,16 @@ main(int argc, /* I - Number of command-line arguments */ errors ++; } else if (verbose > 0) - _cupsLangPuts(stdout, NULL, _(" PASS PSVersion\n")); + _cupsLangPuts(stdout, _(" PASS PSVersion\n")); } else { if (verbose >= 0) { if (!errors && !verbose) - _cupsLangPuts(stdout, NULL, _(" FAIL\n")); + _cupsLangPuts(stdout, _(" FAIL\n")); - _cupsLangPuts(stdout, NULL, + _cupsLangPuts(stdout, _(" **FAIL** REQUIRED PSVersion\n" " REF: Pages 62-64, section 5.3.\n")); } @@ -744,9 +763,9 @@ main(int argc, /* I - Number of command-line arguments */ if (verbose >= 0) { if (!errors && !verbose) - _cupsLangPuts(stdout, NULL, _(" FAIL\n")); + _cupsLangPuts(stdout, _(" FAIL\n")); - _cupsLangPuts(stdout, NULL, + _cupsLangPuts(stdout, _(" **FAIL** BAD ShortNickName - longer " "than 31 chars.\n" " REF: Pages 64-65, section 5.3.\n")); @@ -755,16 +774,16 @@ main(int argc, /* I - Number of command-line arguments */ errors ++; } else if (verbose > 0) - _cupsLangPuts(stdout, NULL, _(" PASS ShortNickName\n")); + _cupsLangPuts(stdout, _(" PASS ShortNickName\n")); } else if (ppdversion >= 43) { if (verbose >= 0) { if (!errors && !verbose) - _cupsLangPuts(stdout, NULL, _(" FAIL\n")); + _cupsLangPuts(stdout, _(" FAIL\n")); - _cupsLangPuts(stdout, NULL, + _cupsLangPuts(stdout, _(" **FAIL** REQUIRED ShortNickName\n" " REF: Page 64-65, section 5.3.\n")); } @@ -778,9 +797,9 @@ main(int argc, /* I - Number of command-line arguments */ if (verbose >= 0) { if (!errors && !verbose) - _cupsLangPuts(stdout, NULL, _(" FAIL\n")); + _cupsLangPuts(stdout, _(" FAIL\n")); - _cupsLangPuts(stdout, NULL, + _cupsLangPuts(stdout, _(" **FAIL** BAD JobPatchFile attribute in file\n" " REF: Page 24, section 3.4.\n")); } @@ -798,9 +817,9 @@ main(int argc, /* I - Number of command-line arguments */ if (verbose >= 0) { if (!errors && !verbose) - _cupsLangPuts(stdout, NULL, _(" FAIL\n")); + _cupsLangPuts(stdout, _(" FAIL\n")); - _cupsLangPuts(stdout, NULL, + _cupsLangPuts(stdout, _(" **FAIL** REQUIRED PageSize\n" " REF: Page 41, section 5.\n" " REF: Page 99, section 5.14.\n")); @@ -829,9 +848,9 @@ main(int argc, /* I - Number of command-line arguments */ if (verbose >= 0) { if (!errors && !verbose) - _cupsLangPuts(stdout, NULL, _(" FAIL\n")); + _cupsLangPuts(stdout, _(" FAIL\n")); - _cupsLangPrintf(stdout, NULL, + _cupsLangPrintf(stdout, _(" **FAIL** REQUIRED ImageableArea for " "PageSize %s\n" " REF: Page 41, section 5.\n" @@ -851,9 +870,9 @@ main(int argc, /* I - Number of command-line arguments */ if (verbose >= 0) { if (!errors && !verbose) - _cupsLangPuts(stdout, NULL, _(" FAIL\n")); + _cupsLangPuts(stdout, _(" FAIL\n")); - _cupsLangPrintf(stdout, NULL, + _cupsLangPrintf(stdout, _(" **FAIL** REQUIRED PaperDimension " "for PageSize %s\n" " REF: Page 41, section 5.\n" @@ -899,9 +918,9 @@ main(int argc, /* I - Number of command-line arguments */ if (verbose >= 0) { if (!errors && !verbose) - _cupsLangPuts(stdout, NULL, _(" FAIL\n")); + _cupsLangPuts(stdout, _(" FAIL\n")); - _cupsLangPrintf(stdout, NULL, + _cupsLangPrintf(stdout, _(" **FAIL** Bad %s choice %s!\n" " REF: Page 84, section 5.9\n"), option->keyword, choice->choice); @@ -928,9 +947,9 @@ main(int argc, /* I - Number of command-line arguments */ if (verbose >= 0) { if (!errors && !verbose) - _cupsLangPuts(stdout, NULL, _(" FAIL\n")); + _cupsLangPuts(stdout, _(" FAIL\n")); - _cupsLangPrintf(stdout, NULL, + _cupsLangPrintf(stdout, _(" **FAIL** REQUIRED %s does not define " "choice None!\n" " REF: Page 122, section 5.17\n"), @@ -949,9 +968,9 @@ main(int argc, /* I - Number of command-line arguments */ if (verbose >= 0) { if (!errors && !verbose) - _cupsLangPuts(stdout, NULL, _(" FAIL\n")); + _cupsLangPuts(stdout, _(" FAIL\n")); - _cupsLangPrintf(stdout, NULL, + _cupsLangPrintf(stdout, _(" **FAIL** Bad %s choice %s!\n" " REF: Page 122, section 5.17\n"), option->keyword, choice->choice); @@ -964,15 +983,17 @@ main(int argc, /* I - Number of command-line arguments */ if (errors) status = ERROR_CONFORMANCE; else if (!verbose) - _cupsLangPuts(stdout, NULL, _(" PASS\n")); + _cupsLangPuts(stdout, _(" PASS\n")); if (verbose >= 0) { + check_basics(argv[i]); + if (option && strcmp(option->keyword, "Duplex") && strcmp(option->keyword, "JCLDuplex")) { - _cupsLangPrintf(stdout, NULL, + _cupsLangPrintf(stdout, _(" WARN Duplex option keyword %s " "should be named Duplex or JCLDuplex!\n" " REF: Page 122, section 5.17\n"), @@ -982,7 +1003,7 @@ main(int argc, /* I - Number of command-line arguments */ ppdMarkDefaults(ppd); if (ppdConflicts(ppd)) { - _cupsLangPuts(stdout, NULL, + _cupsLangPuts(stdout, _(" WARN Default choices conflicting!\n")); show_conflicts(ppd); @@ -990,7 +1011,7 @@ main(int argc, /* I - Number of command-line arguments */ if (ppdversion < 43) { - _cupsLangPrintf(stdout, NULL, + _cupsLangPrintf(stdout, _(" WARN Obsolete PPD version %.1f!\n" " REF: Page 42, section 5.2.\n"), 0.1f * ppdversion); @@ -998,7 +1019,7 @@ main(int argc, /* I - Number of command-line arguments */ if (!ppd->lang_encoding && ppdversion < 41) { - _cupsLangPuts(stdout, NULL, + _cupsLangPuts(stdout, _(" WARN LanguageEncoding required by PPD " "4.3 spec.\n" " REF: Pages 56-57, section 5.3.\n")); @@ -1006,7 +1027,7 @@ main(int argc, /* I - Number of command-line arguments */ if (!ppd->manufacturer && ppdversion < 43) { - _cupsLangPuts(stdout, NULL, + _cupsLangPuts(stdout, _(" WARN Manufacturer required by PPD " "4.3 spec.\n" " REF: Pages 58-59, section 5.3.\n")); @@ -1019,7 +1040,7 @@ main(int argc, /* I - Number of command-line arguments */ if (ppd->pcfilename && strlen(ppd->pcfilename) > 12) { - _cupsLangPuts(stdout, NULL, + _cupsLangPuts(stdout, _(" WARN PCFileName longer than 8.3 in " "violation of PPD spec.\n" " REF: Pages 61-62, section 5.3.\n")); @@ -1027,7 +1048,7 @@ main(int argc, /* I - Number of command-line arguments */ if (!ppd->shortnickname && ppdversion < 43) { - _cupsLangPuts(stdout, NULL, + _cupsLangPuts(stdout, _(" WARN ShortNickName required by PPD " "4.3 spec.\n" " REF: Pages 64-65, section 5.3.\n")); @@ -1044,7 +1065,7 @@ main(int argc, /* I - Number of command-line arguments */ strstr(ppd->protocols, "BCP") && !strstr(ppd->protocols, "TBCP")) { - _cupsLangPuts(stdout, NULL, + _cupsLangPuts(stdout, _(" WARN Protocols contains both PJL " "and BCP; expected TBCP.\n" " REF: Pages 78-79, section 5.7.\n")); @@ -1053,7 +1074,7 @@ main(int argc, /* I - Number of command-line arguments */ if (strstr(ppd->protocols, "PJL") && (!ppd->jcl_begin || !ppd->jcl_end || !ppd->jcl_ps)) { - _cupsLangPuts(stdout, NULL, + _cupsLangPuts(stdout, _(" WARN Protocols contains PJL but JCL " "attributes are not set.\n" " REF: Pages 78-79, section 5.7.\n")); @@ -1081,7 +1102,7 @@ main(int argc, /* I - Number of command-line arguments */ len < strlen(option2->keyword) && !strncmp(option->keyword, option2->keyword, len)) { - _cupsLangPrintf(stdout, NULL, + _cupsLangPrintf(stdout, _(" WARN %s shares a common " "prefix with %s\n" " REF: Page 15, section " @@ -1094,20 +1115,19 @@ main(int argc, /* I - Number of command-line arguments */ if (verbose > 0) { if (errors) - _cupsLangPrintf(stdout, NULL, _(" %d ERROR%s FOUND\n"), + _cupsLangPrintf(stdout, _(" %d ERROR%s FOUND\n"), errors, errors == 1 ? "" : "S"); else - _cupsLangPuts(stdout, NULL, _(" NO ERRORS FOUND\n")); + _cupsLangPuts(stdout, _(" NO ERRORS FOUND\n")); } - /* * Then list the options, if "-v" was provided... */ if (verbose > 1) { - _cupsLangPrintf(stdout, NULL, + _cupsLangPrintf(stdout, "\n" " language_level = %d\n" " color_device = %s\n" @@ -1121,53 +1141,53 @@ main(int argc, /* I - Number of command-line arguments */ switch (ppd->colorspace) { case PPD_CS_CMYK : - _cupsLangPuts(stdout, NULL, " colorspace = PPD_CS_CMYK\n"); + _cupsLangPuts(stdout, " colorspace = PPD_CS_CMYK\n"); break; case PPD_CS_CMY : - _cupsLangPuts(stdout, NULL, " colorspace = PPD_CS_CMY\n"); + _cupsLangPuts(stdout, " colorspace = PPD_CS_CMY\n"); break; case PPD_CS_GRAY : - _cupsLangPuts(stdout, NULL, " colorspace = PPD_CS_GRAY\n"); + _cupsLangPuts(stdout, " colorspace = PPD_CS_GRAY\n"); break; case PPD_CS_RGB : - _cupsLangPuts(stdout, NULL, " colorspace = PPD_CS_RGB\n"); + _cupsLangPuts(stdout, " colorspace = PPD_CS_RGB\n"); break; default : - _cupsLangPuts(stdout, NULL, " colorspace = <unknown>\n"); + _cupsLangPuts(stdout, " colorspace = <unknown>\n"); break; } - _cupsLangPrintf(stdout, NULL, " num_emulations = %d\n", + _cupsLangPrintf(stdout, " num_emulations = %d\n", ppd->num_emulations); for (j = 0; j < ppd->num_emulations; j ++) - _cupsLangPrintf(stdout, NULL, " emulations[%d] = %s\n", + _cupsLangPrintf(stdout, " emulations[%d] = %s\n", j, ppd->emulations[j].name); - _cupsLangPrintf(stdout, NULL, " lang_encoding = %s\n", + _cupsLangPrintf(stdout, " lang_encoding = %s\n", ppd->lang_encoding); - _cupsLangPrintf(stdout, NULL, " lang_version = %s\n", + _cupsLangPrintf(stdout, " lang_version = %s\n", ppd->lang_version); - _cupsLangPrintf(stdout, NULL, " modelname = %s\n", ppd->modelname); - _cupsLangPrintf(stdout, NULL, " ttrasterizer = %s\n", + _cupsLangPrintf(stdout, " modelname = %s\n", ppd->modelname); + _cupsLangPrintf(stdout, " ttrasterizer = %s\n", ppd->ttrasterizer == NULL ? "None" : ppd->ttrasterizer); - _cupsLangPrintf(stdout, NULL, " manufacturer = %s\n", + _cupsLangPrintf(stdout, " manufacturer = %s\n", ppd->manufacturer); - _cupsLangPrintf(stdout, NULL, " product = %s\n", ppd->product); - _cupsLangPrintf(stdout, NULL, " nickname = %s\n", ppd->nickname); - _cupsLangPrintf(stdout, NULL, " shortnickname = %s\n", + _cupsLangPrintf(stdout, " product = %s\n", ppd->product); + _cupsLangPrintf(stdout, " nickname = %s\n", ppd->nickname); + _cupsLangPrintf(stdout, " shortnickname = %s\n", ppd->shortnickname); - _cupsLangPrintf(stdout, NULL, " patches = %d bytes\n", + _cupsLangPrintf(stdout, " patches = %d bytes\n", ppd->patches == NULL ? 0 : (int)strlen(ppd->patches)); - _cupsLangPrintf(stdout, NULL, " num_groups = %d\n", ppd->num_groups); + _cupsLangPrintf(stdout, " num_groups = %d\n", ppd->num_groups); for (j = 0, group = ppd->groups; j < ppd->num_groups; j ++, group ++) { - _cupsLangPrintf(stdout, NULL, " group[%d] = %s\n", + _cupsLangPrintf(stdout, " group[%d] = %s\n", j, group->text); for (k = 0, option = group->options; k < group->num_options; k ++, option ++) { - _cupsLangPrintf(stdout, NULL, + _cupsLangPrintf(stdout, " options[%d] = %s (%s) %s %s %.0f " "(%d choices)\n", k, option->keyword, option->text, uis[option->ui], @@ -1184,11 +1204,11 @@ main(int argc, /* I - Number of command-line arguments */ size = ppdPageSize(ppd, choice->choice); if (size == NULL) - _cupsLangPrintf(stdout, NULL, + _cupsLangPrintf(stdout, " %s (%s) = ERROR", choice->choice, choice->text); else - _cupsLangPrintf(stdout, NULL, + _cupsLangPrintf(stdout, " %s (%s) = %.2fx%.2fin " "(%.1f,%.1f,%.1f,%.1f)", choice->choice, choice->text, @@ -1197,9 +1217,9 @@ main(int argc, /* I - Number of command-line arguments */ size->right / 72.0, size->top / 72.0); if (!strcmp(option->defchoice, choice->choice)) - _cupsLangPuts(stdout, NULL, " *\n"); + _cupsLangPuts(stdout, " *\n"); else - _cupsLangPuts(stdout, NULL, "\n"); + _cupsLangPuts(stdout, "\n"); } } else @@ -1208,22 +1228,22 @@ main(int argc, /* I - Number of command-line arguments */ m > 0; m --, choice ++) { - _cupsLangPrintf(stdout, NULL, " %s (%s)", + _cupsLangPrintf(stdout, " %s (%s)", choice->choice, choice->text); if (!strcmp(option->defchoice, choice->choice)) - _cupsLangPuts(stdout, NULL, " *\n"); + _cupsLangPuts(stdout, " *\n"); else - _cupsLangPuts(stdout, NULL, "\n"); + _cupsLangPuts(stdout, "\n"); } } } } - _cupsLangPrintf(stdout, NULL, " num_profiles = %d\n", + _cupsLangPrintf(stdout, " num_profiles = %d\n", ppd->num_profiles); for (j = 0; j < ppd->num_profiles; j ++) - _cupsLangPrintf(stdout, NULL, + _cupsLangPrintf(stdout, " profiles[%d] = %s/%s %.3f %.3f " "[ %.3f %.3f %.3f %.3f %.3f %.3f %.3f %.3f %.3f ]\n", j, ppd->profiles[j].resolution, @@ -1239,14 +1259,14 @@ main(int argc, /* I - Number of command-line arguments */ ppd->profiles[j].matrix[2][1], ppd->profiles[j].matrix[2][2]); - _cupsLangPrintf(stdout, NULL, " num_fonts = %d\n", ppd->num_fonts); + _cupsLangPrintf(stdout, " num_fonts = %d\n", ppd->num_fonts); for (j = 0; j < ppd->num_fonts; j ++) - _cupsLangPrintf(stdout, NULL, " fonts[%d] = %s\n", + _cupsLangPrintf(stdout, " fonts[%d] = %s\n", j, ppd->fonts[j]); - _cupsLangPrintf(stdout, NULL, " num_attrs = %d\n", ppd->num_attrs); + _cupsLangPrintf(stdout, " num_attrs = %d\n", ppd->num_attrs); for (j = 0; j < ppd->num_attrs; j ++) - _cupsLangPrintf(stdout, NULL, + _cupsLangPrintf(stdout, " attrs[%d] = %s %s%s%s: \"%s\"\n", j, ppd->attrs[j]->name, ppd->attrs[j]->spec, ppd->attrs[j]->text[0] ? "/" : "", @@ -1266,6 +1286,91 @@ main(int argc, /* I - Number of command-line arguments */ /* + * 'check_basics()' - Check for CR LF, mixed line endings, and blank lines. + */ + +void +check_basics(const char *filename) /* I - PPD file to check */ +{ + cups_file_t *fp; /* File pointer */ + int ch; /* Current character */ + int col, /* Current column */ + whitespace; /* Only seen whitespace? */ + int eol; /* Line endings */ + int linenum; /* Line number */ + int mixed; /* Mixed line endings? */ + + + if ((fp = cupsFileOpen(filename, "r")) == NULL) + return; + + linenum = 1; + col = 0; + eol = EOL_NONE; + mixed = 0; + whitespace = 1; + + while ((ch = cupsFileGetChar(fp)) != EOF) + { + if (ch == '\r' || ch == '\n') + { + if (ch == '\n') + { + if (eol == EOL_NONE) + eol = EOL_LF; + else if (eol != EOL_LF) + mixed = 1; + } + else if (ch == '\r') + { + if (cupsFilePeekChar(fp) == '\n') + { + cupsFileGetChar(fp); + + if (eol == EOL_NONE) + eol = EOL_CRLF; + else + mixed = 1; + } + else if (eol == EOL_NONE) + eol = EOL_CR; + else + mixed = 1; + } + + if (col > 0 && whitespace) + _cupsLangPrintf(stdout, + _(" WARN Line %d only contains whitespace!\n"), + linenum); + + linenum ++; + col = 0; + whitespace = 1; + } + else + { + if (ch != ' ' && ch != '\t') + whitespace = 0; + + col ++; + } + } + + if (mixed) + _cupsLangPuts(stdout, + _(" WARN File contains a mix of CR, LF, and " + "CR LF line endings!\n")); + + if (eol == EOL_CRLF) + _cupsLangPuts(stdout, + _(" WARN Non-Windows PPD files should use lines " + "ending with only LF, not CR LF!\n")); + + cupsFileClose(fp); +} + + +/* * 'show_conflicts()' - Show option conflicts in a PPD file. */ @@ -1356,7 +1461,7 @@ show_conflicts(ppd_file_t *ppd) /* I - PPD to check */ */ if (c1 != NULL && c1->marked && c2 != NULL && c2->marked) - _cupsLangPrintf(stdout, NULL, + _cupsLangPrintf(stdout, _(" WARN \"%s %s\" conflicts with \"%s %s\"\n" " (constraint=\"%s %s %s %s\")\n"), o1->keyword, c1->choice, o2->keyword, c2->choice, @@ -1372,7 +1477,7 @@ show_conflicts(ppd_file_t *ppd) /* I - PPD to check */ void usage(void) { - _cupsLangPuts(stdout, NULL, + _cupsLangPuts(stdout, _("Usage: cupstestppd [-q] [-r] [-v[v]] filename1.ppd[.gz] " "[... filenameN.ppd[.gz]]\n" " program | cupstestppd [-q] [-r] [-v[v]] -\n")); @@ -1382,5 +1487,5 @@ usage(void) /* - * End of "$Id: cupstestppd.c 4906 2006-01-10 20:53:28Z mike $". + * End of "$Id: cupstestppd.c 4990 2006-01-26 02:21:45Z mike $". */ diff --git a/systemv/lp.c b/systemv/lp.c index 13acd1676..6946280ae 100644 --- a/systemv/lp.c +++ b/systemv/lp.c @@ -1,5 +1,5 @@ /* - * "$Id: lp.c 4906 2006-01-10 20:53:28Z mike $" + * "$Id: lp.c 4974 2006-01-25 07:04:33Z mike $" * * "lp" command for the Common UNIX Printing System (CUPS). * @@ -52,8 +52,9 @@ void sighandler(int); #endif /* !WIN32 */ -int restart_job(int job_id); -int set_job_attrs(int job_id, int num_options, cups_option_t *options); +int restart_job(const char *command, int job_id); +int set_job_attrs(const char *command, int job_id, int num_options, + cups_option_t *options); /* @@ -86,8 +87,11 @@ main(int argc, /* I - Number of command-line arguments */ *dest; /* Selected destination */ int num_options; /* Number of options */ cups_option_t *options; /* Options */ + int end_options; /* No more options? */ int silent; /* Silent or verbose output? */ char buffer[8192]; /* Copy buffer */ + ssize_t bytes; /* Bytes copied */ + off_t filesize; /* Size of temp file */ int temp; /* Temporary file descriptor */ #if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET) struct sigaction action; /* Signal action */ @@ -122,21 +126,41 @@ main(int argc, /* I - Number of command-line arguments */ num_files = 0; title = NULL; job_id = 0; + end_options = 0; for (i = 1; i < argc; i ++) - if (argv[i][0] == '-' && argv[i][1]) + if (argv[i][0] == '-' && argv[i][1] && !end_options) switch (argv[i][1]) { case 'E' : /* Encrypt */ #ifdef HAVE_SSL cupsSetEncryption(HTTP_ENCRYPT_REQUIRED); #else - _cupsLangPrintf(stderr, NULL, + _cupsLangPrintf(stderr, _("%s: Sorry, no encryption support compiled in!\n"), argv[0]); #endif /* HAVE_SSL */ break; + case 'U' : /* Username */ + if (argv[i][2] != '\0') + cupsSetUser(argv[i] + 2); + else + { + i ++; + if (i >= argc) + { + _cupsLangPrintf(stderr, + _("%s: Error - expected username after " + "\'-U\' option!\n"), + argv[0]); + return (1); + } + + cupsSetUser(argv[i]); + } + break; + case 'c' : /* Copy to spool dir (always enabled) */ break; @@ -149,8 +173,10 @@ main(int argc, /* I - Number of command-line arguments */ if (i >= argc) { - _cupsLangPuts(stderr, NULL, - _("lp: Expected destination after -d option!\n")); + _cupsLangPrintf(stderr, + _("%s: Error - expected destination after " + "\'-d\' option!\n"), + argv[0]); return (1); } @@ -180,13 +206,16 @@ main(int argc, /* I - Number of command-line arguments */ if (i >= argc) { - _cupsLangPuts(stderr, NULL, - _("lp: Expected form after -f option!\n")); + _cupsLangPrintf(stderr, + _("%s: Error - expected form after \'-f\' " + "option!\n"), + argv[0]); return (1); } } - fputs("lp: Warning - form option ignored!\n", stderr); + _cupsLangPrintf(stderr, _("%s: Warning - form option ignored!\n"), + argv[0]); break; case 'h' : /* Destination host */ @@ -198,8 +227,10 @@ main(int argc, /* I - Number of command-line arguments */ if (i >= argc) { - _cupsLangPuts(stderr, NULL, - _("lp: Expected hostname after -h option!\n")); + _cupsLangPrintf(stderr, + _("%s: Error - expected hostname after " + "\'-h\' option!\n"), + argv[0]); return (1); } @@ -216,8 +247,9 @@ main(int argc, /* I - Number of command-line arguments */ if (i >= argc) { - _cupsLangPuts(stderr, NULL, - _("lp: Expected job ID after -i option!\n")); + _cupsLangPrintf(stderr, + _("%s: Expected job ID after \'-i\' option!\n"), + argv[0]); return (1); } @@ -226,9 +258,10 @@ main(int argc, /* I - Number of command-line arguments */ if (num_files > 0) { - _cupsLangPuts(stderr, NULL, - _("lp: Error - cannot print files and alter " - "jobs simultaneously!\n")); + _cupsLangPrintf(stderr, + _("%s: Error - cannot print files and alter " + "jobs simultaneously!\n"), + argv[0]); return (1); } @@ -239,7 +272,7 @@ main(int argc, /* I - Number of command-line arguments */ if (job_id < 0) { - _cupsLangPuts(stderr, NULL, _("lp: Error - bad job ID!\n")); + _cupsLangPrintf(stderr, _("%s: Error - bad job ID!\n"), argv[0]); break; } break; @@ -249,6 +282,17 @@ main(int argc, /* I - Number of command-line arguments */ case 'p' : /* Notify on completion */ #endif /* __sun */ case 'w' : /* Write to console or email */ + { + char email[1024]; /* EMail address */ + + + snprintf(email, sizeof(email), "mailto:%s@%s", cupsUser(), + httpGetHostname(buffer, sizeof(buffer))); + num_options = cupsAddOption("notify-recipient", email, + num_options, &options); + } + + silent = 1; break; case 'n' : /* Number of copies */ @@ -260,8 +304,10 @@ main(int argc, /* I - Number of command-line arguments */ if (i >= argc) { - _cupsLangPuts(stderr, NULL, - _("lp: Expected copies after -n option!\n")); + _cupsLangPrintf(stderr, + _("%s: Error - expected copies after " + "\'-n\' option!\n"), + argv[0]); return (1); } @@ -281,8 +327,10 @@ main(int argc, /* I - Number of command-line arguments */ if (i >= argc) { - _cupsLangPuts(stderr, NULL, - _("lp: Expected option string after -o option!\n")); + _cupsLangPrintf(stderr, + _("%s: Error - expected option string after " + "\'-o\' option!\n"), + argv[0]); return (1); } @@ -300,9 +348,10 @@ main(int argc, /* I - Number of command-line arguments */ { if ((i + 1) >= argc) { - _cupsLangPrintf(stderr, NULL, - _("lp: Expected priority after -%c option!\n"), - argv[i][1]); + _cupsLangPrintf(stderr, + _("%s: Error - expected priority after " + "\'-%c\' option!\n"), + argv[0], argv[i][1]); return (1); } @@ -322,8 +371,10 @@ main(int argc, /* I - Number of command-line arguments */ if (priority < 1 || priority > 100) { - _cupsLangPuts(stderr, NULL, - _("lp: Priority must be between 1 and 100.\n")); + _cupsLangPrintf(stderr, + _("%s: Error - priority must be between 1 and " + "100.\n"), + argv[0]); return (1); } @@ -344,8 +395,10 @@ main(int argc, /* I - Number of command-line arguments */ if (i >= argc) { - _cupsLangPuts(stderr, NULL, - _("lp: Expected title after -t option!\n")); + _cupsLangPrintf(stderr, + _("%s: Error - expected title after " + "\'-t\' option!\n"), + argv[0]); return (1); } @@ -360,14 +413,17 @@ main(int argc, /* I - Number of command-line arguments */ if (i >= argc) { - _cupsLangPuts(stderr, NULL, - _("lp: Expected mode list after -y option!\n")); + _cupsLangPrintf(stderr, + _("%s: Error - expected mode list after " + "\'-y\' option!\n"), + argv[0]); return (1); } } - _cupsLangPuts(stderr, NULL, - _("lp: Warning - mode option ignored!\n")); + _cupsLangPrintf(stderr, + _("%s: Warning - mode option ignored!\n"), + argv[0]); break; case 'H' : /* Hold job */ @@ -379,8 +435,10 @@ main(int argc, /* I - Number of command-line arguments */ if (i >= argc) { - _cupsLangPuts(stderr, NULL, - _("lp: Expected hold name after -H option!\n")); + _cupsLangPrintf(stderr, + _("%s: Error - expected hold name after " + "\'-H\' option!\n"), + argv[0]); return (1); } @@ -401,12 +459,14 @@ main(int argc, /* I - Number of command-line arguments */ { if (job_id < 1) { - _cupsLangPuts(stderr, NULL, - _("lp: Need job ID (-i) before \"-H restart\"!\n")); + _cupsLangPrintf(stderr, + _("%s: Need job ID (\'-i jobid\') before " + "\'-H restart\'!\n"), + argv[0]); return (1); } - if (restart_job(job_id)) + if (restart_job(argv[0], job_id)) return (1); } else @@ -423,8 +483,10 @@ main(int argc, /* I - Number of command-line arguments */ if (i >= argc) { - _cupsLangPuts(stderr, NULL, - _("lp: Expected page list after -P option!\n")); + _cupsLangPrintf(stderr, + _("%s: Error - expected page list after " + "\'-P\' option!\n"), + argv[0]); return (1); } @@ -442,14 +504,17 @@ main(int argc, /* I - Number of command-line arguments */ if (i >= argc) { - _cupsLangPuts(stderr, NULL, - _("lp: Expected character set after -S option!\n")); + _cupsLangPrintf(stderr, + _("%s: Error - expected character set after " + "\'-S\' option!\n"), + argv[0]); return (1); } } - _cupsLangPuts(stderr, NULL, - _("lp: Warning - character set option ignored!\n")); + _cupsLangPrintf(stderr, + _("%s: Warning - character set option ignored!\n"), + argv[0]); break; case 'T' : /* Content-Type */ @@ -459,28 +524,36 @@ main(int argc, /* I - Number of command-line arguments */ if (i >= argc) { - _cupsLangPuts(stderr, NULL, - _("lp: Expected content type after -T option!\n")); + _cupsLangPrintf(stderr, + _("%s: Error - expected content type after " + "\'-T\' option!\n"), + argv[0]); return (1); } } - _cupsLangPuts(stderr, NULL, - _("lp: Warning - content type option ignored!\n")); + _cupsLangPrintf(stderr, + _("%s: Warning - content type option ignored!\n"), + argv[0]); + break; + + case '-' : /* Stop processing options */ + end_options = 1; break; default : - _cupsLangPrintf(stderr, NULL, _("lp: Unknown option \'%c\'!\n"), - argv[i][1]); + _cupsLangPrintf(stderr, _("%s: Error - unknown option \'%c\'!\n"), + argv[0], argv[i][1]); return (1); } else if (!strcmp(argv[i], "-")) { if (num_files || job_id) { - _cupsLangPuts(stderr, NULL, - _("lp: Error - cannot print from stdin if files or a " - "job ID are provided!\n")); + _cupsLangPrintf(stderr, + _("%s: Error - cannot print from stdin if files or a " + "job ID are provided!\n"), + argv[0]); return (1); } @@ -494,8 +567,8 @@ main(int argc, /* I - Number of command-line arguments */ if (access(argv[i], R_OK) != 0) { - _cupsLangPrintf(stderr, NULL, _("lp: Unable to access \"%s\" - %s\n"), - argv[i], strerror(errno)); + _cupsLangPrintf(stderr, _("%s: Error - unable to access \"%s\" - %s\n"), + argv[0], argv[i], strerror(errno)); return (1); } @@ -511,15 +584,15 @@ main(int argc, /* I - Number of command-line arguments */ } } else - _cupsLangPrintf(stderr, NULL, _("lp: Too many files - \"%s\"\n"), - argv[i]); + _cupsLangPrintf(stderr, _("%s: Error - too many files - \"%s\"\n"), + argv[0], argv[i]); /* * See if we are altering an existing job... */ if (job_id) - return (set_job_attrs(job_id, num_options, options)); + return (set_job_attrs(argv[0], job_id, num_options, options)); /* * See if we have any files to print; if not, print from stdin... @@ -560,16 +633,18 @@ main(int argc, /* I - Number of command-line arguments */ val = "LPDEST"; if (printer && !cupsGetDest(printer, NULL, num_dests, dests)) - _cupsLangPrintf(stderr, NULL, - _("lp: error - %s environment variable names " + _cupsLangPrintf(stderr, + _("%s: Error - %s environment variable names " "non-existent destination \"%s\"!\n"), - val, printer); + argv[0], val, printer); else if (cupsLastError() == IPP_NOT_FOUND) - _cupsLangPuts(stderr, NULL, - _("lp: error - no default destination available.\n")); + _cupsLangPrintf(stderr, + _("%s: Error - no default destination available.\n"), + argv[0]); else - _cupsLangPuts(stderr, NULL, - _("lp: error - scheduler not responding!\n")); + _cupsLangPrintf(stderr, + _("%s: Error - scheduler not responding!\n"), + argv[0]); return (1); } @@ -607,31 +682,32 @@ main(int argc, /* I - Number of command-line arguments */ if (temp < 0) { - _cupsLangPrintf(stderr, NULL, - _("lp: unable to create temporary file \"%s\" - %s\n"), - tempfile, strerror(errno)); + _cupsLangPrintf(stderr, + _("%s: Error - unable to create temporary file \"%s\" - %s\n"), + argv[0], tempfile, strerror(errno)); return (1); } - while ((i = read(0, buffer, sizeof(buffer))) > 0) - if (write(temp, buffer, i) < 0) + while ((bytes = read(0, buffer, sizeof(buffer))) > 0) + if (write(temp, buffer, bytes) < 0) { - _cupsLangPrintf(stderr, NULL, - _("lp: error - unable to write to temporary file " + _cupsLangPrintf(stderr, + _("%s: Error - unable to write to temporary file " "\"%s\" - %s\n"), - tempfile, strerror(errno)); + argv[0], tempfile, strerror(errno)); close(temp); unlink(tempfile); return (1); } - i = lseek(temp, 0, SEEK_CUR); + filesize = lseek(temp, 0, SEEK_CUR); close(temp); - if (i == 0) + if (filesize <= 0) { - _cupsLangPuts(stderr, NULL, - _("lp: stdin is empty, so no job has been sent.\n")); + _cupsLangPrintf(stderr, + _("%s: Error - stdin is empty, so no job has been sent.\n"), + argv[0]); unlink(tempfile); return (1); } @@ -646,14 +722,11 @@ main(int argc, /* I - Number of command-line arguments */ if (job_id < 1) { - _cupsLangPrintf(stderr, NULL, - _("lp: unable to print file: %s\n"), - ippErrorString(cupsLastError())); + _cupsLangPrintf(stderr, "%s: %s\n", argv[0], cupsLastErrorString()); return (1); } else if (!silent) - _cupsLangPrintf(stdout, NULL, - _("request id is %s-%d (%d file(s))\n"), + _cupsLangPrintf(stdout, _("request id is %s-%d (%d file(s))\n"), printer, job_id, num_files); return (0); @@ -665,28 +738,17 @@ main(int argc, /* I - Number of command-line arguments */ */ int /* O - Exit status */ -restart_job(int job_id) /* I - Job ID */ +restart_job(const char *command, /* I - Command name */ + int job_id) /* I - Job ID */ { http_t *http; /* HTTP connection to server */ - ipp_t *request, /* IPP request */ - *response; /* IPP response */ - cups_lang_t *language; /* Language for request */ + ipp_t *request; /* IPP request */ char uri[HTTP_MAX_URI]; /* URI for job */ http = httpConnectEncrypt(cupsServer(), ippPort(), cupsEncryption()); - language = cupsLangDefault(); - - request = ippNew(); - request->request.op.operation_id = IPP_RESTART_JOB; - request->request.op.request_id = 1; - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET, - "attributes-charset", NULL, cupsLangEncoding(language)); - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE, - "attributes-natural-language", NULL, language->language); + request = ippNewRequest(IPP_RESTART_JOB); sprintf(uri, "ipp://localhost/jobs/%d", job_id); @@ -696,22 +758,11 @@ restart_job(int job_id) /* I - Job ID */ ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "requesting-user-name", NULL, cupsUser()); - if ((response = cupsDoRequest(http, request, "/jobs")) != NULL) - { - if (response->request.status.status_code > IPP_OK_CONFLICT) - { - _cupsLangPrintf(stderr, NULL, _("lp: restart-job failed: %s\n"), - ippErrorString(response->request.status.status_code)); - ippDelete(response); - return (1); - } + ippDelete(cupsDoRequest(http, request, "/jobs")); - ippDelete(response); - } - else + if (cupsLastError() > IPP_OK_CONFLICT) { - _cupsLangPrintf(stderr, NULL, _("lp: restart-job failed: %s\n"), - ippErrorString(cupsLastError())); + _cupsLangPrintf(stderr, "%s: %s\n", command, cupsLastErrorString()); return (1); } @@ -724,14 +775,13 @@ restart_job(int job_id) /* I - Job ID */ */ int /* O - Exit status */ -set_job_attrs(int job_id, /* I - Job ID */ +set_job_attrs(const char *command, /* I - Command name */ + int job_id, /* I - Job ID */ int num_options,/* I - Number of options */ cups_option_t *options) /* I - Options */ { http_t *http; /* HTTP connection to server */ - ipp_t *request, /* IPP request */ - *response; /* IPP response */ - cups_lang_t *language; /* Language for request */ + ipp_t *request; /* IPP request */ char uri[HTTP_MAX_URI]; /* URI for job */ @@ -740,17 +790,7 @@ set_job_attrs(int job_id, /* I - Job ID */ http = httpConnectEncrypt(cupsServer(), ippPort(), cupsEncryption()); - language = cupsLangDefault(); - - request = ippNew(); - request->request.op.operation_id = IPP_SET_JOB_ATTRIBUTES; - request->request.op.request_id = 1; - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET, - "attributes-charset", NULL, cupsLangEncoding(language)); - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE, - "attributes-natural-language", NULL, language->language); + request = ippNewRequest(IPP_SET_JOB_ATTRIBUTES); sprintf(uri, "ipp://localhost/jobs/%d", job_id); @@ -762,22 +802,11 @@ set_job_attrs(int job_id, /* I - Job ID */ cupsEncodeOptions(request, num_options, options); - if ((response = cupsDoRequest(http, request, "/jobs")) != NULL) - { - if (response->request.status.status_code > IPP_OK_CONFLICT) - { - _cupsLangPrintf(stderr, NULL, _("lp: set-job-attributes failed: %s\n"), - ippErrorString(response->request.status.status_code)); - ippDelete(response); - return (1); - } + ippDelete(cupsDoRequest(http, request, "/jobs")); - ippDelete(response); - } - else + if (cupsLastError() > IPP_OK_CONFLICT) { - _cupsLangPrintf(stderr, NULL, _("lp: set-job-attributes failed: %s\n"), - ippErrorString(cupsLastError())); + _cupsLangPrintf(stderr, "%s: %s\n", command, cupsLastErrorString()); return (1); } @@ -791,7 +820,7 @@ set_job_attrs(int job_id, /* I - Job ID */ */ void -sighandler(int s) /* I - Signal number */ +sighandler(int s) /* I - Signal number */ { /* * Remove the temporary file we're using to print from stdin... @@ -809,5 +838,5 @@ sighandler(int s) /* I - Signal number */ /* - * End of "$Id: lp.c 4906 2006-01-10 20:53:28Z mike $". + * End of "$Id: lp.c 4974 2006-01-25 07:04:33Z mike $". */ diff --git a/systemv/lpadmin.c b/systemv/lpadmin.c index 4f12b43e4..02b441f43 100644 --- a/systemv/lpadmin.c +++ b/systemv/lpadmin.c @@ -1,5 +1,5 @@ /* - * "$Id: lpadmin.c 4906 2006-01-10 20:53:28Z mike $" + * "$Id: lpadmin.c 4925 2006-01-13 02:52:47Z mike $" * * "lpadmin" command for the Common UNIX Printing System (CUPS). * @@ -109,7 +109,7 @@ main(int argc, /* I - Number of command-line arguments */ if (http == NULL) { - _cupsLangPrintf(stderr, NULL, + _cupsLangPrintf(stderr, _("lpadmin: Unable to connect to server: %s\n"), strerror(errno)); return (1); @@ -118,7 +118,7 @@ main(int argc, /* I - Number of command-line arguments */ if (printer == NULL) { - _cupsLangPuts(stderr, NULL, + _cupsLangPuts(stderr, _("lpadmin: Unable to add a printer to the class:\n" " You must specify a printer name " "first!\n")); @@ -133,7 +133,7 @@ main(int argc, /* I - Number of command-line arguments */ if (i >= argc) { - _cupsLangPuts(stderr, NULL, + _cupsLangPuts(stderr, _("lpadmin: Expected class name after \'-c\' " "option!\n")); return (1); @@ -144,7 +144,7 @@ main(int argc, /* I - Number of command-line arguments */ if (!validate_name(pclass)) { - _cupsLangPuts(stderr, NULL, + _cupsLangPuts(stderr, _("lpadmin: Class name can only contain printable " "characters!\n")); return (1); @@ -162,7 +162,7 @@ main(int argc, /* I - Number of command-line arguments */ if (http == NULL) { - _cupsLangPrintf(stderr, NULL, + _cupsLangPrintf(stderr, _("lpadmin: Unable to connect to server: %s\n"), strerror(errno)); return (1); @@ -177,7 +177,7 @@ main(int argc, /* I - Number of command-line arguments */ if (i >= argc) { - _cupsLangPuts(stderr, NULL, + _cupsLangPuts(stderr, _("lpadmin: Expected printer name after \'-d\' " "option!\n")); return (1); @@ -188,7 +188,7 @@ main(int argc, /* I - Number of command-line arguments */ if (!validate_name(printer)) { - _cupsLangPuts(stderr, NULL, + _cupsLangPuts(stderr, _("lpadmin: Printer name can only contain " "printable characters!\n")); return (1); @@ -215,7 +215,7 @@ main(int argc, /* I - Number of command-line arguments */ if (i >= argc) { - _cupsLangPuts(stderr, NULL, + _cupsLangPuts(stderr, _("lpadmin: Expected hostname after \'-h\' " "option!\n")); return (1); @@ -233,7 +233,7 @@ main(int argc, /* I - Number of command-line arguments */ if (http == NULL) { - _cupsLangPrintf(stderr, NULL, + _cupsLangPrintf(stderr, _("lpadmin: Unable to connect to server: %s\n"), strerror(errno)); return (1); @@ -242,7 +242,7 @@ main(int argc, /* I - Number of command-line arguments */ if (printer == NULL) { - _cupsLangPuts(stderr, NULL, + _cupsLangPuts(stderr, _("lpadmin: Unable to set the interface script:\n" " You must specify a printer name " "first!\n")); @@ -260,7 +260,7 @@ main(int argc, /* I - Number of command-line arguments */ if (i >= argc) { - _cupsLangPuts(stderr, NULL, + _cupsLangPuts(stderr, _("lpadmin: Expected interface after \'-i\' " "option!\n")); return (1); @@ -280,7 +280,7 @@ main(int argc, /* I - Number of command-line arguments */ if (http) httpEncryption(http, HTTP_ENCRYPT_REQUIRED); #else - _cupsLangPrintf(stderr, NULL, + _cupsLangPrintf(stderr, _("%s: Sorry, no encryption support compiled in!\n"), argv[0]); #endif /* HAVE_SSL */ @@ -294,7 +294,7 @@ main(int argc, /* I - Number of command-line arguments */ if (http == NULL) { - _cupsLangPrintf(stderr, NULL, + _cupsLangPrintf(stderr, _("lpadmin: Unable to connect to server: %s\n"), strerror(errno)); return (1); @@ -313,7 +313,7 @@ main(int argc, /* I - Number of command-line arguments */ if (http == NULL) { - _cupsLangPrintf(stderr, NULL, + _cupsLangPrintf(stderr, _("lpadmin: Unable to connect to server: %s\n"), strerror(errno)); return (1); @@ -322,7 +322,7 @@ main(int argc, /* I - Number of command-line arguments */ if (printer == NULL) { - _cupsLangPuts(stderr, NULL, + _cupsLangPuts(stderr, _("lpadmin: Unable to set the interface script or " "PPD file:\n" " You must specify a printer name " @@ -341,7 +341,7 @@ main(int argc, /* I - Number of command-line arguments */ if (i >= argc) { - _cupsLangPuts(stderr, NULL, + _cupsLangPuts(stderr, _("lpadmin: Expected model after \'-m\' " "option!\n")); return (1); @@ -361,7 +361,7 @@ main(int argc, /* I - Number of command-line arguments */ if (i >= argc) { - _cupsLangPuts(stderr, NULL, + _cupsLangPuts(stderr, _("lpadmin: Expected name=value after \'-o\' " "option!\n")); return (1); @@ -379,7 +379,7 @@ main(int argc, /* I - Number of command-line arguments */ if (http == NULL) { - _cupsLangPrintf(stderr, NULL, + _cupsLangPrintf(stderr, _("lpadmin: Unable to connect to server: %s\n"), strerror(errno)); return (1); @@ -394,7 +394,7 @@ main(int argc, /* I - Number of command-line arguments */ if (i >= argc) { - _cupsLangPuts(stderr, NULL, + _cupsLangPuts(stderr, _("lpadmin: Expected printer after \'-p\' " "option!\n")); return (1); @@ -405,7 +405,7 @@ main(int argc, /* I - Number of command-line arguments */ if (!validate_name(printer)) { - _cupsLangPuts(stderr, NULL, + _cupsLangPuts(stderr, _("lpadmin: Printer name can only contain " "printable characters!\n")); return (1); @@ -420,7 +420,7 @@ main(int argc, /* I - Number of command-line arguments */ if (http == NULL) { - _cupsLangPrintf(stderr, NULL, + _cupsLangPrintf(stderr, _("lpadmin: Unable to connect to server: %s\n"), strerror(errno)); return (1); @@ -429,7 +429,7 @@ main(int argc, /* I - Number of command-line arguments */ if (printer == NULL) { - _cupsLangPuts(stderr, NULL, + _cupsLangPuts(stderr, _("lpadmin: Unable to remove a printer from the " "class:\n" " You must specify a printer name " @@ -445,7 +445,7 @@ main(int argc, /* I - Number of command-line arguments */ if (i >= argc) { - _cupsLangPuts(stderr, NULL, + _cupsLangPuts(stderr, _("lpadmin: Expected class after \'-r\' " "option!\n")); return (1); @@ -456,7 +456,7 @@ main(int argc, /* I - Number of command-line arguments */ if (!validate_name(pclass)) { - _cupsLangPuts(stderr, NULL, + _cupsLangPuts(stderr, _("lpadmin: Class name can only contain printable " "characters!\n")); return (1); @@ -475,7 +475,7 @@ main(int argc, /* I - Number of command-line arguments */ if (i >= argc) { - _cupsLangPuts(stderr, NULL, + _cupsLangPuts(stderr, _("lpadmin: Expected allow/deny:userlist after " "\'-u\' option!\n")); return (1); @@ -492,7 +492,7 @@ main(int argc, /* I - Number of command-line arguments */ val + 5, num_options, &options); else { - _cupsLangPrintf(stderr, NULL, + _cupsLangPrintf(stderr, _("lpadmin: Unknown allow/deny option \"%s\"!\n"), val); return (1); @@ -507,7 +507,7 @@ main(int argc, /* I - Number of command-line arguments */ if (http == NULL) { - _cupsLangPrintf(stderr, NULL, + _cupsLangPrintf(stderr, _("lpadmin: Unable to connect to server: %s\n"), strerror(errno)); return (1); @@ -516,7 +516,7 @@ main(int argc, /* I - Number of command-line arguments */ if (printer == NULL) { - _cupsLangPuts(stderr, NULL, + _cupsLangPuts(stderr, _("lpadmin: Unable to set the device URI:\n" " You must specify a printer name " "first!\n")); @@ -534,7 +534,7 @@ main(int argc, /* I - Number of command-line arguments */ if (i >= argc) { - _cupsLangPuts(stderr, NULL, + _cupsLangPuts(stderr, _("lpadmin: Expected device URI after \'-v\' " "option!\n")); return (1); @@ -553,7 +553,7 @@ main(int argc, /* I - Number of command-line arguments */ if (http == NULL) { - _cupsLangPrintf(stderr, NULL, + _cupsLangPrintf(stderr, _("lpadmin: Unable to connect to server: %s\n"), strerror(errno)); return (1); @@ -568,7 +568,7 @@ main(int argc, /* I - Number of command-line arguments */ if (i >= argc) { - _cupsLangPuts(stderr, NULL, + _cupsLangPuts(stderr, _("lpadmin: Expected printer or class after " "\'-x\' option!\n")); return (1); @@ -579,7 +579,7 @@ main(int argc, /* I - Number of command-line arguments */ if (!validate_name(printer)) { - _cupsLangPuts(stderr, NULL, + _cupsLangPuts(stderr, _("lpadmin: Printer name can only contain " "printable characters!\n")); return (1); @@ -599,7 +599,7 @@ main(int argc, /* I - Number of command-line arguments */ if (http == NULL) { - _cupsLangPrintf(stderr, NULL, + _cupsLangPrintf(stderr, _("lpadmin: Unable to connect to server: %s\n"), strerror(errno)); return (1); @@ -608,7 +608,7 @@ main(int argc, /* I - Number of command-line arguments */ if (printer == NULL) { - _cupsLangPuts(stderr, NULL, + _cupsLangPuts(stderr, _("lpadmin: Unable to set the printer " "description:\n" " You must specify a printer name " @@ -627,7 +627,7 @@ main(int argc, /* I - Number of command-line arguments */ if (i >= argc) { - _cupsLangPuts(stderr, NULL, + _cupsLangPuts(stderr, _("lpadmin: Expected description after " "\'-D\' option!\n")); return (1); @@ -643,13 +643,13 @@ main(int argc, /* I - Number of command-line arguments */ if (i >= argc) { - _cupsLangPuts(stderr, NULL, + _cupsLangPuts(stderr, _("lpadmin: Expected file type(s) after \'-I\' " "option!\n")); return (1); } - _cupsLangPuts(stderr, NULL, + _cupsLangPuts(stderr, _("lpadmin: Warning - content type list ignored!\n")); break; @@ -661,7 +661,7 @@ main(int argc, /* I - Number of command-line arguments */ if (http == NULL) { - _cupsLangPrintf(stderr, NULL, + _cupsLangPrintf(stderr, _("lpadmin: Unable to connect to server: %s\n"), strerror(errno)); return (1); @@ -670,7 +670,7 @@ main(int argc, /* I - Number of command-line arguments */ if (printer == NULL) { - _cupsLangPuts(stderr, NULL, + _cupsLangPuts(stderr, _("lpadmin: Unable to set the printer location:\n" " You must specify a printer name " "first!\n")); @@ -688,7 +688,7 @@ main(int argc, /* I - Number of command-line arguments */ if (i >= argc) { - _cupsLangPuts(stderr, NULL, + _cupsLangPuts(stderr, _("lpadmin: Expected location after \'-L\' " "option!\n")); return (1); @@ -707,7 +707,7 @@ main(int argc, /* I - Number of command-line arguments */ if (http == NULL) { - _cupsLangPrintf(stderr, NULL, + _cupsLangPrintf(stderr, _("lpadmin: Unable to connect to server: %s\n"), strerror(errno)); return (1); @@ -716,7 +716,7 @@ main(int argc, /* I - Number of command-line arguments */ if (printer == NULL) { - _cupsLangPuts(stderr, NULL, + _cupsLangPuts(stderr, _("lpadmin: Unable to set the PPD file:\n" " You must specify a printer name " "first!\n")); @@ -734,7 +734,7 @@ main(int argc, /* I - Number of command-line arguments */ if (i >= argc) { - _cupsLangPuts(stderr, NULL, + _cupsLangPuts(stderr, _("lpadmin: Expected PPD after \'-P\' option!\n")); return (1); } @@ -745,13 +745,13 @@ main(int argc, /* I - Number of command-line arguments */ break; default : - _cupsLangPrintf(stderr, NULL, + _cupsLangPrintf(stderr, _("lpadmin: Unknown option \'%c\'!\n"), argv[i][1]); return (1); } else { - _cupsLangPrintf(stderr, NULL, _("lpadmin: Unknown argument \'%s\'!\n"), + _cupsLangPrintf(stderr, _("lpadmin: Unknown argument \'%s\'!\n"), argv[i]); return (1); } @@ -768,7 +768,7 @@ main(int argc, /* I - Number of command-line arguments */ if (http == NULL) { - _cupsLangPrintf(stderr, NULL, + _cupsLangPrintf(stderr, _("lpadmin: Unable to connect to server: %s\n"), strerror(errno)); return (1); @@ -777,7 +777,7 @@ main(int argc, /* I - Number of command-line arguments */ if (printer == NULL) { - _cupsLangPuts(stderr, NULL, + _cupsLangPuts(stderr, _("lpadmin: Unable to set the printer options:\n" " You must specify a printer name first!\n")); return (1); @@ -789,7 +789,7 @@ main(int argc, /* I - Number of command-line arguments */ if (printer == NULL) { - _cupsLangPuts(stdout, NULL, + _cupsLangPuts(stdout, _("Usage:\n" "\n" " lpadmin [-h server] -d destination\n" @@ -825,7 +825,6 @@ add_printer_to_class(http_t *http, /* I - Server connection */ *response; /* IPP Response */ ipp_attribute_t *attr, /* Current attribute */ *members; /* Members in class */ - cups_lang_t *language; /* Default language */ char uri[HTTP_MAX_URI]; /* URI for printer/class */ @@ -841,22 +840,10 @@ add_printer_to_class(http_t *http, /* I - Server connection */ * printer-uri */ + request = ippNewRequest(IPP_GET_PRINTER_ATTRIBUTES); + httpAssembleURIf(uri, sizeof(uri), "ipp", NULL, "localhost", 0, "/classes/%s", pclass); - - request = ippNew(); - - request->request.op.operation_id = IPP_GET_PRINTER_ATTRIBUTES; - request->request.op.request_id = 1; - - language = cupsLangDefault(); - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET, - "attributes-charset", NULL, cupsLangEncoding(language)); - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE, - "attributes-natural-language", NULL, language->language); - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, uri); @@ -876,18 +863,7 @@ add_printer_to_class(http_t *http, /* I - Server connection */ * member-uris */ - request = ippNew(); - - request->request.op.operation_id = CUPS_ADD_CLASS; - request->request.op.request_id = 1; - - language = cupsLangDefault(); - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET, - "attributes-charset", NULL, cupsLangEncoding(language)); - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE, - "attributes-natural-language", NULL, language->language); + request = ippNewRequest(CUPS_ADD_CLASS); ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, uri); @@ -901,8 +877,9 @@ add_printer_to_class(http_t *http, /* I - Server connection */ for (i = 0; i < members->num_values; i ++) if (strcasecmp(printer, members->values[i].string.text) == 0) { - fprintf(stderr, "lpadmin: Printer %s is already a member of class %s.\n", - printer, pclass); + _cupsLangPrintf(stderr, + _("lpadmin: Printer %s is already a member of class %s.\n"), + printer, pclass); ippDelete(request); ippDelete(response); return (0); @@ -940,15 +917,13 @@ add_printer_to_class(http_t *http, /* I - Server connection */ if ((response = cupsDoRequest(http, request, "/admin/")) == NULL) { - fprintf(stderr, "lpadmin: add-class failed: %s\n", - ippErrorString(cupsLastError())); + _cupsLangPrintf(stderr, "lpadmin: %s\n", cupsLastErrorString()); return (1); } else if (response->request.status.status_code > IPP_OK_CONFLICT) { - fprintf(stderr, "lpadmin: add-class failed: %s\n", - ippErrorString(response->request.status.status_code)); + _cupsLangPrintf(stderr, "lpadmin: %s\n", cupsLastErrorString()); ippDelete(response); @@ -973,7 +948,6 @@ default_printer(http_t *http, /* I - Server connection */ { ipp_t *request, /* IPP Request */ *response; /* IPP Response */ - cups_lang_t *language; /* Default language */ char uri[HTTP_MAX_URI]; /* URI for printer/class */ @@ -991,18 +965,7 @@ default_printer(http_t *http, /* I - Server connection */ httpAssembleURIf(uri, sizeof(uri), "ipp", NULL, "localhost", 0, "/printers/%s", printer); - request = ippNew(); - - request->request.op.operation_id = CUPS_SET_DEFAULT; - request->request.op.request_id = 1; - - language = cupsLangDefault(); - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET, - "attributes-charset", NULL, cupsLangEncoding(language)); - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE, - "attributes-natural-language", NULL, language->language); + request = ippNewRequest(CUPS_SET_DEFAULT); ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, uri); @@ -1013,15 +976,13 @@ default_printer(http_t *http, /* I - Server connection */ if ((response = cupsDoRequest(http, request, "/admin/")) == NULL) { - fprintf(stderr, "lpadmin: set-default failed: %s\n", - ippErrorString(cupsLastError())); + _cupsLangPrintf(stderr, "lpadmin: %s\n", cupsLastErrorString()); return (1); } else if (response->request.status.status_code > IPP_OK_CONFLICT) { - fprintf(stderr, "lpadmin: set-default failed: %s\n", - ippErrorString(response->request.status.status_code)); + _cupsLangPrintf(stderr, "lpadmin: %s\n", cupsLastErrorString()); ippDelete(response); @@ -1046,7 +1007,6 @@ delete_printer(http_t *http, /* I - Server connection */ { ipp_t *request, /* IPP Request */ *response; /* IPP Response */ - cups_lang_t *language; /* Default language */ char uri[HTTP_MAX_URI]; /* URI for printer/class */ @@ -1061,22 +1021,10 @@ delete_printer(http_t *http, /* I - Server connection */ * printer-uri */ + request = ippNewRequest(CUPS_DELETE_PRINTER); + httpAssembleURIf(uri, sizeof(uri), "ipp", NULL, "localhost", 0, "/printers/%s", printer); - - request = ippNew(); - - request->request.op.operation_id = CUPS_DELETE_PRINTER; - request->request.op.request_id = 1; - - language = cupsLangDefault(); - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET, - "attributes-charset", NULL, cupsLangEncoding(language)); - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE, - "attributes-natural-language", NULL, language->language); - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, uri); @@ -1086,15 +1034,13 @@ delete_printer(http_t *http, /* I - Server connection */ if ((response = cupsDoRequest(http, request, "/admin/")) == NULL) { - fprintf(stderr, "lpadmin: delete-printer failed: %s\n", - ippErrorString(cupsLastError())); + _cupsLangPrintf(stderr, "lpadmin: %s\n", cupsLastErrorString()); return (1); } else if (response->request.status.status_code > IPP_OK_CONFLICT) { - fprintf(stderr, "lpadmin: delete-printer failed: %s\n", - ippErrorString(response->request.status.status_code)); + _cupsLangPrintf(stderr, "lpadmin: %s\n", cupsLastErrorString()); ippDelete(response); @@ -1114,18 +1060,16 @@ delete_printer(http_t *http, /* I - Server connection */ */ static int /* O - 0 on success, 1 on fail */ -delete_printer_from_class(http_t *http, /* I - Server connection */ - char *printer, - /* I - Printer to remove */ - char *pclass) - /* I - Class to remove from */ +delete_printer_from_class( + http_t *http, /* I - Server connection */ + char *printer, /* I - Printer to remove */ + char *pclass) /* I - Class to remove from */ { int i, j, k; /* Looping vars */ ipp_t *request, /* IPP Request */ *response; /* IPP Response */ ipp_attribute_t *attr, /* Current attribute */ *members; /* Members in class */ - cups_lang_t *language; /* Default language */ char uri[HTTP_MAX_URI]; /* URI for printer/class */ @@ -1141,22 +1085,10 @@ delete_printer_from_class(http_t *http, /* I - Server connection */ * printer-uri */ + request = ippNewRequest(IPP_GET_PRINTER_ATTRIBUTES); + httpAssembleURIf(uri, sizeof(uri), "ipp", NULL, "localhost", 0, "/classes/%s", pclass); - - request = ippNew(); - - request->request.op.operation_id = IPP_GET_PRINTER_ATTRIBUTES; - request->request.op.request_id = 1; - - language = cupsLangDefault(); - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET, - "attributes-charset", NULL, cupsLangEncoding(language)); - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE, - "attributes-natural-language", NULL, language->language); - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, uri); @@ -1167,8 +1099,10 @@ delete_printer_from_class(http_t *http, /* I - Server connection */ if ((response = cupsDoRequest(http, request, "/classes/")) == NULL || response->request.status.status_code == IPP_NOT_FOUND) { + _cupsLangPrintf(stderr, "lpadmin: %s\n", cupsLastErrorString()); + ippDelete(response); - fprintf(stderr, "lpadmin: Class %s does not exist!\n", pclass); + return (1); } @@ -1178,20 +1112,25 @@ delete_printer_from_class(http_t *http, /* I - Server connection */ if ((members = ippFindAttribute(response, "member-names", IPP_TAG_NAME)) == NULL) { + _cupsLangPuts(stderr, _("lpadmin: No member names were seen!\n")); + ippDelete(response); - fputs("lpadmin: No member names were seen!\n", stderr); + return (1); } for (i = 0; i < members->num_values; i ++) - if (strcasecmp(printer, members->values[i].string.text) == 0) + if (!strcasecmp(printer, members->values[i].string.text)) break; if (i >= members->num_values) { - fprintf(stderr, "lpadmin: Printer %s is not a member of class %s.\n", - printer, pclass); + _cupsLangPrintf(stderr, + _("lpadmin: Printer %s is not a member of class %s.\n"), + printer, pclass); + ippDelete(response); + return (1); } @@ -1206,18 +1145,7 @@ delete_printer_from_class(http_t *http, /* I - Server connection */ * printer-uri */ - request = ippNew(); - - request->request.op.operation_id = CUPS_DELETE_CLASS; - request->request.op.request_id = 1; - - language = cupsLangDefault(); - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET, - "attributes-charset", NULL, cupsLangEncoding(language)); - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE, - "attributes-natural-language", NULL, language->language); + request = ippNewRequest(CUPS_DELETE_CLASS); ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, uri); @@ -1234,18 +1162,7 @@ delete_printer_from_class(http_t *http, /* I - Server connection */ * member-uris */ - request = ippNew(); - - request->request.op.operation_id = CUPS_ADD_CLASS; - request->request.op.request_id = 1; - - language = cupsLangDefault(); - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET, - "attributes-charset", NULL, cupsLangEncoding(language)); - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE, - "attributes-natural-language", NULL, language->language); + request = ippNewRequest(CUPS_ADD_CLASS); ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, uri); @@ -1271,14 +1188,13 @@ delete_printer_from_class(http_t *http, /* I - Server connection */ if ((response = cupsDoRequest(http, request, "/admin/")) == NULL) { - fprintf(stderr, "lpadmin: add/delete-class failed: %s\n", - ippErrorString(cupsLastError())); + _cupsLangPrintf(stderr, "lpadmin: %s\n", cupsLastErrorString()); + return (1); } else if (response->request.status.status_code > IPP_OK_CONFLICT) { - fprintf(stderr, "lpadmin: add/delete-class failed: %s\n", - ippErrorString(response->request.status.status_code)); + _cupsLangPrintf(stderr, "lpadmin: %s\n", cupsLastErrorString()); ippDelete(response); @@ -1303,7 +1219,6 @@ enable_printer(http_t *http, /* I - Server connection */ { ipp_t *request, /* IPP Request */ *response; /* IPP Response */ - cups_lang_t *language; /* Default language */ char uri[HTTP_MAX_URI]; /* URI for printer/class */ @@ -1320,22 +1235,10 @@ enable_printer(http_t *http, /* I - Server connection */ * printer-is-accepting-jobs */ + request = ippNewRequest(CUPS_ADD_PRINTER); + httpAssembleURIf(uri, sizeof(uri), "ipp", NULL, "localhost", 0, "/printers/%s", printer); - - request = ippNew(); - - request->request.op.operation_id = CUPS_ADD_PRINTER; - request->request.op.request_id = 1; - - language = cupsLangDefault(); - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET, - "attributes-charset", NULL, cupsLangEncoding(language)); - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE, - "attributes-natural-language", NULL, language->language); - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, uri); @@ -1350,14 +1253,13 @@ enable_printer(http_t *http, /* I - Server connection */ if ((response = cupsDoRequest(http, request, "/admin/")) == NULL) { - fprintf(stderr, "lpadmin: add-printer (enable) failed: %s\n", - ippErrorString(cupsLastError())); + _cupsLangPrintf(stderr, "lpadmin: %s\n", cupsLastErrorString()); + return (1); } else if (response->request.status.status_code > IPP_OK_CONFLICT) { - fprintf(stderr, "lpadmin: add-printer (enable) failed: %s\n", - ippErrorString(response->request.status.status_code)); + _cupsLangPrintf(stderr, "lpadmin: %s\n", cupsLastErrorString()); ippDelete(response); @@ -1431,7 +1333,6 @@ set_printer_device(http_t *http, /* I - Server connection */ { ipp_t *request, /* IPP Request */ *response; /* IPP Response */ - cups_lang_t *language; /* Default language */ char uri[HTTP_MAX_URI]; /* URI for printer/class */ @@ -1447,22 +1348,10 @@ set_printer_device(http_t *http, /* I - Server connection */ * printer-uri */ + request = ippNewRequest(CUPS_ADD_PRINTER); + httpAssembleURIf(uri, sizeof(uri), "ipp", NULL, "localhost", 0, "/printers/%s", printer); - - request = ippNew(); - - request->request.op.operation_id = CUPS_ADD_PRINTER; - request->request.op.request_id = 1; - - language = cupsLangDefault(); - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET, - "attributes-charset", NULL, cupsLangEncoding(language)); - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE, - "attributes-natural-language", NULL, language->language); - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, uri); @@ -1476,7 +1365,7 @@ set_printer_device(http_t *http, /* I - Server connection */ * Convert filename to URI... */ - snprintf(uri, sizeof(uri), "file:%s", device); + snprintf(uri, sizeof(uri), "file://%s", device); ippAddString(request, IPP_TAG_PRINTER, IPP_TAG_URI, "device-uri", NULL, uri); } @@ -1490,14 +1379,13 @@ set_printer_device(http_t *http, /* I - Server connection */ if ((response = cupsDoRequest(http, request, "/admin/")) == NULL) { - fprintf(stderr, "lpadmin: add-printer (set device) failed: %s\n", - ippErrorString(cupsLastError())); + _cupsLangPrintf(stderr, "lpadmin: %s\n", cupsLastErrorString()); + return (1); } else if (response->request.status.status_code > IPP_OK_CONFLICT) { - fprintf(stderr, "lpadmin: add-printer (set device) failed: %s\n", - ippErrorString(response->request.status.status_code)); + _cupsLangPrintf(stderr, "lpadmin: %s\n", cupsLastErrorString()); ippDelete(response); @@ -1521,10 +1409,8 @@ set_printer_file(http_t *http, /* I - Server connection */ char *printer, /* I - Printer */ char *file) /* I - PPD file or interface script */ { - ipp_status_t status; /* IPP status code */ ipp_t *request, /* IPP Request */ *response; /* IPP Response */ - cups_lang_t *language; /* Default language */ char uri[HTTP_MAX_URI]; /* URI for printer/class */ #ifdef HAVE_LIBZ char tempfile[1024]; /* Temporary filename */ @@ -1550,7 +1436,7 @@ set_printer_file(http_t *http, /* I - Server connection */ if ((fd = cupsTempFd(tempfile, sizeof(tempfile))) < 0) { - _cupsLangPrintf(stderr, NULL, + _cupsLangPrintf(stderr, _("lpadmin: Unable to create temporary file: %s\n"), strerror(errno)); return (1); @@ -1558,7 +1444,7 @@ set_printer_file(http_t *http, /* I - Server connection */ if ((gz = gzopen(file, "rb")) == NULL) { - _cupsLangPrintf(stderr, NULL, + _cupsLangPrintf(stderr, _("lpadmin: Unable to open file \"%s\": %s\n"), file, strerror(errno)); close(fd); @@ -1585,22 +1471,10 @@ set_printer_file(http_t *http, /* I - Server connection */ * printer-uri */ + request = ippNewRequest(CUPS_ADD_PRINTER); + httpAssembleURIf(uri, sizeof(uri), "ipp", NULL, "localhost", 0, "/printers/%s", printer); - - request = ippNew(); - - request->request.op.operation_id = CUPS_ADD_PRINTER; - request->request.op.request_id = 1; - - language = cupsLangDefault(); - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET, - "attributes-charset", NULL, cupsLangEncoding(language)); - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE, - "attributes-natural-language", NULL, language->language); - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, uri); @@ -1608,13 +1482,8 @@ set_printer_file(http_t *http, /* I - Server connection */ * Do the request and get back a response... */ - if ((response = cupsDoFileRequest(http, request, "/admin/", file)) == NULL) - status = cupsLastError(); - else - { - status = response->request.status.status_code; - ippDelete(response); - } + response = cupsDoFileRequest(http, request, "/admin/", file); + ippDelete(response); #ifdef HAVE_LIBZ /* @@ -1625,11 +1494,9 @@ set_printer_file(http_t *http, /* I - Server connection */ unlink(tempfile); #endif /* HAVE_LIBZ */ - if (status > IPP_OK_CONFLICT) + if (cupsLastError() > IPP_OK_CONFLICT) { - _cupsLangPrintf(stderr, NULL, - _("lpadmin: add-printer (set model) failed: %s\n"), - ippErrorString(status)); + _cupsLangPrintf(stderr, "lpadmin: %s\n", cupsLastErrorString()); return (1); } @@ -1649,7 +1516,6 @@ set_printer_info(http_t *http, /* I - Server connection */ { ipp_t *request, /* IPP Request */ *response; /* IPP Response */ - cups_lang_t *language; /* Default language */ char uri[HTTP_MAX_URI]; /* URI for printer/class */ @@ -1665,22 +1531,10 @@ set_printer_info(http_t *http, /* I - Server connection */ * printer-uri */ + request = ippNewRequest(CUPS_ADD_PRINTER); + httpAssembleURIf(uri, sizeof(uri), "ipp", NULL, "localhost", 0, "/printers/%s", printer); - - request = ippNew(); - - request->request.op.operation_id = CUPS_ADD_PRINTER; - request->request.op.request_id = 1; - - language = cupsLangDefault(); - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET, - "attributes-charset", NULL, cupsLangEncoding(language)); - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE, - "attributes-natural-language", NULL, language->language); - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, uri); @@ -1697,16 +1551,12 @@ set_printer_info(http_t *http, /* I - Server connection */ if ((response = cupsDoRequest(http, request, "/admin/")) == NULL) { - _cupsLangPrintf(stderr, NULL, - _("lpadmin: add-printer (set description) failed: %s\n"), - ippErrorString(cupsLastError())); + _cupsLangPrintf(stderr, "lpadmin: %s\n", cupsLastErrorString()); return (1); } else if (response->request.status.status_code > IPP_OK_CONFLICT) { - _cupsLangPrintf(stderr, NULL, - _("lpadmin: add-printer (set description) failed: %s\n"), - ippErrorString(response->request.status.status_code)); + _cupsLangPrintf(stderr, "lpadmin: %s\n", cupsLastErrorString()); ippDelete(response); @@ -1732,7 +1582,6 @@ set_printer_location(http_t *http, /* I - Server connection */ { ipp_t *request, /* IPP Request */ *response; /* IPP Response */ - cups_lang_t *language; /* Default language */ char uri[HTTP_MAX_URI]; /* URI for printer/class */ @@ -1748,22 +1597,10 @@ set_printer_location(http_t *http, /* I - Server connection */ * printer-uri */ + request = ippNewRequest(CUPS_ADD_PRINTER); + httpAssembleURIf(uri, sizeof(uri), "ipp", NULL, "localhost", 0, "/printers/%s", printer); - - request = ippNew(); - - request->request.op.operation_id = CUPS_ADD_PRINTER; - request->request.op.request_id = 1; - - language = cupsLangDefault(); - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET, - "attributes-charset", NULL, cupsLangEncoding(language)); - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE, - "attributes-natural-language", NULL, language->language); - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, uri); @@ -1780,17 +1617,13 @@ set_printer_location(http_t *http, /* I - Server connection */ if ((response = cupsDoRequest(http, request, "/admin/")) == NULL) { - _cupsLangPrintf(stderr, NULL, - _("lpadmin: add-printer (set location) failed: %s\n"), - ippErrorString(cupsLastError())); + _cupsLangPrintf(stderr, "lpadmin: %s\n", cupsLastErrorString()); return (1); } else if (response->request.status.status_code > IPP_OK_CONFLICT) { - _cupsLangPrintf(stderr, NULL, - _("lpadmin: add-printer (set location) failed: %s\n"), - ippErrorString(response->request.status.status_code)); + _cupsLangPrintf(stderr, "lpadmin: %s\n", cupsLastErrorString()); ippDelete(response); @@ -1816,7 +1649,6 @@ set_printer_model(http_t *http, /* I - Server connection */ { ipp_t *request, /* IPP Request */ *response; /* IPP Response */ - cups_lang_t *language; /* Default language */ char uri[HTTP_MAX_URI]; /* URI for printer/class */ @@ -1830,22 +1662,10 @@ set_printer_model(http_t *http, /* I - Server connection */ * ppd-name */ + request = ippNewRequest(CUPS_ADD_PRINTER); + httpAssembleURIf(uri, sizeof(uri), "ipp", NULL, "localhost", 0, "/printers/%s", printer); - - request = ippNew(); - - request->request.op.operation_id = CUPS_ADD_PRINTER; - request->request.op.request_id = 1; - - language = cupsLangDefault(); - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET, - "attributes-charset", NULL, cupsLangEncoding(language)); - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE, - "attributes-natural-language", NULL, language->language); - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, uri); @@ -1858,17 +1678,13 @@ set_printer_model(http_t *http, /* I - Server connection */ if ((response = cupsDoRequest(http, request, "/admin/")) == NULL) { - _cupsLangPrintf(stderr, NULL, - _("lpadmin: add-printer (set model) failed: %s\n"), - ippErrorString(cupsLastError())); + _cupsLangPrintf(stderr, "lpadmin: %s\n", cupsLastErrorString()); return (1); } else if (response->request.status.status_code > IPP_OK_CONFLICT) { - _cupsLangPrintf(stderr, NULL, - _("lpadmin: add-printer (set model) failed: %s\n"), - ippErrorString(response->request.status.status_code)); + _cupsLangPrintf(stderr, "lpadmin: %s\n", cupsLastErrorString()); ippDelete(response); @@ -1888,18 +1704,15 @@ set_printer_model(http_t *http, /* I - Server connection */ */ static int /* O - 0 on success, 1 on fail */ -set_printer_options(http_t *http,/* I - Server connection */ - char *printer, - /* I - Printer */ - int num_options, - /* I - Number of options */ - cups_option_t *options) - /* I - Options */ +set_printer_options( + http_t *http, /* I - Server connection */ + char *printer, /* I - Printer */ + int num_options, /* I - Number of options */ + cups_option_t *options) /* I - Options */ { ipp_t *request, /* IPP Request */ *response; /* IPP Response */ ipp_attribute_t *attr; /* IPP attribute */ - cups_lang_t *language; /* Default language */ ipp_op_t op; /* Operation to perform */ const char *val, /* Option value */ *ppdfile; /* PPD filename */ @@ -1917,8 +1730,6 @@ set_printer_options(http_t *http,/* I - Server connection */ DEBUG_printf(("set_printer_options(%p, \"%s\", %d, %p)\n", http, printer, num_options, options)); - language = cupsLangDefault(); - httpAssembleURIf(uri, sizeof(uri), "ipp", NULL, "localhost", 0, "/printers/%s", printer); @@ -1932,16 +1743,7 @@ set_printer_options(http_t *http,/* I - Server connection */ * requested-attributes */ - request = ippNew(); - - request->request.op.operation_id = IPP_GET_PRINTER_ATTRIBUTES; - request->request.op.request_id = 1; - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET, - "attributes-charset", NULL, cupsLangEncoding(language)); - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE, - "attributes-natural-language", NULL, language->language); + request = ippNewRequest(IPP_GET_PRINTER_ATTRIBUTES); ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, uri); @@ -1984,16 +1786,7 @@ set_printer_options(http_t *http,/* I - Server connection */ * other options */ - request = ippNew(); - - request->request.op.operation_id = op; - request->request.op.request_id = 1; - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET, - "attributes-charset", NULL, cupsLangEncoding(language)); - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE, - "attributes-natural-language", NULL, language->language); + request = ippNewRequest(op); ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, uri); @@ -2017,7 +1810,7 @@ set_printer_options(http_t *http,/* I - Server connection */ if ((outfd = cupsTempFd(tempfile, sizeof(tempfile))) < 0) { - _cupsLangPrintf(stderr, NULL, + _cupsLangPrintf(stderr, _("lpadmin: Unable to create temporary file - %s\n"), strerror(errno)); ippDelete(request); @@ -2027,7 +1820,7 @@ set_printer_options(http_t *http,/* I - Server connection */ if ((in = fopen(ppdfile, "rb")) == NULL) { - _cupsLangPrintf(stderr, NULL, + _cupsLangPrintf(stderr, _("lpadmin: Unable to open PPD file \"%s\" - %s\n"), ppdfile, strerror(errno)); ippDelete(request); @@ -2066,7 +1859,7 @@ set_printer_options(http_t *http,/* I - Server connection */ *keyptr = '\0'; - if (strcmp(keyword, "PageRegion") == 0) + if (!strcmp(keyword, "PageRegion")) val = cupsGetOption("PageSize", num_options, options); else val = cupsGetOption(keyword, num_options, options); @@ -2112,30 +1905,15 @@ set_printer_options(http_t *http,/* I - Server connection */ * Check the response... */ - if (response == NULL) - { - _cupsLangPrintf(stderr, NULL, _("lpadmin: %s failed: %s\n"), - op == CUPS_ADD_PRINTER ? "add-printer" : "add-class", - ippErrorString(cupsLastError())); - - return (1); - } - else if (response->request.status.status_code > IPP_OK_CONFLICT) + ippDelete(response); + if (cupsLastError() > IPP_OK_CONFLICT) { - _cupsLangPrintf(stderr, NULL, _("lpadmin: %s failed: %s\n"), - op == CUPS_ADD_PRINTER ? "add-printer" : "add-class", - ippErrorString(response->request.status.status_code)); - - ippDelete(response); + _cupsLangPrintf(stderr, "lpadmin: %s\n", cupsLastErrorString()); return (1); } else - { - ippDelete(response); - return (0); - } } @@ -2143,10 +1921,10 @@ set_printer_options(http_t *http,/* I - Server connection */ * 'validate_name()' - Make sure the printer name only contains valid chars. */ -static int /* O - 0 if name is no good, 1 if name is good */ -validate_name(const char *name) /* I - Name to check */ +static int /* O - 0 if name is no good, 1 if name is good */ +validate_name(const char *name) /* I - Name to check */ { - const char *ptr; /* Pointer into name */ + const char *ptr; /* Pointer into name */ /* @@ -2169,5 +1947,5 @@ validate_name(const char *name) /* I - Name to check */ /* - * End of "$Id: lpadmin.c 4906 2006-01-10 20:53:28Z mike $". + * End of "$Id: lpadmin.c 4925 2006-01-13 02:52:47Z mike $". */ diff --git a/systemv/lpinfo.c b/systemv/lpinfo.c index 41ffad206..df8bef1aa 100644 --- a/systemv/lpinfo.c +++ b/systemv/lpinfo.c @@ -1,5 +1,5 @@ /* - * "$Id: lpinfo.c 4906 2006-01-10 20:53:28Z mike $" + * "$Id: lpinfo.c 4925 2006-01-13 02:52:47Z mike $" * * "lpinfo" command for the Common UNIX Printing System (CUPS). * @@ -76,7 +76,7 @@ main(int argc, /* I - Number of command-line arguments */ if (http) httpEncryption(http, HTTP_ENCRYPT_REQUIRED); #else - _cupsLangPrintf(stderr, NULL, + _cupsLangPrintf(stderr, _("%s: Sorry, no encryption support compiled in!\n"), argv[0]); #endif /* HAVE_SSL */ @@ -94,7 +94,7 @@ main(int argc, /* I - Number of command-line arguments */ if (http == NULL) { - _cupsLangPrintf(stderr, NULL, + _cupsLangPrintf(stderr, _("lpinfo: Unable to connect to server: %s\n"), strerror(errno)); return (1); @@ -113,7 +113,7 @@ main(int argc, /* I - Number of command-line arguments */ if (http == NULL) { - _cupsLangPrintf(stderr, NULL, + _cupsLangPrintf(stderr, _("lpinfo: Unable to connect to server: %s\n"), strerror(errno)); return (1); @@ -139,7 +139,7 @@ main(int argc, /* I - Number of command-line arguments */ if (i >= argc) { - _cupsLangPuts(stderr, NULL, + _cupsLangPuts(stderr, _("Error: need hostname after \'-h\' option!\n")); return (1); } @@ -149,13 +149,13 @@ main(int argc, /* I - Number of command-line arguments */ break; default : - _cupsLangPrintf(stderr, NULL, _("lpinfo: Unknown option \'%c\'!\n"), + _cupsLangPrintf(stderr, _("lpinfo: Unknown option \'%c\'!\n"), argv[i][1]); return (1); } else { - _cupsLangPrintf(stderr, NULL, _("lpinfo: Unknown argument \'%s\'!\n"), + _cupsLangPrintf(stderr, _("lpinfo: Unknown argument \'%s\'!\n"), argv[i]); return (1); } @@ -175,11 +175,11 @@ show_devices(http_t *http, /* I - HTTP connection to server */ ipp_t *request, /* IPP Request */ *response; /* IPP Response */ ipp_attribute_t *attr; /* Current attribute */ - cups_lang_t *language; /* Default language */ - const char *device_class, /* Pointer into device-class */ - *device_info, /* Pointer into device-info */ - *device_make, /* Pointer into device-make-and-model */ - *device_uri; /* Pointer into device-uri */ + const char *device_class, /* Pointer to device-class */ + *device_id, /* Pointer to device-id */ + *device_info, /* Pointer to device-info */ + *device_make, /* Pointer to device-make-and-model */ + *device_uri; /* Pointer to device-uri */ if (http == NULL) @@ -191,24 +191,9 @@ show_devices(http_t *http, /* I - HTTP connection to server */ * * attributes-charset * attributes-natural-language - * printer-uri */ - request = ippNew(); - - request->request.op.operation_id = CUPS_GET_DEVICES; - request->request.op.request_id = 1; - - language = cupsLangDefault(); - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET, - "attributes-charset", NULL, cupsLangEncoding(language)); - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE, - "attributes-natural-language", NULL, language->language); - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", - NULL, "ipp://localhost/printers/"); + request = ippNewRequest(CUPS_GET_DEVICES); /* * Do the request and get back a response... @@ -222,8 +207,7 @@ show_devices(http_t *http, /* I - HTTP connection to server */ if (response->request.status.status_code > IPP_OK_CONFLICT) { - _cupsLangPrintf(stderr, NULL, _("lpinfo: cups-get-devices failed: %s\n"), - ippErrorString(response->request.status.status_code)); + _cupsLangPrintf(stderr, "lpinfo: %s\n", cupsLastErrorString()); ippDelete(response); return (1); } @@ -248,24 +232,25 @@ show_devices(http_t *http, /* I - HTTP connection to server */ device_info = NULL; device_make = NULL; device_uri = NULL; + device_id = "NONE"; while (attr != NULL && attr->group_tag == IPP_TAG_PRINTER) { if (!strcmp(attr->name, "device-class") && attr->value_tag == IPP_TAG_KEYWORD) device_class = attr->values[0].string.text; - - if (!strcmp(attr->name, "device-info") && - attr->value_tag == IPP_TAG_TEXT) + else if (!strcmp(attr->name, "device-info") && + attr->value_tag == IPP_TAG_TEXT) device_info = attr->values[0].string.text; - - if (!strcmp(attr->name, "device-make-and-model") && - attr->value_tag == IPP_TAG_TEXT) + else if (!strcmp(attr->name, "device-make-and-model") && + attr->value_tag == IPP_TAG_TEXT) device_make = attr->values[0].string.text; - - if (!strcmp(attr->name, "device-uri") && - attr->value_tag == IPP_TAG_URI) + else if (!strcmp(attr->name, "device-uri") && + attr->value_tag == IPP_TAG_URI) device_uri = attr->values[0].string.text; + else if (!strcmp(attr->name, "device-id") && + attr->value_tag == IPP_TAG_TEXT) + device_id = attr->values[0].string.text; attr = attr->next; } @@ -289,15 +274,17 @@ show_devices(http_t *http, /* I - HTTP connection to server */ if (long_status) { - _cupsLangPrintf(stdout, language, + _cupsLangPrintf(stdout, _("Device: uri = %s\n" " class = %s\n" " info = %s\n" - " make-and-model = %s\n"), - device_uri, device_class, device_info, device_make); + " make-and-model = %s\n" + " device-id = %s\n"), + device_uri, device_class, device_info, device_make, + device_id); } else - _cupsLangPrintf(stdout, language, "%s %s\n", device_class, device_uri); + _cupsLangPrintf(stdout, "%s %s\n", device_class, device_uri); if (attr == NULL) break; @@ -307,8 +294,7 @@ show_devices(http_t *http, /* I - HTTP connection to server */ } else { - _cupsLangPrintf(stderr, NULL, _("lpinfo: cups-get-devices failed: %s\n"), - ippErrorString(cupsLastError())); + _cupsLangPrintf(stderr, "lpinfo: %s\n", cupsLastErrorString()); return (1); } @@ -327,10 +313,10 @@ show_models(http_t *http, /* I - HTTP connection to server */ ipp_t *request, /* IPP Request */ *response; /* IPP Response */ ipp_attribute_t *attr; /* Current attribute */ - cups_lang_t *language; /* Default language */ - const char *ppd_language, /* Pointer into ppd-natural-language */ - *ppd_make, /* Pointer into ppd-make-and-model */ - *ppd_name; /* Pointer into ppd-name */ + 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_name; /* Pointer to ppd-name */ if (http == NULL) @@ -342,24 +328,9 @@ show_models(http_t *http, /* I - HTTP connection to server */ * * attributes-charset * attributes-natural-language - * printer-uri */ - request = ippNew(); - - request->request.op.operation_id = CUPS_GET_PPDS; - request->request.op.request_id = 1; - - language = cupsLangDefault(); - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET, - "attributes-charset", NULL, cupsLangEncoding(language)); - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE, - "attributes-natural-language", NULL, language->language); - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", - NULL, "ipp://localhost/printers/"); + request = ippNewRequest(CUPS_GET_PPDS); /* * Do the request and get back a response... @@ -373,8 +344,7 @@ show_models(http_t *http, /* I - HTTP connection to server */ if (response->request.status.status_code > IPP_OK_CONFLICT) { - _cupsLangPrintf(stderr, NULL, _("lpinfo: cups-get-ppds failed: %s\n"), - ippErrorString(response->request.status.status_code)); + _cupsLangPrintf(stderr, "lpinfo: %s\n", cupsLastErrorString()); ippDelete(response); return (1); } @@ -395,22 +365,24 @@ show_models(http_t *http, /* I - HTTP connection to server */ * Pull the needed attributes from this PPD... */ - ppd_language = NULL; - ppd_make = NULL; - ppd_name = NULL; + ppd_device_id = "NONE"; + ppd_language = NULL; + ppd_make = NULL; + ppd_name = NULL; while (attr != NULL && attr->group_tag == IPP_TAG_PRINTER) { - if (!strcmp(attr->name, "ppd-natural-language") && - attr->value_tag == IPP_TAG_LANGUAGE) - ppd_language = attr->values[0].string.text; - - if (!strcmp(attr->name, "ppd-make-and-model") && + if (!strcmp(attr->name, "ppd-device-id") && attr->value_tag == IPP_TAG_TEXT) + ppd_device_id = attr->values[0].string.text; + else if (!strcmp(attr->name, "ppd-natural-language") && + attr->value_tag == IPP_TAG_LANGUAGE) + 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; - - if (!strcmp(attr->name, "ppd-name") && - attr->value_tag == IPP_TAG_NAME) + else if (!strcmp(attr->name, "ppd-name") && + attr->value_tag == IPP_TAG_NAME) ppd_name = attr->values[0].string.text; attr = attr->next; @@ -434,14 +406,15 @@ show_models(http_t *http, /* I - HTTP connection to server */ if (long_status) { - _cupsLangPrintf(stdout, language, + _cupsLangPrintf(stdout, _("Model: name = %s\n" " natural_language = %s\n" - " make-and-model = %s\n"), - ppd_name, ppd_language, ppd_make); + " make-and-model = %s\n" + " device-id = %s\n"), + ppd_name, ppd_language, ppd_make, ppd_device_id); } else - _cupsLangPrintf(stdout, language, "%s %s\n", ppd_name, ppd_make); + _cupsLangPrintf(stdout, "%s %s\n", ppd_name, ppd_make); if (attr == NULL) break; @@ -451,8 +424,7 @@ show_models(http_t *http, /* I - HTTP connection to server */ } else { - _cupsLangPrintf(stderr, NULL, _("lpinfo: cups-get-ppds failed: %s\n"), - ippErrorString(cupsLastError())); + _cupsLangPrintf(stderr, "lpinfo: %s\n", cupsLastErrorString()); return (1); } @@ -462,5 +434,5 @@ show_models(http_t *http, /* I - HTTP connection to server */ /* - * End of "$Id: lpinfo.c 4906 2006-01-10 20:53:28Z mike $". + * End of "$Id: lpinfo.c 4925 2006-01-13 02:52:47Z mike $". */ diff --git a/systemv/lpmove.c b/systemv/lpmove.c index 5980a972d..27889fbd0 100644 --- a/systemv/lpmove.c +++ b/systemv/lpmove.c @@ -1,5 +1,5 @@ /* - * "$Id: lpmove.c 4906 2006-01-10 20:53:28Z mike $" + * "$Id: lpmove.c 4945 2006-01-18 21:41:17Z mike $" * * "lpmove" command for the Common UNIX Printing System (CUPS). * @@ -44,7 +44,8 @@ * Local functions... */ -static void move_job(http_t *, int, const char *); +static int move_job(http_t *http, const char *src, int jobid, + const char *dest); /* @@ -58,16 +59,20 @@ main(int argc, /* I - Number of command-line arguments */ int i; /* Looping var */ http_t *http; /* Connection to server */ const char *job; /* Job name */ + int jobid; /* Job ID */ int num_dests; /* Number of destinations */ cups_dest_t *dests; /* Destinations */ - const char *dest; /* New destination */ + const char *src, /* Original queue */ + *dest; /* New destination */ + dest = NULL; + dests = NULL; http = NULL; job = NULL; - dest = NULL; + jobid = 0; num_dests = 0; - dests = NULL; + src = NULL; for (i = 1; i < argc; i ++) if (argv[i][0] == '-') @@ -80,7 +85,7 @@ main(int argc, /* I - Number of command-line arguments */ if (http) httpEncryption(http, HTTP_ENCRYPT_REQUIRED); #else - _cupsLangPrintf(stderr, NULL, + _cupsLangPrintf(stderr, _("%s: Sorry, no encryption support compiled in!\n"), argv[0]); #endif /* HAVE_SSL */ @@ -101,7 +106,7 @@ main(int argc, /* I - Number of command-line arguments */ if (i >= argc) { - _cupsLangPuts(stderr, NULL, + _cupsLangPuts(stderr, _("Error: need hostname after \'-h\' option!\n")); return (1); } @@ -111,33 +116,33 @@ main(int argc, /* I - Number of command-line arguments */ break; default : - _cupsLangPrintf(stderr, NULL, _("lpmove: Unknown option \'%c\'!\n"), + _cupsLangPrintf(stderr, _("lpmove: Unknown option \'%c\'!\n"), argv[i][1]); return (1); } - else if (job == NULL) + else if (!jobid && !src) { if (num_dests == 0) num_dests = cupsGetDests(&dests); if ((job = strrchr(argv[i], '-')) != NULL && cupsGetDest(argv[i], NULL, num_dests, dests) == NULL) - job ++; + jobid = atoi(job + 1); else - job = argv[i]; + src = argv[i]; } else if (dest == NULL) dest = argv[i]; else { - _cupsLangPrintf(stderr, NULL, _("lpmove: Unknown argument \'%s\'!\n"), + _cupsLangPrintf(stderr, _("lpmove: Unknown argument \'%s\'!\n"), argv[i]); return (1); } - if (job == NULL || dest == NULL) + if ((!jobid && !src) || !dest) { - _cupsLangPuts(stdout, NULL, _("Usage: lpmove job dest\n")); + _cupsLangPuts(stdout, _("Usage: lpmove job/src dest\n")); return (1); } @@ -147,16 +152,14 @@ main(int argc, /* I - Number of command-line arguments */ if (http == NULL) { - _cupsLangPrintf(stderr, NULL, + _cupsLangPrintf(stderr, _("lpmove: Unable to connect to server: %s\n"), strerror(errno)); return (1); } } - move_job(http, atoi(job), dest); - - return (0); + return (move_job(http, src, jobid, dest)); } @@ -164,21 +167,19 @@ main(int argc, /* I - Number of command-line arguments */ * 'move_job()' - Move a job. */ -static void +static int /* O - 0 on success, 1 on error */ move_job(http_t *http, /* I - HTTP connection to server */ + const char *src, /* I - Source queue */ int jobid, /* I - Job ID */ - const char *dest) /* I - Destination */ + const char *dest) /* I - Destination queue */ { - ipp_t *request, /* IPP Request */ - *response; /* IPP Response */ - cups_lang_t *language; /* Default language */ - char job_uri[HTTP_MAX_URI], /* job-uri */ - printer_uri[HTTP_MAX_URI]; - /* job-printer-uri */ + ipp_t *request; /* IPP Request */ + char job_uri[HTTP_MAX_URI], /* job-uri */ + printer_uri[HTTP_MAX_URI]; /* job-printer-uri */ - if (http == NULL) - return; + if (!http) + return (1); /* * Build a CUPS_MOVE_JOB request, which requires the following @@ -186,25 +187,26 @@ move_job(http_t *http, /* I - HTTP connection to server */ * * attributes-charset * attributes-natural-language - * job-uri + * job-uri/printer-uri * job-printer-uri + * requesting-user-name */ - request = ippNew(); - - request->request.op.operation_id = CUPS_MOVE_JOB; - request->request.op.request_id = 1; - - language = cupsLangDefault(); - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET, - "attributes-charset", NULL, cupsLangEncoding(language)); - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE, - "attributes-natural-language", NULL, language->language); + request = ippNewRequest(CUPS_MOVE_JOB); - snprintf(job_uri, sizeof(job_uri), "ipp://localhost/jobs/%d", jobid); - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "job-uri", NULL, job_uri); + if (jobid) + { + snprintf(job_uri, sizeof(job_uri), "ipp://localhost/jobs/%d", jobid); + ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "job-uri", NULL, + job_uri); + } + else + { + httpAssembleURIf(job_uri, sizeof(job_uri), "ipp", NULL, "localhost", 0, + "/printers/%s", src); + ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, + job_uri); + } ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "requesting-user-name", NULL, cupsUser()); @@ -218,24 +220,18 @@ move_job(http_t *http, /* I - HTTP connection to server */ * Do the request and get back a response... */ - if ((response = cupsDoRequest(http, request, "/jobs")) != NULL) - { - if (response->request.status.status_code > IPP_OK_CONFLICT) - { - _cupsLangPrintf(stderr, NULL, _("lpmove: move-job failed: %s\n"), - ippErrorString(response->request.status.status_code)); - ippDelete(response); - return; - } + ippDelete(cupsDoRequest(http, request, "/jobs")); - ippDelete(response); + if (cupsLastError() > IPP_OK_CONFLICT) + { + _cupsLangPrintf(stderr, "lpmove: %s\n", cupsLastErrorString()); + return (1); } else - _cupsLangPrintf(stderr, NULL, _("lpmove: move-job failed: %s\n"), - ippErrorString(cupsLastError())); + return (0); } /* - * End of "$Id: lpmove.c 4906 2006-01-10 20:53:28Z mike $". + * End of "$Id: lpmove.c 4945 2006-01-18 21:41:17Z mike $". */ diff --git a/systemv/lpoptions.c b/systemv/lpoptions.c index 3792ab499..8e6441d8a 100644 --- a/systemv/lpoptions.c +++ b/systemv/lpoptions.c @@ -1,5 +1,5 @@ /* - * "$Id: lpoptions.c 4906 2006-01-10 20:53:28Z mike $" + * "$Id: lpoptions.c 4924 2006-01-13 01:55:20Z mike $" * * Printer option program for the Common UNIX Printing System (CUPS). * @@ -105,7 +105,7 @@ main(int argc, /* I - Number of command-line arguments */ if ((dest = cupsGetDest(printer, instance, num_dests, dests)) == NULL) { - _cupsLangPuts(stderr, NULL, + _cupsLangPuts(stderr, _("lpoptions: Unknown printer or class!\n")); return (1); } @@ -156,7 +156,7 @@ main(int argc, /* I - Number of command-line arguments */ } if (dest == NULL) - _cupsLangPuts(stderr, NULL, _("lpoptions: No printers!?!\n")); + _cupsLangPuts(stderr, _("lpoptions: No printers!?!\n")); else list_options(dest); @@ -203,7 +203,7 @@ main(int argc, /* I - Number of command-line arguments */ if (dest == NULL) { - _cupsLangPrintf(stderr, NULL, + _cupsLangPrintf(stderr, _("lpoptions: Unable to add printer or " "instance: %s\n"), strerror(errno)); @@ -342,20 +342,20 @@ main(int argc, /* I - Number of command-line arguments */ for (i = 0; i < num_options; i ++) { if (i) - _cupsLangPuts(stdout, NULL, " "); + _cupsLangPuts(stdout, " "); if (!options[i].value[0]) - _cupsLangPrintf(stdout, NULL, "%s", options[i].name); + _cupsLangPrintf(stdout, "%s", options[i].name); else if (strchr(options[i].value, ' ') != NULL || strchr(options[i].value, '\t') != NULL) - _cupsLangPrintf(stdout, NULL, "%s=\'%s\'", options[i].name, + _cupsLangPrintf(stdout, "%s=\'%s\'", options[i].name, options[i].value); else - _cupsLangPrintf(stdout, NULL, "%s=%s", options[i].name, + _cupsLangPrintf(stdout, "%s=%s", options[i].name, options[i].value); } - _cupsLangPuts(stdout, NULL, "\n"); + _cupsLangPuts(stdout, "\n"); } return (0); @@ -376,15 +376,15 @@ list_group(ppd_group_t *group) /* I - Group to show */ for (i = group->num_options, option = group->options; i > 0; i --, option ++) { - _cupsLangPrintf(stdout, NULL, "%s/%s:", option->keyword, option->text); + _cupsLangPrintf(stdout, "%s/%s:", option->keyword, option->text); for (j = option->num_choices, choice = option->choices; j > 0; j --, choice ++) if (choice->marked) - _cupsLangPrintf(stdout, NULL, " *%s", choice->choice); + _cupsLangPrintf(stdout, " *%s", choice->choice); else - _cupsLangPrintf(stdout, NULL, " %s", choice->choice); + _cupsLangPrintf(stdout, " %s", choice->choice); - _cupsLangPuts(stdout, NULL, "\n"); + _cupsLangPuts(stdout, "\n"); } for (i = group->num_subgroups, subgroup = group->subgroups; i > 0; i --, subgroup ++) @@ -407,7 +407,7 @@ list_options(cups_dest_t *dest) /* I - Destination to list */ if ((filename = cupsGetPPD(dest->name)) == NULL) { - _cupsLangPrintf(stderr, NULL, + _cupsLangPrintf(stderr, _("lpoptions: Destination %s has no PPD file!\n"), dest->name); return; @@ -416,7 +416,7 @@ list_options(cups_dest_t *dest) /* I - Destination to list */ if ((ppd = ppdOpenFile(filename)) == NULL) { unlink(filename); - _cupsLangPrintf(stderr, NULL, + _cupsLangPrintf(stderr, _("lpoptions: Unable to open PPD file for %s!\n"), dest->name); return; @@ -440,7 +440,7 @@ list_options(cups_dest_t *dest) /* I - Destination to list */ void usage(void) { - _cupsLangPuts(stdout, NULL, + _cupsLangPuts(stdout, _("Usage: lpoptions [-h server] [-E] -d printer\n" " lpoptions [-h server] [-E] [-p printer] -l\n" " lpoptions [-h server] [-E] -p printer -o " @@ -452,5 +452,5 @@ usage(void) /* - * End of "$Id: lpoptions.c 4906 2006-01-10 20:53:28Z mike $". + * End of "$Id: lpoptions.c 4924 2006-01-13 01:55:20Z mike $". */ diff --git a/systemv/lppasswd.c b/systemv/lppasswd.c index 306d29ff5..d9822a07e 100644 --- a/systemv/lppasswd.c +++ b/systemv/lppasswd.c @@ -1,5 +1,5 @@ /* - * "$Id: lppasswd.c 4906 2006-01-10 20:53:28Z mike $" + * "$Id: lppasswd.c 4924 2006-01-13 01:55:20Z mike $" * * MD5 password program for the Common UNIX Printing System (CUPS). * @@ -188,7 +188,7 @@ main(int argc, /* I - Number of command-line arguments */ if (getuid() && getuid() != geteuid() && (op != CHANGE || username)) { - _cupsLangPuts(stderr, NULL, + _cupsLangPuts(stderr, _("lppasswd: Only root can add or delete passwords!\n")); return (1); } @@ -214,7 +214,7 @@ main(int argc, /* I - Number of command-line arguments */ if ((oldpass = strdup(passwd)) == NULL) { - _cupsLangPrintf(stderr, NULL, + _cupsLangPrintf(stderr, _("lppasswd: Unable to copy password string: %s\n"), strerror(errno)); return (1); @@ -232,7 +232,7 @@ main(int argc, /* I - Number of command-line arguments */ if ((newpass = strdup(passwd)) == NULL) { - _cupsLangPrintf(stderr, NULL, + _cupsLangPrintf(stderr, _("lppasswd: Unable to copy password string: %s\n"), strerror(errno)); return (1); @@ -243,7 +243,7 @@ main(int argc, /* I - Number of command-line arguments */ if (strcmp(passwd, newpass) != 0) { - _cupsLangPuts(stderr, NULL, + _cupsLangPuts(stderr, _("lppasswd: Sorry, passwords don't match!\n")); return (1); } @@ -267,7 +267,7 @@ main(int argc, /* I - Number of command-line arguments */ if (strlen(newpass) < 6 || strstr(newpass, username) != NULL || flag != 3) { - _cupsLangPuts(stderr, NULL, + _cupsLangPuts(stderr, _("lppasswd: Sorry, password rejected.\n" "Your password must be at least 6 characters long, " "cannot contain\n" @@ -318,9 +318,9 @@ main(int argc, /* I - Number of command-line arguments */ if ((fd = open(passwdnew, O_WRONLY | O_CREAT | O_EXCL, 0400)) < 0) { if (errno == EEXIST) - _cupsLangPuts(stderr, NULL, _("lppasswd: Password file busy!\n")); + _cupsLangPuts(stderr, _("lppasswd: Password file busy!\n")); else - _cupsLangPrintf(stderr, NULL, + _cupsLangPrintf(stderr, _("lppasswd: Unable to open password file: %s\n"), strerror(errno)); @@ -329,7 +329,7 @@ main(int argc, /* I - Number of command-line arguments */ if ((outfile = fdopen(fd, "w")) == NULL) { - _cupsLangPrintf(stderr, NULL, + _cupsLangPrintf(stderr, _("lppasswd: Unable to open password file: %s\n"), strerror(errno)); @@ -347,7 +347,7 @@ main(int argc, /* I - Number of command-line arguments */ infile = fopen(passwdmd5, "r"); if (infile == NULL && errno != ENOENT && op != ADD) { - _cupsLangPrintf(stderr, NULL, + _cupsLangPrintf(stderr, _("lppasswd: Unable to open password file: %s\n"), strerror(errno)); @@ -382,7 +382,7 @@ main(int argc, /* I - Number of command-line arguments */ if (fputs(line, outfile) == EOF) { - _cupsLangPrintf(stderr, NULL, + _cupsLangPrintf(stderr, _("lppasswd: Unable to write to password file: %s\n"), strerror(errno)); error = 1; @@ -395,7 +395,7 @@ main(int argc, /* I - Number of command-line arguments */ while (fgets(line, sizeof(line), infile) != NULL) if (fputs(line, outfile) == EOF) { - _cupsLangPrintf(stderr, NULL, + _cupsLangPrintf(stderr, _("lppasswd: Unable to write to password file: %s\n"), strerror(errno)); error = 1; @@ -407,7 +407,7 @@ main(int argc, /* I - Number of command-line arguments */ if (op == CHANGE && (strcmp(username, userline) || strcmp(groupname, groupline))) { - _cupsLangPrintf(stderr, NULL, + _cupsLangPrintf(stderr, _("lppasswd: user \"%s\" and group \"%s\" do not exist.\n"), username, groupname); error = 1; @@ -417,7 +417,7 @@ main(int argc, /* I - Number of command-line arguments */ if (oldpass && strcmp(httpMD5(username, "CUPS", oldpass, md5new), md5line) != 0) { - _cupsLangPuts(stderr, NULL, + _cupsLangPuts(stderr, _("lppasswd: Sorry, password doesn't match!\n")); error = 1; } @@ -427,7 +427,7 @@ main(int argc, /* I - Number of command-line arguments */ httpMD5(username, "CUPS", newpass, md5new)); if (fputs(line, outfile) == EOF) { - _cupsLangPrintf(stderr, NULL, + _cupsLangPrintf(stderr, _("lppasswd: Unable to write to password file: %s\n"), strerror(errno)); error = 1; @@ -451,7 +451,7 @@ main(int argc, /* I - Number of command-line arguments */ if (error) { - _cupsLangPuts(stderr, NULL, _("lppasswd: Password file not updated!\n")); + _cupsLangPuts(stderr, _("lppasswd: Password file not updated!\n")); unlink(passwdnew); @@ -465,7 +465,7 @@ main(int argc, /* I - Number of command-line arguments */ unlink(passwdold); if (link(passwdmd5, passwdold) && errno != ENOENT) { - _cupsLangPrintf(stderr, NULL, + _cupsLangPrintf(stderr, _("lppasswd: failed to backup old password file: %s\n"), strerror(errno)); unlink(passwdnew); @@ -478,7 +478,7 @@ main(int argc, /* I - Number of command-line arguments */ if (rename(passwdnew, passwdmd5) < 0) { - _cupsLangPrintf(stderr, NULL, + _cupsLangPrintf(stderr, _("lppasswd: failed to rename password file: %s\n"), strerror(errno)); unlink(passwdnew); @@ -497,21 +497,17 @@ static void usage(FILE *fp) /* I - File to send usage to */ { if (getuid()) - { - _cupsLangPuts(fp, NULL, _("Usage: lppasswd [-g groupname]\n")); - } + _cupsLangPuts(fp, _("Usage: lppasswd [-g groupname]\n")); else - { - _cupsLangPuts(fp, NULL, + _cupsLangPuts(fp, _("Usage: lppasswd [-g groupname] [username]\n" " lppasswd [-g groupname] -a [username]\n" " lppasswd [-g groupname] -x [username]\n")); - } exit(1); } /* - * End of "$Id: lppasswd.c 4906 2006-01-10 20:53:28Z mike $". + * End of "$Id: lppasswd.c 4924 2006-01-13 01:55:20Z mike $". */ diff --git a/systemv/lpstat.c b/systemv/lpstat.c index d789f04e7..ca02571eb 100644 --- a/systemv/lpstat.c +++ b/systemv/lpstat.c @@ -1,5 +1,5 @@ /* - * "$Id: lpstat.c 4922 2006-01-12 22:05:06Z mike $" + * "$Id: lpstat.c 4948 2006-01-19 03:23:41Z mike $" * * "lpstat" command for the Common UNIX Printing System (CUPS). * @@ -52,8 +52,9 @@ * Local functions... */ -static void check_dest(http_t *, const char *, int *, cups_dest_t **); -static http_t *connect_server(http_t *); +static void check_dest(const char *, http_t *, const char *, int *, + cups_dest_t **); +static http_t *connect_server(const char *, http_t *); static int show_accepting(http_t *, const char *, int, cups_dest_t *); static int show_classes(http_t *, const char *); static void show_default(int, cups_dest_t *); @@ -111,7 +112,7 @@ main(int argc, /* I - Number of command-line arguments */ if (http) httpEncryption(http, HTTP_ENCRYPT_REQUIRED); #else - _cupsLangPrintf(stderr, NULL, + _cupsLangPrintf(stderr, _("%s: Sorry, no encryption support compiled in!\n"), argv[0]); #endif /* HAVE_SSL */ @@ -131,6 +132,25 @@ main(int argc, /* I - Number of command-line arguments */ i ++; break; + case 'U' : /* Username */ + if (argv[i][2] != '\0') + cupsSetUser(argv[i] + 2); + else + { + i ++; + if (i >= argc) + { + _cupsLangPrintf(stderr, + _("%s: Error - expected username after " + "\'-U\' option!\n"), + argv[0]); + return (1); + } + + cupsSetUser(argv[i]); + } + break; + case 'W' : /* Show which jobs? */ if (argv[i][2]) which = argv[i] + 2; @@ -140,31 +160,36 @@ main(int argc, /* I - Number of command-line arguments */ if (i >= argc) { - _cupsLangPuts(stderr, NULL, - _("lpstat: Need \"completed\" or " - "\"not-completed\" after -W!\n")); + _cupsLangPrintf(stderr, + _("%s: Error - need \"completed\", " + "\"not-completed\", or \"all\" after " + "\'-W\' option!\n"), + argv[0]); return (1); } which = argv[i]; } - if (strcmp(which, "completed") && strcmp(which, "not-completed")) + if (strcmp(which, "completed") && strcmp(which, "not-completed") && + strcmp(which, "all")) { - _cupsLangPuts(stderr, NULL, - _("lpstat: Need \"completed\" or " - "\"not-completed\" after -W!\n")); + _cupsLangPrintf(stderr, + _("%s: Error - need \"completed\", " + "\"not-completed\", or \"all\" after " + "\'-W\' option!\n"), + argv[0]); return (1); } break; case 'a' : /* Show acceptance status */ op = 'a'; - http = connect_server(http); + http = connect_server(argv[0], http); if (argv[i][2] != '\0') { - check_dest(http, argv[i] + 2, &num_dests, &dests); + check_dest(argv[0], http, argv[i] + 2, &num_dests, &dests); status |= show_accepting(http, argv[i] + 2, num_dests, dests); } @@ -172,7 +197,7 @@ main(int argc, /* I - Number of command-line arguments */ { i ++; - check_dest(http, argv[i], &num_dests, &dests); + check_dest(argv[0], http, argv[i], &num_dests, &dests); status |= show_accepting(http, argv[i], num_dests, dests); } @@ -188,7 +213,7 @@ main(int argc, /* I - Number of command-line arguments */ #ifdef __sgi case 'b' : /* Show both the local and remote status */ op = 'b'; - http = connect_server(http); + http = connect_server(argv[0], http); if (argv[i][2] != '\0') { @@ -201,16 +226,17 @@ main(int argc, /* I - Number of command-line arguments */ * happy... */ - check_dest(http, argv[i] + 2, &num_dests, &dests); + check_dest(argv[0], http, argv[i] + 2, &num_dests, &dests); puts(""); status |= show_jobs(http, argv[i] + 2, NULL, 3, ranking, which); } else { - _cupsLangPuts(stderr, NULL, - _("lpstat: The -b option requires a destination " - "argument.\n")); + _cupsLangPuts(stderr, + _("%s: Error - expected destination after " + "\'-b\' option!\n"), + argv[0]); return (1); } @@ -219,11 +245,11 @@ main(int argc, /* I - Number of command-line arguments */ case 'c' : /* Show classes and members */ op = 'c'; - http = connect_server(http); + http = connect_server(argv[0], http); if (argv[i][2] != '\0') { - check_dest(http, argv[i] + 2, &num_dests, &dests); + check_dest(argv[0], http, argv[i] + 2, &num_dests, &dests); status |= show_classes(http, argv[i] + 2); } @@ -231,7 +257,7 @@ main(int argc, /* I - Number of command-line arguments */ { i ++; - check_dest(http, argv[i], &num_dests, &dests); + check_dest(argv[0], http, argv[i], &num_dests, &dests); status |= show_classes(http, argv[i]); } @@ -241,7 +267,7 @@ main(int argc, /* I - Number of command-line arguments */ case 'd' : /* Show default destination */ op = 'd'; - http = connect_server(http); + http = connect_server(argv[0], http); if (num_dests == 0) num_dests = cupsGetDests2(http, &dests); @@ -270,8 +296,10 @@ main(int argc, /* I - Number of command-line arguments */ if (i >= argc) { - _cupsLangPuts(stderr, NULL, - _("Error: need hostname after \'-h\' option!\n")); + _cupsLangPrintf(stderr, + _("%s: Error - expected hostname after " + "\'-h\' option!\n"), + argv[0]); return (1); } @@ -282,11 +310,11 @@ main(int argc, /* I - Number of command-line arguments */ case 'l' : /* Long status or long job status */ #ifdef __sgi op = 'l'; - http = connect_server(http); + http = connect_server(argv[0], http); if (argv[i][2] != '\0') { - check_dest(http, argv[i] + 2, &num_dests, &dests); + check_dest(argv[0], http, argv[i] + 2, &num_dests, &dests); status |= show_jobs(http, argv[i] + 2, NULL, 3, ranking, which); } @@ -297,11 +325,11 @@ main(int argc, /* I - Number of command-line arguments */ case 'o' : /* Show jobs by destination */ op = 'o'; - http = connect_server(http); + http = connect_server(argv[0], http); if (argv[i][2] != '\0') { - check_dest(http, argv[i] + 2, &num_dests, &dests); + check_dest(argv[0], http, argv[i] + 2, &num_dests, &dests); status |= show_jobs(http, argv[i] + 2, NULL, long_status, ranking, which); @@ -310,7 +338,7 @@ main(int argc, /* I - Number of command-line arguments */ { i ++; - check_dest(http, argv[i], &num_dests, &dests); + check_dest(argv[0], http, argv[i], &num_dests, &dests); status |= show_jobs(http, argv[i], NULL, long_status, ranking, which); @@ -322,11 +350,11 @@ main(int argc, /* I - Number of command-line arguments */ case 'p' : /* Show printers */ op = 'p'; - http = connect_server(http); + http = connect_server(argv[0], http); if (argv[i][2] != '\0') { - check_dest(http, argv[i] + 2, &num_dests, &dests); + check_dest(argv[0], http, argv[i] + 2, &num_dests, &dests); status |= show_printers(http, argv[i] + 2, num_dests, dests, long_status); } @@ -334,7 +362,7 @@ main(int argc, /* I - Number of command-line arguments */ { i ++; - check_dest(http, argv[i], &num_dests, &dests); + check_dest(argv[0], http, argv[i], &num_dests, &dests); status |= show_printers(http, argv[i], num_dests, dests, long_status); } @@ -349,14 +377,14 @@ main(int argc, /* I - Number of command-line arguments */ case 'r' : /* Show scheduler status */ op = 'r'; - http = connect_server(http); + http = connect_server(argv[0], http); show_scheduler(http); break; case 's' : /* Show summary */ op = 's'; - http = connect_server(http); + http = connect_server(argv[0], http); if (num_dests == 0) num_dests = cupsGetDests2(http, &dests); @@ -368,7 +396,7 @@ main(int argc, /* I - Number of command-line arguments */ case 't' : /* Show all info */ op = 't'; - http = connect_server(http); + http = connect_server(argv[0], http); if (num_dests == 0) num_dests = cupsGetDests2(http, &dests); @@ -384,7 +412,7 @@ main(int argc, /* I - Number of command-line arguments */ case 'u' : /* Show jobs by user */ op = 'u'; - http = connect_server(http); + http = connect_server(argv[0], http); if (argv[i][2] != '\0') status |= show_jobs(http, NULL, argv[i] + 2, long_status, @@ -402,11 +430,11 @@ main(int argc, /* I - Number of command-line arguments */ case 'v' : /* Show printer devices */ op = 'v'; - http = connect_server(http); + http = connect_server(argv[0], http); if (argv[i][2] != '\0') { - check_dest(http, argv[i] + 2, &num_dests, &dests); + check_dest(argv[0], http, argv[i] + 2, &num_dests, &dests); status |= show_devices(http, argv[i] + 2, num_dests, dests); } @@ -414,7 +442,7 @@ main(int argc, /* I - Number of command-line arguments */ { i ++; - check_dest(http, argv[i], &num_dests, &dests); + check_dest(argv[0], http, argv[i], &num_dests, &dests); status |= show_devices(http, argv[i], num_dests, dests); } @@ -429,13 +457,14 @@ main(int argc, /* I - Number of command-line arguments */ default : - _cupsLangPrintf(stderr, NULL, - _("lpstat: Unknown option \'%c\'!\n"), argv[i][1]); + _cupsLangPrintf(stderr, + _("%s: Error - unknown option \'%c\'!\n"), + argv[0], argv[i][1]); return (1); } else { - http = connect_server(http); + http = connect_server(argv[0], http); status |= show_jobs(http, argv[i], NULL, long_status, ranking, which); op = 'o'; @@ -443,7 +472,7 @@ main(int argc, /* I - Number of command-line arguments */ if (!op) { - http = connect_server(http); + http = connect_server(argv[0], http); status |= show_jobs(http, NULL, cupsUser(), long_status, ranking, which); } @@ -457,7 +486,8 @@ main(int argc, /* I - Number of command-line arguments */ */ static void -check_dest(http_t *http, /* I - HTTP connection */ +check_dest(const char *command, /* I - Command name */ + http_t *http, /* I - HTTP connection */ const char *name, /* I - Name of printer/class(es) */ int *num_dests, /* IO - Number of destinations */ cups_dest_t **dests) /* IO - Destinations */ @@ -500,9 +530,9 @@ check_dest(http_t *http, /* I - HTTP connection */ *pptr++ = *dptr++; else { - _cupsLangPrintf(stderr, NULL, - _("lpstat: Invalid destination name in list \"%s\"!\n"), - name); + _cupsLangPrintf(stderr, + _("%s: Invalid destination name in list \"%s\"!\n"), + command, name); exit(1); } } @@ -515,8 +545,8 @@ check_dest(http_t *http, /* I - HTTP connection */ if (cupsGetDest(printer, NULL, *num_dests, *dests) == NULL) { - _cupsLangPrintf(stderr, NULL, - _("lpstat: Unknown destination \"%s\"!\n"), printer); + _cupsLangPrintf(stderr, + _("%s: Unknown destination \"%s\"!\n"), command, printer); exit(1); } } @@ -528,7 +558,8 @@ check_dest(http_t *http, /* I - HTTP connection */ */ static http_t * /* O - New HTTP connection */ -connect_server(http_t *http) /* I - Current HTTP connection */ +connect_server(const char *command, /* I - Command name */ + http_t *http) /* I - Current HTTP connection */ { if (!http) { @@ -537,9 +568,7 @@ connect_server(http_t *http) /* I - Current HTTP connection */ if (http == NULL) { - _cupsLangPrintf(stderr, NULL, - _("lpstat: Unable to connect to server %s on port %d: %s\n"), - cupsServer(), ippPort(), strerror(errno)); + _cupsLangPrintf(stderr, _("%s: Unable to connect to server\n"), command); exit(1); } } @@ -565,12 +594,16 @@ show_accepting(http_t *http, /* I - HTTP connection to server */ const char *printer, /* Printer name */ *message; /* Printer device URI */ int accepting; /* Accepting requests? */ + time_t ptime; /* Printer state time */ + struct tm *pdate; /* Printer state date & time */ + char printer_state_time[255];/* Printer state time */ const char *dptr, /* Pointer into destination list */ *ptr; /* Pointer into printer name */ int match; /* Non-zero if this job matches */ static const char *pattrs[] = /* Attributes we need for printers... */ { "printer-name", + "printer-state-change-time", "printer-state-message", "printer-is-accepting-jobs" }; @@ -581,7 +614,7 @@ show_accepting(http_t *http, /* I - HTTP connection to server */ if (http == NULL) return (1); - if (printers != NULL && strcmp(printers, "all") == 0) + if (printers != NULL && !strcmp(printers, "all")) printers = NULL; /* @@ -591,6 +624,7 @@ show_accepting(http_t *http, /* I - HTTP connection to server */ * attributes-charset * attributes-natural-language * requested-attributes + * requesting-user-name */ request = ippNewRequest(CUPS_GET_PRINTERS); @@ -599,6 +633,9 @@ show_accepting(http_t *http, /* I - HTTP connection to server */ "requested-attributes", sizeof(pattrs) / sizeof(pattrs[0]), NULL, pattrs); + ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "requesting-user-name", + NULL, cupsUser()); + /* * Do the request and get back a response... */ @@ -609,9 +646,7 @@ show_accepting(http_t *http, /* I - HTTP connection to server */ if (response->request.status.status_code > IPP_OK_CONFLICT) { - _cupsLangPrintf(stderr, NULL, - _("lpstat: get-printers failed: %s\n"), - ippErrorString(response->request.status.status_code)); + _cupsLangPrintf(stderr, "lpstat: %s\n", cupsLastErrorString()); ippDelete(response); return (1); } @@ -640,19 +675,21 @@ show_accepting(http_t *http, /* I - HTTP connection to server */ printer = NULL; message = NULL; accepting = 1; + ptime = 0; while (attr != NULL && attr->group_tag == IPP_TAG_PRINTER) { if (!strcmp(attr->name, "printer-name") && attr->value_tag == IPP_TAG_NAME) printer = attr->values[0].string.text; - - if (!strcmp(attr->name, "printer-state-message") && - attr->value_tag == IPP_TAG_TEXT) + else if (!strcmp(attr->name, "printer-state-change-time") && + attr->value_tag == IPP_TAG_INTEGER) + ptime = (time_t)attr->values[0].integer; + else if (!strcmp(attr->name, "printer-state-message") && + attr->value_tag == IPP_TAG_TEXT) message = attr->values[0].string.text; - - if (!strcmp(attr->name, "printer-is-accepting-jobs") && - attr->value_tag == IPP_TAG_BOOLEAN) + else if (!strcmp(attr->name, "printer-is-accepting-jobs") && + attr->value_tag == IPP_TAG_BOOLEAN) accepting = attr->values[0].boolean; attr = attr->next; @@ -724,28 +761,28 @@ show_accepting(http_t *http, /* I - HTTP connection to server */ if (match) { + pdate = localtime(&ptime); + strftime(printer_state_time, sizeof(printer_state_time), "%c", pdate); + if (accepting) - _cupsLangPrintf(stdout, NULL, - _("%s accepting requests since Jan 01 00:00\n"), - printer); + _cupsLangPrintf(stdout, _("%s accepting requests since %s\n"), + printer, printer_state_time); else - _cupsLangPrintf(stdout, NULL, - _("%s not accepting requests since Jan 01 00:00 -\n" - "\t%s\n"), - printer, message == NULL ? "reason unknown" : message); + _cupsLangPrintf(stdout, _("%s not accepting requests since %s -\n" + "\t%s\n"), + printer, printer_state_time, + message == NULL ? "reason unknown" : message); for (i = 0; i < num_dests; i ++) if (!strcasecmp(dests[i].name, printer) && dests[i].instance) { if (accepting) - _cupsLangPrintf(stdout, NULL, - _("%s/%s accepting requests since Jan 01 00:00\n"), - printer, dests[i].instance); + _cupsLangPrintf(stdout, _("%s/%s accepting requests since %s\n"), + printer, dests[i].instance, printer_state_time); else - _cupsLangPrintf(stdout, NULL, - _("%s/%s not accepting requests since " - "Jan 01 00:00 -\n\t%s\n"), - printer, dests[i].instance, + _cupsLangPrintf(stdout, _("%s/%s not accepting requests since " + "%s -\n\t%s\n"), + printer, dests[i].instance, printer_state_time, message == NULL ? "reason unknown" : message); } } @@ -758,8 +795,7 @@ show_accepting(http_t *http, /* I - HTTP connection to server */ } else { - _cupsLangPrintf(stderr, NULL, _("lpstat: get-printers failed: %s\n"), - ippErrorString(cupsLastError())); + _cupsLangPrintf(stderr, "lpstat: %s\n", cupsLastErrorString()); return (1); } @@ -805,7 +841,7 @@ show_classes(http_t *http, /* I - HTTP connection to server */ if (http == NULL) return (1); - if (dests != NULL && strcmp(dests, "all") == 0) + if (dests != NULL && !strcmp(dests, "all")) dests = NULL; /* @@ -815,6 +851,7 @@ show_classes(http_t *http, /* I - HTTP connection to server */ * attributes-charset * attributes-natural-language * requested-attributes + * requesting-user-name */ request = ippNewRequest(CUPS_GET_CLASSES); @@ -823,6 +860,9 @@ show_classes(http_t *http, /* I - HTTP connection to server */ "requested-attributes", sizeof(cattrs) / sizeof(cattrs[0]), NULL, cattrs); + ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "requesting-user-name", + NULL, cupsUser()); + /* * Do the request and get back a response... */ @@ -833,9 +873,7 @@ show_classes(http_t *http, /* I - HTTP connection to server */ if (response->request.status.status_code > IPP_OK_CONFLICT) { - _cupsLangPrintf(stderr, NULL, - _("lpstat: get-classes failed: %s\n"), - ippErrorString(response->request.status.status_code)); + _cupsLangPrintf(stderr, "lpstat: %s\n", cupsLastErrorString()); ippDelete(response); return (1); } @@ -917,7 +955,8 @@ show_classes(http_t *http, /* I - HTTP connection to server */ "printer-uri", NULL, printer_uri); ippAddStrings(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD, - "requested-attributes", sizeof(cattrs) / sizeof(cattrs[0]), + "requested-attributes", + sizeof(cattrs) / sizeof(cattrs[0]), NULL, cattrs); if ((response2 = cupsDoRequest(http2, request, "/")) != NULL) @@ -997,16 +1036,16 @@ show_classes(http_t *http, /* I - HTTP connection to server */ if (match) { - _cupsLangPrintf(stdout, NULL, _("members of class %s:\n"), printer); + _cupsLangPrintf(stdout, _("members of class %s:\n"), printer); if (members) { for (i = 0; i < members->num_values; i ++) - _cupsLangPrintf(stdout, NULL, "\t%s\n", + _cupsLangPrintf(stdout, "\t%s\n", members->values[i].string.text); } else - _cupsLangPuts(stdout, NULL, "\tunknown\n"); + _cupsLangPuts(stdout, "\tunknown\n"); } if (response2) @@ -1020,8 +1059,7 @@ show_classes(http_t *http, /* I - HTTP connection to server */ } else { - _cupsLangPrintf(stderr, NULL, _("lpstat: get-classes failed: %s\n"), - ippErrorString(cupsLastError())); + _cupsLangPrintf(stderr, "lpstat: %s\n", cupsLastErrorString()); return (1); } @@ -1044,10 +1082,10 @@ show_default(int num_dests, /* I - Number of user-defined dests */ if ((dest = cupsGetDest(NULL, NULL, num_dests, dests)) != NULL) { if (dest->instance) - _cupsLangPrintf(stdout, NULL, _("system default destination: %s/%s\n"), + _cupsLangPrintf(stdout, _("system default destination: %s/%s\n"), dest->name, dest->instance); else - _cupsLangPrintf(stdout, NULL, _("system default destination: %s\n"), + _cupsLangPrintf(stdout, _("system default destination: %s\n"), dest->name); } else @@ -1068,12 +1106,12 @@ show_default(int num_dests, /* I - Number of user-defined dests */ val = "LPDEST"; if (printer && !cupsGetDest(printer, NULL, num_dests, dests)) - _cupsLangPrintf(stdout, NULL, + _cupsLangPrintf(stdout, _("lpstat: error - %s environment variable names " "non-existent destination \"%s\"!\n"), val, printer); else - _cupsLangPuts(stdout, NULL, _("no system default destination\n")); + _cupsLangPuts(stdout, _("no system default destination\n")); } } @@ -1111,7 +1149,7 @@ show_devices(http_t *http, /* I - HTTP connection to server */ if (http == NULL) return (1); - if (printers != NULL && strcmp(printers, "all") == 0) + if (printers != NULL && !strcmp(printers, "all")) printers = NULL; /* @@ -1121,6 +1159,7 @@ show_devices(http_t *http, /* I - HTTP connection to server */ * attributes-charset * attributes-natural-language * requested-attributes + * requesting-user-name */ request = ippNewRequest(CUPS_GET_PRINTERS); @@ -1129,6 +1168,9 @@ show_devices(http_t *http, /* I - HTTP connection to server */ "requested-attributes", sizeof(pattrs) / sizeof(pattrs[0]), NULL, pattrs); + ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "requesting-user-name", + NULL, cupsUser()); + /* * Do the request and get back a response... */ @@ -1139,8 +1181,7 @@ show_devices(http_t *http, /* I - HTTP connection to server */ if (response->request.status.status_code > IPP_OK_CONFLICT) { - _cupsLangPrintf(stderr, NULL, _("lpstat: get-printers failed: %s\n"), - ippErrorString(response->request.status.status_code)); + _cupsLangPrintf(stderr, "lpstat: %s\n", cupsLastErrorString()); ippDelete(response); return (1); } @@ -1264,17 +1305,17 @@ show_devices(http_t *http, /* I - HTTP connection to server */ if (device == NULL) { httpSeparate(uri, method, username, hostname, &port, resource); - _cupsLangPrintf(stdout, NULL, + _cupsLangPrintf(stdout, _("Output for printer %s is sent to remote " "printer %s on %s\n"), printer, strrchr(resource, '/') + 1, hostname); } - else if (strncmp(device, "file:", 5) == 0) - _cupsLangPrintf(stdout, NULL, + else if (!strncmp(device, "file:", 5)) + _cupsLangPrintf(stdout, _("Output for printer %s is sent to %s\n"), printer, device + 5); else - _cupsLangPrintf(stdout, NULL, + _cupsLangPrintf(stdout, _("Output for printer %s is sent to %s\n"), printer, device); @@ -1282,42 +1323,42 @@ show_devices(http_t *http, /* I - HTTP connection to server */ if (!strcasecmp(printer, dests[i].name) && dests[i].instance) { if (device == NULL) - _cupsLangPrintf(stdout, NULL, + _cupsLangPrintf(stdout, _("Output for printer %s/%s is sent to " "remote printer %s on %s\n"), printer, dests[i].instance, strrchr(resource, '/') + 1, hostname); else if (!strncmp(device, "file:", 5)) - _cupsLangPrintf(stdout, NULL, + _cupsLangPrintf(stdout, _("Output for printer %s/%s is sent to %s\n"), printer, dests[i].instance, device + 5); else - _cupsLangPrintf(stdout, NULL, + _cupsLangPrintf(stdout, _("Output for printer %s/%s is sent to %s\n"), printer, dests[i].instance, device); } #else if (device == NULL) - _cupsLangPrintf(stdout, NULL, _("device for %s: %s\n"), + _cupsLangPrintf(stdout, _("device for %s: %s\n"), printer, uri); else if (!strncmp(device, "file:", 5)) - _cupsLangPrintf(stdout, NULL, _("device for %s: %s\n"), + _cupsLangPrintf(stdout, _("device for %s: %s\n"), printer, device + 5); else - _cupsLangPrintf(stdout, NULL, _("device for %s: %s\n"), + _cupsLangPrintf(stdout, _("device for %s: %s\n"), printer, device); for (i = 0; i < num_dests; i ++) if (!strcasecmp(printer, dests[i].name) && dests[i].instance) { if (device == NULL) - _cupsLangPrintf(stdout, NULL, _("device for %s/%s: %s\n"), + _cupsLangPrintf(stdout, _("device for %s/%s: %s\n"), printer, dests[i].instance, uri); else if (!strncmp(device, "file:", 5)) - _cupsLangPrintf(stdout, NULL, _("device for %s/%s: %s\n"), + _cupsLangPrintf(stdout, _("device for %s/%s: %s\n"), printer, dests[i].instance, device + 5); else - _cupsLangPrintf(stdout, NULL, _("device for %s/%s: %s\n"), + _cupsLangPrintf(stdout, _("device for %s/%s: %s\n"), printer, dests[i].instance, device); } #endif /* __osf__ */ @@ -1331,8 +1372,7 @@ show_devices(http_t *http, /* I - HTTP connection to server */ } else { - _cupsLangPrintf(stderr, NULL, _("lpstat: get-printers failed: %s\n"), - ippErrorString(cupsLastError())); + _cupsLangPrintf(stderr, "lpstat: %s\n", cupsLastErrorString()); return (1); } @@ -1384,7 +1424,7 @@ show_jobs(http_t *http, /* I - HTTP connection to server */ if (http == NULL) return (1); - if (dests != NULL && strcmp(dests, "all") == 0) + if (dests != NULL && !strcmp(dests, "all")) dests = NULL; /* @@ -1421,8 +1461,7 @@ show_jobs(http_t *http, /* I - HTTP connection to server */ if (response->request.status.status_code > IPP_OK_CONFLICT) { - _cupsLangPrintf(stderr, NULL, _("lpstat: get-jobs failed: %s\n"), - ippErrorString(response->request.status.status_code)); + _cupsLangPrintf(stderr, "lpstat: %s\n", cupsLastErrorString()); ippDelete(response); return (1); } @@ -1454,28 +1493,28 @@ show_jobs(http_t *http, /* I - HTTP connection to server */ while (attr != NULL && attr->group_tag == IPP_TAG_JOB) { - if (strcmp(attr->name, "job-id") == 0 && + if (!strcmp(attr->name, "job-id") && attr->value_tag == IPP_TAG_INTEGER) jobid = attr->values[0].integer; - if (strcmp(attr->name, "job-k-octets") == 0 && + if (!strcmp(attr->name, "job-k-octets") && attr->value_tag == IPP_TAG_INTEGER) size = attr->values[0].integer; - if (strcmp(attr->name, "time-at-creation") == 0 && + if (!strcmp(attr->name, "time-at-creation") && attr->value_tag == IPP_TAG_INTEGER) jobtime = attr->values[0].integer; - if (strcmp(attr->name, "job-printer-uri") == 0 && + if (!strcmp(attr->name, "job-printer-uri") && attr->value_tag == IPP_TAG_URI) if ((dest = strrchr(attr->values[0].string.text, '/')) != NULL) dest ++; - if (strcmp(attr->name, "job-originating-user-name") == 0 && + if (!strcmp(attr->name, "job-originating-user-name") && attr->value_tag == IPP_TAG_NAME) username = attr->values[0].string.text; - if (strcmp(attr->name, "job-name") == 0 && + if (!strcmp(attr->name, "job-name") && attr->value_tag == IPP_TAG_NAME) title = attr->values[0].string.text; @@ -1603,7 +1642,7 @@ show_jobs(http_t *http, /* I - HTTP connection to server */ if (!strftime(date, sizeof(date), "%b %d %H:%M", jobdate)) strcpy(date, "Unknown"); - _cupsLangPrintf(stdout, NULL, "%s;%s;%d;%s;%s\n", + _cupsLangPrintf(stdout, "%s;%s;%d;%s;%s\n", temp, username ? username : "unknown", size, title ? title : "unknown", date); } @@ -1613,15 +1652,15 @@ show_jobs(http_t *http, /* I - HTTP connection to server */ strcpy(date, "Unknown"); if (ranking) - _cupsLangPrintf(stdout, NULL, "%3d %-21s %-13s %8.0f %s\n", + _cupsLangPrintf(stdout, "%3d %-21s %-13s %8.0f %s\n", rank, temp, username ? username : "unknown", 1024.0 * size, date); else - _cupsLangPrintf(stdout, NULL, "%-23s %-13s %8.0f %s\n", + _cupsLangPrintf(stdout, "%-23s %-13s %8.0f %s\n", temp, username ? username : "unknown", 1024.0 * size, date); if (long_status) - _cupsLangPrintf(stdout, NULL, _("\tqueued for %s\n"), dest); + _cupsLangPrintf(stdout, _("\tqueued for %s\n"), dest); } } @@ -1633,8 +1672,7 @@ show_jobs(http_t *http, /* I - HTTP connection to server */ } else { - _cupsLangPrintf(stderr, NULL, _("lpstat: get-jobs failed: %s\n"), - ippErrorString(cupsLastError())); + _cupsLangPrintf(stderr, "lpstat: %s\n", cupsLastErrorString()); return (1); } @@ -1709,7 +1747,7 @@ show_printers(http_t *http, /* I - HTTP connection to server */ if ((root = getenv("CUPS_SERVERROOT")) == NULL) root = CUPS_SERVERROOT; - if (printers != NULL && strcmp(printers, "all") == 0) + if (printers != NULL && !strcmp(printers, "all")) printers = NULL; /* @@ -1719,6 +1757,7 @@ show_printers(http_t *http, /* I - HTTP connection to server */ * attributes-charset * attributes-natural-language * requested-attributes + * requesting-user-name */ request = ippNewRequest(CUPS_GET_PRINTERS); @@ -1727,6 +1766,9 @@ show_printers(http_t *http, /* I - HTTP connection to server */ "requested-attributes", sizeof(pattrs) / sizeof(pattrs[0]), NULL, pattrs); + ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "requesting-user-name", + NULL, cupsUser()); + /* * Do the request and get back a response... */ @@ -1737,8 +1779,7 @@ show_printers(http_t *http, /* I - HTTP connection to server */ if (response->request.status.status_code > IPP_OK_CONFLICT) { - _cupsLangPrintf(stderr, NULL, _("lpstat: get-printers failed: %s\n"), - ippErrorString(response->request.status.status_code)); + _cupsLangPrintf(stderr, "lpstat: %s\n", cupsLastErrorString()); ippDelete(response); return (1); } @@ -1954,18 +1995,18 @@ show_printers(http_t *http, /* I - HTTP connection to server */ switch (pstate) { case IPP_PRINTER_IDLE : - _cupsLangPrintf(stdout, NULL, + _cupsLangPrintf(stdout, _("printer %s is idle. enabled since %s\n"), printer, printer_state_time); break; case IPP_PRINTER_PROCESSING : - _cupsLangPrintf(stdout, NULL, + _cupsLangPrintf(stdout, _("printer %s now printing %s-%d. " "enabled since %s\n"), printer, printer, jobid, printer_state_time); break; case IPP_PRINTER_STOPPED : - _cupsLangPrintf(stdout, NULL, + _cupsLangPrintf(stdout, _("printer %s disabled since %s -\n"), printer, printer_state_time); break; @@ -1974,87 +2015,87 @@ show_printers(http_t *http, /* I - HTTP connection to server */ if ((message && *message) || pstate == IPP_PRINTER_STOPPED) { if (!message || !*message) - _cupsLangPuts(stdout, NULL, _("\treason unknown\n")); + _cupsLangPuts(stdout, _("\treason unknown\n")); else - _cupsLangPrintf(stdout, NULL, "\t%s\n", message); + _cupsLangPrintf(stdout, "\t%s\n", message); } if (long_status > 1) - _cupsLangPuts(stdout, NULL, + _cupsLangPuts(stdout, _("\tForm mounted:\n" "\tContent types: any\n" "\tPrinter types: unknown\n")); if (long_status) { - _cupsLangPrintf(stdout, NULL, _("\tDescription: %s\n"), + _cupsLangPrintf(stdout, _("\tDescription: %s\n"), description ? description : ""); if (reasons) { - _cupsLangPuts(stdout, NULL, _("\tAlerts:")); + _cupsLangPuts(stdout, _("\tAlerts:")); for (i = 0; i < reasons->num_values; i ++) - _cupsLangPrintf(stdout, NULL, " %s", + _cupsLangPrintf(stdout, " %s", reasons->values[i].string.text); - _cupsLangPuts(stdout, NULL, "\n"); + _cupsLangPuts(stdout, "\n"); } } if (long_status > 1) { - _cupsLangPrintf(stdout, NULL, _("\tLocation: %s\n"), + _cupsLangPrintf(stdout, _("\tLocation: %s\n"), location ? location : ""); if (ptype & CUPS_PRINTER_REMOTE) { - _cupsLangPuts(stdout, NULL, _("\tConnection: remote\n")); + _cupsLangPuts(stdout, _("\tConnection: remote\n")); if (make_model && !strstr(make_model, "System V Printer") && !strstr(make_model, "Raw Printer") && uri) - _cupsLangPrintf(stdout, NULL, _("\tInterface: %s.ppd\n"), + _cupsLangPrintf(stdout, _("\tInterface: %s.ppd\n"), uri); } else { - _cupsLangPuts(stdout, NULL, _("\tConnection: direct\n")); + _cupsLangPuts(stdout, _("\tConnection: direct\n")); if (make_model && strstr(make_model, "System V Printer")) - _cupsLangPrintf(stdout, NULL, + _cupsLangPrintf(stdout, _("\tInterface: %s/interfaces/%s\n"), root, printer); else if (make_model && !strstr(make_model, "Raw Printer")) - _cupsLangPrintf(stdout, NULL, + _cupsLangPrintf(stdout, _("\tInterface: %s/ppd/%s.ppd\n"), root, printer); } - _cupsLangPuts(stdout, NULL, _("\tOn fault: no alert\n")); - _cupsLangPuts(stdout, NULL, _("\tAfter fault: continue\n")); + _cupsLangPuts(stdout, _("\tOn fault: no alert\n")); + _cupsLangPuts(stdout, _("\tAfter fault: continue\n")); // TODO update to use printer-error-policy if (allowed) { - _cupsLangPuts(stdout, NULL, _("\tUsers allowed:\n")); + _cupsLangPuts(stdout, _("\tUsers allowed:\n")); for (i = 0; i < allowed->num_values; i ++) - _cupsLangPrintf(stdout, NULL, "\t\t%s\n", + _cupsLangPrintf(stdout, "\t\t%s\n", allowed->values[i].string.text); } else if (denied) { - _cupsLangPuts(stdout, NULL, _("\tUsers denied:\n")); + _cupsLangPuts(stdout, _("\tUsers denied:\n")); for (i = 0; i < denied->num_values; i ++) - _cupsLangPrintf(stdout, NULL, "\t\t%s\n", + _cupsLangPrintf(stdout, "\t\t%s\n", denied->values[i].string.text); } else { - _cupsLangPuts(stdout, NULL, _("\tUsers allowed:\n")); - _cupsLangPuts(stdout, NULL, _("\t\t(all)\n")); + _cupsLangPuts(stdout, _("\tUsers allowed:\n")); + _cupsLangPuts(stdout, _("\t\t(all)\n")); } - _cupsLangPuts(stdout, NULL, _("\tForms allowed:\n")); - _cupsLangPuts(stdout, NULL, _("\t\t(none)\n")); - _cupsLangPuts(stdout, NULL, _("\tBanner required\n")); - _cupsLangPuts(stdout, NULL, _("\tCharset sets:\n")); - _cupsLangPuts(stdout, NULL, _("\t\t(none)\n")); - _cupsLangPuts(stdout, NULL, _("\tDefault pitch:\n")); - _cupsLangPuts(stdout, NULL, _("\tDefault page size:\n")); - _cupsLangPuts(stdout, NULL, _("\tDefault port settings:\n")); + _cupsLangPuts(stdout, _("\tForms allowed:\n")); + _cupsLangPuts(stdout, _("\t\t(none)\n")); + _cupsLangPuts(stdout, _("\tBanner required\n")); + _cupsLangPuts(stdout, _("\tCharset sets:\n")); + _cupsLangPuts(stdout, _("\t\t(none)\n")); + _cupsLangPuts(stdout, _("\tDefault pitch:\n")); + _cupsLangPuts(stdout, _("\tDefault page size:\n")); + _cupsLangPuts(stdout, _("\tDefault port settings:\n")); } for (i = 0; i < num_dests; i ++) @@ -2063,21 +2104,21 @@ show_printers(http_t *http, /* I - HTTP connection to server */ switch (pstate) { case IPP_PRINTER_IDLE : - _cupsLangPrintf(stdout, NULL, + _cupsLangPrintf(stdout, _("printer %s/%s is idle. " "enabled since %s\n"), printer, dests[i].instance, printer_state_time); break; case IPP_PRINTER_PROCESSING : - _cupsLangPrintf(stdout, NULL, + _cupsLangPrintf(stdout, _("printer %s/%s now printing %s-%d. " "enabled since %s\n"), printer, dests[i].instance, printer, jobid, printer_state_time); break; case IPP_PRINTER_STOPPED : - _cupsLangPrintf(stdout, NULL, + _cupsLangPrintf(stdout, _("printer %s/%s disabled since %s -\n"), printer, dests[i].instance, printer_state_time); @@ -2087,87 +2128,87 @@ show_printers(http_t *http, /* I - HTTP connection to server */ if ((message && *message) || pstate == IPP_PRINTER_STOPPED) { if (!message || !*message) - _cupsLangPuts(stdout, NULL, _("\treason unknown\n")); + _cupsLangPuts(stdout, _("\treason unknown\n")); else - _cupsLangPrintf(stdout, NULL, "\t%s\n", message); + _cupsLangPrintf(stdout, "\t%s\n", message); } if (long_status > 1) - _cupsLangPuts(stdout, NULL, + _cupsLangPuts(stdout, _("\tForm mounted:\n" "\tContent types: any\n" "\tPrinter types: unknown\n")); if (long_status) { - _cupsLangPrintf(stdout, NULL, _("\tDescription: %s\n"), + _cupsLangPrintf(stdout, _("\tDescription: %s\n"), description ? description : ""); if (reasons) { - _cupsLangPuts(stdout, NULL, _("\tAlerts:")); + _cupsLangPuts(stdout, _("\tAlerts:")); for (i = 0; i < reasons->num_values; i ++) - _cupsLangPrintf(stdout, NULL, " %s", + _cupsLangPrintf(stdout, " %s", reasons->values[i].string.text); - _cupsLangPuts(stdout, NULL, "\n"); + _cupsLangPuts(stdout, "\n"); } } if (long_status > 1) { - _cupsLangPrintf(stdout, NULL, _("\tLocation: %s\n"), + _cupsLangPrintf(stdout, _("\tLocation: %s\n"), location ? location : ""); if (ptype & CUPS_PRINTER_REMOTE) { - _cupsLangPuts(stdout, NULL, _("\tConnection: remote\n")); + _cupsLangPuts(stdout, _("\tConnection: remote\n")); if (make_model && !strstr(make_model, "System V Printer") && !strstr(make_model, "Raw Printer") && uri) - _cupsLangPrintf(stdout, NULL, _("\tInterface: %s.ppd\n"), + _cupsLangPrintf(stdout, _("\tInterface: %s.ppd\n"), uri); } else { - _cupsLangPuts(stdout, NULL, _("\tConnection: direct\n")); + _cupsLangPuts(stdout, _("\tConnection: direct\n")); if (make_model && strstr(make_model, "System V Printer")) - _cupsLangPrintf(stdout, NULL, + _cupsLangPrintf(stdout, _("\tInterface: %s/interfaces/%s\n"), root, printer); else if (make_model && !strstr(make_model, "Raw Printer")) - _cupsLangPrintf(stdout, NULL, + _cupsLangPrintf(stdout, _("\tInterface: %s/ppd/%s.ppd\n"), root, printer); } - _cupsLangPuts(stdout, NULL, _("\tOn fault: no alert\n")); - _cupsLangPuts(stdout, NULL, _("\tAfter fault: continue\n")); + _cupsLangPuts(stdout, _("\tOn fault: no alert\n")); + _cupsLangPuts(stdout, _("\tAfter fault: continue\n")); // TODO update to use printer-error-policy if (allowed) { - _cupsLangPuts(stdout, NULL, _("\tUsers allowed:\n")); + _cupsLangPuts(stdout, _("\tUsers allowed:\n")); for (i = 0; i < allowed->num_values; i ++) - _cupsLangPrintf(stdout, NULL, "\t\t%s\n", + _cupsLangPrintf(stdout, "\t\t%s\n", allowed->values[i].string.text); } else if (denied) { - _cupsLangPuts(stdout, NULL, _("\tUsers denied:\n")); + _cupsLangPuts(stdout, _("\tUsers denied:\n")); for (i = 0; i < denied->num_values; i ++) - _cupsLangPrintf(stdout, NULL, "\t\t%s\n", + _cupsLangPrintf(stdout, "\t\t%s\n", denied->values[i].string.text); } else { - _cupsLangPuts(stdout, NULL, _("\tUsers allowed:\n")); - _cupsLangPuts(stdout, NULL, _("\t\t(all)\n")); + _cupsLangPuts(stdout, _("\tUsers allowed:\n")); + _cupsLangPuts(stdout, _("\t\t(all)\n")); } - _cupsLangPuts(stdout, NULL, _("\tForms allowed:\n")); - _cupsLangPuts(stdout, NULL, _("\t\t(none)\n")); - _cupsLangPuts(stdout, NULL, _("\tBanner required\n")); - _cupsLangPuts(stdout, NULL, _("\tCharset sets:\n")); - _cupsLangPuts(stdout, NULL, _("\t\t(none)\n")); - _cupsLangPuts(stdout, NULL, _("\tDefault pitch:\n")); - _cupsLangPuts(stdout, NULL, _("\tDefault page size:\n")); - _cupsLangPuts(stdout, NULL, _("\tDefault port settings:\n")); + _cupsLangPuts(stdout, _("\tForms allowed:\n")); + _cupsLangPuts(stdout, _("\t\t(none)\n")); + _cupsLangPuts(stdout, _("\tBanner required\n")); + _cupsLangPuts(stdout, _("\tCharset sets:\n")); + _cupsLangPuts(stdout, _("\t\t(none)\n")); + _cupsLangPuts(stdout, _("\tDefault pitch:\n")); + _cupsLangPuts(stdout, _("\tDefault page size:\n")); + _cupsLangPuts(stdout, _("\tDefault port settings:\n")); } } } @@ -2180,8 +2221,7 @@ show_printers(http_t *http, /* I - HTTP connection to server */ } else { - _cupsLangPrintf(stderr, NULL, _("lpstat: get-printers failed: %s\n"), - ippErrorString(cupsLastError())); + _cupsLangPrintf(stderr, "lpstat: %s\n", cupsLastErrorString()); return (1); } @@ -2197,12 +2237,12 @@ static void show_scheduler(http_t *http) /* I - HTTP connection to server */ { if (http) - _cupsLangPuts(stdout, NULL, _("scheduler is running\n")); + _cupsLangPuts(stdout, _("scheduler is running\n")); else - _cupsLangPuts(stdout, NULL, _("scheduler is not running\n")); + _cupsLangPuts(stdout, _("scheduler is not running\n")); } /* - * End of "$Id: lpstat.c 4922 2006-01-12 22:05:06Z mike $". + * End of "$Id: lpstat.c 4948 2006-01-19 03:23:41Z mike $". */ diff --git a/templates/Makefile b/templates/Makefile index 4225d336c..31f7d7dce 100644 --- a/templates/Makefile +++ b/templates/Makefile @@ -1,5 +1,5 @@ # -# "$Id: Makefile 4881 2005-12-15 22:03:40Z mike $" +# "$Id: Makefile 4950 2006-01-19 16:07:57Z mike $" # # Template makefile for the Common UNIX Printing System (CUPS). # @@ -28,9 +28,9 @@ include ../Makedefs # Template files... # -FILES = add-class.tmpl \ +FILES = \ + add-class.tmpl \ add-printer.tmpl \ - admin-op.tmpl \ admin.tmpl \ choose-device.tmpl \ choose-make.tmpl \ @@ -40,18 +40,23 @@ FILES = add-class.tmpl \ class-added.tmpl \ class-confirm.tmpl \ class-deleted.tmpl \ - classes.tmpl \ + class-jobs-header.tmpl \ class-modified.tmpl \ + classes.tmpl \ + classes-header.tmpl \ edit-config.tmpl \ error.tmpl \ + error-op.tmpl \ header.tmpl \ help-header.tmpl \ job-cancel.tmpl \ job-hold.tmpl \ - job-op.tmpl \ + job-move.tmpl \ + job-moved.tmpl \ job-release.tmpl \ job-restart.tmpl \ jobs.tmpl \ + jobs-header.tmpl \ modify-class.tmpl \ modify-printer.tmpl \ option-boolean.tmpl \ @@ -60,19 +65,23 @@ FILES = add-class.tmpl \ option-pickmany.tmpl \ option-pickone.tmpl \ option-trailer.tmpl \ + pager.tmpl \ printer-accept.tmpl \ printer-added.tmpl \ printer-configured.tmpl \ printer-confirm.tmpl \ printer-default.tmpl \ printer-deleted.tmpl \ + printer-jobs-header.tmpl \ printer-modified.tmpl \ printer-purge.tmpl \ printer-reject.tmpl \ printer-start.tmpl \ - printers.tmpl \ printer-stop.tmpl \ + printers.tmpl \ + printers-header.tmpl \ restart.tmpl \ + search.tmpl \ set-printer-options-header.tmpl \ set-printer-options-trailer.tmpl \ test-page.tmpl \ @@ -98,7 +107,7 @@ clean: # Install files... # -install: +install: all $(INSTALL_DIR) $(DATADIR)/templates for file in $(FILES); do \ $(INSTALL_DATA) $$file $(DATADIR)/templates; \ @@ -106,5 +115,5 @@ install: # -# End of "$Id: Makefile 4881 2005-12-15 22:03:40Z mike $". +# End of "$Id: Makefile 4950 2006-01-19 16:07:57Z mike $". # diff --git a/templates/add-class.tmpl b/templates/add-class.tmpl index ec13434e9..a1b1689ee 100644 --- a/templates/add-class.tmpl +++ b/templates/add-class.tmpl @@ -26,7 +26,7 @@ </TR> <TR> <TD></TD> -<TD><INPUT TYPE="IMAGE" SRC="/images/continue.gif" ALT="Continue"></TD> +<TD><INPUT TYPE="IMAGE" SRC="/images/add-class.gif" ALT="Add Class"></TD> </TR> </TABLE> diff --git a/templates/admin-op.tmpl b/templates/admin-op.tmpl deleted file mode 100644 index 16699f815..000000000 --- a/templates/admin-op.tmpl +++ /dev/null @@ -1 +0,0 @@ -<P>Unsupported administration operation "{op}". diff --git a/templates/admin.tmpl b/templates/admin.tmpl index af88e33b3..989c46be2 100644 --- a/templates/admin.tmpl +++ b/templates/admin.tmpl @@ -1,22 +1,6 @@ <TABLE CELLPADDING="0" CELLSPACING="0" CLASS="button" WIDTH="100%"> <TR><TD VALIGN="TOP" NOWRAP> -<H2 CLASS="title">Classes</H2> - -<P> -<A HREF="/admin?op=add-class"><IMG SRC="/images/add-class.gif" -ALT="Add Class" CLASS="button"></A> -<A HREF="/classes/"><IMG SRC="/images/manage-classes.gif" -ALT="Manage Classes" CLASS="button"></A> -</P> - -<H2 CLASS="title">Jobs</H2> - -<P> -<A HREF="/jobs/"><IMG SRC="/images/manage-jobs.gif" ALT="Manage -Jobs" CLASS="button"></A> -</P> - <H2 CLASS="title">Printers</H2> <P> @@ -24,6 +8,9 @@ Jobs" CLASS="button"></A> SRC="/images/add-printer.gif" ALT="Add Printer" CLASS="button"></A> <A HREF="/printers/"><IMG SRC="/images/manage-printers.gif" ALT="Manage Printers" CLASS="button"></A> +{have_samba?<A HREF="/admin/?op=export-samba"><IMG +SRC="/images/export-samba.gif" ALT="Export Printers to Samba" +CLASS="button"></A>:} </P> {#device_uri=0?:<P><B>New Printers Found:</B></P><UL>{[device_uri] @@ -33,6 +20,22 @@ SRC="/images/add-this-printer.gif" ALT="Add This Printer" CLASS="button" ALIGN="MIDDLE"></A></LI> }</UL>} +<H2 CLASS="title">Classes</H2> + +<P> +<A HREF="/admin?op=add-class"><IMG SRC="/images/add-class.gif" +ALT="Add Class" CLASS="button"></A> +<A HREF="/classes/"><IMG SRC="/images/manage-classes.gif" +ALT="Manage Classes" CLASS="button"></A> +</P> + +<H2 CLASS="title">Jobs</H2> + +<P> +<A HREF="/jobs/"><IMG SRC="/images/manage-jobs.gif" ALT="Manage +Jobs" CLASS="button"></A> +</P> + </TD><TD> </TD><TD VALIGN="TOP"> <H2 CLASS="title">Server</H2> diff --git a/templates/class-jobs-header.tmpl b/templates/class-jobs-header.tmpl new file mode 100644 index 000000000..61e5151d2 --- /dev/null +++ b/templates/class-jobs-header.tmpl @@ -0,0 +1 @@ +<H3 CLASS="title">Jobs</H3> diff --git a/templates/classes-header.tmpl b/templates/classes-header.tmpl new file mode 100644 index 000000000..7ac98fbdd --- /dev/null +++ b/templates/classes-header.tmpl @@ -0,0 +1 @@ +<P ALIGN="CENTER">{total=0?No classes:Showing {#printer_name} of {total} class{total=1?:es}}.</P> diff --git a/templates/classes.tmpl b/templates/classes.tmpl index 2f582ea23..4a5a92f04 100644 --- a/templates/classes.tmpl +++ b/templates/classes.tmpl @@ -1,9 +1,4 @@ -<P><A HREF="/admin?op=add-class"><IMG -SRC="/images/add-class.gif" ALT="Add Class" -CLASS="button"></A></P> - -{#printer_name=0?No classes: -<P><B>Server Default Destination:</B> {default_name?<A HREF="{default_uri}">{default_name}</A>:none}</P> +{#printer_name=0?: {[printer_name] <H2 CLASS="title"><A HREF="{printer_uri_supported}">{printer_name}</A>{default_name={printer_name}? (Default Printer):}</H2> @@ -11,9 +6,9 @@ CLASS="button"></A></P> <TR> <TD VALIGN=TOP><A HREF="{printer_uri_supported}"> <IMG SRC="/images/classes.gif" CLASS="button" ALT=""></A></TD> -<TD VALIGN=TOP>Description: {printer_info}<BR> -Location: {printer_location}<BR> -Class State: {printer_state=3?idle:{printer_state=4?processing:stopped}}, +<TD VALIGN=TOP><B>Description:</B> {printer_info}<BR> +<B>Location:</B> {printer_location}<BR> +<B>Class State:</B> {printer_state=3?idle:{printer_state=4?processing:stopped}}, {printer_is_accepting_jobs=0?rejecting jobs:accepting jobs}, {printer_is_shared=0?not:} published. {?printer_state_message=?:<BR><I>"{printer_state_message}"</I>} {?member_uris=?:<BR>Members: {member_uris}} @@ -22,39 +17,38 @@ Class State: {printer_state=3?idle:{printer_state=4?processing:stopped}}, <A HREF="{printer_uri_supported}?op=print-test-page"> <IMG SRC="/images/print-test-page.gif" ALT="Print Test Page" CLASS="button"></A> {printer_state=5? -<A HREF="{admin_uri}?op=start-class&printer_name={printer_name}"> +<A HREF="{admin_uri}?op=start-class&printer_name={printer_name}&is_class=Y"> <IMG SRC="/images/start-class.gif" ALT="Start Class" CLASS="button"></A> : -<A HREF="{admin_uri}?op=stop-class&printer_name={printer_name}"> +<A HREF="{admin_uri}?op=stop-class&printer_name={printer_name}&is_class=Y"> <IMG SRC="/images/stop-class.gif" ALT="Stop Class" CLASS="button"></A> } {printer_is_accepting_jobs=0? -<A HREF="{admin_uri}?op=accept-jobs&printer_name={printer_name}"> +<A HREF="{admin_uri}?op=accept-jobs&printer_name={printer_name}&is_class=Y"> <IMG SRC="/images/accept-jobs.gif" ALT="Accept Jobs" CLASS="button"></A> : -<A HREF="{admin_uri}?op=reject-jobs&printer_name={printer_name}"> +<A HREF="{admin_uri}?op=reject-jobs&printer_name={printer_name}&is_class=Y"> <IMG SRC="/images/reject-jobs.gif" ALT="Reject Jobs" CLASS="button"></A> } -<A HREF="{admin_uri}?op=purge-jobs&printer_name={printer_name}"> +<A HREF="{admin_uri}?op=purge-jobs&printer_name={printer_name}&is_class=Y"> <IMG SRC="/images/cancel-all-jobs.gif" ALT="Cancel All Jobs" CLASS="button"></A> {printer_is_shared=0? -<A HREF="{admin_uri}?op=set-sharing&printer_name={printer_name}&shared=1"> +<A HREF="{admin_uri}?op=set-sharing&printer_name={printer_name}&shared=1&is_class=Y"> <IMG SRC="/images/publish-printer.gif" ALT="Publish Printer" CLASS="button"></A> : -<A HREF="{admin_uri}?op=set-sharing&printer_name={printer_name}&shared=0"> +<A HREF="{admin_uri}?op=set-sharing&printer_name={printer_name}&shared=0&is_class=Y"> <IMG SRC="/images/unpublish-printer.gif" ALT="Unpublish Printer" CLASS="button"></A> } <A HREF="{admin_uri}?op=modify-class&printer_name={printer_name}"> <IMG SRC="/images/modify-class.gif" ALT="Modify Class" CLASS="button"></A> <A HREF="{admin_uri}?op=delete-class&printer_name={printer_name}"> <IMG SRC="/images/delete-class.gif" ALT="Delete Class" CLASS="button"></A> -<A HREF="{admin_uri}?op=set-as-default&printer_name={printer_name}"> +<A HREF="{admin_uri}?op=set-as-default&printer_name={printer_name}&is_class=Y"> <IMG SRC="/images/set-as-default.gif" ALT="Set As Default" CLASS="button"></A> -<A HREF="{admin_uri}?op=set-allowed-users&printer_name={printer_name}"> +<A HREF="{admin_uri}?op=set-allowed-users&printer_name={printer_name}&is_class=Y"> <IMG SRC="/images/set-allowed-users.gif" ALT="Set Allowed Users" CLASS="button"></A> </P> </TD> </TR> </TABLE> - }} diff --git a/templates/error-op.tmpl b/templates/error-op.tmpl new file mode 100644 index 000000000..6950831a0 --- /dev/null +++ b/templates/error-op.tmpl @@ -0,0 +1,3 @@ +<P>Error:</P> + +<BLOCKQUOTE>Unknown operation "{op}"!</BLOCKQUOTE> diff --git a/templates/error.tmpl b/templates/error.tmpl index eb15a06ff..bf0530cbd 100644 --- a/templates/error.tmpl +++ b/templates/error.tmpl @@ -1,3 +1,3 @@ -<P>Error: +<P>{?message?{message}:Error:}</P> <BLOCKQUOTE>{error}</BLOCKQUOTE> diff --git a/templates/job-move.tmpl b/templates/job-move.tmpl new file mode 100644 index 000000000..65d8e9821 --- /dev/null +++ b/templates/job-move.tmpl @@ -0,0 +1,22 @@ +<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}">:} + +<H2 CLASS="title">{job_id?Move Job {job_id}:Move All Jobs}</H2> + +<TABLE> +<TR> +<TH CLASS="label">New Destination:</TH> +<TD> +<SELECT NAME="JOB_PRINTER_URI" SIZE="10"> +{[job_printer_uri]<OPTION VALUE="{job_printer_uri}">{job_printer_name}} +</SELECT> +</TD> +</TR> +<TR> +<TD></TD> +<TD><INPUT TYPE="IMAGE" SRC="/images/move-job{job_id?:s}.gif" ALT="Move Job{job_id?:s}"></TD> +</TR> +</TABLE> + +</FORM> diff --git a/templates/job-moved.tmpl b/templates/job-moved.tmpl new file mode 100644 index 000000000..df7ea1d34 --- /dev/null +++ b/templates/job-moved.tmpl @@ -0,0 +1,2 @@ +<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> diff --git a/templates/job-op.tmpl b/templates/job-op.tmpl deleted file mode 100644 index 19520367f..000000000 --- a/templates/job-op.tmpl +++ /dev/null @@ -1 +0,0 @@ -<P>Unsupported job operation "{op}". diff --git a/templates/jobs-header.tmpl b/templates/jobs-header.tmpl index fef904715..45743a18a 100644 --- a/templates/jobs-header.tmpl +++ b/templates/jobs-header.tmpl @@ -1,5 +1,3 @@ -{?printer_name=?:<H3 CLASS="title">Jobs</H3>} - <P>{?which_jobs=?<A HREF="{?printer_name=?/jobs:{printer_uri_supported}}?which_jobs=completed"><IMG SRC="/images/show-completed.gif" CLASS="button" ALT="Show Completed Jobs"></A> @@ -14,4 +12,4 @@ SRC="/images/show-active.gif" CLASS="button" ALT="Show Active Jobs"></A> <A HREF="{?printer_name=?/jobs:{printer_uri_supported}}?which_jobs=all"><IMG SRC="/images/show-all.gif" CLASS="button" ALT="Show All Jobs">}}</A></P> -<P>Showing {#job_id} of {total} {?which_jobs=?active:{which_jobs=all?:completed}} job{total=1?:s}.</P> +<P ALIGN="CENTER">{total=0?No jobs:Showing {#job_id} of {total} {?which_jobs=?active:{which_jobs=all?:completed}} job{total=1?:s}}.</P> diff --git a/templates/jobs.tmpl b/templates/jobs.tmpl index aeac2002c..76d8ac877 100644 --- a/templates/jobs.tmpl +++ b/templates/jobs.tmpl @@ -21,22 +21,20 @@ {job_state=5?processing since<BR>{time_at_processing}:{job_state=6?stopped at<BR>{time_at_completed}: {job_state=7?cancelled at<BR>{time_at_completed}:{job_state=8?aborted:completed at<BR>{time_at_completed}}}}}}} </TD> <TD> -{job_state>5? -{job_k_octets>0? +{job_preserved>0? <A HREF="/jobs/?op=restart-job&job_id={job_id}&job_printer_uri={job_printer_uri}"> -<IMG SRC="/images/restart-job.gif" ALT="Reprint Job" CLASS="button"></A> -:}:} -{job_state>6?: +<IMG SRC="/images/restart-job.gif" ALT="Reprint Job" CLASS="button"></A>:} {job_state=4? <A HREF="/jobs/?op=release-job&job_id={job_id}&job_printer_uri={job_printer_uri}"> -<IMG SRC="/images/release-job.gif" ALT="Release Job" CLASS="button"></A> -: +<IMG SRC="/images/release-job.gif" ALT="Release Job" CLASS="button"></A>:} +{job_state=3? <A HREF="/jobs/?op=hold-job&job_id={job_id}&job_printer_uri={job_printer_uri}"> -<IMG SRC="/images/hold-job.gif" ALT="Hold Job" CLASS="button"></A> -} +<IMG SRC="/images/hold-job.gif" ALT="Hold Job" CLASS="button"></A>:} +{job_state<7? <A HREF="/jobs/?op=cancel-job&job_id={job_id}&job_printer_uri={job_printer_uri}"> <IMG SRC="/images/cancel-job.gif" ALT="Cancel Job" CLASS="button"></A> -} +<A HREF="/jobs/?op=move-job&job_id={job_id}"><IMG +SRC="/images/move-job.gif" ALT="Move Job" CLASS="button"></A>:} </TD> </TR> } diff --git a/templates/modify-class.tmpl b/templates/modify-class.tmpl index 6a35cce94..4cacc2654 100644 --- a/templates/modify-class.tmpl +++ b/templates/modify-class.tmpl @@ -27,7 +27,7 @@ </TR> <TR> <TD></TD> -<TD><INPUT TYPE="IMAGE" SRC="/images/continue.gif" ALT="Continue"></TD> +<TD><INPUT TYPE="IMAGE" SRC="/images/modify-class.gif" ALT="Modify Class"></TD> </TR> </TABLE> diff --git a/templates/page.tmpl b/templates/pager.tmpl index a949fe8c5..c95f0c559 100644 --- a/templates/page.tmpl +++ b/templates/pager.tmpl @@ -1,7 +1,7 @@ -<TABLE WIDTH="100%"> +<TABLE WIDTH="100%" CLASS="pager"> <TR> <TD WIDTH="33%">{PREVURL?<A HREF="{PREVURL}"><IMG SRC="/images/show-previous.gif" ALT="Show Previous" CLASS="button"></A>: }</TD> - <TD WIDTH="34%" ALIGN="CENTER">{ORDER=dec?<A HREF="{THISURL}&ORDER=asc"><IMG SRC="/images/show-ascending.gif" ALT="Show Ascending" CLASS="button"></A>:<A HREF="{THISURL}&ORDER=dec"><IMG SRC="/images/show-descending.gif" ALT="Show Descending" CLASS="button"></A>}</TD> + <TD WIDTH="34%" ALIGN="CENTER">{ORDER=dec?<A HREF="{THISURL}&ORDER=asc"><IMG SRC="/images/sort-ascending.gif" ALT="Sort Ascending" CLASS="button"></A>:<A HREF="{THISURL}&ORDER=dec"><IMG SRC="/images/sort-descending.gif" ALT="Sort Descending" CLASS="button"></A>}</TD> <TD WIDTH="33%" ALIGN="RIGHT">{NEXTURL?<A HREF="{NEXTURL}"><IMG SRC="/images/show-next.gif" ALT="Show Next" CLASS="button"></A>: }</TD> </TR> </TABLE> diff --git a/templates/printer-accept.tmpl b/templates/printer-accept.tmpl index 3a269eb0d..15e8b15ff 100644 --- a/templates/printer-accept.tmpl +++ b/templates/printer-accept.tmpl @@ -1 +1,3 @@ -<P>Printer <A HREF="/printers/{printer_name}">{printer_name}</A> is now accepting jobs. +<P>{is_class?Class:Printer} <A +HREF="/{is_class?classes:printers}/{printer_name}">{printer_name}</A> +is now accepting jobs.</P> diff --git a/templates/printer-default.tmpl b/templates/printer-default.tmpl index e5dd0b08c..7bb6bc41d 100644 --- a/templates/printer-default.tmpl +++ b/templates/printer-default.tmpl @@ -1,4 +1,7 @@ -<P>Printer <A HREF="/printers/{printer_name}">{printer_name}</A> has been -made the default printer on the server. Please note that any user default -that has been set via the <TT>lpoptions</TT> command will override this -default setting. +<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> + +<BLOCKQUOTE><B>Note:</B> Any user default that has been set via +the <TT>lpoptions</TT> command will override this default +setting.</BLOCKQUOTE> diff --git a/templates/printer-jobs-header.tmpl b/templates/printer-jobs-header.tmpl new file mode 100644 index 000000000..61e5151d2 --- /dev/null +++ b/templates/printer-jobs-header.tmpl @@ -0,0 +1 @@ +<H3 CLASS="title">Jobs</H3> diff --git a/templates/printer-purge.tmpl b/templates/printer-purge.tmpl index 863d33916..8226d6040 100644 --- a/templates/printer-purge.tmpl +++ b/templates/printer-purge.tmpl @@ -1 +1,3 @@ -<P>Printer <A HREF="/printers/{printer_name}">{printer_name}</A> has been purged of all jobs. +<P>{is_class?Class:Printer} <A +HREF="/{is_class?classes:printers}/{printer_name}">{printer_name}</A> +has been purged of all jobs.</P> diff --git a/templates/printer-reject.tmpl b/templates/printer-reject.tmpl index e73d87380..aca24a576 100644 --- a/templates/printer-reject.tmpl +++ b/templates/printer-reject.tmpl @@ -1 +1,3 @@ -<P>Printer <A HREF="/printers/{printer_name}">{printer_name}</A> is no longer accepting jobs. +<P>{is_class?Class:Printer} <A +HREF="/{is_class?classes:printers}/{printer_name}">{printer_name}</A> +is no longer accepting jobs.</P> diff --git a/templates/printer-start.tmpl b/templates/printer-start.tmpl index e8d9f497f..d3b95d3df 100644 --- a/templates/printer-start.tmpl +++ b/templates/printer-start.tmpl @@ -1,2 +1,3 @@ -<P>Printer <A HREF="/printers/{printer_name}">{printer_name}</A> has been -started. +<P>{is_class?Class:Printer} <A +HREF="/{is_class?classes:printers}/{printer_name}">{printer_name}</A> +has been started.</P> diff --git a/templates/printer-stop.tmpl b/templates/printer-stop.tmpl index e01b82677..bdccd88f8 100644 --- a/templates/printer-stop.tmpl +++ b/templates/printer-stop.tmpl @@ -1,2 +1,3 @@ -<P>Printer <A HREF="/printers/{printer_name}">{printer_name}</A> has been -stopped. +<P>{is_class?Class:Printer} <A +HREF="/{is_class?classes:printers}/{printer_name}">{printer_name}</A> +has been stopped.</P> diff --git a/templates/printers-header.tmpl b/templates/printers-header.tmpl new file mode 100644 index 000000000..5196be1d8 --- /dev/null +++ b/templates/printers-header.tmpl @@ -0,0 +1 @@ +<P ALIGN="CENTER">{total=0?No printers:Showing {#printer_name} of {total} printer{total=1?:s}}.</P> diff --git a/templates/printers.tmpl b/templates/printers.tmpl index 44d28dfb3..d13997f48 100644 --- a/templates/printers.tmpl +++ b/templates/printers.tmpl @@ -1,9 +1,4 @@ -<P><A HREF="/admin?op=add-printer"><IMG -SRC="/images/add-printer.gif" ALT="Add Printer" -CLASS="button"></A></P> - -{#printer_name=0?No printers: -<P><B>Server Default Destination:</B> {default_name?<A HREF="{default_uri}">{default_name}</A>:none}</P> +{#printer_name=0?: {[printer_name] <H2 CLASS="title"><A HREF="{printer_uri_supported}">{printer_name}</A>{default_name={printer_name}? (Default Printer):}</H2> @@ -12,17 +7,17 @@ CLASS="button"></A></P> <TD VALIGN="TOP"><A HREF="{printer_uri_supported}"> <IMG SRC="/images/printer-{printer_state=3?idle:{printer_state=4?processing:stopped}}.gif" CLASS="button" ALT=""></A> </TD> -<TD VALIGN="TOP">Description: {printer_info}<BR> -Location: {printer_location}<BR> -Make and Model: {printer_make_and_model}<BR> -Printer State: {printer_state=3?idle:{printer_state=4?processing:stopped}}, +<TD VALIGN="TOP"><B>Description:</B> {printer_info}<BR> +<B>Location:</B> {printer_location}<BR> +<B>Make and Model:</B> {printer_make_and_model}<BR> +<B>Printer State:</B> {printer_state=3?idle:{printer_state=4?processing:stopped}}, {printer_is_accepting_jobs=0?rejecting jobs:accepting jobs}, {printer_is_shared=0?not:} published. {?printer_state_message=?:<BR><I>"{printer_state_message}"</I>} {?printer_state_history2.printer_state_message=?:<BR><I>"{printer_state_history2.printer_state_message}"</I>} {?printer_state_history3.printer_state_message=?:<BR><I>"{printer_state_history3.printer_state_message}"</I>} {?printer_state_history4.printer_state_message=?:<BR><I>"{printer_state_history4.printer_state_message}"</I>} {?printer_state_history5.printer_state_message=?:<BR><I>"{printer_state_history5.printer_state_message}"</I>} -{?device_uri=?:<BR>Device URI: {device_uri}} +{?device_uri=?:<BR><B>Device URI:</B> {device_uri}} <P> <A HREF="{printer_uri_supported}?op=print-test-page"> @@ -41,6 +36,8 @@ Printer State: {printer_state=3?idle:{printer_state=4?processing:stopped}}, <A HREF="{admin_uri}?op=reject-jobs&printer_name={printer_name}"> <IMG SRC="/images/reject-jobs.gif" ALT="Reject Jobs" CLASS="button"></A> } +<A HREF="{printer_uri_supported}?op=move-jobs&printer_name={printer_name}"> +<IMG SRC="/images/move-jobs.gif" ALT="Move All Jobs" CLASS="button"></A> <A HREF="{admin_uri}?op=purge-jobs&printer_name={printer_name}"> <IMG SRC="/images/cancel-all-jobs.gif" ALT="Cancel All Jobs" CLASS="button"></A> {printer_is_shared=0? @@ -64,5 +61,4 @@ Printer State: {printer_state=3?idle:{printer_state=4?processing:stopped}}, </TD> </TR> </TABLE> - }} diff --git a/templates/search.tmpl b/templates/search.tmpl index ee4e48c00..8fc2ac7c6 100644 --- a/templates/search.tmpl +++ b/templates/search.tmpl @@ -1,9 +1,9 @@ -<FORM ACTION="/{SECTION}/" METHOD="GET"> +<FORM ACTION="/{SECTION}/{?SEARCH_DEST}" METHOD="GET"> {WHICH_JOBS?<INPUT TYPE="HIDDEN" NAME="WHICH_JOBS" VALUE="{WHICH_JOBS}">:} {ORDER?<INPUT TYPE="HIDDEN" NAME="ORDER" VALUE="{ORDER}">:} <P ALIGN="CENTER"><B>Search in -{SECTION=classes?Classes:{SECTION=jobs?Jobs:Printers}}:</B> +{SEARCH_DEST?{SEARCH_DEST}:{SECTION=classes?Classes:{SECTION=jobs?Jobs:Printers}}}:</B> <INPUT TYPE="TEXT" NAME="QUERY" VALUE="{?QUERY}" SIZE="60"> <INPUT TYPE="IMAGE" SRC="/images/search.gif" ALT="Search"></P> diff --git a/templates/test-page.tmpl b/templates/test-page.tmpl index 5c5005438..bbca2dcc9 100644 --- a/templates/test-page.tmpl +++ b/templates/test-page.tmpl @@ -1,2 +1,2 @@ -<P>Test page sent; job ID is <A HREF="/printers/{printer_name}"> +<P>Test page sent; job ID is <A HREF="/{SECTION}/{printer_name}"> {printer_name}-{job_id}</A>. diff --git a/templates/users.tmpl b/templates/users.tmpl index a5734416a..61c6e474b 100644 --- a/templates/users.tmpl +++ b/templates/users.tmpl @@ -1,6 +1,7 @@ <FORM METHOD="POST" ACTION="/admin"> <INPUT TYPE="HIDDEN" NAME="OP" VALUE="{OP}"> <INPUT TYPE="HIDDEN" NAME="PRINTER_NAME" VALUE="{printer_name}"> +{IS_CLASS?<INPUT TYPE="HIDDEN" NAME="IS_CLASS" VALUE="{IS_CLASS}">:} <H2 CLASS="title">Allowed Users For {printer_name}</H2> @@ -17,7 +18,7 @@ <TR> <TD></TD> <TD> -<INPUT TYPE="IMAGE" SRC="/images/continue.gif" ALT="Continue"> +<INPUT TYPE="IMAGE" SRC="/images/set-allowed-users.gif" ALT="Set Allowed Users"> </TD> </TR> </TABLE> diff --git a/test/Makefile b/test/Makefile index 14b8ab5bc..86d3ad2dd 100644 --- a/test/Makefile +++ b/test/Makefile @@ -1,5 +1,5 @@ # -# "$Id: Makefile 4837 2005-11-14 04:13:13Z mike $" +# "$Id: Makefile 4950 2006-01-19 16:07:57Z mike $" # # IPP test makefile for the Common UNIX Printing System (CUPS). # @@ -52,7 +52,7 @@ depend: # Install all targets... # -install: +install: all # @@ -73,5 +73,5 @@ include Dependencies # -# End of "$Id: Makefile 4837 2005-11-14 04:13:13Z mike $". +# End of "$Id: Makefile 4950 2006-01-19 16:07:57Z mike $". # diff --git a/test/ipptest.c b/test/ipptest.c index 14d26e055..4bddc10ac 100644 --- a/test/ipptest.c +++ b/test/ipptest.c @@ -1,9 +1,9 @@ /* - * "$Id: ipptest.c 4837 2005-11-14 04:13:13Z mike $" + * "$Id: ipptest.c 4973 2006-01-25 02:36:02Z mike $" * * IPP test command for the Common UNIX Printing System (CUPS). * - * Copyright 1997-2005 by Easy Software Products. + * Copyright 1997-2006 by Easy Software Products. * * These coded instructions, statements, and computer programs are the * property of Easy Software Products and are protected by Federal @@ -151,7 +151,8 @@ do_tests(const char *uri, /* I - URI to connect on */ * Connect to the server... */ - httpSeparate(uri, method, userpass, server, &port, resource); + httpSeparateURI(uri, method, sizeof(method), userpass, sizeof(userpass), + server, sizeof(server), &port, resource, sizeof(resource)); if ((http = httpConnect(server, port)) == NULL) { printf("Unable to connect to %s on port %d - %s\n", server, port, @@ -188,7 +189,8 @@ do_tests(const char *uri, /* I - URI to connect on */ * Initialize things... */ - httpSeparate(uri, method, userpass, server, &port, resource); + httpSeparateURI(uri, method, sizeof(method), userpass, sizeof(userpass), + server, sizeof(server), &port, resource, sizeof(resource)); request = ippNew(); op = (ipp_op_t)0; @@ -782,5 +784,5 @@ print_attr(ipp_attribute_t *attr) /* I - Attribute to print */ /* - * End of "$Id: ipptest.c 4837 2005-11-14 04:13:13Z mike $". + * End of "$Id: ipptest.c 4973 2006-01-25 02:36:02Z mike $". */ |