Could I get you folks to try the current version of IFHP and see if
it gets pagecounts correctly? If not, could you put your patches in
and see if it works? I will then add the patch.
Patrick Powell
> From [EMAIL PROTECTED] Wed Aug 21 16:36:22 2002
> From: Duncan McEwan <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Subject: Re: LPRng: pagecounting on the hp4100
> Date: Thu, 22 Aug 2002 10:46:12 +1200
>
> --Multipart_Thu_Aug_22_10:46:12_2002-1
> Content-Type: text/plain; charset=US-ASCII
>
> > Has anybody found a reasonable way to get pagecount data out of
> > the HP Laserjet 4100?
>
> Coincidently I've been looking at this as well, since I found the same
> problem with zero page counts for 1 page print jobs.
>
> I searched back through some previous mailing list messages I'd saved and found
> one from Fernando Blanco Marcilla <[EMAIL PROTECTED]> sent on Jan 22nd
> 2002 with a subject "HP-4100 Pagecount problem. A possible solution." I don't
> think Fernando has said anything in to this thread so far so I hope he doesn't
> mind if I do it for him!
>
> I've attached his message below so you can see what he said back then.
>
> I've also tried his patch with ifhp 3.5.10 (the code is essentially the same in
> the affected areas but the line numbers are off so I've also attached an
> "updated" version of the patch.
>
> It actually does seem to work for me, in that if I run ifhp in debugging mode,
> it exits with the correct page count almost exactly as soon as the last page of
> a job finishes printing.
>
> I've also tried this patch on an hp4000, a 4050 and an 8000 and it seems to
> work on all of those. However, it doesn't work on an older hp5m we still have.
> So right now I'm attempting to understand more of what is going on here to see
> if I can figure out *why* his patch works for the newer printers but not for
> the 5m. And I'd rather not put it into production use until I do understand
> it, so if anyone can explain it I'd like to hear...
>
> Duncan
>
>
> --Multipart_Thu_Aug_22_10:46:12_2002-1
> Content-Type: application/octet-stream; type=patch
> Content-Disposition: attachment; filename="ifhp.patch"
> Content-Transfer-Encoding: 7bit
>
> *** ifhp.c.ORIG Tue Jul 23 04:19:05 2002
> --- ifhp.c Mon Aug 19 15:38:42 2002
> ***************
> *** 3232,3238 ****
> void Do_waitend( int waitend_timeout, int waitend_interval,
> int waitend_ctrl_t_interval, int banner )
> {
> ! char *sync_str, *s, *t, *u, buffer[SMALLBUFFER], endname[SMALLBUFFER];
> int len, elapsed, timeout, waitend,
> use, use_pjl, use_ps, use_job, c,
> echo_received = 0;
> --- 3232,3238 ----
> void Do_waitend( int waitend_timeout, int waitend_interval,
> int waitend_ctrl_t_interval, int banner )
> {
> ! char *sync_str, *s, *t, *u, buffer[SMALLBUFFER], endname[SMALLBUFFER],
> statusname[SMALLBUFFER];
> int len, elapsed, timeout, waitend,
> use, use_pjl, use_ps, use_job, c,
> echo_received = 0;
> ***************
> *** 3415,3421 ****
> t = GET_HASH_STR_OBJ( Devstatus, "name", MEMINFO);
> u = GET_HASH_STR_OBJ( Devstatus, "result", MEMINFO);
> DEBUG2("Do_waitend: job '%s', name '%s', result '%s', endname
> '%s'", s, t, u, endname );
> ! if( s && safestrstr(s,"END") && t && safestrstr(t,endname) ){
> waitend = 1;
> }
> /* we have the job cancelled, so we retry */
> --- 3415,3427 ----
> t = GET_HASH_STR_OBJ( Devstatus, "name", MEMINFO);
> u = GET_HASH_STR_OBJ( Devstatus, "result", MEMINFO);
> DEBUG2("Do_waitend: job '%s', name '%s', result '%s', endname
> '%s'", s, t, u, endname );
> ! /* if( s && safestrstr(s,"END") && t && safestrstr(t,endname)
> ){
> ! waitend = 1;
> ! } */
> ! if (t) { strcpy(statusname,t+1);
> ! statusname[strlen(statusname)-1]='\0';
> ! }
> ! if( s && strstr(s,"END") && t && strstr(Jobname,statusname) ){
> waitend = 1;
> }
> /* we have the job cancelled, so we retry */
>
> --Multipart_Thu_Aug_22_10:46:12_2002-1
> Content-Type: text/plain; charset=US-ASCII
>
>
> --Multipart_Thu_Aug_22_10:46:12_2002-1
> Content-Type: message/rfc822
>
> Return-Path: [EMAIL PROTECTED]
> Delivery-Date: Tue Jan 22 14:16:01 2002
> Date: Tue, 22 Jan 2002 01:40:23 +0100
> From: Fernando Blanco Marcilla <[EMAIL PROTECTED]>
> Subject: LPRng: HP-4100 Pagecount problem. A possible solution.
> To: [EMAIL PROTECTED]
> Message-id: <[EMAIL PROTECTED]>
> MIME-version: 1.0
> X-Mailer: Mozilla 4.5 [es] (Win98; I)
> Content-type: text/plain; charset=us-ascii
> Content-transfer-encoding: 7BIT
> X-Accept-Language: es
> Sender: [EMAIL PROTECTED]
> Precedence: bulk
> Reply-To: [EMAIL PROTECTED]
> Content-Length: 2787
>
> Hello.
>
> I have done some tests with the version of ifhp 3.5.2 and the pagecount
> of HP-4100 printers, observing the messages of status that it returns
> as the job is being processed.
>
> Unfortunately, unlike other HP printers, this model gives back 'END'
> status a long before the job is completed; nevertheless, when it really
> finishes a job, the following values in Devstatus are given:
>
> job="END"
> name=Jobname (or a substring of this.)
>
> Having this behavior into account, I modified a few lines in the routine
> Do_waitend and finally I managed to count the pages correctly (at least
> in the tests I did, using it for some days with five HP-4100 and several
> other models, sending PCL files and Postscript).
>
> The modification I have done in ifhp 3.5.2 has been:
> line 2912: I added the statusname variable
> lines 3085,3088: I modified the end of job detection criterion
>
> See:
> diff ifhp.c.orig ifhp.c
> 2911c2911
> < char *sync_str, *s, *t, *u, buffer[SMALLBUFFER],
> endname[SMALLBUFFER];
> ---
> > /* */ char *sync_str, *s, *t, *u, buffer[SMALLBUFFER], endname[SMALLBUFFER];
> > statusname[SMALLBUFFER];
> 3084c3084,3087
> < if( s && strstr(s,"END") && t &&
> strstr(t,endname) ){
> ---
> > /* hp4100 17.12.01 */ if (t) { strcpy(statusname,t+1);
> > statusname[strlen(statusname)-1]='\0';
> > }
> > /* hp4100 17.12.01 */ if( s && strstr(s,"END") && t && strstr(Jobname,statusname)
> > ){
>
>
> This was sufficient. The statusname variable I used to remove the quotes
> that are in the first and last character of t, due to problems when the
> Jobname is too long or contains the character ','.
> It was not necessary to put pagecount_poll and pagecount_interval in the
> printcap file.
>
> As I do not know the code in depth, I do not know if this modification
> might introduce any problem that I have not taken into account.
>
> I also tried the same modification with 3.5.0 version, and it counts
> correctly too.
>
> Regards:
> Fernando Blanco.
> CIEMAT.
>
> -----------------------------------------------------------------------------
> YOU MUST BE A LIST MEMBER IN ORDER TO POST TO THE LPRNG MAILING LIST
> The address you post from MUST be your subscription address
>
> 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.
> -----------------------------------------------------------------------------
>
> --Multipart_Thu_Aug_22_10:46:12_2002-1--
>
> -----------------------------------------------------------------------------
> YOU MUST BE A LIST MEMBER IN ORDER TO POST TO THE LPRNG MAILING LIST
> The address you post from MUST be your subscription address
>
> 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.
> -----------------------------------------------------------------------------
>
-----------------------------------------------------------------------------
YOU MUST BE A LIST MEMBER IN ORDER TO POST TO THE LPRNG MAILING LIST
The address you post from MUST be your subscription address
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.
-----------------------------------------------------------------------------