notify.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 1997 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
#pragma ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.2.1.3 */
#include "lpsched.h"
static char *N_Msg[] = {
"Subject: Status of lp request %s\n\nYour request %s destined for %s%s\n",
"has completed successfully on printer %s.\n",
"was canceled by the lpsched daemon%s\n", /* bugfix 1100252 */
"encountered an error during filtering.\n",
"encountered an error while printing on printer %s.\n",
"Filtering stopped with an exit code of %d.\n",
"Printing stopped with an exit code of %d.\n",
"Filtering was interrupted with a signal %d.\n",
"Printing was interrupted with a signal %d.\n",
"\nReason for failure:\n\n%s\n",
"\nReason for being canceled:\n\n%s\n",
};
static struct reason {
short reason;
char *msg;
} N_Reason[] = {
{
"The requested print destination has been removed."
}, {
"All candidate destinations are rejecting further requests."
}, {
"You are no longer allowed to use any printer suitable for\nthe request."
}, {
"No candidate printer can handle these characteristics:"
}, {
"The form you requested no longer exists."
}, {
"You are no longer allowed to use the form you requested."
}, {
"The form you wanted now requires a different character set."
}, {
"There is no longer a filter that will convert your file for printing."
}, {
"The form or print wheel you requested is not allowed on any\nprinter otherwise suitable for the request."
}, {
"Memory allocation problem."
}, {
-1,
""
}
};
static void print_reason(int, int);
/**
** notify() - NOTIFY USER OF FINISHED REQUEST
**/
void
{
register char *cp;
char *file;
int fd;
/*
* Screen out cases where no notification is needed.
*/
return;
if (
&& !e && !k && !errbuf /* exited normally */
)
return;
/*
* Create the notification message to the user.
*/
: "");
}
: ".");
if (slow)
else
if (e > 0)
else if (k)
}
if (errbuf) {
;
}
/* start fix for bugid 1100252 */
}
}
if (file)
return;
}
/**
** print_reason() - PRINT REASON FOR AUTOMATIC CANCEL
**/
static void
{
register int i;
i++;
i++;
P (PCK_TYPE, "\tprinter type\n");
P (PCK_CHARSET, "\tcharacter set\n");
P (PCK_CPI, "\tcharacter pitch\n");
P (PCK_LPI, "\tline pitch\n");
P (PCK_WIDTH, "\tpage width\n");
P (PCK_LENGTH, "\tpage length\n");
P (PCK_BANNER, "\tno banner\n");
}
break;
}
return;
}