--- freem/src/mlib.c 2025/03/09 19:50:47 1.3 +++ freem/src/mlib.c 2025/04/10 01:24:38 1.5 @@ -1,5 +1,5 @@ /* - * $Id: mlib.c,v 1.3 2025/03/09 19:50:47 snw Exp $ + * $Id: mlib.c,v 1.5 2025/04/10 01:24:38 snw Exp $ * Function prototypes, structs, and macros for FreeM * binding library * @@ -25,6 +25,12 @@ * 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 * @@ -90,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); } @@ -139,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; @@ -166,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 (); @@ -187,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; @@ -224,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; @@ -245,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 (); @@ -265,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; @@ -305,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; @@ -344,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;