/**************************************************************************/
/*                                                                        */
/*                                 Sources                                */
/*                                from  the                               */
/*                           XSC SOFTWARE PACKAGE                         */
/*                                                                        */
/*                Copyright (c) 1997 University of Karlsruhe              */
/*                     Institute for Appl. Mathematics                    */
/*                                                                        */
/* This program is free software for non-commercial use. For details, see */
/* the file LICENSE.XSC, distributed with this software package.          */
/*                                                                        */
/* This program is distributed WITHOUT ANY WARRANTY. For details, see the */
/* file LICENSE.XSC, distributed with this software package.              */
/*                                                                        */
/**************************************************************************/

/* RCS $Id: s_ins1.c,v 1.2 1997/09/25 17:59:59 ae59 Exp $ */
/*
$Log: s_ins1.c,v $
 * Revision 1.2  1997/09/25  17:59:59  ae59
 * Copyright-message
 *
 * Revision 1.1  1994/01/27  13:24:40  ae59
 * Put under RCS control
 *
 */
/****************************************************************/
/*                                                              */
/*      Filename        : s_ins1.c                              */
/*                                                              */
/*      Entries         : a_VOID s_ins1(s,e)                    */
/*                        s_etof s;                             */
/*                        a_intg e;                             */
/*                                                              */
/*      Arguments       : s = set                               */
/*                        e = element                           */
/*                                                              */
/*      Function value  : pointer to updated set                */
/*                                                              */
/*      Description     : Add element e to set s.               */
/*                                                              */
/*      Date    : 1992-07-22                                    */
/*      1992-07-22 : cast to a_char at s assignment =b=         */
/*      1991-09-06 : reduce maximum line length                 */
/*      1991-01-29 : 0x80 casted with (unsigned char)           */
/*      1990-11-19 : E_TPUSH+E_TPOPP / (a_VOID) in result       */
/****************************************************************/

#ifndef ALL_IN_ONE
#ifdef AIX
#include "/u/p88c/runtime/o_defs.h"
#else
#include "o_defs.h"
#endif
#define local
#endif

#ifdef LINT_ARGS
local a_VOID s_ins1(s_etof s,a_intg e)
#else
local a_VOID s_ins1(s,e)

s_etof s;
a_intg e;
#endif
        {
        E_TPUSH("s_ins1")

        if (e<0 || e>s_SIZE*BITS_PER_CHAR-1)
           e_trap(INDEX_RANGE,2,E_TINT+E_TEXT(14),&e);
        else
           s[e/BITS_PER_CHAR] |=(a_char)(
              (((unsigned char)0x80)>>(e%BITS_PER_CHAR)));

        E_TPOPP("s_ins1")
        return((a_VOID)&s[0]);
        }
