expand PJL heade with Username #3100

Closed
michaelrsweet opened this Issue Feb 12, 2009 · 4 comments

Comments

Projects
None yet
1 participant
Collaborator

michaelrsweet commented Feb 12, 2009

Version: 1.6-feature
CUPS.org User: franz.pfoertsch.brose

Please expand the PJL-Header with the "PJL SET USERNAME" command.

I created a diff to the emit.c file:

---8<---
diff -p emit.c emit.c.139
*** emit.c 2009-02-12 19:55:33.000000000 +0100
--- emit.c.139 2008-08-26 05:43:28.000000000 +0200
*************** ppdEmitJCL(ppd_file_t ppd, / I - PPD
*** 426,432 ****
fprintf(fp, "@pjl JOB NAME = "%s" DISPLAY = "%d %s %s"\n", temp,
job_id, user, temp);
fprintf(fp, "@pjl RDYMSG DISPLAY = "%d %s %s"\n", job_id, user, temp);

  • fprintf(fp, "@PJL SET USERNAME = \"%s\"\n", user);
    
    }
    else
    fputs(ppd->jcl_begin, fp);
    --- 426,431 ----

---8<---

I need this expansion to realize printing into mailboxes wiht UTAX Multifunction device.

Collaborator

michaelrsweet commented Jan 13, 2012

CUPS.org User: mike

Looks reasonable, will add to CUPS 1.6.

Collaborator

michaelrsweet commented Feb 16, 2012

CUPS.org User: mike

Fixed in Subversion repository.

Collaborator

michaelrsweet commented Feb 16, 2012

"emit.c.patch":

*** emit.c 2009-02-12 19:55:33.000000000 +0100
--- emit.c.139 2008-08-26 05:43:28.000000000 +0200
*************** ppdEmitJCL(ppd_file_t ppd, / I - PPD
*** 426,432 ****
fprintf(fp, "@pjl JOB NAME = "%s" DISPLAY = "%d %s %s"\n", temp,
job_id, user, temp);
fprintf(fp, "@pjl RDYMSG DISPLAY = "%d %s %s"\n", job_id, user, temp);

  • fprintf(fp, "@PJL SET USERNAME = \"%s\"\n", user);
    
    }
    else
    fputs(ppd->jcl_begin, fp);
    --- 426,431 ----
Collaborator

michaelrsweet commented Feb 16, 2012

"str3100.patch":

Index: cups/emit.c

--- cups/emit.c (revision 10288)
+++ cups/emit.c (working copy)
@@ -3,7 +3,7 @@
*

  • PPD code emission routines for CUPS.
  • * Copyright 2007-2011 by Apple Inc.
  • * Copyright 2007-2012 by Apple Inc.
  • Copyright 1997-2007 by Easy Software Products, all rights reserved.
  • These coded instructions, statements, and computer programs are the
    @@ -519,15 +519,27 @@
    */

if (display && strcmp(display->value, "job"))

  • {
    fprintf(fp, "@pjl JOB NAME = "%s"\n", temp);
  •  if (display && !strcmp(display->value, "rdymsg"))
    
  •    fprintf(fp, "@PJL RDYMSG DISPLAY = \"%s\"\n", displaymsg);
    
  • }
  • else if (display && !strcmp(display->value, "rdymsg"))
  •  fprintf(fp, "@PJL RDYMSG DISPLAY = \"%s\"\n", displaymsg);
    
    else
    fprintf(fp, "@pjl JOB NAME = "%s" DISPLAY = "%s"\n", temp,
    displaymsg);
    +
  • /*
  • * Replace double quotes with single quotes and UTF-8 characters with
  • * question marks so that the user does not cause a PJL syntax error.
  • */
  • strlcpy(temp, user, sizeof(temp));
  • for (ptr = temp; *ptr; ptr ++)
  •  if (*ptr == '\"')
    
  •    *ptr = '\'';
    
  •  else if (!charset && (*ptr & 128))
    
  •    *ptr = '?';
    
  • fprintf(fp, "@pjl SET USERNAME = "%s"\n", temp);
    }
    else
    fputs(ppd->jcl_begin, fp);

michaelrsweet added this to the Stable milestone Mar 17, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment