//====START_GENERATED_PROLOG======================================
//
//
//   COMPONENT_NAME: odutils
//
//   CLASSES: none
//
//   ORIGINS: 81,82,27
//
//
//   (C) COPYRIGHT International Business Machines Corp. 1995,1996
//   All Rights Reserved
//   Licensed Materials - Property of IBM
//   US Government Users Restricted Rights - Use, duplication or
//   disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
//   	
//   IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
//   ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
//   PURPOSE. IN NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR
//   CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
//   USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
//   OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
//   OR PERFORMANCE OF THIS SOFTWARE.
//
//====END_GENERATED_PROLOG========================================
//
// @(#) 1.2 nt/src/utils/mlink.cpp, odutils, od96nt, odnt9712d 11/1/96 19:07:54 [ 3/21/97 17:37:37 ]
//
//   Copyright © 1988 Apple Computer, Inc. All rights reserved.

/* WIN16PORT ADD3 */
#ifdef _WIN16
#pragma data_seg("_DATA")
#endif


#define somf_MLinkable_Class_Source
#include "mlink.xih"

/* Defines to take the place of PrimitiveTypes.h */
#define SOMF_NIL 0
#define Boolean boolean

/*
 * -- Original Instance Data (this is a comment -- actual defn in MLink.xih)
 */
/*
typedef struct {
	somf_MLinkable *fNext;
	somf_MLinkable *fPrevious;
} somf_MLinkableData;
*/

/*
 * -- Method Procedures for somf_MLinkable
 */

/*
 *  This is the closest SOM has to a constructor, the original pink reference
 *  is below:
 *    somf_MLinkable()   { fNext = SOMF_NIL; fPrevious = SOMF_NIL;}
 */

SOM_Scope void   SOMLINK somInit(somf_MLinkable *somSelf)
{
    somf_MLinkableData *somThis = somf_MLinkableGetData(somSelf);
    somf_MLinkableMethodDebug("somf_MLinkable","somInit");

    parent_SOMObject_somInit(somSelf);

   somThis->fNext = SOMF_NIL;
   somThis->fPrevious = SOMF_NIL;
}

/*
 *  There is no such thing as a constructor in SOM, the closest thing is
 *  somInit, which doesn't take arguments.  This means the following
 *  initialization can not be done through a SOM constructor.  Create an
 *  instance of the somf_MLinkable class, and call somfMLinkableInit to
 *  initialize it.
 *
 *    somf_MLinkable(somf_MLinkable* n, somf_MLinkable* p)   { fNext = n; fPrevious = p;}
 */

/*
 *  This method initialized the somf_MLinkable object using n and p.
 */


/*
 * SOM_Scope somf_MLinkable *  SOMLINK somfMLinkableInit(somf_MLinkable *somSelf,
 *              somf_MLinkable *n,
 *              somf_MLinkable *p)
 */

/*
 * The prototype for somfMLinkableInit was replaced by the following prototype:
 */
SOM_Scope somf_MLinkable*  SOMLINK somfMLinkableInit(somf_MLinkable *somSelf, Environment *ev,
		somf_MLinkable* n,
		somf_MLinkable* p)
{
    somf_MLinkableData *somThis = somf_MLinkableGetData(somSelf);
    somf_MLinkableMethodDebug("somf_MLinkable","somfMLinkableInit");

   somThis->fNext = n;
   somThis->fPrevious = p;

   return(somSelf);
//    return (somf_MLinkable*) 0;
}

/*
 *    somf_MLinkable* somfGetNext() const { return fNext;}
 */

/*
 *  This method returns a pointer to the next somf_MLinkable.
 */


/*
 * SOM_Scope somf_MLinkable *  SOMLINK somfGetNext(somf_MLinkable *somSelf)
 */

/*
 * The prototype for somfGetNext was replaced by the following prototype:
 */
SOM_Scope somf_MLinkable*  SOMLINK somfGetNext(somf_MLinkable *somSelf, Environment *ev)
{
    somf_MLinkableData *somThis = somf_MLinkableGetData(somSelf);
    somf_MLinkableMethodDebug("somf_MLinkable","somfGetNext");

    return (somThis->fNext);
}

/*
 *    void somfSetNext(somf_MLinkable* aLink) { fNext = aLink;}
 */

/*
 *  This method sets the pointer to the next somf_MLinkable.
 */


/*
 * SOM_Scope void   SOMLINK somfSetNext(somf_MLinkable *somSelf,
 *              somf_MLinkable *aLink)
 */

/*
 * The prototype for somfSetNext was replaced by the following prototype:
 */
SOM_Scope void  SOMLINK somfSetNext(somf_MLinkable *somSelf, Environment *ev,
		somf_MLinkable* aLink)
{
    somf_MLinkableData *somThis = somf_MLinkableGetData(somSelf);
    somf_MLinkableMethodDebug("somf_MLinkable","somfSetNext");

   somThis->fNext = aLink;
}

/*
 *    somf_MLinkable* somfGetPrevious() const { return fPrevious;}
 */

/*
 *  This method returns a pointer to the previous somf_MLinkable.
 */


/*
 * SOM_Scope somf_MLinkable *  SOMLINK somfGetPrevious(somf_MLinkable *somSelf)
 */

/*
 * The prototype for somfGetPrevious was replaced by the following prototype:
 */
SOM_Scope somf_MLinkable*  SOMLINK somfGetPrevious(somf_MLinkable *somSelf, Environment *ev)
{
    somf_MLinkableData *somThis = somf_MLinkableGetData(somSelf);
    somf_MLinkableMethodDebug("somf_MLinkable","somfGetPrevious");

    return (somThis->fPrevious);
}

/*
 *   void somfSetPrevious(somf_MLinkable* aLink) { fPrevious = aLink;}
 */

/*
 *  This method sets the pointer to the previous somf_MLinkable.
 */


/*
 * SOM_Scope void   SOMLINK somfSetPrevious(somf_MLinkable *somSelf,
 *              somf_MLinkable *aLink)
 */

/*
 * The prototype for somfSetPrevious was replaced by the following prototype:
 */
SOM_Scope void  SOMLINK somfSetPrevious(somf_MLinkable *somSelf, Environment *ev,
		somf_MLinkable* aLink)
{
    somf_MLinkableData *somThis = somf_MLinkableGetData(somSelf);
    somf_MLinkableMethodDebug("somf_MLinkable","somfSetPrevious");

   somThis->fPrevious = aLink;
}
