/*
 * This file was generated by orbit-idl - DO NOT EDIT!
 */

#include <string.h>
#include "test-ir.h"

void 
_ORBIT_skel_Test_Inter__get_a1(POA_Test_Inter * _ORBIT_servant, GIOPRecvBuffer * _ORBIT_recv_buffer, CORBA_Environment * ev, CORBA_long(*_impl__get_a1) (PortableServer_Servant _servant, CORBA_Environment * ev))
{
   CORBA_long _ORBIT_retval;
   _ORBIT_retval = _impl__get_a1(_ORBIT_servant, ev);
   {				/* marshalling */
      register GIOPSendBuffer *_ORBIT_send_buffer;
      _ORBIT_send_buffer = giop_send_reply_buffer_use(GIOP_MESSAGE_BUFFER(_ORBIT_recv_buffer)->connection, NULL, _ORBIT_recv_buffer->message.u.request.request_id, ev->_major);
      if (_ORBIT_send_buffer) {
	 if (ev->_major == CORBA_NO_EXCEPTION) {
	    giop_message_buffer_do_alignment(GIOP_MESSAGE_BUFFER(_ORBIT_send_buffer), 4);
	    {
	       guchar *_ORBIT_t;
	       _ORBIT_t = alloca(sizeof(_ORBIT_retval));
	       memcpy(_ORBIT_t, &(_ORBIT_retval), sizeof(_ORBIT_retval));
	       giop_message_buffer_append_mem(GIOP_MESSAGE_BUFFER(_ORBIT_send_buffer), (_ORBIT_t), sizeof(_ORBIT_retval));
	    }
	 } else
	    ORBit_send_system_exception(_ORBIT_send_buffer, ev);
	 giop_send_buffer_write(_ORBIT_send_buffer);
	 giop_send_buffer_unuse(_ORBIT_send_buffer);
      }
   }
}
void 
_ORBIT_skel_Test_Inter__set_a1(POA_Test_Inter * _ORBIT_servant, GIOPRecvBuffer * _ORBIT_recv_buffer, CORBA_Environment * ev, void (*_impl__set_a1) (PortableServer_Servant _servant, const CORBA_long value, CORBA_Environment * ev))
{
   CORBA_long value;
   {				/* demarshalling */
      guchar *_ORBIT_curptr;
      _ORBIT_curptr = GIOP_RECV_BUFFER(_ORBIT_recv_buffer)->cur;
      if (giop_msg_conversion_needed(GIOP_MESSAGE_BUFFER(_ORBIT_recv_buffer))) {
	 _ORBIT_curptr = ALIGN_ADDRESS(_ORBIT_curptr, 4);
	 (*((guint32 *) & (value))) = GUINT32_SWAP_LE_BE(*((guint32 *) _ORBIT_curptr));
      } else {
	 _ORBIT_curptr = ALIGN_ADDRESS(_ORBIT_curptr, 4);
	 value = *((CORBA_long *) _ORBIT_curptr);
      }
   }
   _impl__set_a1(_ORBIT_servant, value, ev);
   {				/* marshalling */
      register GIOPSendBuffer *_ORBIT_send_buffer;
      _ORBIT_send_buffer = giop_send_reply_buffer_use(GIOP_MESSAGE_BUFFER(_ORBIT_recv_buffer)->connection, NULL, _ORBIT_recv_buffer->message.u.request.request_id, ev->_major);
      if (_ORBIT_send_buffer) {
	 if (ev->_major == CORBA_NO_EXCEPTION) {
	 } else
	    ORBit_send_system_exception(_ORBIT_send_buffer, ev);
	 giop_send_buffer_write(_ORBIT_send_buffer);
	 giop_send_buffer_unuse(_ORBIT_send_buffer);
      }
   }
}
void 
_ORBIT_skel_Test_Inter__get_a2(POA_Test_Inter * _ORBIT_servant, GIOPRecvBuffer * _ORBIT_recv_buffer, CORBA_Environment * ev, CORBA_long(*_impl__get_a2) (PortableServer_Servant _servant, CORBA_Environment * ev))
{
   CORBA_long _ORBIT_retval;
   _ORBIT_retval = _impl__get_a2(_ORBIT_servant, ev);
   {				/* marshalling */
      register GIOPSendBuffer *_ORBIT_send_buffer;
      _ORBIT_send_buffer = giop_send_reply_buffer_use(GIOP_MESSAGE_BUFFER(_ORBIT_recv_buffer)->connection, NULL, _ORBIT_recv_buffer->message.u.request.request_id, ev->_major);
      if (_ORBIT_send_buffer) {
	 if (ev->_major == CORBA_NO_EXCEPTION) {
	    giop_message_buffer_do_alignment(GIOP_MESSAGE_BUFFER(_ORBIT_send_buffer), 4);
	    {
	       guchar *_ORBIT_t;
	       _ORBIT_t = alloca(sizeof(_ORBIT_retval));
	       memcpy(_ORBIT_t, &(_ORBIT_retval), sizeof(_ORBIT_retval));
	       giop_message_buffer_append_mem(GIOP_MESSAGE_BUFFER(_ORBIT_send_buffer), (_ORBIT_t), sizeof(_ORBIT_retval));
	    }
	 } else
	    ORBit_send_system_exception(_ORBIT_send_buffer, ev);
	 giop_send_buffer_write(_ORBIT_send_buffer);
	 giop_send_buffer_unuse(_ORBIT_send_buffer);
      }
   }
}
void 
_ORBIT_skel_Test_Inter_method1(POA_Test_Inter * _ORBIT_servant, GIOPRecvBuffer * _ORBIT_recv_buffer, CORBA_Environment * ev, CORBA_long(*_impl_method1) (PortableServer_Servant _servant, const CORBA_long arg1, CORBA_long * arg2, CORBA_Environment * ev))
{
   CORBA_long _ORBIT_retval;
   CORBA_long arg1;
   CORBA_long arg2;
   {				/* demarshalling */
      guchar *_ORBIT_curptr;
      _ORBIT_curptr = GIOP_RECV_BUFFER(_ORBIT_recv_buffer)->cur;
      if (giop_msg_conversion_needed(GIOP_MESSAGE_BUFFER(_ORBIT_recv_buffer))) {
	 _ORBIT_curptr = ALIGN_ADDRESS(_ORBIT_curptr, 4);
	 (*((guint32 *) & (arg1))) = GUINT32_SWAP_LE_BE(*((guint32 *) _ORBIT_curptr));
      } else {
	 _ORBIT_curptr = ALIGN_ADDRESS(_ORBIT_curptr, 4);
	 arg1 = *((CORBA_long *) _ORBIT_curptr);
      }
   }
   _ORBIT_retval = _impl_method1(_ORBIT_servant, arg1, &(arg2), ev);
   {				/* marshalling */
      register GIOPSendBuffer *_ORBIT_send_buffer;
      _ORBIT_send_buffer = giop_send_reply_buffer_use(GIOP_MESSAGE_BUFFER(_ORBIT_recv_buffer)->connection, NULL, _ORBIT_recv_buffer->message.u.request.request_id, ev->_major);
      if (_ORBIT_send_buffer) {
	 if (ev->_major == CORBA_NO_EXCEPTION) {
	    giop_message_buffer_do_alignment(GIOP_MESSAGE_BUFFER(_ORBIT_send_buffer), 4);
	    {
	       guchar *_ORBIT_t;
	       _ORBIT_t = alloca(sizeof(_ORBIT_retval));
	       memcpy(_ORBIT_t, &(_ORBIT_retval), sizeof(_ORBIT_retval));
	       giop_message_buffer_append_mem(GIOP_MESSAGE_BUFFER(_ORBIT_send_buffer), (_ORBIT_t), sizeof(_ORBIT_retval));
	    }
	    giop_message_buffer_append_mem(GIOP_MESSAGE_BUFFER(_ORBIT_send_buffer), &(arg2), sizeof(arg2));
	 } else
	    ORBit_send_system_exception(_ORBIT_send_buffer, ev);
	 giop_send_buffer_write(_ORBIT_send_buffer);
	 giop_send_buffer_unuse(_ORBIT_send_buffer);
      }
   }
}
static ORBitSkeleton 
get_skel_Test_Inter(POA_Test_Inter * servant,
		    GIOPRecvBuffer * _ORBIT_recv_buffer,
		    gpointer * impl)
{
   gchar *opname = _ORBIT_recv_buffer->message.u.request.operation;
   switch (opname[0]) {
	 case '_':
	    switch (opname[1]) {
		  case 'g':
		     switch (opname[2]) {
			   case 'e':
			      switch (opname[3]) {
				    case 't':
				       switch (opname[4]) {
					     case '_':
						switch (opname[5]) {
						      case 'a':
							 switch (opname[6]) {
							       case '1':
								  if (strcmp((opname + 7), ""))
								     break;
								  *impl = (gpointer) servant->vepv->Test_Inter_epv->_get_a1;
								  return (ORBitSkeleton) _ORBIT_skel_Test_Inter__get_a1;
								  break;
							       case '2':
								  if (strcmp((opname + 7), ""))
								     break;
								  *impl = (gpointer) servant->vepv->Test_Inter_epv->_get_a2;
								  return (ORBitSkeleton) _ORBIT_skel_Test_Inter__get_a2;
								  break;
							       default:
								  break;
							 }
							 break;
						      default:
							 break;
						}
						break;
					     default:
						break;
				       }
				       break;
				    default:
				       break;
			      }
			      break;
			   default:
			      break;
		     }
		     break;
		  case 's':
		     if (strcmp((opname + 2), "et_a1"))
			break;
		     *impl = (gpointer) servant->vepv->Test_Inter_epv->_set_a1;
		     return (ORBitSkeleton) _ORBIT_skel_Test_Inter__set_a1;
		     break;
		  default:
		     break;
	    }
	    break;
	 case 'm':
	    if (strcmp((opname + 1), "ethod1"))
	       break;
	    *impl = (gpointer) servant->vepv->Test_Inter_epv->method1;
	    return (ORBitSkeleton) _ORBIT_skel_Test_Inter_method1;
	    break;
	 default:
	    break;
   }
   return NULL;
}

static void 
init_local_objref_Test_Inter(CORBA_Object obj, POA_Test_Inter * servant)
{
   obj->vepv[Test_Inter__classid] = servant->vepv->Test_Inter_epv;
}
void 
POA_Test_Inter__init(PortableServer_Servant servant,
		     CORBA_Environment * env)
{
   static const PortableServer_ClassInfo class_info = {(ORBit_impl_finder) & get_skel_Test_Inter, "IDL:Test/Inter:1.0", (ORBit_local_objref_init) & init_local_objref_Test_Inter};
   PortableServer_ServantBase__init(((PortableServer_ServantBase *) servant), env);
   ORBIT_OBJECT_KEY(((PortableServer_ServantBase *) servant)->_private)->class_info = (PortableServer_ClassInfo *) & class_info;
   if (!Test_Inter__classid)
      Test_Inter__classid = ORBit_register_class(&class_info);
}

void 
POA_Test_Inter__fini(PortableServer_Servant servant,
		     CORBA_Environment * env)
{
   PortableServer_ServantBase__fini(servant, env);
}
