/**************************************************************************/
/*                                                                        */
/*                                 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: y_inxn.c,v 1.2 1997/09/25 18:25:41 ae59 Exp $ */
/*
$Log: y_inxn.c,v $
 * Revision 1.2  1997/09/25  18:25:41  ae59
 * Copyright-message
 *
 * Revision 1.1  1994/01/27  13:25:56  ae59
 * Put under RCS control
 *
 */
/****************************************************************/
/*                                                              */
/*      Filename        : y_inxn.c                              */
/*                                                              */
/*      Entry           : a_VOID y_inxn(d,e_args)               */
/*                        y_dscp d;                             */
/*                        e_list                                */
/*                                                              */
/*      Arguments       : d - descriptor of dynamic array       */
/*                        e_args - variable argument list       */
/*                                                              */
/*      Return value    : char pointer to indexed element       */
/*                                                              */
/*      Description     : determine pointer to indexed element  */
/*                        without index checking.               */
/*                                                              */
/*      Date            : 1991-05-29                            */
/*      1991-05-29 : descrtype * replaced by y_dscp             */
/*      1990-12-11 : type of variable i changed: byte -> a_intg */
/*      1990-07-04 : LINT_ARGS prototype                        */
/****************************************************************/

#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
#if C_P_7
local a_VOID y_inxn(y_dscp d,...)
#else
local a_VOID y_inxn(d,e_args)

y_dscp d;
e_list
#endif
#else
local a_VOID y_inxn(d,e_args)

y_dscp d;
e_list
#endif

        {
        a_btyp v = 0;
        a_intg i;
        va_list e_argv;

        e_open(d);

        for (i=0;i<((y_desc *)d)->numdim;i++)
           /* possible pointer allignment problems              */
           v += (e_ref(a_intg)-
((y_desc *)d)->fd[i].lbound)*((y_desc *)d)->fd[i].stride;

        e_shut;

        return((char *)(((y_desc *)d)->array)+v*((y_desc *)d)->elsize);
        }
