> From [EMAIL PROTECTED] Tue Aug 1 13:00:39 2000
> Date: Tue, 1 Aug 2000 14:47:39 -0400 (EDT)
> From: Lars Kellogg-Stedman <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Subject: Re: LPRng: IFHP: common filters and '+='
>
> > ps_cardstock = [ media=Card\040Stock ]
> >
> > This appears to work correctly.
>
> Odd, it doesn't appear to work on my end. This is what I get in the
> postscript file:
>
> % Set media type
> << /MediaType (Card\040Stock) /Policies << /MediaType 2 >> >> setpagedevice
>
> That is, the \040 isn't getting expanded. Any thoughts?
>
> -- Lars
>
> PS Just to save you from hunting down my previous email, the ifhp.conf
> looks like this:
>
> ps_media = % Set media type
> << /MediaType (\%s{media}) /Policies << /MediaType 2 >> >> setpagedevice
>
> ps_plain = [ media=Letter ]
> ps_cardstock = [ media=Card\040Stock ]
>
> --
> Lars Kellogg-Stedman <[EMAIL PROTECTED]> --> http://www.larsshack.org/
Apply the following patch and tell me if this works:
*** ifhp.c 2000/07/17 02:35:46 1.60
--- ifhp.c 2000/08/02 02:16:05
***************
*** 411,423 ****
Split( &v, line, ",", 0, 0, 0, 1, 0 );
for( i = 0; i < v.count; ++i ){
key = v.list[i];
c = 0;
if( (value = strpbrk( key, Value_sep )) ){
c = *value;
*value = 0;
}
lowercase(key);
- DEBUG1("Fix_special_user_opts: '%s'='%s'", key, value );
if( (append = !strcasecmp( key, "font")) && c == '=' ){
if( (s = Find_str_value(opts,key,Value_sep)) ){
DEBUG1("Fix_special_user_opts: old '%s'='%s'", key, s
);
--- 411,423 ----
Split( &v, line, ",", 0, 0, 0, 1, 0 );
for( i = 0; i < v.count; ++i ){
key = v.list[i];
+ DEBUG1("Fix_special_user_opts: option '%s'", key );
c = 0;
if( (value = strpbrk( key, Value_sep )) ){
c = *value;
*value = 0;
}
lowercase(key);
if( (append = !strcasecmp( key, "font")) && c == '=' ){
if( (s = Find_str_value(opts,key,Value_sep)) ){
DEBUG1("Fix_special_user_opts: old '%s'='%s'", key, s
);
***************
*** 1149,1157 ****
void Put_ps( char *s )
{
! DEBUG4("Put_fixed: orig '%s'", s );
s = Fix_option_str( s, 0, 0, 0 );
! DEBUG4("Put_fixed: final '%s'", s );
Put_outbuf_str( s );
if(s)free(s);s=0;
Put_outbuf_str( "\n" );
--- 1149,1157 ----
void Put_ps( char *s )
{
! DEBUG4("Put_ps: orig '%s'", s );
s = Fix_option_str( s, 0, 0, 0 );
! DEBUG4("Put_ps: final '%s'", s );
Put_outbuf_str( s );
if(s)free(s);s=0;
Put_outbuf_str( "\n" );
***************
*** 1712,1728 ****
int c = 0, done = 0;
int depth = setvals.count;
! if( (value = strpbrk( key_val, Value_sep )) ){
c = *value; *value = 0;
}
! /* we expand the key here */
! id = Fix_option_str( key_val, 0, 0, 0);
lowercase( id );
if( value ){
*value++ = c;
! Check_max(&setvals,1);
! setvals.list[setvals.count++]
! = safestrdup3(id,"=",value,__FILE__,__LINE__);
}
/* decide if it is a built-in function or simply forcing a string out */
DEBUG4("Resolve_key_val: prefix '%s', id '%s'='%s'",
--- 1712,1730 ----
int c = 0, done = 0;
int depth = setvals.count;
! /* we expand the key here */
! key_val = Fix_option_str( key_val, 0, 0, 0);
! if( (value = safestrpbrk( key_val, Value_sep )) ){
c = *value; *value = 0;
}
! id = safestrdup( key_val, __FILE__,__LINE__ );
lowercase( id );
if( value ){
*value++ = c;
! if( c == '=' ){
! Check_max(&setvals,1);
! setvals.list[setvals.count++] = key_val;
! }
}
/* decide if it is a built-in function or simply forcing a string out */
DEBUG4("Resolve_key_val: prefix '%s', id '%s'='%s'",
***************
*** 1754,1769 ****
}
if( prefix_id ) free(prefix_id); prefix_id = 0;
}
if( !done && value && *value && !Is_flag(value, 0) ){
routine( Fix_val(value) );
done = 1;
}
- for( c = depth; c < setvals.count; ++c ){
- if( (s = setvals.list[c]) ) free(s);
- setvals.list[c] = 0;
- }
setvals.count = depth;
if(id)free(id); id = 0;
}
int Is_flag( char *s, int *v )
--- 1756,1770 ----
}
if( prefix_id ) free(prefix_id); prefix_id = 0;
}
+ DEBUG4("Resolve_key_val: done '%d', value '%s'", done, value);
if( !done && value && *value && !Is_flag(value, 0) ){
+ DEBUG4("Resolve_key_val: after Is_flag value now '%s'", value);
routine( Fix_val(value) );
done = 1;
}
setvals.count = depth;
if(id)free(id); id = 0;
+ if(key_val)free(key_val); key_val = 0;
}
int Is_flag( char *s, int *v )
***************
*** 3205,3222 ****
if(DEBUGL2)Dump_line_list("Send_job: after files", &match );
}
for( i = 0; i < match.count; ++i ){
! DEBUG2("Send_job: [%d] '%s'", i, match.list[i] );
Free_line_list(&l);
! Split_count(2,&l,match.list[i],Whitespace, 0, 0, 0, 1, 1 );
if(DEBUGL2)Dump_line_list("Send_job: checking against", &l );
if( l.count == 0 ) continue;
s = l.list[0];
- if( !strcmp(s,"]") || !strcmp(s,"[") ){
- if( l.count != 1 ){
- LOGMSG( "Send_job: bad pattern in
'file_output_match' - '%s'", s );
- }
- continue;
- }
if( l.count != 2 && l.count != 3 ){
LOGMSG( "Send_job: wrong number of fields in
'file_output_match' - '%s'", s );
continue;
--- 3206,3220 ----
if(DEBUGL2)Dump_line_list("Send_job: after files", &match );
}
for( i = 0; i < match.count; ++i ){
! s = match.list[i];
! DEBUG2("Send_job: [%d] '%s'", i, s );
! if( !s ) continue;
! while( isspace(cval(s)) || cval(s) == ']' || cval(s) == '[' )
++s;
Free_line_list(&l);
! Split_count(2,&l,s,Whitespace, 0, 0, 0, 1, 1 );
if(DEBUGL2)Dump_line_list("Send_job: checking against", &l );
if( l.count == 0 ) continue;
s = l.list[0];
if( l.count != 2 && l.count != 3 ){
LOGMSG( "Send_job: wrong number of fields in
'file_output_match' - '%s'", s );
continue;
-----------------------------------------------------------------------------
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.
-----------------------------------------------------------------------------