File:  [Coherent Logic Development] / freem / src / cmd_with.c
Revision 1.2: download - view: text, annotated - select for diffs
Sun Mar 9 15:20:18 2025 UTC (12 months, 3 weeks ago) by snw
Branches: MAIN
CVS tags: HEAD
Begin formatting overhaul and REUSE compliance

    1: /*
    2:  *                            *
    3:  *                           * *
    4:  *                          *   *
    5:  *                     ***************
    6:  *                      * *       * *
    7:  *                       *  MUMPS  *
    8:  *                      * *       * *
    9:  *                     ***************
   10:  *                          *   *
   11:  *                           * *
   12:  *                            *
   13:  *
   14:  *   cmd_with.c
   15:  *    Implementation of the WITH command
   16:  *
   17:  *  
   18:  *   Author: Serena Willis <snw@coherent-logic.com>
   19:  *    Copyright (C) 1998 MUG Deutschland
   20:  *    Copyright (C) 2023 Coherent Logic Development LLC
   21:  *
   22:  *
   23:  *   This file is part of FreeM.
   24:  *
   25:  *   FreeM is free software: you can redistribute it and/or modify
   26:  *   it under the terms of the GNU Affero Public License as published by
   27:  *   the Free Software Foundation, either version 3 of the License, or
   28:  *   (at your option) any later version.
   29:  *
   30:  *   FreeM is distributed in the hope that it will be useful,
   31:  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
   32:  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   33:  *   GNU Affero Public License for more details.
   34:  *
   35:  *   You should have received a copy of the GNU Affero Public License
   36:  *   along with FreeM.  If not, see <https://www.gnu.org/licenses/>.
   37:  *
   38:  **/
   39: 
   40: #include "mpsdef.h"
   41: #include "mcommand.h"
   42: 
   43: MRESULT cmd_with(MACTION *ra)
   44: {
   45:     register char ch;
   46:     
   47:     if (is_standard ()) {
   48:         return NOSTAND;
   49:     }
   50:     
   51:     /* argumentless WITH */
   52:     if (((ch = *codptr) == SP) || ch == EOL) {
   53:         i_with[0] = '\201';
   54:         
   55:         *ra = RA_CONTINUE;
   56:         return OK;
   57:     }
   58:     
   59:     expr (STRING);
   60:     
   61:     if (merr () == BRAER) merr_clear ();
   62:     if (merr ()) return merr ();
   63:     
   64:     stcpy (i_with, argptr);
   65: 
   66:     *ra = RA_CONTINUE;
   67:     return OK;
   68: }

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