Files
Arquivotheca.SunOS-4.1.4/usr.lib/libsunwindow/notify/ntfy_debug.c
seta75D ff309bfe1c Init
2021-10-11 18:37:13 -03:00

68 lines
1.3 KiB
C

#ifndef lint
#ifdef sccs
static char sccsid[] = "@(#)ntfy_debug.c 1.1 94/10/31 Copyr 1985 Sun Micro";
#endif
#endif
/*
* Copyright (c) 1985 by Sun Microsystems, Inc.
*/
/*
* Ntfy_debug.c - Debugging routines enabled by NTFY_DEBUG in ntfy.h
*/
#include <stdio.h>
#include <sunwindow/ntfy.h>
pkg_private_data int ntfy_errno_no_print;
pkg_private_data int ntfy_warning_print;
pkg_private_data int ntfy_errno_abort;
pkg_private_data int ntfy_errno_abort_init;
pkg_private void
ntfy_set_errno_debug(error)
Notify_error error;
{
notify_errno = error;
if ((!ntfy_errno_no_print) && error != NOTIFY_OK)
notify_perror("Notifier error");
if (!ntfy_errno_abort_init) {
extern char *getenv();
char *str = getenv("NOTIFY_ERROR_ABORT");
if (str && (str[0] == 'y' || str[0] == 'Y'))
ntfy_errno_abort = 1;
else
ntfy_errno_abort = 0;
ntfy_errno_abort_init = 1;
}
if (ntfy_errno_abort == 1 && error != NOTIFY_OK)
abort();
}
pkg_private void
ntfy_set_warning_debug(error)
Notify_error error;
{
notify_errno = error;
if (ntfy_warning_print && error != NOTIFY_OK)
notify_perror("Notifier warning");
}
pkg_private void
ntfy_assert_debug(msg)
char *msg;
{
(void) fprintf(stderr, "Notifier assertion botched: %s\n", msg);
}
pkg_private void
ntfy_fatal_error(msg)
char *msg;
{
(void) fprintf(stderr, "Notifier fatal error: %s\n", msg);
}