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 (8 days, 20 hours ago) by snw
Branches: MAIN
CVS tags: v0-62-3, HEAD
Replace action macro dat with fra_dat to avoid symbol conflict on OS/2

/*
 *   $Id: ssvn_event.c,v 1.4 2025/03/24 04:13:11 snw Exp $
 *    ^$EVENT ssvn
 *
 *  
 *   Author: Serena Willis <snw@coherent-logic.com>
 *    Copyright (C) 1998 MUG Deutschland
 *    Copyright (C) 2020, 2025 Coherent Logic Development LLC
 *
 *
 *   This file is part of FreeM.
 *
 *   FreeM is free software: you can redistribute it and/or modify
 *   it under the terms of the GNU Affero Public License as published by
 *   the Free Software Foundation, either version 3 of the License, or
 *   (at your option) any later version.
 *
 *   FreeM is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU Affero Public License for more details.
 *
 *   You should have received a copy of the GNU Affero Public License
 *   along with FreeM.  If not, see <https://www.gnu.org/licenses/>.
 *
 *   $Log: ssvn_event.c,v $
 *   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
 *
 *
 * SPDX-FileCopyrightText:  (C) 2025 Coherent Logic Development LLC
 * SPDX-License-Identifier: AGPL-3.0-or-later
 **/

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include "freem.h"
#include "mref.h"
#include "mpsdef.h"

void ssvn_event(short action, char *key, char *data)
{

    freem_ref_t *ref;
    char *kbuf;
    
    ref = (freem_ref_t *) malloc (sizeof(freem_ref_t));
    NULLPTRCHK(ref,"ssvn_event");
	
    kbuf = (char *) malloc (STRLEN * sizeof(char));
    NULLPTRCHK(kbuf,"ssvn_event");
	
    stcpy (kbuf, key);

    mref_init (ref, MREF_RT_SSVN, "");
    internal_to_mref (ref, key);

    switch (action) {
    
    	case new_sym:
        case get_sym:         
        case set_sym:   
        case killone:
        case kill_sym:     
        case fra_dat:
        case fra_order:
        case fra_query:
        case bigquery:
        case getnext:
        case m_alias:
        case zdata:            
            
            symtab (action, key, data);
                
            free (kbuf);
            free (ref);

            merr_clear ();
            return;
            
        default:
            merr_raise (INVREF);
            return;

    }

    free (kbuf);
    free (ref);

    *data = EOL;
    return;
}

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