2N/A * Copyright 1997 by Massachusetts Institute of Technology 2N/A * Copyright 1987, 1988 by MIT Student Information Processing Board 2N/A * Permission to use, copy, modify, and distribute this software 2N/A * and its documentation for any purpose and without fee is 2N/A * hereby granted, provided that the above copyright notice 2N/A * appear in all copies and that both that copyright notice and 2N/A * this permission notice appear in supporting documentation, 2N/A * and that the names of M.I.T. and the M.I.T. S.I.P.B. not be 2N/A * used in advertising or publicity pertaining to distribution 2N/A * of the software without specific, written prior permission. 2N/A * Furthermore if you modify this software you must label 2N/A * your software as modified software and not distribute it in such a 2N/A * fashion that it might be confused with the original M.I.T. software. 2N/A * M.I.T. and the M.I.T. S.I.P.B. make no representations about 2N/A * the suitability of this software for any purpose. It is 2N/A * provided "as is" without express or implied warranty. 2N/A * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved. 2N/A * It is sometimes desirable to have more than a single hook called 2N/A * when com_err() is invoked. A number of new functions have been 2N/A * added which allow hooks to be added and removed: 2N/A * add_com_err_hook() 2N/A * add_default_com_err_hook() 2N/A * remove_com_err_hook() 2N/A * remove_default_com_err_hook() 2N/A * The existing functions: 2N/A * set_com_err_hook() 2N/A * reset_com_err_hook() 2N/A * have been modified to work with the new scheme. Applications using 2N/A * the original function calls are not affected. 2N/A/* Solaris Kerberos specific fix start --------------------------- */ 2N/A {
gettext(
"%s\n## com_err msg of format: 'while ...'"),
2N/A {
gettext(
"%s\n## com_err message of format: 'error msg ...'"),
2N/A {
gettext(
"%1$s %2$s\n## com_err message of format: " 2N/A "'error msg ... while ...'"),
2N/A {
gettext(
"%1$s: %2$s\n## com_err msg of format: 'whoami: while ...'"),
2N/A {
gettext(
"%1$s: %2$s\n## com_err message of format: " 2N/A "'whoami: error msg ...'"),
2N/A {
gettext(
"%1$s: %2$s %3$s\n## com_err message of format: " 2N/A "'whoami: error msg ... while ...'"),
2N/A "%1$s: %2$s %3$s\n" },
2N/A "'whoami: with no error msg or while ...'"),
2N/A * The idea is that we provide a unique message id that contains extra junk 2N/A * that we never want to display in the C locale. If dgettext() returns 2N/A * a string that is equal to the message id, then we return the c_msgstr, 2N/A * for display in the locale. 2N/A/* Solaris Kerberos specific fix end --------------------------- */ 2N/A/* Solaris Kerberos: this code is significantly altered from 2N/A * the MIT 1.2.1 version to work with internationalization */ 2N/A * Because 'while ...' message could contain a format string 2N/A * we have to intepret it now, in a buffer. We need to put it 2N/A * into a buffer so that the message can be juxtaposed in a locale 2N/A * meaningful manner. In some natural languages, the 'while ...' phrase 2N/A * There are 8 possible combinations here depending on whether 2N/A * a whoami string was provided, error code is non-zero, and if a 2N/A * a 'while ...' messge was provided. 2N/A /* Yikes. Our library initialization failed or we couldn't lock 2N/A the lock we want. We could be in trouble. Gosh, we should 2N/A probably print an error message. Oh, wait. That's what we're 2N/A trying to do. In fact, if we're losing on initialization here, 2N/A there's a good chance it has to do with failed initialization 2N/A/* Make a separate function because the assert invocations below 2N/A use the macro expansion on some platforms, which may be insanely 2N/A long and incomprehensible. */ 2N/A /* Broken initialization? What can we do? */ 2N/A /* Broken initialization? What can we do? */ 2N/A * Register a hook which will be called every time 2N/A * com_err() is called. 2N/A * Remove a logging hook. The first hook matching 'f' will 2N/A * Remove the default hook. 2N/A * Add back the default hook