--- freem/src/mlib.c 2025/01/19 02:04:04 1.1 +++ freem/src/mlib.c 2025/04/10 01:24:38 1.5 @@ -1,24 +1,12 @@ /* - * * - * * * - * * * - * *************** - * * * * * - * * MUMPS * - * * * * * - * *************** - * * * - * * * - * * - * - * mlib.h + * $Id: mlib.c,v 1.5 2025/04/10 01:24:38 snw Exp $ * Function prototypes, structs, and macros for FreeM * binding library * * - * Author: Serena Willis + * Author: Serena Willis * 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. @@ -36,6 +24,19 @@ * You should have received a copy of the GNU Affero Public License * along with FreeM. If not, see . * + * $Log: mlib.c,v $ + * Revision 1.5 2025/04/10 01:24:38 snw + * Remove C++ style comments + * + * Revision 1.4 2025/03/24 04:13:11 snw + * Replace action macro dat with fra_dat to avoid symbol conflict on OS/2 + * + * 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 @@ -95,7 +96,7 @@ void mref2str(freem_ref_t *ref, char *ke strcat (key, ref->name); } - // ends with EOL + /* ends with EOL */ strncat (key, "\201", 2); } @@ -144,25 +145,25 @@ short freem_get(freem_ref_t *ref) freem_return_io (); - // set up the EOL-delimited string + /* set up the EOL-delimited string */ mref2str (ref, key); switch (ref->reftype) { case MREF_RT_LOCAL: - // call into the symbol table to get the local var + /* call into the symbol table to get the local var */ symtab (get_sym, key, result); ref->status = merr (); break; case MREF_RT_GLOBAL: - // call into the FreeM global handler; result in &result + /* call into the FreeM global handler; result in &result */ global (get_sym, key, result); ref->status = merr (); break; case MREF_RT_SSVN: - // call into the SSVN code + /* call into the SSVN code */ ssvn (get_sym, key, result); ref->status = merr (); break; @@ -171,7 +172,7 @@ short freem_get(freem_ref_t *ref) stcnv_m2c (result); - strncpy (ref->value, result, 255); + strncpy (ref->value, result, sizeof (ref->value)); freem_release_io (); @@ -192,19 +193,19 @@ short freem_set(freem_ref_t *ref) switch (ref->reftype) { case MREF_RT_LOCAL: - // call into the symbol table to set the local var + /* call into the symbol table to set the local var */ symtab (set_sym, key, data); ref->status = merr (); break; case MREF_RT_GLOBAL: - // call into the FreeM global handler; data in &data + /* call into the FreeM global handler; data in &data */ global (set_sym, key, data); ref->status = merr (); break; case MREF_RT_SSVN: - // call into the SSVN code + /* call into the SSVN code */ ssvn (set_sym, key, data); ref->status = merr (); break; @@ -229,19 +230,19 @@ short freem_kill(freem_ref_t *ref) switch (ref->reftype) { case MREF_RT_LOCAL: - // call into the symbol table to kill the local var + /* call into the symbol table to kill the local var */ symtab (kill_sym, key, result); ref->status = merr (); break; case MREF_RT_GLOBAL: - // call into the FreeM global handler; result in &result + /* call into the FreeM global handler; result in &result */ global (kill_sym, key, result); ref->status = merr (); break; case MREF_RT_SSVN: - // call into the SSVN code + /* call into the SSVN code */ ssvn (kill_sym, key, result); ref->status = merr (); break; @@ -250,7 +251,7 @@ short freem_kill(freem_ref_t *ref) stcnv_m2c (result); - strncpy (ref->value, result, 255); + strncpy (ref->value, result, sizeof (ref->value) - 1); freem_release_io (); @@ -270,20 +271,20 @@ short freem_data(freem_ref_t *ref) switch (ref->reftype) { case MREF_RT_LOCAL: - // call into the symbol table - symtab (dat, key, result); + /* call into the symbol table */ + symtab (fra_dat, key, result); ref->status = merr (); break; case MREF_RT_GLOBAL: - // call into the FreeM global handler; result in &result - global (dat, key, result); + /* call into the FreeM global handler; result in &result */ + global (fra_dat, key, result); ref->status = merr (); break; case MREF_RT_SSVN: - // call into the SSVN code - ssvn (dat, key, result); + /* call into the SSVN code */ + ssvn (fra_dat, key, result); ref->status = merr (); break; @@ -310,19 +311,19 @@ short freem_order(freem_ref_t *ref) switch (ref->reftype) { case MREF_RT_LOCAL: - // call into the symbol table for $ORDER + /* call into the symbol table for $ORDER */ symtab (fra_order, key, result); ref->status = merr (); break; case MREF_RT_GLOBAL: - // call into the FreeM global handler; result in &result + /* call into the FreeM global handler; result in &result */ global (fra_order, key, result); ref->status = merr (); break; case MREF_RT_SSVN: - // call into the SSVN code + /* call into the SSVN code */ ssvn (fra_order, key, result); ref->status = merr (); break; @@ -349,19 +350,19 @@ short freem_query(freem_ref_t *ref) switch (ref->reftype) { case MREF_RT_LOCAL: - // call into the symbol table + /* call into the symbol table */ symtab (fra_query, key, result); ref->status = merr (); break; case MREF_RT_GLOBAL: - // call into the FreeM global handler; result in &result + /* call into the FreeM global handler; result in &result */ global (fra_query, key, result); ref->status = merr (); break; case MREF_RT_SSVN: - // call into the SSVN code + /* call into the SSVN code */ ssvn (fra_query, key, result); ref->status = merr (); break;