From: mike Date: Sat, 7 Jun 2003 16:35:56 +0000 (+0000) Subject: Mirror 1.1.x changes. X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=af50faa7feac40b1082ec4072932c790ef6e81d8;p=thirdparty%2Fcups.git Mirror 1.1.x changes. git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/branches/branch-1.2@3764 7a7537e8-13f0-0310-91df-b6672ffda945 --- diff --git a/CHANGES-1.1.txt b/CHANGES-1.1.txt index 2be4a3215d..509a892754 100644 --- a/CHANGES-1.1.txt +++ b/CHANGES-1.1.txt @@ -3,6 +3,12 @@ CHANGES-1.1.txt CHANGES IN CUPS V1.1.20rc1 + - The ppdOpen() functions now add all Default attributes + to the attribute list; previously only certain + unassigned default attributes would be added (STR + #139) + - The ppdEmitJCL() function wrote JCL commands to stdout + instead of the passed file pointer (STR #142) - The httpGets() function could, in certain states, block waiting for data (STR #132) - The cupsEmitJCL() function not outputs an empty @PJL diff --git a/cups/emit.c b/cups/emit.c index 461f307b76..9456e09571 100644 --- a/cups/emit.c +++ b/cups/emit.c @@ -1,5 +1,5 @@ /* - * "$Id: emit.c,v 1.23.2.10 2003/06/02 20:24:19 mike Exp $" + * "$Id: emit.c,v 1.23.2.11 2003/06/07 16:35:54 mike Exp $" * * PPD code emission routines for the Common UNIX Printing System (CUPS). * @@ -607,10 +607,10 @@ ppdEmitJCL(ppd_file_t *ppd, /* I - PPD file record */ job_id, user, temp); } else - fputs(ppd->jcl_begin, stdout); + fputs(ppd->jcl_begin, fp); - ppdEmit(ppd, stdout, PPD_ORDER_JCL); - fputs(ppd->jcl_ps, stdout); + ppdEmit(ppd, fp, PPD_ORDER_JCL); + fputs(ppd->jcl_ps, fp); return (0); } @@ -709,5 +709,5 @@ ppd_sort(ppd_choice_t **c1, /* I - First choice */ /* - * End of "$Id: emit.c,v 1.23.2.10 2003/06/02 20:24:19 mike Exp $". + * End of "$Id: emit.c,v 1.23.2.11 2003/06/07 16:35:54 mike Exp $". */ diff --git a/cups/ppd.c b/cups/ppd.c index 4244b11ef6..769084920e 100644 --- a/cups/ppd.c +++ b/cups/ppd.c @@ -1,5 +1,5 @@ /* - * "$Id: ppd.c,v 1.51.2.51 2003/04/11 13:07:36 mike Exp $" + * "$Id: ppd.c,v 1.51.2.52 2003/06/07 16:35:54 mike Exp $" * * PPD file routines for the Common UNIX Printing System (CUPS). * @@ -808,21 +808,6 @@ ppdOpen(FILE *fp) /* I - File to read from */ ppd->color_device = strcmp(string, "True") == 0; else if (strcmp(keyword, "ContoneOnly") == 0) ppd->contone_only = strcmp(string, "True") == 0; - else if (strcmp(keyword, "DefaultColorSpace") == 0) - { - if (strcmp(string, "CMY") == 0) - ppd->colorspace = PPD_CS_CMY; - else if (strcmp(string, "CMYK") == 0) - ppd->colorspace = PPD_CS_CMYK; - else if (strcmp(string, "RGB") == 0) - ppd->colorspace = PPD_CS_RGB; - else if (strcmp(string, "RGBK") == 0) - ppd->colorspace = PPD_CS_RGBK; - else if (strcmp(string, "N") == 0) - ppd->colorspace = PPD_CS_N; - else - ppd->colorspace = PPD_CS_GRAY; - } else if (strcmp(keyword, "cupsFlipDuplex") == 0) ppd->flip_duplex = strcmp(string, "True") == 0; else if (strcmp(keyword, "cupsManualCopies") == 0) @@ -1688,39 +1673,64 @@ ppdOpen(FILE *fp) /* I - File to read from */ if (string == NULL) continue; + /* + * Drop UI text, if any, from value... + */ + if (strchr(string, '/') != NULL) *strchr(string, '/') = '\0'; - if (option == NULL) - { - if ((option = ppdFindOption(ppd, keyword + 7)) != NULL) - { - strlcpy(option->defchoice, string, sizeof(option->defchoice)); - option = NULL; - } - else - { - /* - * Option not found; add this as an attribute... - */ + /* + * Assign the default value as appropriate... + */ - ppd_add_attr(ppd, keyword, "", "", string); + if (strcmp(keyword, "DefaultColorSpace") == 0) + { + /* + * Set default colorspace... + */ - string = NULL; /* Don't free this string below */ - } + if (strcmp(string, "CMY") == 0) + ppd->colorspace = PPD_CS_CMY; + else if (strcmp(string, "CMYK") == 0) + ppd->colorspace = PPD_CS_CMYK; + else if (strcmp(string, "RGB") == 0) + ppd->colorspace = PPD_CS_RGB; + else if (strcmp(string, "RGBK") == 0) + ppd->colorspace = PPD_CS_RGBK; + else if (strcmp(string, "N") == 0) + ppd->colorspace = PPD_CS_N; + else + ppd->colorspace = PPD_CS_GRAY; } - else if (strcmp(keyword + 7, option->keyword) == 0) + else if (option && strcmp(keyword + 7, option->keyword) == 0) + { + /* + * Set the default as part of the current option... + */ + strlcpy(option->defchoice, string, sizeof(option->defchoice)); + } else { /* - * Default doesn't match this option; add as an attribute... + * Lookup option and set if it has been defined... */ - ppd_add_attr(ppd, keyword, "", "", string); + ppd_option_t *toption; /* Temporary option */ + - string = NULL; /* Don't free this string below */ + if ((toption = ppdFindOption(ppd, keyword + 7)) != NULL) + strlcpy(toption->defchoice, string, sizeof(toption->defchoice)); } + + /* + * Add default as attribute, too... + */ + + ppd_add_attr(ppd, keyword, "", "", string); + + string = NULL; /* Don't free this string below */ } else if (strcmp(keyword, "UIConstraints") == 0 || strcmp(keyword, "NonUIConstraints") == 0) @@ -3361,5 +3371,5 @@ ppd_read(FILE *fp, /* I - File to read from */ /* - * End of "$Id: ppd.c,v 1.51.2.51 2003/04/11 13:07:36 mike Exp $". + * End of "$Id: ppd.c,v 1.51.2.52 2003/06/07 16:35:54 mike Exp $". */ diff --git a/systemv/cupstestppd.c b/systemv/cupstestppd.c index b982948b47..5eb0a8934c 100644 --- a/systemv/cupstestppd.c +++ b/systemv/cupstestppd.c @@ -1,5 +1,5 @@ /* - * "$Id: cupstestppd.c,v 1.1.2.22 2003/05/23 15:25:11 mike Exp $" + * "$Id: cupstestppd.c,v 1.1.2.23 2003/06/07 16:35:56 mike Exp $" * * PPD test program for the Common UNIX Printing System (CUPS). * @@ -854,6 +854,13 @@ main(int argc, /* I - Number of command-line arguments */ printf(" num_fonts = %d\n", ppd->num_fonts); for (j = 0; j < ppd->num_fonts; j ++) printf(" fonts[%d] = %s\n", j, ppd->fonts[j]); + + printf(" num_attrs = %d\n", ppd->num_attrs); + for (j = 0; j < ppd->num_attrs; j ++) + printf(" attrs[%d] = %s %s%s%s: \"%s\"\n", j, + ppd->attrs[j]->name, ppd->attrs[j]->spec, + ppd->attrs[j]->text[0] ? "/" : "", ppd->attrs[j]->text, + ppd->attrs[j]->value ? ppd->attrs[j]->value : "(null)"); } ppdClose(ppd); @@ -980,5 +987,5 @@ usage(void) /* - * End of "$Id: cupstestppd.c,v 1.1.2.22 2003/05/23 15:25:11 mike Exp $". + * End of "$Id: cupstestppd.c,v 1.1.2.23 2003/06/07 16:35:56 mike Exp $". */