… | |
… | |
2381 | /*----------------------------------------------------------------------*/ |
2381 | /*----------------------------------------------------------------------*/ |
2382 | #ifdef PRINTPIPE |
2382 | #ifdef PRINTPIPE |
2383 | FILE * |
2383 | FILE * |
2384 | rxvt_term::popen_printer () |
2384 | rxvt_term::popen_printer () |
2385 | { |
2385 | { |
2386 | FILE *stream = popen (rs[Rs_print_pipe], "w"); |
2386 | FILE *stream = popen (rs[Rs_print_pipe] ? rs[Rs_print_pipe] : PRINTPIPE, "w"); |
2387 | |
2387 | |
2388 | if (stream == NULL) |
2388 | if (stream == NULL) |
2389 | rxvt_warn ("can't open printer pipe, not printing.\n"); |
2389 | rxvt_warn ("can't open printer pipe, not printing.\n"); |
2390 | |
2390 | |
2391 | return stream; |
2391 | return stream; |
… | |
… | |
2402 | * simulate attached vt100 printer |
2402 | * simulate attached vt100 printer |
2403 | */ |
2403 | */ |
2404 | void |
2404 | void |
2405 | rxvt_term::process_print_pipe () |
2405 | rxvt_term::process_print_pipe () |
2406 | { |
2406 | { |
2407 | int done; |
2407 | FILE *fd = popen_printer (); |
2408 | FILE *fd; |
|
|
2409 | |
2408 | |
2410 | if ((fd = popen_printer ()) == NULL) |
2409 | if (!fd) |
2411 | return; |
2410 | return; |
2412 | |
2411 | |
2413 | /* |
2412 | /* |
2414 | * Send all input to the printer until either ESC[4i or ESC[?4i |
2413 | * Send all input to the printer until either ESC[4i or ESC[?4i |
2415 | * is received. |
2414 | * is received. |
2416 | */ |
2415 | */ |
2417 | for (done = 0; !done;) |
2416 | for (int done = 0; !done; ) |
2418 | { |
2417 | { |
2419 | unsigned char buf[8]; |
2418 | unsigned char buf[8]; |
2420 | unicode_t ch; |
2419 | unicode_t ch; |
2421 | unsigned int i, len; |
2420 | unsigned int i, len; |
2422 | |
2421 | |