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

#include <string.h>
#include "CosNaming.h"

void
_ORBIT_CosNaming_NamingContext_NotFound_marshal(GIOPSendBuffer * _ORBIT_send_buffer, CORBA_Environment * ev)
{
   register CORBA_unsigned_long _ORBIT_tmpvar_0;
   register CORBA_unsigned_long _ORBIT_tmpvar_1;
   CORBA_unsigned_long _ORBIT_tmpvar_2;
   register CORBA_unsigned_long _ORBIT_tmpvar_3;
   CORBA_unsigned_long _ORBIT_tmpvar_4;
   CosNaming_NamingContext_NotFound *_ORBIT_exdata = ev->_params;
   giop_message_buffer_do_alignment(GIOP_MESSAGE_BUFFER(_ORBIT_send_buffer), 4);
   giop_message_buffer_append_mem(GIOP_MESSAGE_BUFFER(_ORBIT_send_buffer), &((*_ORBIT_exdata).why), sizeof((*_ORBIT_exdata).why));
   giop_send_buffer_append_mem_indirect(GIOP_SEND_BUFFER(_ORBIT_send_buffer), &((*_ORBIT_exdata).rest_of_name._length), sizeof((*_ORBIT_exdata).rest_of_name._length));
   for (_ORBIT_tmpvar_0 = 0; _ORBIT_tmpvar_0 < (*_ORBIT_exdata).rest_of_name._length; _ORBIT_tmpvar_0++) {
      _ORBIT_tmpvar_2 = strlen((*_ORBIT_exdata).rest_of_name._buffer[_ORBIT_tmpvar_0].id) + 1;
      giop_message_buffer_do_alignment(GIOP_MESSAGE_BUFFER(_ORBIT_send_buffer), 4);
      giop_send_buffer_append_mem_indirect(GIOP_SEND_BUFFER(_ORBIT_send_buffer), &(_ORBIT_tmpvar_2), sizeof(_ORBIT_tmpvar_2));
      giop_send_buffer_append_mem_indirect(GIOP_SEND_BUFFER(_ORBIT_send_buffer), ((*_ORBIT_exdata).rest_of_name._buffer[_ORBIT_tmpvar_0].id), sizeof((*_ORBIT_exdata).rest_of_name._buffer[_ORBIT_tmpvar_0].id[_ORBIT_tmpvar_1]) * _ORBIT_tmpvar_2);
      _ORBIT_tmpvar_4 = strlen((*_ORBIT_exdata).rest_of_name._buffer[_ORBIT_tmpvar_0].kind) + 1;
      giop_message_buffer_do_alignment(GIOP_MESSAGE_BUFFER(_ORBIT_send_buffer), 4);
      giop_send_buffer_append_mem_indirect(GIOP_SEND_BUFFER(_ORBIT_send_buffer), &(_ORBIT_tmpvar_4), sizeof(_ORBIT_tmpvar_4));
      giop_send_buffer_append_mem_indirect(GIOP_SEND_BUFFER(_ORBIT_send_buffer), ((*_ORBIT_exdata).rest_of_name._buffer[_ORBIT_tmpvar_0].kind), sizeof((*_ORBIT_exdata).rest_of_name._buffer[_ORBIT_tmpvar_0].kind[_ORBIT_tmpvar_3]) * _ORBIT_tmpvar_4);
   }

}
void
_ORBIT_CosNaming_NamingContext_CannotProceed_marshal(GIOPSendBuffer * _ORBIT_send_buffer, CORBA_Environment * ev)
{
   register CORBA_unsigned_long _ORBIT_tmpvar_0;
   register CORBA_unsigned_long _ORBIT_tmpvar_1;
   CORBA_unsigned_long _ORBIT_tmpvar_2;
   register CORBA_unsigned_long _ORBIT_tmpvar_3;
   CORBA_unsigned_long _ORBIT_tmpvar_4;
   CosNaming_NamingContext_CannotProceed *_ORBIT_exdata = ev->_params;
   ORBit_marshal_object(_ORBIT_send_buffer, (*_ORBIT_exdata).ctx);
   giop_message_buffer_do_alignment(GIOP_MESSAGE_BUFFER(_ORBIT_send_buffer), 4);
   giop_send_buffer_append_mem_indirect(GIOP_SEND_BUFFER(_ORBIT_send_buffer), &((*_ORBIT_exdata).rest_of_name._length), sizeof((*_ORBIT_exdata).rest_of_name._length));
   for (_ORBIT_tmpvar_0 = 0; _ORBIT_tmpvar_0 < (*_ORBIT_exdata).rest_of_name._length; _ORBIT_tmpvar_0++) {
      _ORBIT_tmpvar_2 = strlen((*_ORBIT_exdata).rest_of_name._buffer[_ORBIT_tmpvar_0].id) + 1;
      giop_message_buffer_do_alignment(GIOP_MESSAGE_BUFFER(_ORBIT_send_buffer), 4);
      giop_send_buffer_append_mem_indirect(GIOP_SEND_BUFFER(_ORBIT_send_buffer), &(_ORBIT_tmpvar_2), sizeof(_ORBIT_tmpvar_2));
      giop_send_buffer_append_mem_indirect(GIOP_SEND_BUFFER(_ORBIT_send_buffer), ((*_ORBIT_exdata).rest_of_name._buffer[_ORBIT_tmpvar_0].id), sizeof((*_ORBIT_exdata).rest_of_name._buffer[_ORBIT_tmpvar_0].id[_ORBIT_tmpvar_1]) * _ORBIT_tmpvar_2);
      _ORBIT_tmpvar_4 = strlen((*_ORBIT_exdata).rest_of_name._buffer[_ORBIT_tmpvar_0].kind) + 1;
      giop_message_buffer_do_alignment(GIOP_MESSAGE_BUFFER(_ORBIT_send_buffer), 4);
      giop_send_buffer_append_mem_indirect(GIOP_SEND_BUFFER(_ORBIT_send_buffer), &(_ORBIT_tmpvar_4), sizeof(_ORBIT_tmpvar_4));
      giop_send_buffer_append_mem_indirect(GIOP_SEND_BUFFER(_ORBIT_send_buffer), ((*_ORBIT_exdata).rest_of_name._buffer[_ORBIT_tmpvar_0].kind), sizeof((*_ORBIT_exdata).rest_of_name._buffer[_ORBIT_tmpvar_0].kind[_ORBIT_tmpvar_3]) * _ORBIT_tmpvar_4);
   }

}
void
_ORBIT_CosNaming_NamingContext_InvalidName_marshal(GIOPSendBuffer * _ORBIT_send_buffer, CORBA_Environment * ev)
{
}
void
_ORBIT_CosNaming_NamingContext_AlreadyBound_marshal(GIOPSendBuffer * _ORBIT_send_buffer, CORBA_Environment * ev)
{
}
void
_ORBIT_CosNaming_NamingContext_NotEmpty_marshal(GIOPSendBuffer * _ORBIT_send_buffer, CORBA_Environment * ev)
{
}
void 
_ORBIT_skel_CosNaming_NamingContext_bind(POA_CosNaming_NamingContext * _ORBIT_servant, GIOPRecvBuffer * _ORBIT_recv_buffer, CORBA_Environment * ev, void (*_impl_bind) (PortableServer_Servant _servant, const CosNaming_Name * n, const CORBA_Object obj, CORBA_Environment * ev))
{
   CosNaming_Name n = {0, 0, NULL, CORBA_FALSE};
   CORBA_Object obj;
   {				/* demarshalling */
      guchar *_ORBIT_curptr;
      register CORBA_unsigned_long _ORBIT_tmpvar_5;
      register CORBA_unsigned_long _ORBIT_tmpvar_6;
      CORBA_unsigned_long _ORBIT_tmpvar_7;
      register CORBA_unsigned_long _ORBIT_tmpvar_8;
      CORBA_unsigned_long _ORBIT_tmpvar_9;
      _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 *) & (n._length))) = GUINT32_SWAP_LE_BE(*((guint32 *) _ORBIT_curptr));
	 _ORBIT_curptr += 4;
	 n._buffer = alloca(sizeof(n._buffer[_ORBIT_tmpvar_5]) * n._length);
	 n._release = CORBA_FALSE;
	 for (_ORBIT_tmpvar_5 = 0; _ORBIT_tmpvar_5 < n._length; _ORBIT_tmpvar_5++) {
	    _ORBIT_curptr = ALIGN_ADDRESS(_ORBIT_curptr, 4);
	    (*((guint32 *) & (_ORBIT_tmpvar_7))) = GUINT32_SWAP_LE_BE(*((guint32 *) _ORBIT_curptr));
	    _ORBIT_curptr += 4;
	    n._buffer[_ORBIT_tmpvar_5].id = (void *) _ORBIT_curptr;
	    _ORBIT_curptr += sizeof(n._buffer[_ORBIT_tmpvar_5].id[_ORBIT_tmpvar_6]) * _ORBIT_tmpvar_7;
	    _ORBIT_curptr = ALIGN_ADDRESS(_ORBIT_curptr, 4);
	    (*((guint32 *) & (_ORBIT_tmpvar_9))) = GUINT32_SWAP_LE_BE(*((guint32 *) _ORBIT_curptr));
	    _ORBIT_curptr += 4;
	    n._buffer[_ORBIT_tmpvar_5].kind = (void *) _ORBIT_curptr;
	    _ORBIT_curptr += sizeof(n._buffer[_ORBIT_tmpvar_5].kind[_ORBIT_tmpvar_8]) * _ORBIT_tmpvar_9;
	 }

	 GIOP_RECV_BUFFER(_ORBIT_recv_buffer)->cur = _ORBIT_curptr;
	 obj = ORBit_demarshal_object(_ORBIT_recv_buffer, (((ORBit_ObjectKey *) _ORBIT_servant->_private)->object->orb));
	 _ORBIT_curptr = GIOP_RECV_BUFFER(_ORBIT_recv_buffer)->cur;
      } else {
	 _ORBIT_curptr = ALIGN_ADDRESS(_ORBIT_curptr, 4);
	 n._length = *((CORBA_unsigned_long *) _ORBIT_curptr);
	 _ORBIT_curptr += 4;
	 n._buffer = alloca(sizeof(n._buffer[_ORBIT_tmpvar_5]) * n._length);
	 n._release = CORBA_FALSE;
	 for (_ORBIT_tmpvar_5 = 0; _ORBIT_tmpvar_5 < n._length; _ORBIT_tmpvar_5++) {
	    _ORBIT_curptr = ALIGN_ADDRESS(_ORBIT_curptr, 4);
	    _ORBIT_tmpvar_7 = *((CORBA_unsigned_long *) _ORBIT_curptr);
	    _ORBIT_curptr += 4;
	    n._buffer[_ORBIT_tmpvar_5].id = (void *) _ORBIT_curptr;
	    _ORBIT_curptr += sizeof(n._buffer[_ORBIT_tmpvar_5].id[_ORBIT_tmpvar_6]) * _ORBIT_tmpvar_7;
	    _ORBIT_curptr = ALIGN_ADDRESS(_ORBIT_curptr, 4);
	    _ORBIT_tmpvar_9 = *((CORBA_unsigned_long *) _ORBIT_curptr);
	    _ORBIT_curptr += 4;
	    n._buffer[_ORBIT_tmpvar_5].kind = (void *) _ORBIT_curptr;
	    _ORBIT_curptr += sizeof(n._buffer[_ORBIT_tmpvar_5].kind[_ORBIT_tmpvar_8]) * _ORBIT_tmpvar_9;
	 }

	 GIOP_RECV_BUFFER(_ORBIT_recv_buffer)->cur = _ORBIT_curptr;
	 obj = ORBit_demarshal_object(_ORBIT_recv_buffer, (((ORBit_ObjectKey *) _ORBIT_servant->_private)->object->orb));
	 _ORBIT_curptr = GIOP_RECV_BUFFER(_ORBIT_recv_buffer)->cur;
      }
   }
   _impl_bind(_ORBIT_servant, &(n), obj, 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 if (ev->_major == CORBA_USER_EXCEPTION) {
	    static const ORBit_exception_marshal_info _ORBIT_user_exceptions[] = {{(const CORBA_TypeCode) & TC_CosNaming_NamingContext_NotFound_struct, (gpointer) _ORBIT_CosNaming_NamingContext_NotFound_marshal}, {(const CORBA_TypeCode) & TC_CosNaming_NamingContext_CannotProceed_struct, (gpointer) _ORBIT_CosNaming_NamingContext_CannotProceed_marshal}, {(const CORBA_TypeCode) & TC_CosNaming_NamingContext_InvalidName_struct, (gpointer) _ORBIT_CosNaming_NamingContext_InvalidName_marshal}, {(const CORBA_TypeCode) & TC_CosNaming_NamingContext_AlreadyBound_struct, (gpointer) _ORBIT_CosNaming_NamingContext_AlreadyBound_marshal}, {CORBA_OBJECT_NIL, NULL}};
	    ORBit_send_user_exception(_ORBIT_send_buffer, ev, _ORBIT_user_exceptions);
	 } else
	    ORBit_send_system_exception(_ORBIT_send_buffer, ev);
	 giop_send_buffer_write(_ORBIT_send_buffer);
	 giop_send_buffer_unuse(_ORBIT_send_buffer);
      }
      CORBA_Object_release(obj, ev);
   }
}
void 
_ORBIT_skel_CosNaming_NamingContext_rebind(POA_CosNaming_NamingContext * _ORBIT_servant, GIOPRecvBuffer * _ORBIT_recv_buffer, CORBA_Environment * ev, void (*_impl_rebind) (PortableServer_Servant _servant, const CosNaming_Name * n, const CORBA_Object obj, CORBA_Environment * ev))
{
   CosNaming_Name n = {0, 0, NULL, CORBA_FALSE};
   CORBA_Object obj;
   {				/* demarshalling */
      guchar *_ORBIT_curptr;
      register CORBA_unsigned_long _ORBIT_tmpvar_5;
      register CORBA_unsigned_long _ORBIT_tmpvar_6;
      CORBA_unsigned_long _ORBIT_tmpvar_7;
      register CORBA_unsigned_long _ORBIT_tmpvar_8;
      CORBA_unsigned_long _ORBIT_tmpvar_9;
      _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 *) & (n._length))) = GUINT32_SWAP_LE_BE(*((guint32 *) _ORBIT_curptr));
	 _ORBIT_curptr += 4;
	 n._buffer = alloca(sizeof(n._buffer[_ORBIT_tmpvar_5]) * n._length);
	 n._release = CORBA_FALSE;
	 for (_ORBIT_tmpvar_5 = 0; _ORBIT_tmpvar_5 < n._length; _ORBIT_tmpvar_5++) {
	    _ORBIT_curptr = ALIGN_ADDRESS(_ORBIT_curptr, 4);
	    (*((guint32 *) & (_ORBIT_tmpvar_7))) = GUINT32_SWAP_LE_BE(*((guint32 *) _ORBIT_curptr));
	    _ORBIT_curptr += 4;
	    n._buffer[_ORBIT_tmpvar_5].id = (void *) _ORBIT_curptr;
	    _ORBIT_curptr += sizeof(n._buffer[_ORBIT_tmpvar_5].id[_ORBIT_tmpvar_6]) * _ORBIT_tmpvar_7;
	    _ORBIT_curptr = ALIGN_ADDRESS(_ORBIT_curptr, 4);
	    (*((guint32 *) & (_ORBIT_tmpvar_9))) = GUINT32_SWAP_LE_BE(*((guint32 *) _ORBIT_curptr));
	    _ORBIT_curptr += 4;
	    n._buffer[_ORBIT_tmpvar_5].kind = (void *) _ORBIT_curptr;
	    _ORBIT_curptr += sizeof(n._buffer[_ORBIT_tmpvar_5].kind[_ORBIT_tmpvar_8]) * _ORBIT_tmpvar_9;
	 }

	 GIOP_RECV_BUFFER(_ORBIT_recv_buffer)->cur = _ORBIT_curptr;
	 obj = ORBit_demarshal_object(_ORBIT_recv_buffer, (((ORBit_ObjectKey *) _ORBIT_servant->_private)->object->orb));
	 _ORBIT_curptr = GIOP_RECV_BUFFER(_ORBIT_recv_buffer)->cur;
      } else {
	 _ORBIT_curptr = ALIGN_ADDRESS(_ORBIT_curptr, 4);
	 n._length = *((CORBA_unsigned_long *) _ORBIT_curptr);
	 _ORBIT_curptr += 4;
	 n._buffer = alloca(sizeof(n._buffer[_ORBIT_tmpvar_5]) * n._length);
	 n._release = CORBA_FALSE;
	 for (_ORBIT_tmpvar_5 = 0; _ORBIT_tmpvar_5 < n._length; _ORBIT_tmpvar_5++) {
	    _ORBIT_curptr = ALIGN_ADDRESS(_ORBIT_curptr, 4);
	    _ORBIT_tmpvar_7 = *((CORBA_unsigned_long *) _ORBIT_curptr);
	    _ORBIT_curptr += 4;
	    n._buffer[_ORBIT_tmpvar_5].id = (void *) _ORBIT_curptr;
	    _ORBIT_curptr += sizeof(n._buffer[_ORBIT_tmpvar_5].id[_ORBIT_tmpvar_6]) * _ORBIT_tmpvar_7;
	    _ORBIT_curptr = ALIGN_ADDRESS(_ORBIT_curptr, 4);
	    _ORBIT_tmpvar_9 = *((CORBA_unsigned_long *) _ORBIT_curptr);
	    _ORBIT_curptr += 4;
	    n._buffer[_ORBIT_tmpvar_5].kind = (void *) _ORBIT_curptr;
	    _ORBIT_curptr += sizeof(n._buffer[_ORBIT_tmpvar_5].kind[_ORBIT_tmpvar_8]) * _ORBIT_tmpvar_9;
	 }

	 GIOP_RECV_BUFFER(_ORBIT_recv_buffer)->cur = _ORBIT_curptr;
	 obj = ORBit_demarshal_object(_ORBIT_recv_buffer, (((ORBit_ObjectKey *) _ORBIT_servant->_private)->object->orb));
	 _ORBIT_curptr = GIOP_RECV_BUFFER(_ORBIT_recv_buffer)->cur;
      }
   }
   _impl_rebind(_ORBIT_servant, &(n), obj, 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 if (ev->_major == CORBA_USER_EXCEPTION) {
	    static const ORBit_exception_marshal_info _ORBIT_user_exceptions[] = {{(const CORBA_TypeCode) & TC_CosNaming_NamingContext_NotFound_struct, (gpointer) _ORBIT_CosNaming_NamingContext_NotFound_marshal}, {(const CORBA_TypeCode) & TC_CosNaming_NamingContext_CannotProceed_struct, (gpointer) _ORBIT_CosNaming_NamingContext_CannotProceed_marshal}, {(const CORBA_TypeCode) & TC_CosNaming_NamingContext_InvalidName_struct, (gpointer) _ORBIT_CosNaming_NamingContext_InvalidName_marshal}, {CORBA_OBJECT_NIL, NULL}};
	    ORBit_send_user_exception(_ORBIT_send_buffer, ev, _ORBIT_user_exceptions);
	 } else
	    ORBit_send_system_exception(_ORBIT_send_buffer, ev);
	 giop_send_buffer_write(_ORBIT_send_buffer);
	 giop_send_buffer_unuse(_ORBIT_send_buffer);
      }
      CORBA_Object_release(obj, ev);
   }
}
void 
_ORBIT_skel_CosNaming_NamingContext_bind_context(POA_CosNaming_NamingContext * _ORBIT_servant, GIOPRecvBuffer * _ORBIT_recv_buffer, CORBA_Environment * ev, void (*_impl_bind_context) (PortableServer_Servant _servant, const CosNaming_Name * n, const CosNaming_NamingContext nc, CORBA_Environment * ev))
{
   CosNaming_Name n = {0, 0, NULL, CORBA_FALSE};
   CosNaming_NamingContext nc;
   {				/* demarshalling */
      guchar *_ORBIT_curptr;
      register CORBA_unsigned_long _ORBIT_tmpvar_5;
      register CORBA_unsigned_long _ORBIT_tmpvar_6;
      CORBA_unsigned_long _ORBIT_tmpvar_7;
      register CORBA_unsigned_long _ORBIT_tmpvar_8;
      CORBA_unsigned_long _ORBIT_tmpvar_9;
      _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 *) & (n._length))) = GUINT32_SWAP_LE_BE(*((guint32 *) _ORBIT_curptr));
	 _ORBIT_curptr += 4;
	 n._buffer = alloca(sizeof(n._buffer[_ORBIT_tmpvar_5]) * n._length);
	 n._release = CORBA_FALSE;
	 for (_ORBIT_tmpvar_5 = 0; _ORBIT_tmpvar_5 < n._length; _ORBIT_tmpvar_5++) {
	    _ORBIT_curptr = ALIGN_ADDRESS(_ORBIT_curptr, 4);
	    (*((guint32 *) & (_ORBIT_tmpvar_7))) = GUINT32_SWAP_LE_BE(*((guint32 *) _ORBIT_curptr));
	    _ORBIT_curptr += 4;
	    n._buffer[_ORBIT_tmpvar_5].id = (void *) _ORBIT_curptr;
	    _ORBIT_curptr += sizeof(n._buffer[_ORBIT_tmpvar_5].id[_ORBIT_tmpvar_6]) * _ORBIT_tmpvar_7;
	    _ORBIT_curptr = ALIGN_ADDRESS(_ORBIT_curptr, 4);
	    (*((guint32 *) & (_ORBIT_tmpvar_9))) = GUINT32_SWAP_LE_BE(*((guint32 *) _ORBIT_curptr));
	    _ORBIT_curptr += 4;
	    n._buffer[_ORBIT_tmpvar_5].kind = (void *) _ORBIT_curptr;
	    _ORBIT_curptr += sizeof(n._buffer[_ORBIT_tmpvar_5].kind[_ORBIT_tmpvar_8]) * _ORBIT_tmpvar_9;
	 }

	 GIOP_RECV_BUFFER(_ORBIT_recv_buffer)->cur = _ORBIT_curptr;
	 nc = ORBit_demarshal_object(_ORBIT_recv_buffer, (((ORBit_ObjectKey *) _ORBIT_servant->_private)->object->orb));
	 _ORBIT_curptr = GIOP_RECV_BUFFER(_ORBIT_recv_buffer)->cur;
      } else {
	 _ORBIT_curptr = ALIGN_ADDRESS(_ORBIT_curptr, 4);
	 n._length = *((CORBA_unsigned_long *) _ORBIT_curptr);
	 _ORBIT_curptr += 4;
	 n._buffer = alloca(sizeof(n._buffer[_ORBIT_tmpvar_5]) * n._length);
	 n._release = CORBA_FALSE;
	 for (_ORBIT_tmpvar_5 = 0; _ORBIT_tmpvar_5 < n._length; _ORBIT_tmpvar_5++) {
	    _ORBIT_curptr = ALIGN_ADDRESS(_ORBIT_curptr, 4);
	    _ORBIT_tmpvar_7 = *((CORBA_unsigned_long *) _ORBIT_curptr);
	    _ORBIT_curptr += 4;
	    n._buffer[_ORBIT_tmpvar_5].id = (void *) _ORBIT_curptr;
	    _ORBIT_curptr += sizeof(n._buffer[_ORBIT_tmpvar_5].id[_ORBIT_tmpvar_6]) * _ORBIT_tmpvar_7;
	    _ORBIT_curptr = ALIGN_ADDRESS(_ORBIT_curptr, 4);
	    _ORBIT_tmpvar_9 = *((CORBA_unsigned_long *) _ORBIT_curptr);
	    _ORBIT_curptr += 4;
	    n._buffer[_ORBIT_tmpvar_5].kind = (void *) _ORBIT_curptr;
	    _ORBIT_curptr += sizeof(n._buffer[_ORBIT_tmpvar_5].kind[_ORBIT_tmpvar_8]) * _ORBIT_tmpvar_9;
	 }

	 GIOP_RECV_BUFFER(_ORBIT_recv_buffer)->cur = _ORBIT_curptr;
	 nc = ORBit_demarshal_object(_ORBIT_recv_buffer, (((ORBit_ObjectKey *) _ORBIT_servant->_private)->object->orb));
	 _ORBIT_curptr = GIOP_RECV_BUFFER(_ORBIT_recv_buffer)->cur;
      }
   }
   _impl_bind_context(_ORBIT_servant, &(n), nc, 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 if (ev->_major == CORBA_USER_EXCEPTION) {
	    static const ORBit_exception_marshal_info _ORBIT_user_exceptions[] = {{(const CORBA_TypeCode) & TC_CosNaming_NamingContext_NotFound_struct, (gpointer) _ORBIT_CosNaming_NamingContext_NotFound_marshal}, {(const CORBA_TypeCode) & TC_CosNaming_NamingContext_CannotProceed_struct, (gpointer) _ORBIT_CosNaming_NamingContext_CannotProceed_marshal}, {(const CORBA_TypeCode) & TC_CosNaming_NamingContext_InvalidName_struct, (gpointer) _ORBIT_CosNaming_NamingContext_InvalidName_marshal}, {(const CORBA_TypeCode) & TC_CosNaming_NamingContext_AlreadyBound_struct, (gpointer) _ORBIT_CosNaming_NamingContext_AlreadyBound_marshal}, {CORBA_OBJECT_NIL, NULL}};
	    ORBit_send_user_exception(_ORBIT_send_buffer, ev, _ORBIT_user_exceptions);
	 } else
	    ORBit_send_system_exception(_ORBIT_send_buffer, ev);
	 giop_send_buffer_write(_ORBIT_send_buffer);
	 giop_send_buffer_unuse(_ORBIT_send_buffer);
      }
      CORBA_Object_release(nc, ev);
   }
}
void 
_ORBIT_skel_CosNaming_NamingContext_rebind_context(POA_CosNaming_NamingContext * _ORBIT_servant, GIOPRecvBuffer * _ORBIT_recv_buffer, CORBA_Environment * ev, void (*_impl_rebind_context) (PortableServer_Servant _servant, const CosNaming_Name * n, const CosNaming_NamingContext nc, CORBA_Environment * ev))
{
   CosNaming_Name n = {0, 0, NULL, CORBA_FALSE};
   CosNaming_NamingContext nc;
   {				/* demarshalling */
      guchar *_ORBIT_curptr;
      register CORBA_unsigned_long _ORBIT_tmpvar_5;
      register CORBA_unsigned_long _ORBIT_tmpvar_6;
      CORBA_unsigned_long _ORBIT_tmpvar_7;
      register CORBA_unsigned_long _ORBIT_tmpvar_8;
      CORBA_unsigned_long _ORBIT_tmpvar_9;
      _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 *) & (n._length))) = GUINT32_SWAP_LE_BE(*((guint32 *) _ORBIT_curptr));
	 _ORBIT_curptr += 4;
	 n._buffer = alloca(sizeof(n._buffer[_ORBIT_tmpvar_5]) * n._length);
	 n._release = CORBA_FALSE;
	 for (_ORBIT_tmpvar_5 = 0; _ORBIT_tmpvar_5 < n._length; _ORBIT_tmpvar_5++) {
	    _ORBIT_curptr = ALIGN_ADDRESS(_ORBIT_curptr, 4);
	    (*((guint32 *) & (_ORBIT_tmpvar_7))) = GUINT32_SWAP_LE_BE(*((guint32 *) _ORBIT_curptr));
	    _ORBIT_curptr += 4;
	    n._buffer[_ORBIT_tmpvar_5].id = (void *) _ORBIT_curptr;
	    _ORBIT_curptr += sizeof(n._buffer[_ORBIT_tmpvar_5].id[_ORBIT_tmpvar_6]) * _ORBIT_tmpvar_7;
	    _ORBIT_curptr = ALIGN_ADDRESS(_ORBIT_curptr, 4);
	    (*((guint32 *) & (_ORBIT_tmpvar_9))) = GUINT32_SWAP_LE_BE(*((guint32 *) _ORBIT_curptr));
	    _ORBIT_curptr += 4;
	    n._buffer[_ORBIT_tmpvar_5].kind = (void *) _ORBIT_curptr;
	    _ORBIT_curptr += sizeof(n._buffer[_ORBIT_tmpvar_5].kind[_ORBIT_tmpvar_8]) * _ORBIT_tmpvar_9;
	 }

	 GIOP_RECV_BUFFER(_ORBIT_recv_buffer)->cur = _ORBIT_curptr;
	 nc = ORBit_demarshal_object(_ORBIT_recv_buffer, (((ORBit_ObjectKey *) _ORBIT_servant->_private)->object->orb));
	 _ORBIT_curptr = GIOP_RECV_BUFFER(_ORBIT_recv_buffer)->cur;
      } else {
	 _ORBIT_curptr = ALIGN_ADDRESS(_ORBIT_curptr, 4);
	 n._length = *((CORBA_unsigned_long *) _ORBIT_curptr);
	 _ORBIT_curptr += 4;
	 n._buffer = alloca(sizeof(n._buffer[_ORBIT_tmpvar_5]) * n._length);
	 n._release = CORBA_FALSE;
	 for (_ORBIT_tmpvar_5 = 0; _ORBIT_tmpvar_5 < n._length; _ORBIT_tmpvar_5++) {
	    _ORBIT_curptr = ALIGN_ADDRESS(_ORBIT_curptr, 4);
	    _ORBIT_tmpvar_7 = *((CORBA_unsigned_long *) _ORBIT_curptr);
	    _ORBIT_curptr += 4;
	    n._buffer[_ORBIT_tmpvar_5].id = (void *) _ORBIT_curptr;
	    _ORBIT_curptr += sizeof(n._buffer[_ORBIT_tmpvar_5].id[_ORBIT_tmpvar_6]) * _ORBIT_tmpvar_7;
	    _ORBIT_curptr = ALIGN_ADDRESS(_ORBIT_curptr, 4);
	    _ORBIT_tmpvar_9 = *((CORBA_unsigned_long *) _ORBIT_curptr);
	    _ORBIT_curptr += 4;
	    n._buffer[_ORBIT_tmpvar_5].kind = (void *) _ORBIT_curptr;
	    _ORBIT_curptr += sizeof(n._buffer[_ORBIT_tmpvar_5].kind[_ORBIT_tmpvar_8]) * _ORBIT_tmpvar_9;
	 }

	 GIOP_RECV_BUFFER(_ORBIT_recv_buffer)->cur = _ORBIT_curptr;
	 nc = ORBit_demarshal_object(_ORBIT_recv_buffer, (((ORBit_ObjectKey *) _ORBIT_servant->_private)->object->orb));
	 _ORBIT_curptr = GIOP_RECV_BUFFER(_ORBIT_recv_buffer)->cur;
      }
   }
   _impl_rebind_context(_ORBIT_servant, &(n), nc, 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 if (ev->_major == CORBA_USER_EXCEPTION) {
	    static const ORBit_exception_marshal_info _ORBIT_user_exceptions[] = {{(const CORBA_TypeCode) & TC_CosNaming_NamingContext_NotFound_struct, (gpointer) _ORBIT_CosNaming_NamingContext_NotFound_marshal}, {(const CORBA_TypeCode) & TC_CosNaming_NamingContext_CannotProceed_struct, (gpointer) _ORBIT_CosNaming_NamingContext_CannotProceed_marshal}, {(const CORBA_TypeCode) & TC_CosNaming_NamingContext_InvalidName_struct, (gpointer) _ORBIT_CosNaming_NamingContext_InvalidName_marshal}, {CORBA_OBJECT_NIL, NULL}};
	    ORBit_send_user_exception(_ORBIT_send_buffer, ev, _ORBIT_user_exceptions);
	 } else
	    ORBit_send_system_exception(_ORBIT_send_buffer, ev);
	 giop_send_buffer_write(_ORBIT_send_buffer);
	 giop_send_buffer_unuse(_ORBIT_send_buffer);
      }
      CORBA_Object_release(nc, ev);
   }
}
void 
_ORBIT_skel_CosNaming_NamingContext_resolve(POA_CosNaming_NamingContext * _ORBIT_servant, GIOPRecvBuffer * _ORBIT_recv_buffer, CORBA_Environment * ev, CORBA_Object(*_impl_resolve) (PortableServer_Servant _servant, const CosNaming_Name * n, CORBA_Environment * ev))
{
   CORBA_Object _ORBIT_retval;
   CosNaming_Name n = {0, 0, NULL, CORBA_FALSE};
   {				/* demarshalling */
      guchar *_ORBIT_curptr;
      register CORBA_unsigned_long _ORBIT_tmpvar_5;
      register CORBA_unsigned_long _ORBIT_tmpvar_6;
      CORBA_unsigned_long _ORBIT_tmpvar_7;
      register CORBA_unsigned_long _ORBIT_tmpvar_8;
      CORBA_unsigned_long _ORBIT_tmpvar_9;
      _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 *) & (n._length))) = GUINT32_SWAP_LE_BE(*((guint32 *) _ORBIT_curptr));
	 _ORBIT_curptr += 4;
	 n._buffer = alloca(sizeof(n._buffer[_ORBIT_tmpvar_5]) * n._length);
	 n._release = CORBA_FALSE;
	 for (_ORBIT_tmpvar_5 = 0; _ORBIT_tmpvar_5 < n._length; _ORBIT_tmpvar_5++) {
	    _ORBIT_curptr = ALIGN_ADDRESS(_ORBIT_curptr, 4);
	    (*((guint32 *) & (_ORBIT_tmpvar_7))) = GUINT32_SWAP_LE_BE(*((guint32 *) _ORBIT_curptr));
	    _ORBIT_curptr += 4;
	    n._buffer[_ORBIT_tmpvar_5].id = (void *) _ORBIT_curptr;
	    _ORBIT_curptr += sizeof(n._buffer[_ORBIT_tmpvar_5].id[_ORBIT_tmpvar_6]) * _ORBIT_tmpvar_7;
	    _ORBIT_curptr = ALIGN_ADDRESS(_ORBIT_curptr, 4);
	    (*((guint32 *) & (_ORBIT_tmpvar_9))) = GUINT32_SWAP_LE_BE(*((guint32 *) _ORBIT_curptr));
	    _ORBIT_curptr += 4;
	    n._buffer[_ORBIT_tmpvar_5].kind = (void *) _ORBIT_curptr;
	    _ORBIT_curptr += sizeof(n._buffer[_ORBIT_tmpvar_5].kind[_ORBIT_tmpvar_8]) * _ORBIT_tmpvar_9;
	 }

      } else {
	 _ORBIT_curptr = ALIGN_ADDRESS(_ORBIT_curptr, 4);
	 n._length = *((CORBA_unsigned_long *) _ORBIT_curptr);
	 _ORBIT_curptr += 4;
	 n._buffer = alloca(sizeof(n._buffer[_ORBIT_tmpvar_5]) * n._length);
	 n._release = CORBA_FALSE;
	 for (_ORBIT_tmpvar_5 = 0; _ORBIT_tmpvar_5 < n._length; _ORBIT_tmpvar_5++) {
	    _ORBIT_curptr = ALIGN_ADDRESS(_ORBIT_curptr, 4);
	    _ORBIT_tmpvar_7 = *((CORBA_unsigned_long *) _ORBIT_curptr);
	    _ORBIT_curptr += 4;
	    n._buffer[_ORBIT_tmpvar_5].id = (void *) _ORBIT_curptr;
	    _ORBIT_curptr += sizeof(n._buffer[_ORBIT_tmpvar_5].id[_ORBIT_tmpvar_6]) * _ORBIT_tmpvar_7;
	    _ORBIT_curptr = ALIGN_ADDRESS(_ORBIT_curptr, 4);
	    _ORBIT_tmpvar_9 = *((CORBA_unsigned_long *) _ORBIT_curptr);
	    _ORBIT_curptr += 4;
	    n._buffer[_ORBIT_tmpvar_5].kind = (void *) _ORBIT_curptr;
	    _ORBIT_curptr += sizeof(n._buffer[_ORBIT_tmpvar_5].kind[_ORBIT_tmpvar_8]) * _ORBIT_tmpvar_9;
	 }

      }
   }
   _ORBIT_retval = _impl_resolve(_ORBIT_servant, &(n), 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) {
	    ORBit_marshal_object(_ORBIT_send_buffer, _ORBIT_retval);
	 } else if (ev->_major == CORBA_USER_EXCEPTION) {
	    static const ORBit_exception_marshal_info _ORBIT_user_exceptions[] = {{(const CORBA_TypeCode) & TC_CosNaming_NamingContext_NotFound_struct, (gpointer) _ORBIT_CosNaming_NamingContext_NotFound_marshal}, {(const CORBA_TypeCode) & TC_CosNaming_NamingContext_CannotProceed_struct, (gpointer) _ORBIT_CosNaming_NamingContext_CannotProceed_marshal}, {(const CORBA_TypeCode) & TC_CosNaming_NamingContext_InvalidName_struct, (gpointer) _ORBIT_CosNaming_NamingContext_InvalidName_marshal}, {CORBA_OBJECT_NIL, NULL}};
	    ORBit_send_user_exception(_ORBIT_send_buffer, ev, _ORBIT_user_exceptions);
	 } else
	    ORBit_send_system_exception(_ORBIT_send_buffer, ev);
	 giop_send_buffer_write(_ORBIT_send_buffer);
	 giop_send_buffer_unuse(_ORBIT_send_buffer);
      }
      if (ev->_major == CORBA_NO_EXCEPTION)
	 CORBA_Object_release(_ORBIT_retval, ev);
   }
}
void 
_ORBIT_skel_CosNaming_NamingContext_unbind(POA_CosNaming_NamingContext * _ORBIT_servant, GIOPRecvBuffer * _ORBIT_recv_buffer, CORBA_Environment * ev, void (*_impl_unbind) (PortableServer_Servant _servant, const CosNaming_Name * n, CORBA_Environment * ev))
{
   CosNaming_Name n = {0, 0, NULL, CORBA_FALSE};
   {				/* demarshalling */
      guchar *_ORBIT_curptr;
      register CORBA_unsigned_long _ORBIT_tmpvar_5;
      register CORBA_unsigned_long _ORBIT_tmpvar_6;
      CORBA_unsigned_long _ORBIT_tmpvar_7;
      register CORBA_unsigned_long _ORBIT_tmpvar_8;
      CORBA_unsigned_long _ORBIT_tmpvar_9;
      _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 *) & (n._length))) = GUINT32_SWAP_LE_BE(*((guint32 *) _ORBIT_curptr));
	 _ORBIT_curptr += 4;
	 n._buffer = alloca(sizeof(n._buffer[_ORBIT_tmpvar_5]) * n._length);
	 n._release = CORBA_FALSE;
	 for (_ORBIT_tmpvar_5 = 0; _ORBIT_tmpvar_5 < n._length; _ORBIT_tmpvar_5++) {
	    _ORBIT_curptr = ALIGN_ADDRESS(_ORBIT_curptr, 4);
	    (*((guint32 *) & (_ORBIT_tmpvar_7))) = GUINT32_SWAP_LE_BE(*((guint32 *) _ORBIT_curptr));
	    _ORBIT_curptr += 4;
	    n._buffer[_ORBIT_tmpvar_5].id = (void *) _ORBIT_curptr;
	    _ORBIT_curptr += sizeof(n._buffer[_ORBIT_tmpvar_5].id[_ORBIT_tmpvar_6]) * _ORBIT_tmpvar_7;
	    _ORBIT_curptr = ALIGN_ADDRESS(_ORBIT_curptr, 4);
	    (*((guint32 *) & (_ORBIT_tmpvar_9))) = GUINT32_SWAP_LE_BE(*((guint32 *) _ORBIT_curptr));
	    _ORBIT_curptr += 4;
	    n._buffer[_ORBIT_tmpvar_5].kind = (void *) _ORBIT_curptr;
	    _ORBIT_curptr += sizeof(n._buffer[_ORBIT_tmpvar_5].kind[_ORBIT_tmpvar_8]) * _ORBIT_tmpvar_9;
	 }

      } else {
	 _ORBIT_curptr = ALIGN_ADDRESS(_ORBIT_curptr, 4);
	 n._length = *((CORBA_unsigned_long *) _ORBIT_curptr);
	 _ORBIT_curptr += 4;
	 n._buffer = alloca(sizeof(n._buffer[_ORBIT_tmpvar_5]) * n._length);
	 n._release = CORBA_FALSE;
	 for (_ORBIT_tmpvar_5 = 0; _ORBIT_tmpvar_5 < n._length; _ORBIT_tmpvar_5++) {
	    _ORBIT_curptr = ALIGN_ADDRESS(_ORBIT_curptr, 4);
	    _ORBIT_tmpvar_7 = *((CORBA_unsigned_long *) _ORBIT_curptr);
	    _ORBIT_curptr += 4;
	    n._buffer[_ORBIT_tmpvar_5].id = (void *) _ORBIT_curptr;
	    _ORBIT_curptr += sizeof(n._buffer[_ORBIT_tmpvar_5].id[_ORBIT_tmpvar_6]) * _ORBIT_tmpvar_7;
	    _ORBIT_curptr = ALIGN_ADDRESS(_ORBIT_curptr, 4);
	    _ORBIT_tmpvar_9 = *((CORBA_unsigned_long *) _ORBIT_curptr);
	    _ORBIT_curptr += 4;
	    n._buffer[_ORBIT_tmpvar_5].kind = (void *) _ORBIT_curptr;
	    _ORBIT_curptr += sizeof(n._buffer[_ORBIT_tmpvar_5].kind[_ORBIT_tmpvar_8]) * _ORBIT_tmpvar_9;
	 }

      }
   }
   _impl_unbind(_ORBIT_servant, &(n), 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 if (ev->_major == CORBA_USER_EXCEPTION) {
	    static const ORBit_exception_marshal_info _ORBIT_user_exceptions[] = {{(const CORBA_TypeCode) & TC_CosNaming_NamingContext_NotFound_struct, (gpointer) _ORBIT_CosNaming_NamingContext_NotFound_marshal}, {(const CORBA_TypeCode) & TC_CosNaming_NamingContext_CannotProceed_struct, (gpointer) _ORBIT_CosNaming_NamingContext_CannotProceed_marshal}, {(const CORBA_TypeCode) & TC_CosNaming_NamingContext_InvalidName_struct, (gpointer) _ORBIT_CosNaming_NamingContext_InvalidName_marshal}, {CORBA_OBJECT_NIL, NULL}};
	    ORBit_send_user_exception(_ORBIT_send_buffer, ev, _ORBIT_user_exceptions);
	 } 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_CosNaming_NamingContext_new_context(POA_CosNaming_NamingContext * _ORBIT_servant, GIOPRecvBuffer * _ORBIT_recv_buffer, CORBA_Environment * ev, CosNaming_NamingContext(*_impl_new_context) (PortableServer_Servant _servant, CORBA_Environment * ev))
{
   CosNaming_NamingContext _ORBIT_retval;
   _ORBIT_retval = _impl_new_context(_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) {
	    ORBit_marshal_object(_ORBIT_send_buffer, _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);
      }
      if (ev->_major == CORBA_NO_EXCEPTION)
	 CORBA_Object_release(_ORBIT_retval, ev);
   }
}
void 
_ORBIT_skel_CosNaming_NamingContext_bind_new_context(POA_CosNaming_NamingContext * _ORBIT_servant, GIOPRecvBuffer * _ORBIT_recv_buffer, CORBA_Environment * ev, CosNaming_NamingContext(*_impl_bind_new_context) (PortableServer_Servant _servant, const CosNaming_Name * n, CORBA_Environment * ev))
{
   CosNaming_NamingContext _ORBIT_retval;
   CosNaming_Name n = {0, 0, NULL, CORBA_FALSE};
   {				/* demarshalling */
      guchar *_ORBIT_curptr;
      register CORBA_unsigned_long _ORBIT_tmpvar_5;
      register CORBA_unsigned_long _ORBIT_tmpvar_6;
      CORBA_unsigned_long _ORBIT_tmpvar_7;
      register CORBA_unsigned_long _ORBIT_tmpvar_8;
      CORBA_unsigned_long _ORBIT_tmpvar_9;
      _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 *) & (n._length))) = GUINT32_SWAP_LE_BE(*((guint32 *) _ORBIT_curptr));
	 _ORBIT_curptr += 4;
	 n._buffer = alloca(sizeof(n._buffer[_ORBIT_tmpvar_5]) * n._length);
	 n._release = CORBA_FALSE;
	 for (_ORBIT_tmpvar_5 = 0; _ORBIT_tmpvar_5 < n._length; _ORBIT_tmpvar_5++) {
	    _ORBIT_curptr = ALIGN_ADDRESS(_ORBIT_curptr, 4);
	    (*((guint32 *) & (_ORBIT_tmpvar_7))) = GUINT32_SWAP_LE_BE(*((guint32 *) _ORBIT_curptr));
	    _ORBIT_curptr += 4;
	    n._buffer[_ORBIT_tmpvar_5].id = (void *) _ORBIT_curptr;
	    _ORBIT_curptr += sizeof(n._buffer[_ORBIT_tmpvar_5].id[_ORBIT_tmpvar_6]) * _ORBIT_tmpvar_7;
	    _ORBIT_curptr = ALIGN_ADDRESS(_ORBIT_curptr, 4);
	    (*((guint32 *) & (_ORBIT_tmpvar_9))) = GUINT32_SWAP_LE_BE(*((guint32 *) _ORBIT_curptr));
	    _ORBIT_curptr += 4;
	    n._buffer[_ORBIT_tmpvar_5].kind = (void *) _ORBIT_curptr;
	    _ORBIT_curptr += sizeof(n._buffer[_ORBIT_tmpvar_5].kind[_ORBIT_tmpvar_8]) * _ORBIT_tmpvar_9;
	 }

      } else {
	 _ORBIT_curptr = ALIGN_ADDRESS(_ORBIT_curptr, 4);
	 n._length = *((CORBA_unsigned_long *) _ORBIT_curptr);
	 _ORBIT_curptr += 4;
	 n._buffer = alloca(sizeof(n._buffer[_ORBIT_tmpvar_5]) * n._length);
	 n._release = CORBA_FALSE;
	 for (_ORBIT_tmpvar_5 = 0; _ORBIT_tmpvar_5 < n._length; _ORBIT_tmpvar_5++) {
	    _ORBIT_curptr = ALIGN_ADDRESS(_ORBIT_curptr, 4);
	    _ORBIT_tmpvar_7 = *((CORBA_unsigned_long *) _ORBIT_curptr);
	    _ORBIT_curptr += 4;
	    n._buffer[_ORBIT_tmpvar_5].id = (void *) _ORBIT_curptr;
	    _ORBIT_curptr += sizeof(n._buffer[_ORBIT_tmpvar_5].id[_ORBIT_tmpvar_6]) * _ORBIT_tmpvar_7;
	    _ORBIT_curptr = ALIGN_ADDRESS(_ORBIT_curptr, 4);
	    _ORBIT_tmpvar_9 = *((CORBA_unsigned_long *) _ORBIT_curptr);
	    _ORBIT_curptr += 4;
	    n._buffer[_ORBIT_tmpvar_5].kind = (void *) _ORBIT_curptr;
	    _ORBIT_curptr += sizeof(n._buffer[_ORBIT_tmpvar_5].kind[_ORBIT_tmpvar_8]) * _ORBIT_tmpvar_9;
	 }

      }
   }
   _ORBIT_retval = _impl_bind_new_context(_ORBIT_servant, &(n), 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) {
	    ORBit_marshal_object(_ORBIT_send_buffer, _ORBIT_retval);
	 } else if (ev->_major == CORBA_USER_EXCEPTION) {
	    static const ORBit_exception_marshal_info _ORBIT_user_exceptions[] = {{(const CORBA_TypeCode) & TC_CosNaming_NamingContext_NotFound_struct, (gpointer) _ORBIT_CosNaming_NamingContext_NotFound_marshal}, {(const CORBA_TypeCode) & TC_CosNaming_NamingContext_AlreadyBound_struct, (gpointer) _ORBIT_CosNaming_NamingContext_AlreadyBound_marshal}, {(const CORBA_TypeCode) & TC_CosNaming_NamingContext_CannotProceed_struct, (gpointer) _ORBIT_CosNaming_NamingContext_CannotProceed_marshal}, {(const CORBA_TypeCode) & TC_CosNaming_NamingContext_InvalidName_struct, (gpointer) _ORBIT_CosNaming_NamingContext_InvalidName_marshal}, {CORBA_OBJECT_NIL, NULL}};
	    ORBit_send_user_exception(_ORBIT_send_buffer, ev, _ORBIT_user_exceptions);
	 } else
	    ORBit_send_system_exception(_ORBIT_send_buffer, ev);
	 giop_send_buffer_write(_ORBIT_send_buffer);
	 giop_send_buffer_unuse(_ORBIT_send_buffer);
      }
      if (ev->_major == CORBA_NO_EXCEPTION)
	 CORBA_Object_release(_ORBIT_retval, ev);
   }
}
void 
_ORBIT_skel_CosNaming_NamingContext_destroy(POA_CosNaming_NamingContext * _ORBIT_servant, GIOPRecvBuffer * _ORBIT_recv_buffer, CORBA_Environment * ev, void (*_impl_destroy) (PortableServer_Servant _servant, CORBA_Environment * ev))
{
   _impl_destroy(_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) {
	 } else if (ev->_major == CORBA_USER_EXCEPTION) {
	    static const ORBit_exception_marshal_info _ORBIT_user_exceptions[] = {{(const CORBA_TypeCode) & TC_CosNaming_NamingContext_NotEmpty_struct, (gpointer) _ORBIT_CosNaming_NamingContext_NotEmpty_marshal}, {CORBA_OBJECT_NIL, NULL}};
	    ORBit_send_user_exception(_ORBIT_send_buffer, ev, _ORBIT_user_exceptions);
	 } 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_CosNaming_NamingContext_list(POA_CosNaming_NamingContext * _ORBIT_servant, GIOPRecvBuffer * _ORBIT_recv_buffer, CORBA_Environment * ev, void (*_impl_list) (PortableServer_Servant _servant, const CORBA_unsigned_long how_many, CosNaming_BindingList ** bl, CosNaming_BindingIterator * bi, CORBA_Environment * ev))
{
   CORBA_unsigned_long how_many;
   CosNaming_BindingList *bl;
   CosNaming_BindingIterator bi;
   {				/* 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 *) & (how_many))) = GUINT32_SWAP_LE_BE(*((guint32 *) _ORBIT_curptr));
      } else {
	 _ORBIT_curptr = ALIGN_ADDRESS(_ORBIT_curptr, 4);
	 how_many = *((CORBA_unsigned_long *) _ORBIT_curptr);
      }
   }
   _impl_list(_ORBIT_servant, how_many, &(bl), &(bi), 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) {
	    register CORBA_unsigned_long _ORBIT_tmpvar_0;
	    register CORBA_unsigned_long _ORBIT_tmpvar_1;
	    register CORBA_unsigned_long _ORBIT_tmpvar_2;
	    CORBA_unsigned_long _ORBIT_tmpvar_3;
	    register CORBA_unsigned_long _ORBIT_tmpvar_4;
	    CORBA_unsigned_long _ORBIT_tmpvar_5;
	    giop_message_buffer_do_alignment(GIOP_MESSAGE_BUFFER(_ORBIT_send_buffer), 4);
	    {
	       guchar *_ORBIT_t;
	       _ORBIT_t = alloca(sizeof((*bl)._length));
	       memcpy(_ORBIT_t, &((*bl)._length), sizeof((*bl)._length));
	       giop_message_buffer_append_mem(GIOP_MESSAGE_BUFFER(_ORBIT_send_buffer), (_ORBIT_t), sizeof((*bl)._length));
	    }
	    for (_ORBIT_tmpvar_0 = 0; _ORBIT_tmpvar_0 < (*bl)._length; _ORBIT_tmpvar_0++) {
	       {
		  guchar *_ORBIT_t;
		  _ORBIT_t = alloca(sizeof((*bl)._buffer[_ORBIT_tmpvar_0].binding_name._length));
		  memcpy(_ORBIT_t, &((*bl)._buffer[_ORBIT_tmpvar_0].binding_name._length), sizeof((*bl)._buffer[_ORBIT_tmpvar_0].binding_name._length));
		  giop_message_buffer_append_mem(GIOP_MESSAGE_BUFFER(_ORBIT_send_buffer), (_ORBIT_t), sizeof((*bl)._buffer[_ORBIT_tmpvar_0].binding_name._length));
	       }
	       for (_ORBIT_tmpvar_1 = 0; _ORBIT_tmpvar_1 < (*bl)._buffer[_ORBIT_tmpvar_0].binding_name._length; _ORBIT_tmpvar_1++) {
		  _ORBIT_tmpvar_3 = strlen((*bl)._buffer[_ORBIT_tmpvar_0].binding_name._buffer[_ORBIT_tmpvar_1].id) + 1;
		  giop_message_buffer_do_alignment(GIOP_MESSAGE_BUFFER(_ORBIT_send_buffer), 4);
		  {
		     guchar *_ORBIT_t;
		     _ORBIT_t = alloca(sizeof(_ORBIT_tmpvar_3));
		     memcpy(_ORBIT_t, &(_ORBIT_tmpvar_3), sizeof(_ORBIT_tmpvar_3));
		     giop_message_buffer_append_mem(GIOP_MESSAGE_BUFFER(_ORBIT_send_buffer), (_ORBIT_t), sizeof(_ORBIT_tmpvar_3));
		  }
		  {
		     guchar *_ORBIT_t;
		     _ORBIT_t = alloca(sizeof((*bl)._buffer[_ORBIT_tmpvar_0].binding_name._buffer[_ORBIT_tmpvar_1].id[_ORBIT_tmpvar_2]) * _ORBIT_tmpvar_3);
		     memcpy(_ORBIT_t, ((*bl)._buffer[_ORBIT_tmpvar_0].binding_name._buffer[_ORBIT_tmpvar_1].id), sizeof((*bl)._buffer[_ORBIT_tmpvar_0].binding_name._buffer[_ORBIT_tmpvar_1].id[_ORBIT_tmpvar_2]) * _ORBIT_tmpvar_3);
		     giop_message_buffer_append_mem(GIOP_MESSAGE_BUFFER(_ORBIT_send_buffer), (_ORBIT_t), sizeof((*bl)._buffer[_ORBIT_tmpvar_0].binding_name._buffer[_ORBIT_tmpvar_1].id[_ORBIT_tmpvar_2]) * _ORBIT_tmpvar_3);
		  }
		  _ORBIT_tmpvar_5 = strlen((*bl)._buffer[_ORBIT_tmpvar_0].binding_name._buffer[_ORBIT_tmpvar_1].kind) + 1;
		  giop_message_buffer_do_alignment(GIOP_MESSAGE_BUFFER(_ORBIT_send_buffer), 4);
		  {
		     guchar *_ORBIT_t;
		     _ORBIT_t = alloca(sizeof(_ORBIT_tmpvar_5));
		     memcpy(_ORBIT_t, &(_ORBIT_tmpvar_5), sizeof(_ORBIT_tmpvar_5));
		     giop_message_buffer_append_mem(GIOP_MESSAGE_BUFFER(_ORBIT_send_buffer), (_ORBIT_t), sizeof(_ORBIT_tmpvar_5));
		  }
		  {
		     guchar *_ORBIT_t;
		     _ORBIT_t = alloca(sizeof((*bl)._buffer[_ORBIT_tmpvar_0].binding_name._buffer[_ORBIT_tmpvar_1].kind[_ORBIT_tmpvar_4]) * _ORBIT_tmpvar_5);
		     memcpy(_ORBIT_t, ((*bl)._buffer[_ORBIT_tmpvar_0].binding_name._buffer[_ORBIT_tmpvar_1].kind), sizeof((*bl)._buffer[_ORBIT_tmpvar_0].binding_name._buffer[_ORBIT_tmpvar_1].kind[_ORBIT_tmpvar_4]) * _ORBIT_tmpvar_5);
		     giop_message_buffer_append_mem(GIOP_MESSAGE_BUFFER(_ORBIT_send_buffer), (_ORBIT_t), sizeof((*bl)._buffer[_ORBIT_tmpvar_0].binding_name._buffer[_ORBIT_tmpvar_1].kind[_ORBIT_tmpvar_4]) * _ORBIT_tmpvar_5);
		  }
	       }

	       giop_message_buffer_do_alignment(GIOP_MESSAGE_BUFFER(_ORBIT_send_buffer), 4);
	       {
		  guchar *_ORBIT_t;
		  _ORBIT_t = alloca(sizeof((*bl)._buffer[_ORBIT_tmpvar_0].binding_type));
		  memcpy(_ORBIT_t, &((*bl)._buffer[_ORBIT_tmpvar_0].binding_type), sizeof((*bl)._buffer[_ORBIT_tmpvar_0].binding_type));
		  giop_message_buffer_append_mem(GIOP_MESSAGE_BUFFER(_ORBIT_send_buffer), (_ORBIT_t), sizeof((*bl)._buffer[_ORBIT_tmpvar_0].binding_type));
	       }
	    }

	    ORBit_marshal_object(_ORBIT_send_buffer, bi);
	 } else
	    ORBit_send_system_exception(_ORBIT_send_buffer, ev);
	 giop_send_buffer_write(_ORBIT_send_buffer);
	 giop_send_buffer_unuse(_ORBIT_send_buffer);
      }
      if (ev->_major == CORBA_NO_EXCEPTION)
	 CORBA_free(bl);
      if (ev->_major == CORBA_NO_EXCEPTION)
	 CORBA_Object_release(bi, ev);
   }
}
void 
_ORBIT_skel_CosNaming_BindingIterator_next_one(POA_CosNaming_BindingIterator * _ORBIT_servant, GIOPRecvBuffer * _ORBIT_recv_buffer, CORBA_Environment * ev, CORBA_boolean(*_impl_next_one) (PortableServer_Servant _servant, CosNaming_Binding ** b, CORBA_Environment * ev))
{
   CORBA_boolean _ORBIT_retval;
   CosNaming_Binding *b;
   {				/* demarshalling */
      guchar *_ORBIT_curptr;
      _ORBIT_curptr = GIOP_RECV_BUFFER(_ORBIT_recv_buffer)->cur;
      if (giop_msg_conversion_needed(GIOP_MESSAGE_BUFFER(_ORBIT_recv_buffer))) {
      } else {
      }
   }
   _ORBIT_retval = _impl_next_one(_ORBIT_servant, &(b), 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) {
	    register CORBA_unsigned_long _ORBIT_tmpvar_0;
	    register CORBA_unsigned_long _ORBIT_tmpvar_1;
	    CORBA_unsigned_long _ORBIT_tmpvar_2;
	    register CORBA_unsigned_long _ORBIT_tmpvar_3;
	    CORBA_unsigned_long _ORBIT_tmpvar_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_do_alignment(GIOP_MESSAGE_BUFFER(_ORBIT_send_buffer), 4);
	    {
	       guchar *_ORBIT_t;
	       _ORBIT_t = alloca(sizeof((*b).binding_name._length));
	       memcpy(_ORBIT_t, &((*b).binding_name._length), sizeof((*b).binding_name._length));
	       giop_message_buffer_append_mem(GIOP_MESSAGE_BUFFER(_ORBIT_send_buffer), (_ORBIT_t), sizeof((*b).binding_name._length));
	    }
	    for (_ORBIT_tmpvar_0 = 0; _ORBIT_tmpvar_0 < (*b).binding_name._length; _ORBIT_tmpvar_0++) {
	       _ORBIT_tmpvar_2 = strlen((*b).binding_name._buffer[_ORBIT_tmpvar_0].id) + 1;
	       giop_message_buffer_do_alignment(GIOP_MESSAGE_BUFFER(_ORBIT_send_buffer), 4);
	       {
		  guchar *_ORBIT_t;
		  _ORBIT_t = alloca(sizeof(_ORBIT_tmpvar_2));
		  memcpy(_ORBIT_t, &(_ORBIT_tmpvar_2), sizeof(_ORBIT_tmpvar_2));
		  giop_message_buffer_append_mem(GIOP_MESSAGE_BUFFER(_ORBIT_send_buffer), (_ORBIT_t), sizeof(_ORBIT_tmpvar_2));
	       }
	       {
		  guchar *_ORBIT_t;
		  _ORBIT_t = alloca(sizeof((*b).binding_name._buffer[_ORBIT_tmpvar_0].id[_ORBIT_tmpvar_1]) * _ORBIT_tmpvar_2);
		  memcpy(_ORBIT_t, ((*b).binding_name._buffer[_ORBIT_tmpvar_0].id), sizeof((*b).binding_name._buffer[_ORBIT_tmpvar_0].id[_ORBIT_tmpvar_1]) * _ORBIT_tmpvar_2);
		  giop_message_buffer_append_mem(GIOP_MESSAGE_BUFFER(_ORBIT_send_buffer), (_ORBIT_t), sizeof((*b).binding_name._buffer[_ORBIT_tmpvar_0].id[_ORBIT_tmpvar_1]) * _ORBIT_tmpvar_2);
	       }
	       _ORBIT_tmpvar_4 = strlen((*b).binding_name._buffer[_ORBIT_tmpvar_0].kind) + 1;
	       giop_message_buffer_do_alignment(GIOP_MESSAGE_BUFFER(_ORBIT_send_buffer), 4);
	       {
		  guchar *_ORBIT_t;
		  _ORBIT_t = alloca(sizeof(_ORBIT_tmpvar_4));
		  memcpy(_ORBIT_t, &(_ORBIT_tmpvar_4), sizeof(_ORBIT_tmpvar_4));
		  giop_message_buffer_append_mem(GIOP_MESSAGE_BUFFER(_ORBIT_send_buffer), (_ORBIT_t), sizeof(_ORBIT_tmpvar_4));
	       }
	       {
		  guchar *_ORBIT_t;
		  _ORBIT_t = alloca(sizeof((*b).binding_name._buffer[_ORBIT_tmpvar_0].kind[_ORBIT_tmpvar_3]) * _ORBIT_tmpvar_4);
		  memcpy(_ORBIT_t, ((*b).binding_name._buffer[_ORBIT_tmpvar_0].kind), sizeof((*b).binding_name._buffer[_ORBIT_tmpvar_0].kind[_ORBIT_tmpvar_3]) * _ORBIT_tmpvar_4);
		  giop_message_buffer_append_mem(GIOP_MESSAGE_BUFFER(_ORBIT_send_buffer), (_ORBIT_t), sizeof((*b).binding_name._buffer[_ORBIT_tmpvar_0].kind[_ORBIT_tmpvar_3]) * _ORBIT_tmpvar_4);
	       }
	    }

	    giop_message_buffer_do_alignment(GIOP_MESSAGE_BUFFER(_ORBIT_send_buffer), 4);
	    giop_message_buffer_append_mem(GIOP_MESSAGE_BUFFER(_ORBIT_send_buffer), &((*b).binding_type), sizeof((*b).binding_type));
	 } else
	    ORBit_send_system_exception(_ORBIT_send_buffer, ev);
	 giop_send_buffer_write(_ORBIT_send_buffer);
	 giop_send_buffer_unuse(_ORBIT_send_buffer);
      }
      if (ev->_major == CORBA_NO_EXCEPTION)
	 CORBA_free(b);
   }
}
void 
_ORBIT_skel_CosNaming_BindingIterator_next_n(POA_CosNaming_BindingIterator * _ORBIT_servant, GIOPRecvBuffer * _ORBIT_recv_buffer, CORBA_Environment * ev, CORBA_boolean(*_impl_next_n) (PortableServer_Servant _servant, const CORBA_unsigned_long how_many, CosNaming_BindingList ** bl, CORBA_Environment * ev))
{
   CORBA_boolean _ORBIT_retval;
   CORBA_unsigned_long how_many;
   CosNaming_BindingList *bl;
   {				/* 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 *) & (how_many))) = GUINT32_SWAP_LE_BE(*((guint32 *) _ORBIT_curptr));
      } else {
	 _ORBIT_curptr = ALIGN_ADDRESS(_ORBIT_curptr, 4);
	 how_many = *((CORBA_unsigned_long *) _ORBIT_curptr);
      }
   }
   _ORBIT_retval = _impl_next_n(_ORBIT_servant, how_many, &(bl), 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) {
	    register CORBA_unsigned_long _ORBIT_tmpvar_0;
	    register CORBA_unsigned_long _ORBIT_tmpvar_1;
	    register CORBA_unsigned_long _ORBIT_tmpvar_2;
	    CORBA_unsigned_long _ORBIT_tmpvar_3;
	    register CORBA_unsigned_long _ORBIT_tmpvar_4;
	    CORBA_unsigned_long _ORBIT_tmpvar_5;
	    {
	       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_do_alignment(GIOP_MESSAGE_BUFFER(_ORBIT_send_buffer), 4);
	    {
	       guchar *_ORBIT_t;
	       _ORBIT_t = alloca(sizeof((*bl)._length));
	       memcpy(_ORBIT_t, &((*bl)._length), sizeof((*bl)._length));
	       giop_message_buffer_append_mem(GIOP_MESSAGE_BUFFER(_ORBIT_send_buffer), (_ORBIT_t), sizeof((*bl)._length));
	    }
	    for (_ORBIT_tmpvar_0 = 0; _ORBIT_tmpvar_0 < (*bl)._length; _ORBIT_tmpvar_0++) {
	       {
		  guchar *_ORBIT_t;
		  _ORBIT_t = alloca(sizeof((*bl)._buffer[_ORBIT_tmpvar_0].binding_name._length));
		  memcpy(_ORBIT_t, &((*bl)._buffer[_ORBIT_tmpvar_0].binding_name._length), sizeof((*bl)._buffer[_ORBIT_tmpvar_0].binding_name._length));
		  giop_message_buffer_append_mem(GIOP_MESSAGE_BUFFER(_ORBIT_send_buffer), (_ORBIT_t), sizeof((*bl)._buffer[_ORBIT_tmpvar_0].binding_name._length));
	       }
	       for (_ORBIT_tmpvar_1 = 0; _ORBIT_tmpvar_1 < (*bl)._buffer[_ORBIT_tmpvar_0].binding_name._length; _ORBIT_tmpvar_1++) {
		  _ORBIT_tmpvar_3 = strlen((*bl)._buffer[_ORBIT_tmpvar_0].binding_name._buffer[_ORBIT_tmpvar_1].id) + 1;
		  giop_message_buffer_do_alignment(GIOP_MESSAGE_BUFFER(_ORBIT_send_buffer), 4);
		  {
		     guchar *_ORBIT_t;
		     _ORBIT_t = alloca(sizeof(_ORBIT_tmpvar_3));
		     memcpy(_ORBIT_t, &(_ORBIT_tmpvar_3), sizeof(_ORBIT_tmpvar_3));
		     giop_message_buffer_append_mem(GIOP_MESSAGE_BUFFER(_ORBIT_send_buffer), (_ORBIT_t), sizeof(_ORBIT_tmpvar_3));
		  }
		  {
		     guchar *_ORBIT_t;
		     _ORBIT_t = alloca(sizeof((*bl)._buffer[_ORBIT_tmpvar_0].binding_name._buffer[_ORBIT_tmpvar_1].id[_ORBIT_tmpvar_2]) * _ORBIT_tmpvar_3);
		     memcpy(_ORBIT_t, ((*bl)._buffer[_ORBIT_tmpvar_0].binding_name._buffer[_ORBIT_tmpvar_1].id), sizeof((*bl)._buffer[_ORBIT_tmpvar_0].binding_name._buffer[_ORBIT_tmpvar_1].id[_ORBIT_tmpvar_2]) * _ORBIT_tmpvar_3);
		     giop_message_buffer_append_mem(GIOP_MESSAGE_BUFFER(_ORBIT_send_buffer), (_ORBIT_t), sizeof((*bl)._buffer[_ORBIT_tmpvar_0].binding_name._buffer[_ORBIT_tmpvar_1].id[_ORBIT_tmpvar_2]) * _ORBIT_tmpvar_3);
		  }
		  _ORBIT_tmpvar_5 = strlen((*bl)._buffer[_ORBIT_tmpvar_0].binding_name._buffer[_ORBIT_tmpvar_1].kind) + 1;
		  giop_message_buffer_do_alignment(GIOP_MESSAGE_BUFFER(_ORBIT_send_buffer), 4);
		  {
		     guchar *_ORBIT_t;
		     _ORBIT_t = alloca(sizeof(_ORBIT_tmpvar_5));
		     memcpy(_ORBIT_t, &(_ORBIT_tmpvar_5), sizeof(_ORBIT_tmpvar_5));
		     giop_message_buffer_append_mem(GIOP_MESSAGE_BUFFER(_ORBIT_send_buffer), (_ORBIT_t), sizeof(_ORBIT_tmpvar_5));
		  }
		  {
		     guchar *_ORBIT_t;
		     _ORBIT_t = alloca(sizeof((*bl)._buffer[_ORBIT_tmpvar_0].binding_name._buffer[_ORBIT_tmpvar_1].kind[_ORBIT_tmpvar_4]) * _ORBIT_tmpvar_5);
		     memcpy(_ORBIT_t, ((*bl)._buffer[_ORBIT_tmpvar_0].binding_name._buffer[_ORBIT_tmpvar_1].kind), sizeof((*bl)._buffer[_ORBIT_tmpvar_0].binding_name._buffer[_ORBIT_tmpvar_1].kind[_ORBIT_tmpvar_4]) * _ORBIT_tmpvar_5);
		     giop_message_buffer_append_mem(GIOP_MESSAGE_BUFFER(_ORBIT_send_buffer), (_ORBIT_t), sizeof((*bl)._buffer[_ORBIT_tmpvar_0].binding_name._buffer[_ORBIT_tmpvar_1].kind[_ORBIT_tmpvar_4]) * _ORBIT_tmpvar_5);
		  }
	       }

	       giop_message_buffer_do_alignment(GIOP_MESSAGE_BUFFER(_ORBIT_send_buffer), 4);
	       {
		  guchar *_ORBIT_t;
		  _ORBIT_t = alloca(sizeof((*bl)._buffer[_ORBIT_tmpvar_0].binding_type));
		  memcpy(_ORBIT_t, &((*bl)._buffer[_ORBIT_tmpvar_0].binding_type), sizeof((*bl)._buffer[_ORBIT_tmpvar_0].binding_type));
		  giop_message_buffer_append_mem(GIOP_MESSAGE_BUFFER(_ORBIT_send_buffer), (_ORBIT_t), sizeof((*bl)._buffer[_ORBIT_tmpvar_0].binding_type));
	       }
	    }

	 } else
	    ORBit_send_system_exception(_ORBIT_send_buffer, ev);
	 giop_send_buffer_write(_ORBIT_send_buffer);
	 giop_send_buffer_unuse(_ORBIT_send_buffer);
      }
      if (ev->_major == CORBA_NO_EXCEPTION)
	 CORBA_free(bl);
   }
}
void 
_ORBIT_skel_CosNaming_BindingIterator_destroy(POA_CosNaming_BindingIterator * _ORBIT_servant, GIOPRecvBuffer * _ORBIT_recv_buffer, CORBA_Environment * ev, void (*_impl_destroy) (PortableServer_Servant _servant, CORBA_Environment * ev))
{
   _impl_destroy(_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) {
	 } 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_CosNaming_NamingContext(POA_CosNaming_NamingContext * servant,
				 GIOPRecvBuffer * _ORBIT_recv_buffer,
				 gpointer * impl)
{
   gchar *opname = _ORBIT_recv_buffer->message.u.request.operation;
   switch (opname[0]) {
	 case 'b':
	    switch (opname[1]) {
		  case 'i':
		     switch (opname[2]) {
			   case 'n':
			      switch (opname[3]) {
				    case 'd':
				       switch (opname[4]) {
					     case '\0':
						*impl = (gpointer) servant->vepv->CosNaming_NamingContext_epv->bind;
						return (ORBitSkeleton) _ORBIT_skel_CosNaming_NamingContext_bind;
						break;
					     case '_':
						switch (opname[5]) {
						      case 'c':
							 if (strcmp((opname + 6), "ontext"))
							    break;
							 *impl = (gpointer) servant->vepv->CosNaming_NamingContext_epv->bind_context;
							 return (ORBitSkeleton) _ORBIT_skel_CosNaming_NamingContext_bind_context;
							 break;
						      case 'n':
							 if (strcmp((opname + 6), "ew_context"))
							    break;
							 *impl = (gpointer) servant->vepv->CosNaming_NamingContext_epv->bind_new_context;
							 return (ORBitSkeleton) _ORBIT_skel_CosNaming_NamingContext_bind_new_context;
							 break;
						      default:
							 break;
						}
						break;
					     default:
						break;
				       }
				       break;
				    default:
				       break;
			      }
			      break;
			   default:
			      break;
		     }
		     break;
		  default:
		     break;
	    }
	    break;
	 case 'd':
	    if (strcmp((opname + 1), "estroy"))
	       break;
	    *impl = (gpointer) servant->vepv->CosNaming_NamingContext_epv->destroy;
	    return (ORBitSkeleton) _ORBIT_skel_CosNaming_NamingContext_destroy;
	    break;
	 case 'l':
	    if (strcmp((opname + 1), "ist"))
	       break;
	    *impl = (gpointer) servant->vepv->CosNaming_NamingContext_epv->list;
	    return (ORBitSkeleton) _ORBIT_skel_CosNaming_NamingContext_list;
	    break;
	 case 'n':
	    if (strcmp((opname + 1), "ew_context"))
	       break;
	    *impl = (gpointer) servant->vepv->CosNaming_NamingContext_epv->new_context;
	    return (ORBitSkeleton) _ORBIT_skel_CosNaming_NamingContext_new_context;
	    break;
	 case 'r':
	    switch (opname[1]) {
		  case 'e':
		     switch (opname[2]) {
			   case 'b':
			      switch (opname[3]) {
				    case 'i':
				       switch (opname[4]) {
					     case 'n':
						switch (opname[5]) {
						      case 'd':
							 switch (opname[6]) {
							       case '\0':
								  *impl = (gpointer) servant->vepv->CosNaming_NamingContext_epv->rebind;
								  return (ORBitSkeleton) _ORBIT_skel_CosNaming_NamingContext_rebind;
								  break;
							       case '_':
								  if (strcmp((opname + 7), "context"))
								     break;
								  *impl = (gpointer) servant->vepv->CosNaming_NamingContext_epv->rebind_context;
								  return (ORBitSkeleton) _ORBIT_skel_CosNaming_NamingContext_rebind_context;
								  break;
							       default:
								  break;
							 }
							 break;
						      default:
							 break;
						}
						break;
					     default:
						break;
				       }
				       break;
				    default:
				       break;
			      }
			      break;
			   case 's':
			      if (strcmp((opname + 3), "olve"))
				 break;
			      *impl = (gpointer) servant->vepv->CosNaming_NamingContext_epv->resolve;
			      return (ORBitSkeleton) _ORBIT_skel_CosNaming_NamingContext_resolve;
			      break;
			   default:
			      break;
		     }
		     break;
		  default:
		     break;
	    }
	    break;
	 case 'u':
	    if (strcmp((opname + 1), "nbind"))
	       break;
	    *impl = (gpointer) servant->vepv->CosNaming_NamingContext_epv->unbind;
	    return (ORBitSkeleton) _ORBIT_skel_CosNaming_NamingContext_unbind;
	    break;
	 default:
	    break;
   }
   return NULL;
}

static void 
init_local_objref_CosNaming_NamingContext(CORBA_Object obj, POA_CosNaming_NamingContext * servant)
{
   obj->vepv[CosNaming_NamingContext__classid] = servant->vepv->CosNaming_NamingContext_epv;
}
void 
POA_CosNaming_NamingContext__init(PortableServer_Servant servant,
				  CORBA_Environment * env)
{
   static const PortableServer_ClassInfo class_info = {(ORBit_impl_finder) & get_skel_CosNaming_NamingContext, "IDL:omg.org/CosNaming/NamingContext:1.0", (ORBit_local_objref_init) & init_local_objref_CosNaming_NamingContext};
   PortableServer_ServantBase__init(((PortableServer_ServantBase *) servant), env);
   ORBIT_OBJECT_KEY(((PortableServer_ServantBase *) servant)->_private)->class_info = (PortableServer_ClassInfo *) & class_info;
   if (!CosNaming_NamingContext__classid)
      CosNaming_NamingContext__classid = ORBit_register_class(&class_info);
}

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

static ORBitSkeleton 
get_skel_CosNaming_BindingIterator(POA_CosNaming_BindingIterator * servant,
				   GIOPRecvBuffer * _ORBIT_recv_buffer,
				   gpointer * impl)
{
   gchar *opname = _ORBIT_recv_buffer->message.u.request.operation;
   switch (opname[0]) {
	 case 'd':
	    if (strcmp((opname + 1), "estroy"))
	       break;
	    *impl = (gpointer) servant->vepv->CosNaming_BindingIterator_epv->destroy;
	    return (ORBitSkeleton) _ORBIT_skel_CosNaming_BindingIterator_destroy;
	    break;
	 case 'n':
	    switch (opname[1]) {
		  case 'e':
		     switch (opname[2]) {
			   case 'x':
			      switch (opname[3]) {
				    case 't':
				       switch (opname[4]) {
					     case '_':
						switch (opname[5]) {
						      case 'n':
							 if (strcmp((opname + 6), ""))
							    break;
							 *impl = (gpointer) servant->vepv->CosNaming_BindingIterator_epv->next_n;
							 return (ORBitSkeleton) _ORBIT_skel_CosNaming_BindingIterator_next_n;
							 break;
						      case 'o':
							 if (strcmp((opname + 6), "ne"))
							    break;
							 *impl = (gpointer) servant->vepv->CosNaming_BindingIterator_epv->next_one;
							 return (ORBitSkeleton) _ORBIT_skel_CosNaming_BindingIterator_next_one;
							 break;
						      default:
							 break;
						}
						break;
					     default:
						break;
				       }
				       break;
				    default:
				       break;
			      }
			      break;
			   default:
			      break;
		     }
		     break;
		  default:
		     break;
	    }
	    break;
	 default:
	    break;
   }
   return NULL;
}

static void 
init_local_objref_CosNaming_BindingIterator(CORBA_Object obj, POA_CosNaming_BindingIterator * servant)
{
   obj->vepv[CosNaming_BindingIterator__classid] = servant->vepv->CosNaming_BindingIterator_epv;
}
void 
POA_CosNaming_BindingIterator__init(PortableServer_Servant servant,
				    CORBA_Environment * env)
{
   static const PortableServer_ClassInfo class_info = {(ORBit_impl_finder) & get_skel_CosNaming_BindingIterator, "IDL:omg.org/CosNaming/BindingIterator:1.0", (ORBit_local_objref_init) & init_local_objref_CosNaming_BindingIterator};
   PortableServer_ServantBase__init(((PortableServer_ServantBase *) servant), env);
   ORBIT_OBJECT_KEY(((PortableServer_ServantBase *) servant)->_private)->class_info = (PortableServer_ClassInfo *) & class_info;
   if (!CosNaming_BindingIterator__classid)
      CosNaming_BindingIterator__classid = ORBit_register_class(&class_info);
}

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