version 1.1.1.1, 2025/01/19 02:04:04
|
version 1.4, 2025/04/09 19:52:02
|
Line 1
|
Line 1
|
/* |
/* |
* * |
* $Id$ |
* * * |
|
* * * |
|
* *************** |
|
* * * * * |
|
* * MUMPS * |
|
* * * * * |
|
* *************** |
|
* * * |
|
* * * |
|
* * |
|
* |
|
* merr.c |
|
* stuff for handling program bogosity |
* stuff for handling program bogosity |
* |
* |
* |
* |
* Author: Serena Willis <jpw@coherent-logic.com> |
* Author: Serena Willis <snw@coherent-logic.com> |
* Copyright (C) 1998 MUG Deutschland |
* Copyright (C) 1998 MUG Deutschland |
* Copyright (C) 2020 Coherent Logic Development LLC |
* Copyright (C) 2020, 2025 Coherent Logic Development LLC |
* |
* |
* |
* |
* This file is part of FreeM. |
* This file is part of FreeM. |
Line 35
|
Line 23
|
* You should have received a copy of the GNU Affero Public License |
* You should have received a copy of the GNU Affero Public License |
* along with FreeM. If not, see <https://www.gnu.org/licenses/>. |
* along with FreeM. If not, see <https://www.gnu.org/licenses/>. |
* |
* |
|
* $Log$ |
|
* Revision 1.4 2025/04/09 19:52:02 snw |
|
* Eliminate as many warnings as possible while building with -Wall |
|
* |
|
* Revision 1.3 2025/03/09 19:50:47 snw |
|
* Second phase of REUSE compliance and header reformat |
|
* |
|
* |
|
* SPDX-FileCopyrightText: (C) 2025 Coherent Logic Development LLC |
|
* SPDX-License-Identifier: AGPL-3.0-or-later |
**/ |
**/ |
|
|
#include <string.h> |
#include <string.h> |
Line 208 err_lut errtab[] = {
|
Line 206 err_lut errtab[] = {
|
|
|
inline int merr_raise(int num) |
inline int merr_raise(int num) |
{ |
{ |
char place[256]; |
|
char cod[256]; |
|
|
|
if (merr_in_break ()) { |
if (merr_in_break ()) { |
ierr = num - CTRLB; |
ierr = num - CTRLB; |
Line 403 void merr_dump (int num, char *rtn, char
|
Line 399 void merr_dump (int num, char *rtn, char
|
stcnv_m2c (real_ecode); |
stcnv_m2c (real_ecode); |
real_ecode [strlen (real_ecode) - 1] = NUL; |
real_ecode [strlen (real_ecode) - 1] = NUL; |
|
|
snprintf (tbuf, STRLEN - 1, "^$JOB\202%d\202USER_ERRORS\202%s\201", pid, &user_ecode[1]); |
snprintf (tbuf, STRLEN, "^$JOB\202%d\202USER_ERRORS\202%s\201", pid, &user_ecode[1]); |
tbuf [stlen (tbuf) - 1] = '\201'; |
tbuf [stlen (tbuf) - 1] = '\201'; |
|
|
global (get_sym, tbuf, dbuf); |
global (get_sym, tbuf, dbuf); |
Line 421 void merr_dump (int num, char *rtn, char
|
Line 417 void merr_dump (int num, char *rtn, char
|
strcpy (real_ecode, p->canonical_name); |
strcpy (real_ecode, p->canonical_name); |
} |
} |
|
|
|
|
|
|
if (!stlen (err_suppl)) { |
if (!stlen (err_suppl)) { |
sprintf (tbuf, "\r\n>> Error %s: %s in %s.%s::%s [$STACK = %d]\r\n\201", real_ecode, nem, shm_env, nsn, nrt, nstx); |
snprintf (tbuf, STRLEN, "\r\n>> Error %s: %s in %s.%s::%s [$STACK = %d]\r\n\201", real_ecode, nem, shm_env, nsn, nrt, nstx); |
} |
} |
else { |
else { |
stcnv_m2c (err_suppl); |
stcnv_m2c (err_suppl); |
sprintf (tbuf, "\r\n>> Error %s: %s (%s) in %s::%s [$STACK = %d]\r\n\201", real_ecode, nem, err_suppl, nsn, nrt, nstx); |
snprintf (tbuf, STRLEN, "\r\n>> Error %s: %s (%s) in %s::%s [$STACK = %d]\r\n\201", real_ecode, nem, err_suppl, nsn, nrt, nstx); |
err_suppl[0] = EOL; |
err_suppl[0] = EOL; |
} |
} |
write_m (tbuf); |
write_m (tbuf); |