File:  [Coherent Logic Development] / freem / src / ssvn_event.c
Revision 1.4: download - view: text, annotated - select for diffs
Mon Mar 24 04:13:11 2025 UTC (4 months, 1 week ago) by snw
Branches: MAIN
CVS tags: v0-63-1-rc1, v0-63-0-rc1, v0-63-0, v0-62-3, HEAD
Replace action macro dat with fra_dat to avoid symbol conflict on OS/2

    1: /*
    2:  *   $Id: ssvn_event.c,v 1.4 2025/03/24 04:13:11 snw Exp $
    3:  *    ^$EVENT ssvn
    4:  *
    5:  *  
    6:  *   Author: Serena Willis <snw@coherent-logic.com>
    7:  *    Copyright (C) 1998 MUG Deutschland
    8:  *    Copyright (C) 2020, 2025 Coherent Logic Development LLC
    9:  *
   10:  *
   11:  *   This file is part of FreeM.
   12:  *
   13:  *   FreeM is free software: you can redistribute it and/or modify
   14:  *   it under the terms of the GNU Affero Public License as published by
   15:  *   the Free Software Foundation, either version 3 of the License, or
   16:  *   (at your option) any later version.
   17:  *
   18:  *   FreeM is distributed in the hope that it will be useful,
   19:  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
   20:  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   21:  *   GNU Affero Public License for more details.
   22:  *
   23:  *   You should have received a copy of the GNU Affero Public License
   24:  *   along with FreeM.  If not, see <https://www.gnu.org/licenses/>.
   25:  *
   26:  *   $Log: ssvn_event.c,v $
   27:  *   Revision 1.4  2025/03/24 04:13:11  snw
   28:  *   Replace action macro dat with fra_dat to avoid symbol conflict on OS/2
   29:  *
   30:  *   Revision 1.3  2025/03/09 19:50:47  snw
   31:  *   Second phase of REUSE compliance and header reformat
   32:  *
   33:  *
   34:  * SPDX-FileCopyrightText:  (C) 2025 Coherent Logic Development LLC
   35:  * SPDX-License-Identifier: AGPL-3.0-or-later
   36:  **/
   37: 
   38: #include <stdio.h>
   39: #include <stdlib.h>
   40: #include <string.h>
   41: 
   42: #include "freem.h"
   43: #include "mref.h"
   44: #include "mpsdef.h"
   45: 
   46: void ssvn_event(short action, char *key, char *data)
   47: {
   48: 
   49:     freem_ref_t *ref;
   50:     char *kbuf;
   51:     
   52:     ref = (freem_ref_t *) malloc (sizeof(freem_ref_t));
   53:     NULLPTRCHK(ref,"ssvn_event");
   54: 	
   55:     kbuf = (char *) malloc (STRLEN * sizeof(char));
   56:     NULLPTRCHK(kbuf,"ssvn_event");
   57: 	
   58:     stcpy (kbuf, key);
   59: 
   60:     mref_init (ref, MREF_RT_SSVN, "");
   61:     internal_to_mref (ref, key);
   62: 
   63:     switch (action) {
   64:     
   65:     	case new_sym:
   66:         case get_sym:         
   67:         case set_sym:   
   68:         case killone:
   69:         case kill_sym:     
   70:         case fra_dat:
   71:         case fra_order:
   72:         case fra_query:
   73:         case bigquery:
   74:         case getnext:
   75:         case m_alias:
   76:         case zdata:            
   77:             
   78:             symtab (action, key, data);
   79:                 
   80:             free (kbuf);
   81:             free (ref);
   82: 
   83:             merr_clear ();
   84:             return;
   85:             
   86:         default:
   87:             merr_raise (INVREF);
   88:             return;
   89: 
   90:     }
   91: 
   92:     free (kbuf);
   93:     free (ref);
   94: 
   95:     *data = EOL;
   96:     return;
   97: }

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