
/*
 *  This file was generated by the SOM Compiler.
 *  Generated using:
 *     SOM incremental update: 2.29
 */

/*
 *   COMPONENT_NAME: somx
 *
 *   ORIGINS: 27
 *
 *
 *   25H7912  (C)  COPYRIGHT International Business Machines Corp. 1992,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.
 */

#ifndef lint
static char *sccsid = "@(#) 2.17.1.1 src/somples.os2/somd/c/proxy/barproxy.c, somples.somd, som3.0 12/3/96 10:39:31 [12/4/96 15:10:02]";
#endif

/*
 *
 * DISCLAIMER OF WARRANTIES.
 * The following [enclosed] code is sample code created by IBM
 * Corporation. This sample code is not part of any standard or IBM
 * product and is provided to you solely for the purpose of assisting
 * you in the development of your applications.  The code is provided
 * "AS IS". IBM MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT
 * NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
 * FOR A PARTICULAR PURPOSE, REGARDING THE FUNCTION OR PERFORMANCE OF
 * THIS CODE.  IBM shall not be liable for any damages arising out of
 * your use of the sample code, even if they have been advised of the
 * possibility of such damages.
 *
 * DISTRIBUTION.
 * This sample code can be freely distributed, copied, altered, and
 * incorporated into other software, provided that it bears the above
 * Copyright notice and DISCLAIMER intact.
 */
/*
 *  This file was generated by the SOM Compiler and Emitter Framework.
 *  Generated using:
 *      SOM Emitter emitctm: 2.42
 */

#ifndef SOM_Module_barproxy_Source
#define SOM_Module_barproxy_Source
#endif
#define Bar__Proxy_Class_Source

#include <som.h>
#include <somtc.h>
#include <somdtype.h>
#include "barproxy.ih"


SOM_Scope long  SOMLINK _get_attribute_long(Bar__Proxy somSelf,
                                             Environment *ev)
{
    /* Bar__ProxyData *somThis = Bar__ProxyGetData(somSelf); */
    Bar__ProxyMethodDebug("Bar__Proxy","_get_attribute_long");

    return (Bar__Proxy_parent_Bar__get_attribute_long(somSelf,
                                                      ev));
}

/*
 * The method1 doesn't need to be overridden, it would be
 *     * forwarded automatically. In here, we do it to illustrate
 *     * how to explicitly cause a method to be forwarded.
 */


SOM_Scope void  SOMLINK _set_attribute_long(Bar__Proxy somSelf,
                                             Environment *ev,
                                            long attribute_long)
{
    /* Bar__ProxyData *somThis = Bar__ProxyGetData(somSelf); */
    Bar__ProxyMethodDebug("Bar__Proxy","_set_attribute_long");

    Bar__Proxy_parent_Bar__set_attribute_long(somSelf, ev, attribute_long);
}

SOM_Scope string  SOMLINK method1(Bar__Proxy somSelf,  Environment *ev,
                                  string* arg1, long* arg2, ReferenceData* arg3)
{
    SOMMProxyForObject_sommProxyDispatchInfo dispatchInfo;
    string buffer;
    somVaBuf lvb;
    va_list lap;

    buffer         = (string) SOMMalloc(30);

   /*  Bar__ProxyData *somThis = Bar__ProxyGetData(somSelf); */
    Bar__ProxyMethodDebug("Bar__Proxy","method1");

    somPrintf("BarProxy: arg2 input value  = %d\n", *arg2);
    somPrintf("BarProxy: arg3 maximum      = %d\n", arg3->_maximum);
    somPrintf("BarProxy: arg3 length       = %d\n", arg3->_length);

    if (arg3->_buffer)
    {
       somPrintf("BarProxy: arg3 buffer       = %s\n", arg3->_buffer);
    }

    lvb = (void *) somVaBuf_create(NULL, 0);

    somVaBuf_add( lvb, (char *) &somSelf, tk_pointer);
    somVaBuf_add( lvb, (char *) &ev, tk_pointer);
    somVaBuf_add( lvb, (char *) &arg1, tk_pointer);
    somVaBuf_add( lvb, (char *) &arg2, tk_pointer);
    somVaBuf_add( lvb, (char *) &arg3, tk_pointer);

    somVaBuf_get_valist( lvb, &lap );
    _somGetMethodData(_Bar, somIdFromString("method1"), &dispatchInfo.md);
    SOMMProxyForObject_sommProxyDispatch(somSelf, (void **) &buffer, &dispatchInfo,lap);

    somPrintf("BarProxy: arg2 output value = %d\n", *arg2);

    if (lvb) somVaBuf_destroy( lvb );

    return buffer;
}
