Annotation of freem/src/mcommand.h, revision 1.1

1.1     ! snw         1: /*
        !             2:  *                            *
        !             3:  *                           * *
        !             4:  *                          *   *
        !             5:  *                     ***************
        !             6:  *                      * *       * *
        !             7:  *                       *  MUMPS  *
        !             8:  *                      * *       * *
        !             9:  *                     ***************
        !            10:  *                          *   *
        !            11:  *                           * *
        !            12:  *                            *
        !            13:  *
        !            14:  *   mcommand.h
        !            15:  *    Generic stuff for handling M commands
        !            16:  *
        !            17:  *  
        !            18:  *   Author: Serena Willis <jpw@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: #if !defined(_FREEM_MCOMMAND_H)
        !            41: # define _FREEM_MCOMMAND_H
        !            42: 
        !            43: /* M tokens */
        !            44: #define ABLOCK       0
        !            45: #define ASSIGN      'a'
        !            46: #define ASTART       1
        !            47: #define ASTOP        2
        !            48: #define AUNBLOCK     3
        !            49: #define BREAK       'b'
        !            50: #define CLOSE       'c'
        !            51: #define CONST        24
        !            52: #define DO          'd'
        !            53: #define DO_BLOCK     4
        !            54: #define ELSE        'e'
        !            55: #define ESTART       5
        !            56: #define ESTOP        6
        !            57: #define ETRIGGER     7
        !            58: #define FOR         'f'     /* ALSO in symtab.c */
        !            59: #define GOTO        'g'
        !            60: #define HA          'h'
        !            61: #define HALT         8
        !            62: #define HANG         9
        !            63: #define IF          'i'
        !            64: #define JOB         'j'
        !            65: #define KILL        'k'
        !            66: #define KVALUE      10
        !            67: #define KSUBSC      11
        !            68: #define LOCK        'l'
        !            69: #define MERGE       'm'
        !            70: #define MAP         26
        !            71: #define UNMAP       27
        !            72: #define NEWCMD      'n'
        !            73: #define OPEN        'o'
        !            74: #define QUIT        'q'
        !            75: #define READ        'r'
        !            76: #define RLOAD       12
        !            77: #define RSAVE       13
        !            78: #define SET         's'
        !            79: #define TCOMMIT     14
        !            80: #define THEN        15
        !            81: #define TROLLBACK   17
        !            82: #define TSTART      18
        !            83: #define USE         'u'
        !            84: #define VIEW        'v'
        !            85: #define WRITE       'w'
        !            86: #define XECUTE      'x'
        !            87: #define ZALLOCATE   'A'
        !            88: #define ZBREAK      'B'
        !            89: #define ZDEALLOCATE 'D'
        !            90: #define ZGO         'G'
        !            91: #define ZHALT       'H'
        !            92: #define ZINSERT     'I'
        !            93: #define ZJOB        'J'
        !            94: #define ZLOAD       'L'
        !            95: #define ZNAMESPACE  'N' // formerly ZNEW
        !            96: #define ZPRINT      'P'
        !            97: #define ZQUIT       'Q'
        !            98: #define ZREMOVE     'R'
        !            99: #define ZSAVE       'S'
        !           100: #define ZTRAP       'T'
        !           101: #define ZWRITE      'W'
        !           102: #define WATCH       20
        !           103: #define ASSERT_TKN  21
        !           104: #define OO_USING    22
        !           105: #define OO_WITH     23
        !           106: #define PRIVATE     SP
        !           107: #define THROW       25
        !           108: 
        !           109: #define RA_CONTINUE 0
        !           110: #define RA_PRIVATE 1
        !           111: #define RA_NEXTCMND 2
        !           112: #define RA_SKIPLINE 3
        !           113: 
        !           114: typedef short MRESULT;
        !           115: typedef short MACTION;
        !           116: 
        !           117: extern MRESULT mcmd_tokenize(MACTION *ra, char *tmp3, char *deferrable_codptr, char *deferrable_code, int *j);
        !           118: extern MRESULT cmd_map(MACTION *ra);
        !           119: extern MRESULT cmd_unmap(MACTION *ra);
        !           120: extern MRESULT cmd_then(MACTION *ra, int *then_ctr);
        !           121: extern MRESULT cmd_throw(MACTION *ra);
        !           122: extern MRESULT cmd_const(MACTION *ra);
        !           123: extern MRESULT cmd_kvalue(MACTION *ra);
        !           124: extern MRESULT cmd_ksubscripts(MACTION *ra);
        !           125: extern MRESULT cmd_tstart(MACTION *ra);
        !           126: extern MRESULT cmd_tcommit(MACTION *ra);
        !           127: extern MRESULT cmd_trollback(MACTION *ra);
        !           128: /* TODO: cmd_set */
        !           129: extern MRESULT cmd_if(MACTION *ra);
        !           130: extern MRESULT cmd_using(MACTION *ra);
        !           131: extern MRESULT cmd_with(MACTION *ra);
        !           132: extern MRESULT cmd_write(MACTION *ra, int *i);
        !           133: extern MRESULT cmd_else(MACTION *ra);
        !           134: extern MRESULT cmd_read(MACTION *ra);
        !           135: 
        !           136: #define MRESCHECK(ra) {\
        !           137:         if (merr () > OK) goto err;             \
        !           138:         switch (ra) { \
        !           139:             case RA_CONTINUE: \
        !           140:                 break; \
        !           141:             case RA_NEXTCMND: \
        !           142:                 goto next_cmnd; \
        !           143:             case RA_PRIVATE: \
        !           144:                 goto private; \
        !           145:             case RA_SKIPLINE: \
        !           146:                 goto skip_line; \
        !           147:         } \
        !           148:         }
        !           149: 
        !           150: #endif

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