File:  [Coherent Logic Development] / freem / src / merr.h
Revision 1.4: download - view: text, annotated - select for diffs
Sun Apr 13 04:22:43 2025 UTC (3 months, 2 weeks ago) by snw
Branches: MAIN
CVS tags: HEAD
Fix snprintf calls

    1: /*
    2:  *   $Id: merr.h,v 1.4 2025/04/13 04:22:43 snw Exp $
    3:  *    freem error codes
    4:  *
    5:  *  
    6:  *   Author: Serena Willis <snw@coherent-logic.com>
    7:  *    Copyright (C) 1998 MUG Deutschland
    8:  *    Copyright (C) 2020, 2025 Coherent Logic Development LLC
    9:  *
   10:  *
   11:  *   This file is part of FreeM.
   12:  *
   13:  *   FreeM is free software: you can redistribute it and/or modify
   14:  *   it under the terms of the GNU Affero Public License as published by
   15:  *   the Free Software Foundation, either version 3 of the License, or
   16:  *   (at your option) any later version.
   17:  *
   18:  *   FreeM is distributed in the hope that it will be useful,
   19:  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
   20:  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   21:  *   GNU Affero Public License for more details.
   22:  *
   23:  *   You should have received a copy of the GNU Affero Public License
   24:  *   along with FreeM.  If not, see <https://www.gnu.org/licenses/>.
   25:  *
   26:  *   $Log: merr.h,v $
   27:  *   Revision 1.4  2025/04/13 04:22:43  snw
   28:  *   Fix snprintf calls
   29:  *
   30:  *   Revision 1.3  2025/03/09 19:50:47  snw
   31:  *   Second phase of REUSE compliance and header reformat
   32:  *
   33:  *
   34:  * SPDX-FileCopyrightText:  (C) 2025 Coherent Logic Development LLC
   35:  * SPDX-License-Identifier: AGPL-3.0-or-later
   36:  **/
   37: 
   38: #ifndef _MERR_H
   39: # define _MERR_H
   40: 
   41: #define MERR_COD_LENGTH 256
   42: 
   43: /* error codes */
   44: #define OK            0
   45: #define INRPT         1
   46: #define BKERR         2
   47: #define NOSTAND       3
   48: #define UNDEF         4
   49: #define LBLUNDEF      5
   50: #define MISSOPD       6
   51: #define MISSOP        7
   52: #define ILLOP         8
   53: #define QUOTER        9
   54: #define COMMAER      10
   55: #define ASSIGNER     11
   56: #define ARGER        12
   57: #define SPACER       13
   58: #define BRAER        14
   59: #define LVLERR       15
   60: #define DIVER        16
   61: #define ILLFUN       17
   62: #define FUNARG       18
   63: #define ZTERR        19
   64: #define NEXTER       20
   65: #define SELER        21
   66: #define CMMND        22
   67: #define ARGLIST      23
   68: #define INVEXPR      24
   69: #define INVREF       25
   70: #define MXSTR        26
   71: #define TOOPARA      27
   72: #define NOPEN        28
   73: #define NODEVICE     29
   74: #define PROTECT      30
   75: #define GLOBER       31
   76: #define FILERR       32
   77: #define PGMOV        33
   78: #define STKOV        34
   79: #define STORE        35
   80: #define NOREAD       36
   81: #define NOWRITE      37
   82: #define NOPGM        38
   83: #define NAKED        39
   84: #define SBSCR        40
   85: #define ISYNTX       41
   86: #define DBDGD        42
   87: #define KILLER       43
   88: #define HUPER        44
   89: #define MXNUM        45
   90: #define NOVAL        46
   91: #define TYPEMISMATCH 47
   92: #define MEMOV        48	
   93: 
   94: /* socket errors */
   95: #define NAMERES	     49
   96: #define SCKCREAT     50
   97: #define SCKIFAM      51
   98: #define SCKITYP      52
   99: #define SCKIPRT      53
  100: #define SCKCERR      54
  101: #define SCKAERR      55
  102: #define SCKACON      56
  103: #define SCKNCON      57
  104: #define SCKEOPT      58
  105: #define SCKERCV      59
  106: #define SCKESND      60
  107: #define NORPI        61
  108: #define CREDEF       62
  109: #define CMODIFY      63
  110: #define FILEXWR      64
  111: #define INEWMUL      65
  112: #define ZINVHORO     66
  113: #define TYPMISMATCH  67
  114: #define INVTYPE      68
  115: #define INVLIBOPT    69
  116: #define ECODEINV     80
  117: #define ASSERT       81
  118: #define USERERR      82
  119: 
  120: /* OO errors */
  121: #define OBJFLDACCV    83
  122: #define OBJCONFLICT   84
  123: #define OBJPRIVOVFL   85
  124: #define OBJACINVALID  86
  125: 
  126: /* catch-all for otherwise-unspecified syntax errors */
  127: #define SYNTERR      128
  128: 
  129: /* ANSI X11.1 errors */
  130: #define M1           140
  131: #define M2           141
  132: #define M3           142
  133: #define M4           143
  134: #define M5           144
  135: #define M6           145
  136: #define M7           146
  137: #define M8           147
  138: #define M9           148
  139: #define M10          149
  140: #define M11          150
  141: #define M12          151
  142: #define M13          152
  143: #define M14          153
  144: #define M15          154
  145: #define M16          155
  146: #define M17          156
  147: #define M18          157
  148: #define M19          158
  149: #define M20          159
  150: #define M21          160
  151: #define M22          161
  152: #define M23          162
  153: #define M24          163
  154: #define M25          164
  155: #define M26          165
  156: #define M27          166
  157: #define M28          167
  158: #define M29          168
  159: #define M30          169
  160: #define M31          170
  161: #define M32          171
  162: #define M33          172
  163: #define M34          173
  164: #define M35          174
  165: #define M36          175
  166: #define M37          176
  167: #define M38          177
  168: #define M39          178
  169: #define M40          179
  170: #define M41          180
  171: #define M42          181
  172: #define M43          182
  173: #define M44          183
  174: #define M45          184
  175: #define M46          185
  176: #define M47          186
  177: #define M48          187
  178: #define M49          188
  179: #define M50          189
  180: #define M51          190
  181: #define M52          191
  182: #define M53          192
  183: #define M54          193
  184: #define M55          194
  185: #define M56          195
  186: #define M57          196
  187: #define M58          197
  188: #define M59          198
  189: #define M60          199
  190: #define M75          214
  191: #define M101         240
  192: #define M102         241
  193: #define M103         242
  194: #define M104         243
  195: 
  196: /* pseudo-errors (never reported) */
  197: #define ASYNC 	     254
  198: #define CTRLB        255
  199: 
  200: /* MAXERR = maximum error number plus one */
  201: #define MAXERR  CTRLB + 1
  202: #define MAXVNDERR 49
  203: 
  204: #define MDCERRDIFF 0 /*91*/
  205: #define ECODEOFFSET 139
  206: #define MDCFIRSTERR 140
  207: 
  208: #define NESTLEVLS 80
  209: 
  210: extern int merr_raise(int num);
  211: extern int merr(void);
  212: extern short merr_in_break(void);
  213: extern void merr_set_break(void);
  214: extern void merr_clear_break(void);
  215: extern int merr_num_to_code (int num, char *code);
  216: extern int merr_code_to_num (char *code);
  217: extern void merr_set_ecode_ierr (void);
  218: extern int merr_set_ecode (char *t_code);
  219: extern void merr_dump (int num, char *rtn, char *nsn, char *tcod, int tpos);
  220: extern void merr_set_iochan_err(int channel, short frm_err, char *err_text);
  221: extern void merr_clear_iochan_err(int channel);
  222: 
  223: typedef struct merr_stackent {
  224:     char ECODE[256];
  225:     char MCODE[256];
  226:     char PLACE[256];
  227: } merr_stackent;
  228: 
  229: extern merr_stackent merr_stack[];
  230: extern char etrap[];
  231: extern char ecode[];
  232: extern char user_ecode[];
  233: extern int estack;
  234: extern int etrap_lvl;
  235: extern int merr_topstk;
  236: 
  237: #define ERRCHK() if (merr () != OK) goto err
  238: #define merr_clear() merr_raise (OK)
  239: 
  240: #endif

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>