On PJL capable printers, ifhp shows the job owner (-n argument)
on the printer display, or the job name (-J) if the owner is
unknown.

I thought it's a pity to waste the 32 character display on HP
4000/4050 printers :-), so the following patch makes ifhp-3.3.21
display the job owner *and* the job name if both are known (the
usual case if used within LPRng, I assume).  If only one of them
or neither is known, behaviour is unchanged.


*** ifhp.c.dist Sat Aug 19 21:34:49 2000
--- ifhp.c      Fri Sep 29 23:23:55 2000
***************
*** 2195,2208 ****
        SNPRINTF( buffer, sizeof(buffer), Jobstart_str, Jobname );
  
        if( Pjl_console ){
                DEBUG2("Pjl_job: pjl_console '%d'", Pjl_console );
!               s = Loweropts['n'-'a'];
!               if( !s ) s = Upperopts['J'-'A'];
!               if( !s ) s = "????";
!               if( s ){
!                       len = strlen(buffer);
!                       SNPRINTF( buffer+len, sizeof(buffer)-len, Job_display, s );
                }
        }
  
        if( (s = Find_exists_value( &Zopts, "startpage", Value_sep))
--- 2195,2217 ----
        SNPRINTF( buffer, sizeof(buffer), Jobstart_str, Jobname );
  
        if( Pjl_console ){
+               char pjldisplay[SMALLBUFFER];
+ 
                DEBUG2("Pjl_job: pjl_console '%d'", Pjl_console );
!               if( s = Loweropts['n'-'a'])
!                       SNPRINTF( pjldisplay, sizeof(pjldisplay), s);
!               s = Upperopts['J'-'A'];
!               if( len=strlen(pjldisplay)) {
!                       if( s ) SNPRINTF( pjldisplay+len,
!                                       sizeof(pjldisplay)-len, ": %s", s);
!               } else if( s ) {
!                       SNPRINTF( pjldisplay, sizeof(pjldisplay), s);
                }
+               if( !strlen(pjldisplay))
+                       strcpy(pjldisplay, "????");
+               len = strlen(buffer);
+               SNPRINTF( buffer+len, sizeof(buffer)-len, Job_display,
+                       pjldisplay );
        }
  
        if( (s = Find_exists_value( &Zopts, "startpage", Value_sep))



    Ciao, Lobo


-----------------------------------------------------------------------------
If you need help, send email to [EMAIL PROTECTED] (or lprng-requests
or lprng-digest-requests) with the word 'help' in the body.  For the impatient,
to subscribe to a list with name LIST,  send mail to [EMAIL PROTECTED]
with:                           | example:
subscribe LIST <mailaddr>       |  subscribe lprng-digest [EMAIL PROTECTED]
unsubscribe LIST <mailaddr>     |  unsubscribe lprng [EMAIL PROTECTED]

If you have major problems,  send email to [EMAIL PROTECTED] with the word
LPRNGLIST in the SUBJECT line.
-----------------------------------------------------------------------------

Reply via email to