File:  [Coherent Logic Development] / freem / src / ssvn_event.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Sun Jan 19 02:04:04 2025 UTC (14 months, 2 weeks ago) by snw
Branches: CoherentLogicDevelopment
CVS tags: start
FreeM

    1: /*
    2:  *                            *
    3:  *                           * *
    4:  *                          *   *
    5:  *                     ***************
    6:  *                      * *       * *
    7:  *                       *  MUMPS  *
    8:  *                      * *       * *
    9:  *                     ***************
   10:  *                          *   *
   11:  *                           * *
   12:  *                            *
   13:  *
   14:  *   ssvn_event.c
   15:  *    ^$EVENT ssv
   16:  *
   17:  *  
   18:  *   Author: Serena Willis <jpw@coherent-logic.com>
   19:  *    Copyright (C) 1998 MUG Deutschland
   20:  *    Copyright (C) 2020 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 <stdio.h>
   41: #include <stdlib.h>
   42: #include <string.h>
   43: 
   44: #include "freem.h"
   45: #include "mref.h"
   46: #include "mpsdef.h"
   47: 
   48: void ssvn_event(short action, char *key, char *data)
   49: {
   50: 
   51:     freem_ref_t *ref;
   52:     char *kbuf;
   53:     
   54:     ref = (freem_ref_t *) malloc (sizeof(freem_ref_t));
   55:     NULLPTRCHK(ref,"ssvn_event");
   56: 	
   57:     kbuf = (char *) malloc (STRLEN * sizeof(char));
   58:     NULLPTRCHK(kbuf,"ssvn_event");
   59: 	
   60:     stcpy (kbuf, key);
   61: 
   62:     mref_init (ref, MREF_RT_SSVN, "");
   63:     internal_to_mref (ref, key);
   64: 
   65:     switch (action) {
   66:     
   67:     	case new_sym:
   68:         case get_sym:         
   69:         case set_sym:   
   70:         case killone:
   71:         case kill_sym:     
   72:         case dat:
   73:         case fra_order:
   74:         case fra_query:
   75:         case bigquery:
   76:         case getnext:
   77:         case m_alias:
   78:         case zdata:            
   79:             
   80:             symtab (action, key, data);
   81:                 
   82:             free (kbuf);
   83:             free (ref);
   84: 
   85:             merr_clear ();
   86:             return;
   87:             
   88:         default:
   89:             merr_raise (INVREF);
   90:             return;
   91: 
   92:     }
   93: 
   94:     free (kbuf);
   95:     free (ref);
   96: 
   97:     *data = EOL;
   98:     return;
   99: }

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