Skip to content

Commit

Permalink
Load cups into easysw/current.
Browse files Browse the repository at this point in the history
git-svn-id: svn+ssh://src.apple.com/svn/cups/easysw/current@13 a1ca3aef-8c08-0410-bb20-df032aa958be
  • Loading branch information
jlovell committed Jan 26, 2006
1 parent 4a09f02 commit fa73b22
Show file tree
Hide file tree
Showing 202 changed files with 26,555 additions and 22,537 deletions.
15 changes: 11 additions & 4 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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)
Expand Down
24 changes: 12 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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 $".
#
167 changes: 39 additions & 128 deletions backend/ipp.c
Original file line number Diff line number Diff line change
@@ -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).
*
Expand Down Expand Up @@ -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 *);
Expand Down Expand Up @@ -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)
Expand All @@ -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",
Expand Down Expand Up @@ -539,29 +534,18 @@ 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
{
/*
* 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);
Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -704,43 +686,6 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
else
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...
*/
Expand All @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand All @@ -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...
Expand All @@ -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...
Expand Down Expand Up @@ -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 */
Expand All @@ -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);
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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 */


/*
Expand Down Expand Up @@ -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 $".
*/
Loading

0 comments on commit fa73b22

Please sign in to comment.