|
|
| version 1.1, 2025/01/19 02:04:04 | version 1.5, 2025/03/22 18:43:54 |
|---|---|
| Line 1 | Line 1 |
| /* | /* |
| * * | * $Id$ |
| * * * | |
| * * * | |
| * *************** | |
| * * * * * | |
| * * MUMPS * | |
| * * * * * | |
| * *************** | |
| * * * | |
| * * * | |
| * * | |
| * | |
| * mref.c | |
| * supporting functions for handling freem_ref_t structures | * supporting functions for handling freem_ref_t structures |
| * | * |
| * | * |
| * 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.5 2025/03/22 18:43:54 snw | |
| * Make STRLEN 255 chars and add BIGSTR macro for larger buffers | |
| * | |
| * Revision 1.4 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 <stdio.h> | #include <stdio.h> |
| Line 45 | Line 43 |
| #include "freem.h" | #include "freem.h" |
| #define MREF_CHECK(ref,index,type) if (ref->status != MREF_ST_INIT || index > 255 || index < 0) return (type) NULL | #define MREF_CHECK(ref,index,type) if (ref->status != MREF_ST_INIT || index > 255 || index < 0) return (type) NULL |
| #define MREF_CHECK_EXIT(ref,index,type) if (ref->status != MREF_ST_INIT || index > 255 || index < 0) exit (type) NULL | |
| extern short g_numeric (char *str); | extern short g_numeric (char *str); |
| Line 97 void mref_to_internal_prealloc (char *re | Line 96 void mref_to_internal_prealloc (char *re |
| { | { |
| register int i; | register int i; |
| MREF_CHECK (ref, 0, char *); | /* MREF_CHECK (ref, 0, char *); */ |
| strncpy (res, ref->name, STRLEN - 1); | strncpy (res, ref->name, STRLEN - 1); |
| Line 166 freem_ref_t *internal_to_mref (freem_ref | Line 165 freem_ref_t *internal_to_mref (freem_ref |
| ref->reftype = MREF_RT_LOCAL; | ref->reftype = MREF_RT_LOCAL; |
| } | } |
| strncpy (ref->name, nam, 256); | strncpy (ref->name, nam, STRLEN); |
| /* if no subscripts, return the ref */ | /* if no subscripts, return the ref */ |
| if (*(ptr - 1) == EOL) { | if (*(ptr - 1) == EOL) { |