Exemplo n.º 1
0
static void
closePrinter(XtermWidget xw GCC_UNUSED)
{
    if (xtermHasPrinter(xw) != 0) {
	TScreen *screen = TScreenOf(xw);
#ifdef VMS
	char pcommand[256];
	(void) sprintf(pcommand, "%s %s;",
		       SPS.printer_command,
		       VMS_TEMP_PRINT_FILE);
#endif

	if (SPS.fp != 0) {
	    DEBUG_MSG("closePrinter\n");
	    pclose(SPS.fp);
	    TRACE(("closed printer, waiting...\n"));
#ifdef VMS			/* This is a quick hack, really should use
				   spawn and check status or system services
				   and go straight to the queue */
	    (void) system(pcommand);
#else /* VMS */
	    while (nonblocking_wait() > 0) {
		;
	    }
#endif /* VMS */
	    SPS.fp = 0;
	    SPS.isOpen = False;
	    TRACE(("closed printer\n"));
	    DEBUG_MSG("...closePrinter (done)\n");
	}
Exemplo n.º 2
0
static void
closePrinter(void)
{
    if (xtermHasPrinter() != 0) {
#ifdef VMS
	TScreen *screen = &term->screen;

	char pcommand[256];
	(void) sprintf(pcommand, "%s %s;",
		       screen->printer_command,
		       VMS_TEMP_PRINT_FILE);
#endif

	if (Printer != 0) {
	    fclose(Printer);
	    TRACE(("closed printer, waiting...\n"));
#ifdef VMS			/* This is a quick hack, really should use
				   spawn and check status or system services
				   and go straight to the queue */
	    (void) system(pcommand);
#else /* VMS */
	    while (nonblocking_wait() > 0)
#endif /* VMS */
		;
	    Printer = 0;
	    initialized = 0;
	    TRACE(("closed printer\n"));
	}
TCPSocket ConnectionListener::wait() {
    return is_blocking ? blocking_wait() : nonblocking_wait();  
}