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

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

void
_ORBIT_CosNaming_NamingContext_NotFound_demarshal(GIOPRecvBuffer * _ORBIT_recv_buffer, CORBA_Environment * ev)
{
   guchar *_ORBIT_curptr;
   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 = CosNaming_NamingContext_NotFound__alloc();
   _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 *) & ((*_ORBIT_exdata).why))) = GUINT32_SWAP_LE_BE(*((guint32 *) _ORBIT_curptr));
      _ORBIT_curptr += 4;
      (*((guint32 *) & ((*_ORBIT_exdata).rest_of_name._length))) = GUINT32_SWAP_LE_BE(*((guint32 *) _ORBIT_curptr));
      _ORBIT_curptr += 4;
      (*_ORBIT_exdata).rest_of_name._buffer = CORBA_sequence_CosNaming_NameComponent_allocbuf((*_ORBIT_exdata).rest_of_name._length);
      (*_ORBIT_exdata).rest_of_name._release = CORBA_TRUE;
      for (_ORBIT_tmpvar_0 = 0; _ORBIT_tmpvar_0 < (*_ORBIT_exdata).rest_of_name._length; _ORBIT_tmpvar_0++) {
	 _ORBIT_curptr = ALIGN_ADDRESS(_ORBIT_curptr, 4);
	 (*((guint32 *) & (_ORBIT_tmpvar_2))) = GUINT32_SWAP_LE_BE(*((guint32 *) _ORBIT_curptr));
	 _ORBIT_curptr += 4;
	 (*_ORBIT_exdata).rest_of_name._buffer[_ORBIT_tmpvar_0].id = CORBA_string_alloc(_ORBIT_tmpvar_2);
	 memcpy((*_ORBIT_exdata).rest_of_name._buffer[_ORBIT_tmpvar_0].id, _ORBIT_curptr, sizeof((*_ORBIT_exdata).rest_of_name._buffer[_ORBIT_tmpvar_0].id[_ORBIT_tmpvar_1]) * _ORBIT_tmpvar_2);
	 _ORBIT_curptr += sizeof((*_ORBIT_exdata).rest_of_name._buffer[_ORBIT_tmpvar_0].id[_ORBIT_tmpvar_1]) * _ORBIT_tmpvar_2;
	 _ORBIT_curptr = ALIGN_ADDRESS(_ORBIT_curptr, 4);
	 (*((guint32 *) & (_ORBIT_tmpvar_4))) = GUINT32_SWAP_LE_BE(*((guint32 *) _ORBIT_curptr));
	 _ORBIT_curptr += 4;
	 (*_ORBIT_exdata).rest_of_name._buffer[_ORBIT_tmpvar_0].kind = CORBA_string_alloc(_ORBIT_tmpvar_4);
	 memcpy((*_ORBIT_exdata).rest_of_name._buffer[_ORBIT_tmpvar_0].kind, _ORBIT_curptr, sizeof((*_ORBIT_exdata).rest_of_name._buffer[_ORBIT_tmpvar_0].kind[_ORBIT_tmpvar_3]) * _ORBIT_tmpvar_4);
	 _ORBIT_curptr += sizeof((*_ORBIT_exdata).rest_of_name._buffer[_ORBIT_tmpvar_0].kind[_ORBIT_tmpvar_3]) * _ORBIT_tmpvar_4;
      }

   } else {
      _ORBIT_curptr = ALIGN_ADDRESS(_ORBIT_curptr, 4);
      (*_ORBIT_exdata).why = *((CosNaming_NamingContext_NotFoundReason *) _ORBIT_curptr);
      _ORBIT_curptr += 4;
      (*_ORBIT_exdata).rest_of_name._length = *((CORBA_unsigned_long *) _ORBIT_curptr);
      _ORBIT_curptr += 4;
      (*_ORBIT_exdata).rest_of_name._buffer = CORBA_sequence_CosNaming_NameComponent_allocbuf((*_ORBIT_exdata).rest_of_name._length);
      (*_ORBIT_exdata).rest_of_name._release = CORBA_TRUE;
      for (_ORBIT_tmpvar_0 = 0; _ORBIT_tmpvar_0 < (*_ORBIT_exdata).rest_of_name._length; _ORBIT_tmpvar_0++) {
	 _ORBIT_curptr = ALIGN_ADDRESS(_ORBIT_curptr, 4);
	 _ORBIT_tmpvar_2 = *((CORBA_unsigned_long *) _ORBIT_curptr);
	 _ORBIT_curptr += 4;
	 (*_ORBIT_exdata).rest_of_name._buffer[_ORBIT_tmpvar_0].id = CORBA_string_alloc(_ORBIT_tmpvar_2);
	 memcpy((*_ORBIT_exdata).rest_of_name._buffer[_ORBIT_tmpvar_0].id, _ORBIT_curptr, sizeof((*_ORBIT_exdata).rest_of_name._buffer[_ORBIT_tmpvar_0].id[_ORBIT_tmpvar_1]) * _ORBIT_tmpvar_2);
	 _ORBIT_curptr += sizeof((*_ORBIT_exdata).rest_of_name._buffer[_ORBIT_tmpvar_0].id[_ORBIT_tmpvar_1]) * _ORBIT_tmpvar_2;
	 _ORBIT_curptr = ALIGN_ADDRESS(_ORBIT_curptr, 4);
	 _ORBIT_tmpvar_4 = *((CORBA_unsigned_long *) _ORBIT_curptr);
	 _ORBIT_curptr += 4;
	 (*_ORBIT_exdata).rest_of_name._buffer[_ORBIT_tmpvar_0].kind = CORBA_string_alloc(_ORBIT_tmpvar_4);
	 memcpy((*_ORBIT_exdata).rest_of_name._buffer[_ORBIT_tmpvar_0].kind, _ORBIT_curptr, sizeof((*_ORBIT_exdata).rest_of_name._buffer[_ORBIT_tmpvar_0].kind[_ORBIT_tmpvar_3]) * _ORBIT_tmpvar_4);
	 _ORBIT_curptr += sizeof((*_ORBIT_exdata).rest_of_name._buffer[_ORBIT_tmpvar_0].kind[_ORBIT_tmpvar_3]) * _ORBIT_tmpvar_4;
      }

   }
   CORBA_exception_set(ev, CORBA_USER_EXCEPTION, TC_CosNaming_NamingContext_NotFound_struct.repo_id, _ORBIT_exdata);
}
void
_ORBIT_CosNaming_NamingContext_CannotProceed_demarshal(GIOPRecvBuffer * _ORBIT_recv_buffer, CORBA_Environment * ev)
{
   guchar *_ORBIT_curptr;
   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 = CosNaming_NamingContext_CannotProceed__alloc();
   _ORBIT_curptr = GIOP_RECV_BUFFER(_ORBIT_recv_buffer)->cur;
   if (giop_msg_conversion_needed(GIOP_MESSAGE_BUFFER(_ORBIT_recv_buffer))) {
      GIOP_RECV_BUFFER(_ORBIT_recv_buffer)->cur = _ORBIT_curptr;
      (*_ORBIT_exdata).ctx = ORBit_demarshal_object(_ORBIT_recv_buffer, GIOP_MESSAGE_BUFFER(_ORBIT_recv_buffer)->connection->orb_data);
      _ORBIT_curptr = GIOP_RECV_BUFFER(_ORBIT_recv_buffer)->cur;
      _ORBIT_curptr = ALIGN_ADDRESS(_ORBIT_curptr, 4);
      (*((guint32 *) & ((*_ORBIT_exdata).rest_of_name._length))) = GUINT32_SWAP_LE_BE(*((guint32 *) _ORBIT_curptr));
      _ORBIT_curptr += 4;
      (*_ORBIT_exdata).rest_of_name._buffer = CORBA_sequence_CosNaming_NameComponent_allocbuf((*_ORBIT_exdata).rest_of_name._length);
      (*_ORBIT_exdata).rest_of_name._release = CORBA_TRUE;
      for (_ORBIT_tmpvar_0 = 0; _ORBIT_tmpvar_0 < (*_ORBIT_exdata).rest_of_name._length; _ORBIT_tmpvar_0++) {
	 _ORBIT_curptr = ALIGN_ADDRESS(_ORBIT_curptr, 4);
	 (*((guint32 *) & (_ORBIT_tmpvar_2))) = GUINT32_SWAP_LE_BE(*((guint32 *) _ORBIT_curptr));
	 _ORBIT_curptr += 4;
	 (*_ORBIT_exdata).rest_of_name._buffer[_ORBIT_tmpvar_0].id = CORBA_string_alloc(_ORBIT_tmpvar_2);
	 memcpy((*_ORBIT_exdata).rest_of_name._buffer[_ORBIT_tmpvar_0].id, _ORBIT_curptr, sizeof((*_ORBIT_exdata).rest_of_name._buffer[_ORBIT_tmpvar_0].id[_ORBIT_tmpvar_1]) * _ORBIT_tmpvar_2);
	 _ORBIT_curptr += sizeof((*_ORBIT_exdata).rest_of_name._buffer[_ORBIT_tmpvar_0].id[_ORBIT_tmpvar_1]) * _ORBIT_tmpvar_2;
	 _ORBIT_curptr = ALIGN_ADDRESS(_ORBIT_curptr, 4);
	 (*((guint32 *) & (_ORBIT_tmpvar_4))) = GUINT32_SWAP_LE_BE(*((guint32 *) _ORBIT_curptr));
	 _ORBIT_curptr += 4;
	 (*_ORBIT_exdata).rest_of_name._buffer[_ORBIT_tmpvar_0].kind = CORBA_string_alloc(_ORBIT_tmpvar_4);
	 memcpy((*_ORBIT_exdata).rest_of_name._buffer[_ORBIT_tmpvar_0].kind, _ORBIT_curptr, sizeof((*_ORBIT_exdata).rest_of_name._buffer[_ORBIT_tmpvar_0].kind[_ORBIT_tmpvar_3]) * _ORBIT_tmpvar_4);
	 _ORBIT_curptr += sizeof((*_ORBIT_exdata).rest_of_name._buffer[_ORBIT_tmpvar_0].kind[_ORBIT_tmpvar_3]) * _ORBIT_tmpvar_4;
      }

   } else {
      GIOP_RECV_BUFFER(_ORBIT_recv_buffer)->cur = _ORBIT_curptr;
      (*_ORBIT_exdata).ctx = ORBit_demarshal_object(_ORBIT_recv_buffer, GIOP_MESSAGE_BUFFER(_ORBIT_recv_buffer)->connection->orb_data);
      _ORBIT_curptr = GIOP_RECV_BUFFER(_ORBIT_recv_buffer)->cur;
      _ORBIT_curptr = ALIGN_ADDRESS(_ORBIT_curptr, 4);
      (*_ORBIT_exdata).rest_of_name._length = *((CORBA_unsigned_long *) _ORBIT_curptr);
      _ORBIT_curptr += 4;
      (*_ORBIT_exdata).rest_of_name._buffer = CORBA_sequence_CosNaming_NameComponent_allocbuf((*_ORBIT_exdata).rest_of_name._length);
      (*_ORBIT_exdata).rest_of_name._release = CORBA_TRUE;
      for (_ORBIT_tmpvar_0 = 0; _ORBIT_tmpvar_0 < (*_ORBIT_exdata).rest_of_name._length; _ORBIT_tmpvar_0++) {
	 _ORBIT_curptr = ALIGN_ADDRESS(_ORBIT_curptr, 4);
	 _ORBIT_tmpvar_2 = *((CORBA_unsigned_long *) _ORBIT_curptr);
	 _ORBIT_curptr += 4;
	 (*_ORBIT_exdata).rest_of_name._buffer[_ORBIT_tmpvar_0].id = CORBA_string_alloc(_ORBIT_tmpvar_2);
	 memcpy((*_ORBIT_exdata).rest_of_name._buffer[_ORBIT_tmpvar_0].id, _ORBIT_curptr, sizeof((*_ORBIT_exdata).rest_of_name._buffer[_ORBIT_tmpvar_0].id[_ORBIT_tmpvar_1]) * _ORBIT_tmpvar_2);
	 _ORBIT_curptr += sizeof((*_ORBIT_exdata).rest_of_name._buffer[_ORBIT_tmpvar_0].id[_ORBIT_tmpvar_1]) * _ORBIT_tmpvar_2;
	 _ORBIT_curptr = ALIGN_ADDRESS(_ORBIT_curptr, 4);
	 _ORBIT_tmpvar_4 = *((CORBA_unsigned_long *) _ORBIT_curptr);
	 _ORBIT_curptr += 4;
	 (*_ORBIT_exdata).rest_of_name._buffer[_ORBIT_tmpvar_0].kind = CORBA_string_alloc(_ORBIT_tmpvar_4);
	 memcpy((*_ORBIT_exdata).rest_of_name._buffer[_ORBIT_tmpvar_0].kind, _ORBIT_curptr, sizeof((*_ORBIT_exdata).rest_of_name._buffer[_ORBIT_tmpvar_0].kind[_ORBIT_tmpvar_3]) * _ORBIT_tmpvar_4);
	 _ORBIT_curptr += sizeof((*_ORBIT_exdata).rest_of_name._buffer[_ORBIT_tmpvar_0].kind[_ORBIT_tmpvar_3]) * _ORBIT_tmpvar_4;
      }

   }
   CORBA_exception_set(ev, CORBA_USER_EXCEPTION, TC_CosNaming_NamingContext_CannotProceed_struct.repo_id, _ORBIT_exdata);
}
void
_ORBIT_CosNaming_NamingContext_InvalidName_demarshal(GIOPRecvBuffer * _ORBIT_recv_buffer, CORBA_Environment * ev)
{
   CORBA_exception_set(ev, CORBA_USER_EXCEPTION, TC_CosNaming_NamingContext_InvalidName_struct.repo_id, NULL);
}
void
_ORBIT_CosNaming_NamingContext_AlreadyBound_demarshal(GIOPRecvBuffer * _ORBIT_recv_buffer, CORBA_Environment * ev)
{
   CORBA_exception_set(ev, CORBA_USER_EXCEPTION, TC_CosNaming_NamingContext_AlreadyBound_struct.repo_id, NULL);
}
void
_ORBIT_CosNaming_NamingContext_NotEmpty_demarshal(GIOPRecvBuffer * _ORBIT_recv_buffer, CORBA_Environment * ev)
{
   CORBA_exception_set(ev, CORBA_USER_EXCEPTION, TC_CosNaming_NamingContext_NotEmpty_struct.repo_id, NULL);
}
void 
CosNaming_NamingContext_bind(CosNaming_NamingContext _obj, const CosNaming_Name * n, const CORBA_Object obj, CORBA_Environment * ev)
{
   static const ORBit_exception_demarshal_info _ORBIT_user_exceptions[] = {{(const CORBA_TypeCode) & TC_CosNaming_NamingContext_NotFound_struct, (gpointer) _ORBIT_CosNaming_NamingContext_NotFound_demarshal}, {(const CORBA_TypeCode) & TC_CosNaming_NamingContext_CannotProceed_struct, (gpointer) _ORBIT_CosNaming_NamingContext_CannotProceed_demarshal}, {(const CORBA_TypeCode) & TC_CosNaming_NamingContext_InvalidName_struct, (gpointer) _ORBIT_CosNaming_NamingContext_InvalidName_demarshal}, {(const CORBA_TypeCode) & TC_CosNaming_NamingContext_AlreadyBound_struct, (gpointer) _ORBIT_CosNaming_NamingContext_AlreadyBound_demarshal}, {CORBA_OBJECT_NIL, NULL}};
   register GIOP_unsigned_long _ORBIT_request_id,
    _ORBIT_system_exception_minor;
   register CORBA_completion_status _ORBIT_completion_status;
   register GIOPSendBuffer *_ORBIT_send_buffer;
   register GIOPRecvBuffer *_ORBIT_recv_buffer;
   register GIOPConnection *_cnx;
   if (_obj->servant && _obj->vepv && CosNaming_NamingContext__classid) {
      ((POA_CosNaming_NamingContext__epv *) _obj->vepv[CosNaming_NamingContext__classid])->bind(_obj->servant, n, obj, ev);
      return;
   }
   _cnx = ORBit_object_get_connection(_obj);
_ORBIT_retry_request:
   _ORBIT_send_buffer = NULL;
   _ORBIT_recv_buffer = NULL;
   _ORBIT_completion_status = CORBA_COMPLETED_NO;
   _ORBIT_request_id = GPOINTER_TO_UINT(alloca(0));
   {				/* marshalling */
      static const struct {
	 CORBA_unsigned_long len;
	 char opname[5];
      } _ORBIT_operation_name_data = {
	 5, "bind"
      };
      static const struct iovec _ORBIT_operation_vec = {(gpointer) & _ORBIT_operation_name_data, 9};
      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;
      _ORBIT_send_buffer =
	 giop_send_request_buffer_use(_cnx, NULL, _ORBIT_request_id, CORBA_TRUE,
				      &(_obj->active_profile->object_key_vec), &_ORBIT_operation_vec, &ORBit_default_principal_iovec);

      _ORBIT_system_exception_minor = ex_CORBA_COMM_FAILURE;
      if (!_ORBIT_send_buffer)
	 goto _ORBIT_system_exception;
      giop_message_buffer_do_alignment(GIOP_MESSAGE_BUFFER(_ORBIT_send_buffer), 4);
      {
	 guchar *_ORBIT_t;
	 _ORBIT_t = alloca(sizeof((*n)._length));
	 memcpy(_ORBIT_t, &((*n)._length), sizeof((*n)._length));
	 giop_message_buffer_append_mem(GIOP_MESSAGE_BUFFER(_ORBIT_send_buffer), (_ORBIT_t), sizeof((*n)._length));
      }
      for (_ORBIT_tmpvar_0 = 0; _ORBIT_tmpvar_0 < (*n)._length; _ORBIT_tmpvar_0++) {
	 _ORBIT_tmpvar_2 = strlen((*n)._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((*n)._buffer[_ORBIT_tmpvar_0].id[_ORBIT_tmpvar_1]) * _ORBIT_tmpvar_2);
	    memcpy(_ORBIT_t, ((*n)._buffer[_ORBIT_tmpvar_0].id), sizeof((*n)._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((*n)._buffer[_ORBIT_tmpvar_0].id[_ORBIT_tmpvar_1]) * _ORBIT_tmpvar_2);
	 }
	 _ORBIT_tmpvar_4 = strlen((*n)._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((*n)._buffer[_ORBIT_tmpvar_0].kind[_ORBIT_tmpvar_3]) * _ORBIT_tmpvar_4);
	    memcpy(_ORBIT_t, ((*n)._buffer[_ORBIT_tmpvar_0].kind), sizeof((*n)._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((*n)._buffer[_ORBIT_tmpvar_0].kind[_ORBIT_tmpvar_3]) * _ORBIT_tmpvar_4);
	 }
      }

      ORBit_marshal_object(_ORBIT_send_buffer, obj);
      giop_send_buffer_write(_ORBIT_send_buffer);
      _ORBIT_completion_status = CORBA_COMPLETED_MAYBE;
      giop_send_buffer_unuse(_ORBIT_send_buffer);
      _ORBIT_send_buffer = NULL;
   }
   {				/* demarshalling */
      register guchar *_ORBIT_curptr;
      _ORBIT_recv_buffer = giop_recv_reply_buffer_use_2(_cnx, _ORBIT_request_id, TRUE);
      if (!_ORBIT_recv_buffer)
	 goto _ORBIT_system_exception;
      _ORBIT_completion_status = CORBA_COMPLETED_YES;
      if (_ORBIT_recv_buffer->message.u.reply.reply_status != GIOP_NO_EXCEPTION)
	 goto _ORBIT_msg_exception;
      _ORBIT_curptr = GIOP_RECV_BUFFER(_ORBIT_recv_buffer)->cur;
      if (giop_msg_conversion_needed(GIOP_MESSAGE_BUFFER(_ORBIT_recv_buffer))) {
      } else {
      }
      giop_recv_buffer_unuse(_ORBIT_recv_buffer);
      return;
_ORBIT_system_exception:
      CORBA_exception_set_system(ev, _ORBIT_system_exception_minor, _ORBIT_completion_status);
      giop_recv_buffer_unuse(_ORBIT_recv_buffer);
      giop_send_buffer_unuse(_ORBIT_send_buffer);
      return;
_ORBIT_msg_exception:
      if (_ORBIT_recv_buffer->message.u.reply.reply_status == GIOP_LOCATION_FORWARD) {
	 if (_obj->forward_locations != NULL)
	    ORBit_delete_profiles(_obj->forward_locations);
	 _obj->forward_locations = ORBit_demarshal_IOR(_ORBIT_recv_buffer);
	 _cnx = ORBit_object_get_forwarded_connection(_obj);
	 giop_recv_buffer_unuse(_ORBIT_recv_buffer);

	 goto _ORBIT_retry_request;
      } else {
	 ORBit_handle_exception(_ORBIT_recv_buffer, ev, _ORBIT_user_exceptions, _obj->orb);
	 giop_recv_buffer_unuse(_ORBIT_recv_buffer);
	 return;
      }
   }
}
void 
CosNaming_NamingContext_rebind(CosNaming_NamingContext _obj, const CosNaming_Name * n, const CORBA_Object obj, CORBA_Environment * ev)
{
   static const ORBit_exception_demarshal_info _ORBIT_user_exceptions[] = {{(const CORBA_TypeCode) & TC_CosNaming_NamingContext_NotFound_struct, (gpointer) _ORBIT_CosNaming_NamingContext_NotFound_demarshal}, {(const CORBA_TypeCode) & TC_CosNaming_NamingContext_CannotProceed_struct, (gpointer) _ORBIT_CosNaming_NamingContext_CannotProceed_demarshal}, {(const CORBA_TypeCode) & TC_CosNaming_NamingContext_InvalidName_struct, (gpointer) _ORBIT_CosNaming_NamingContext_InvalidName_demarshal}, {CORBA_OBJECT_NIL, NULL}};
   register GIOP_unsigned_long _ORBIT_request_id,
    _ORBIT_system_exception_minor;
   register CORBA_completion_status _ORBIT_completion_status;
   register GIOPSendBuffer *_ORBIT_send_buffer;
   register GIOPRecvBuffer *_ORBIT_recv_buffer;
   register GIOPConnection *_cnx;
   if (_obj->servant && _obj->vepv && CosNaming_NamingContext__classid) {
      ((POA_CosNaming_NamingContext__epv *) _obj->vepv[CosNaming_NamingContext__classid])->rebind(_obj->servant, n, obj, ev);
      return;
   }
   _cnx = ORBit_object_get_connection(_obj);
_ORBIT_retry_request:
   _ORBIT_send_buffer = NULL;
   _ORBIT_recv_buffer = NULL;
   _ORBIT_completion_status = CORBA_COMPLETED_NO;
   _ORBIT_request_id = GPOINTER_TO_UINT(alloca(0));
   {				/* marshalling */
      static const struct {
	 CORBA_unsigned_long len;
	 char opname[7];
      } _ORBIT_operation_name_data = {
	 7, "rebind"
      };
      static const struct iovec _ORBIT_operation_vec = {(gpointer) & _ORBIT_operation_name_data, 11};
      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;
      _ORBIT_send_buffer =
	 giop_send_request_buffer_use(_cnx, NULL, _ORBIT_request_id, CORBA_TRUE,
				      &(_obj->active_profile->object_key_vec), &_ORBIT_operation_vec, &ORBit_default_principal_iovec);

      _ORBIT_system_exception_minor = ex_CORBA_COMM_FAILURE;
      if (!_ORBIT_send_buffer)
	 goto _ORBIT_system_exception;
      giop_message_buffer_do_alignment(GIOP_MESSAGE_BUFFER(_ORBIT_send_buffer), 4);
      {
	 guchar *_ORBIT_t;
	 _ORBIT_t = alloca(sizeof((*n)._length));
	 memcpy(_ORBIT_t, &((*n)._length), sizeof((*n)._length));
	 giop_message_buffer_append_mem(GIOP_MESSAGE_BUFFER(_ORBIT_send_buffer), (_ORBIT_t), sizeof((*n)._length));
      }
      for (_ORBIT_tmpvar_0 = 0; _ORBIT_tmpvar_0 < (*n)._length; _ORBIT_tmpvar_0++) {
	 _ORBIT_tmpvar_2 = strlen((*n)._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((*n)._buffer[_ORBIT_tmpvar_0].id[_ORBIT_tmpvar_1]) * _ORBIT_tmpvar_2);
	    memcpy(_ORBIT_t, ((*n)._buffer[_ORBIT_tmpvar_0].id), sizeof((*n)._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((*n)._buffer[_ORBIT_tmpvar_0].id[_ORBIT_tmpvar_1]) * _ORBIT_tmpvar_2);
	 }
	 _ORBIT_tmpvar_4 = strlen((*n)._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((*n)._buffer[_ORBIT_tmpvar_0].kind[_ORBIT_tmpvar_3]) * _ORBIT_tmpvar_4);
	    memcpy(_ORBIT_t, ((*n)._buffer[_ORBIT_tmpvar_0].kind), sizeof((*n)._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((*n)._buffer[_ORBIT_tmpvar_0].kind[_ORBIT_tmpvar_3]) * _ORBIT_tmpvar_4);
	 }
      }

      ORBit_marshal_object(_ORBIT_send_buffer, obj);
      giop_send_buffer_write(_ORBIT_send_buffer);
      _ORBIT_completion_status = CORBA_COMPLETED_MAYBE;
      giop_send_buffer_unuse(_ORBIT_send_buffer);
      _ORBIT_send_buffer = NULL;
   }
   {				/* demarshalling */
      register guchar *_ORBIT_curptr;
      _ORBIT_recv_buffer = giop_recv_reply_buffer_use_2(_cnx, _ORBIT_request_id, TRUE);
      if (!_ORBIT_recv_buffer)
	 goto _ORBIT_system_exception;
      _ORBIT_completion_status = CORBA_COMPLETED_YES;
      if (_ORBIT_recv_buffer->message.u.reply.reply_status != GIOP_NO_EXCEPTION)
	 goto _ORBIT_msg_exception;
      _ORBIT_curptr = GIOP_RECV_BUFFER(_ORBIT_recv_buffer)->cur;
      if (giop_msg_conversion_needed(GIOP_MESSAGE_BUFFER(_ORBIT_recv_buffer))) {
      } else {
      }
      giop_recv_buffer_unuse(_ORBIT_recv_buffer);
      return;
_ORBIT_system_exception:
      CORBA_exception_set_system(ev, _ORBIT_system_exception_minor, _ORBIT_completion_status);
      giop_recv_buffer_unuse(_ORBIT_recv_buffer);
      giop_send_buffer_unuse(_ORBIT_send_buffer);
      return;
_ORBIT_msg_exception:
      if (_ORBIT_recv_buffer->message.u.reply.reply_status == GIOP_LOCATION_FORWARD) {
	 if (_obj->forward_locations != NULL)
	    ORBit_delete_profiles(_obj->forward_locations);
	 _obj->forward_locations = ORBit_demarshal_IOR(_ORBIT_recv_buffer);
	 _cnx = ORBit_object_get_forwarded_connection(_obj);
	 giop_recv_buffer_unuse(_ORBIT_recv_buffer);

	 goto _ORBIT_retry_request;
      } else {
	 ORBit_handle_exception(_ORBIT_recv_buffer, ev, _ORBIT_user_exceptions, _obj->orb);
	 giop_recv_buffer_unuse(_ORBIT_recv_buffer);
	 return;
      }
   }
}
void 
CosNaming_NamingContext_bind_context(CosNaming_NamingContext _obj, const CosNaming_Name * n, const CosNaming_NamingContext nc, CORBA_Environment * ev)
{
   static const ORBit_exception_demarshal_info _ORBIT_user_exceptions[] = {{(const CORBA_TypeCode) & TC_CosNaming_NamingContext_NotFound_struct, (gpointer) _ORBIT_CosNaming_NamingContext_NotFound_demarshal}, {(const CORBA_TypeCode) & TC_CosNaming_NamingContext_CannotProceed_struct, (gpointer) _ORBIT_CosNaming_NamingContext_CannotProceed_demarshal}, {(const CORBA_TypeCode) & TC_CosNaming_NamingContext_InvalidName_struct, (gpointer) _ORBIT_CosNaming_NamingContext_InvalidName_demarshal}, {(const CORBA_TypeCode) & TC_CosNaming_NamingContext_AlreadyBound_struct, (gpointer) _ORBIT_CosNaming_NamingContext_AlreadyBound_demarshal}, {CORBA_OBJECT_NIL, NULL}};
   register GIOP_unsigned_long _ORBIT_request_id,
    _ORBIT_system_exception_minor;
   register CORBA_completion_status _ORBIT_completion_status;
   register GIOPSendBuffer *_ORBIT_send_buffer;
   register GIOPRecvBuffer *_ORBIT_recv_buffer;
   register GIOPConnection *_cnx;
   if (_obj->servant && _obj->vepv && CosNaming_NamingContext__classid) {
      ((POA_CosNaming_NamingContext__epv *) _obj->vepv[CosNaming_NamingContext__classid])->bind_context(_obj->servant, n, nc, ev);
      return;
   }
   _cnx = ORBit_object_get_connection(_obj);
_ORBIT_retry_request:
   _ORBIT_send_buffer = NULL;
   _ORBIT_recv_buffer = NULL;
   _ORBIT_completion_status = CORBA_COMPLETED_NO;
   _ORBIT_request_id = GPOINTER_TO_UINT(alloca(0));
   {				/* marshalling */
      static const struct {
	 CORBA_unsigned_long len;
	 char opname[13];
      } _ORBIT_operation_name_data = {
	 13, "bind_context"
      };
      static const struct iovec _ORBIT_operation_vec = {(gpointer) & _ORBIT_operation_name_data, 17};
      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;
      _ORBIT_send_buffer =
	 giop_send_request_buffer_use(_cnx, NULL, _ORBIT_request_id, CORBA_TRUE,
				      &(_obj->active_profile->object_key_vec), &_ORBIT_operation_vec, &ORBit_default_principal_iovec);

      _ORBIT_system_exception_minor = ex_CORBA_COMM_FAILURE;
      if (!_ORBIT_send_buffer)
	 goto _ORBIT_system_exception;
      giop_message_buffer_do_alignment(GIOP_MESSAGE_BUFFER(_ORBIT_send_buffer), 4);
      {
	 guchar *_ORBIT_t;
	 _ORBIT_t = alloca(sizeof((*n)._length));
	 memcpy(_ORBIT_t, &((*n)._length), sizeof((*n)._length));
	 giop_message_buffer_append_mem(GIOP_MESSAGE_BUFFER(_ORBIT_send_buffer), (_ORBIT_t), sizeof((*n)._length));
      }
      for (_ORBIT_tmpvar_0 = 0; _ORBIT_tmpvar_0 < (*n)._length; _ORBIT_tmpvar_0++) {
	 _ORBIT_tmpvar_2 = strlen((*n)._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((*n)._buffer[_ORBIT_tmpvar_0].id[_ORBIT_tmpvar_1]) * _ORBIT_tmpvar_2);
	    memcpy(_ORBIT_t, ((*n)._buffer[_ORBIT_tmpvar_0].id), sizeof((*n)._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((*n)._buffer[_ORBIT_tmpvar_0].id[_ORBIT_tmpvar_1]) * _ORBIT_tmpvar_2);
	 }
	 _ORBIT_tmpvar_4 = strlen((*n)._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((*n)._buffer[_ORBIT_tmpvar_0].kind[_ORBIT_tmpvar_3]) * _ORBIT_tmpvar_4);
	    memcpy(_ORBIT_t, ((*n)._buffer[_ORBIT_tmpvar_0].kind), sizeof((*n)._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((*n)._buffer[_ORBIT_tmpvar_0].kind[_ORBIT_tmpvar_3]) * _ORBIT_tmpvar_4);
	 }
      }

      ORBit_marshal_object(_ORBIT_send_buffer, nc);
      giop_send_buffer_write(_ORBIT_send_buffer);
      _ORBIT_completion_status = CORBA_COMPLETED_MAYBE;
      giop_send_buffer_unuse(_ORBIT_send_buffer);
      _ORBIT_send_buffer = NULL;
   }
   {				/* demarshalling */
      register guchar *_ORBIT_curptr;
      _ORBIT_recv_buffer = giop_recv_reply_buffer_use_2(_cnx, _ORBIT_request_id, TRUE);
      if (!_ORBIT_recv_buffer)
	 goto _ORBIT_system_exception;
      _ORBIT_completion_status = CORBA_COMPLETED_YES;
      if (_ORBIT_recv_buffer->message.u.reply.reply_status != GIOP_NO_EXCEPTION)
	 goto _ORBIT_msg_exception;
      _ORBIT_curptr = GIOP_RECV_BUFFER(_ORBIT_recv_buffer)->cur;
      if (giop_msg_conversion_needed(GIOP_MESSAGE_BUFFER(_ORBIT_recv_buffer))) {
      } else {
      }
      giop_recv_buffer_unuse(_ORBIT_recv_buffer);
      return;
_ORBIT_system_exception:
      CORBA_exception_set_system(ev, _ORBIT_system_exception_minor, _ORBIT_completion_status);
      giop_recv_buffer_unuse(_ORBIT_recv_buffer);
      giop_send_buffer_unuse(_ORBIT_send_buffer);
      return;
_ORBIT_msg_exception:
      if (_ORBIT_recv_buffer->message.u.reply.reply_status == GIOP_LOCATION_FORWARD) {
	 if (_obj->forward_locations != NULL)
	    ORBit_delete_profiles(_obj->forward_locations);
	 _obj->forward_locations = ORBit_demarshal_IOR(_ORBIT_recv_buffer);
	 _cnx = ORBit_object_get_forwarded_connection(_obj);
	 giop_recv_buffer_unuse(_ORBIT_recv_buffer);

	 goto _ORBIT_retry_request;
      } else {
	 ORBit_handle_exception(_ORBIT_recv_buffer, ev, _ORBIT_user_exceptions, _obj->orb);
	 giop_recv_buffer_unuse(_ORBIT_recv_buffer);
	 return;
      }
   }
}
void 
CosNaming_NamingContext_rebind_context(CosNaming_NamingContext _obj, const CosNaming_Name * n, const CosNaming_NamingContext nc, CORBA_Environment * ev)
{
   static const ORBit_exception_demarshal_info _ORBIT_user_exceptions[] = {{(const CORBA_TypeCode) & TC_CosNaming_NamingContext_NotFound_struct, (gpointer) _ORBIT_CosNaming_NamingContext_NotFound_demarshal}, {(const CORBA_TypeCode) & TC_CosNaming_NamingContext_CannotProceed_struct, (gpointer) _ORBIT_CosNaming_NamingContext_CannotProceed_demarshal}, {(const CORBA_TypeCode) & TC_CosNaming_NamingContext_InvalidName_struct, (gpointer) _ORBIT_CosNaming_NamingContext_InvalidName_demarshal}, {CORBA_OBJECT_NIL, NULL}};
   register GIOP_unsigned_long _ORBIT_request_id,
    _ORBIT_system_exception_minor;
   register CORBA_completion_status _ORBIT_completion_status;
   register GIOPSendBuffer *_ORBIT_send_buffer;
   register GIOPRecvBuffer *_ORBIT_recv_buffer;
   register GIOPConnection *_cnx;
   if (_obj->servant && _obj->vepv && CosNaming_NamingContext__classid) {
      ((POA_CosNaming_NamingContext__epv *) _obj->vepv[CosNaming_NamingContext__classid])->rebind_context(_obj->servant, n, nc, ev);
      return;
   }
   _cnx = ORBit_object_get_connection(_obj);
_ORBIT_retry_request:
   _ORBIT_send_buffer = NULL;
   _ORBIT_recv_buffer = NULL;
   _ORBIT_completion_status = CORBA_COMPLETED_NO;
   _ORBIT_request_id = GPOINTER_TO_UINT(alloca(0));
   {				/* marshalling */
      static const struct {
	 CORBA_unsigned_long len;
	 char opname[15];
      } _ORBIT_operation_name_data = {
	 15, "rebind_context"
      };
      static const struct iovec _ORBIT_operation_vec = {(gpointer) & _ORBIT_operation_name_data, 19};
      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;
      _ORBIT_send_buffer =
	 giop_send_request_buffer_use(_cnx, NULL, _ORBIT_request_id, CORBA_TRUE,
				      &(_obj->active_profile->object_key_vec), &_ORBIT_operation_vec, &ORBit_default_principal_iovec);

      _ORBIT_system_exception_minor = ex_CORBA_COMM_FAILURE;
      if (!_ORBIT_send_buffer)
	 goto _ORBIT_system_exception;
      giop_message_buffer_do_alignment(GIOP_MESSAGE_BUFFER(_ORBIT_send_buffer), 4);
      {
	 guchar *_ORBIT_t;
	 _ORBIT_t = alloca(sizeof((*n)._length));
	 memcpy(_ORBIT_t, &((*n)._length), sizeof((*n)._length));
	 giop_message_buffer_append_mem(GIOP_MESSAGE_BUFFER(_ORBIT_send_buffer), (_ORBIT_t), sizeof((*n)._length));
      }
      for (_ORBIT_tmpvar_0 = 0; _ORBIT_tmpvar_0 < (*n)._length; _ORBIT_tmpvar_0++) {
	 _ORBIT_tmpvar_2 = strlen((*n)._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((*n)._buffer[_ORBIT_tmpvar_0].id[_ORBIT_tmpvar_1]) * _ORBIT_tmpvar_2);
	    memcpy(_ORBIT_t, ((*n)._buffer[_ORBIT_tmpvar_0].id), sizeof((*n)._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((*n)._buffer[_ORBIT_tmpvar_0].id[_ORBIT_tmpvar_1]) * _ORBIT_tmpvar_2);
	 }
	 _ORBIT_tmpvar_4 = strlen((*n)._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((*n)._buffer[_ORBIT_tmpvar_0].kind[_ORBIT_tmpvar_3]) * _ORBIT_tmpvar_4);
	    memcpy(_ORBIT_t, ((*n)._buffer[_ORBIT_tmpvar_0].kind), sizeof((*n)._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((*n)._buffer[_ORBIT_tmpvar_0].kind[_ORBIT_tmpvar_3]) * _ORBIT_tmpvar_4);
	 }
      }

      ORBit_marshal_object(_ORBIT_send_buffer, nc);
      giop_send_buffer_write(_ORBIT_send_buffer);
      _ORBIT_completion_status = CORBA_COMPLETED_MAYBE;
      giop_send_buffer_unuse(_ORBIT_send_buffer);
      _ORBIT_send_buffer = NULL;
   }
   {				/* demarshalling */
      register guchar *_ORBIT_curptr;
      _ORBIT_recv_buffer = giop_recv_reply_buffer_use_2(_cnx, _ORBIT_request_id, TRUE);
      if (!_ORBIT_recv_buffer)
	 goto _ORBIT_system_exception;
      _ORBIT_completion_status = CORBA_COMPLETED_YES;
      if (_ORBIT_recv_buffer->message.u.reply.reply_status != GIOP_NO_EXCEPTION)
	 goto _ORBIT_msg_exception;
      _ORBIT_curptr = GIOP_RECV_BUFFER(_ORBIT_recv_buffer)->cur;
      if (giop_msg_conversion_needed(GIOP_MESSAGE_BUFFER(_ORBIT_recv_buffer))) {
      } else {
      }
      giop_recv_buffer_unuse(_ORBIT_recv_buffer);
      return;
_ORBIT_system_exception:
      CORBA_exception_set_system(ev, _ORBIT_system_exception_minor, _ORBIT_completion_status);
      giop_recv_buffer_unuse(_ORBIT_recv_buffer);
      giop_send_buffer_unuse(_ORBIT_send_buffer);
      return;
_ORBIT_msg_exception:
      if (_ORBIT_recv_buffer->message.u.reply.reply_status == GIOP_LOCATION_FORWARD) {
	 if (_obj->forward_locations != NULL)
	    ORBit_delete_profiles(_obj->forward_locations);
	 _obj->forward_locations = ORBit_demarshal_IOR(_ORBIT_recv_buffer);
	 _cnx = ORBit_object_get_forwarded_connection(_obj);
	 giop_recv_buffer_unuse(_ORBIT_recv_buffer);

	 goto _ORBIT_retry_request;
      } else {
	 ORBit_handle_exception(_ORBIT_recv_buffer, ev, _ORBIT_user_exceptions, _obj->orb);
	 giop_recv_buffer_unuse(_ORBIT_recv_buffer);
	 return;
      }
   }
}
CORBA_Object 
CosNaming_NamingContext_resolve(CosNaming_NamingContext _obj, const CosNaming_Name * n, CORBA_Environment * ev)
{
   static const ORBit_exception_demarshal_info _ORBIT_user_exceptions[] = {{(const CORBA_TypeCode) & TC_CosNaming_NamingContext_NotFound_struct, (gpointer) _ORBIT_CosNaming_NamingContext_NotFound_demarshal}, {(const CORBA_TypeCode) & TC_CosNaming_NamingContext_CannotProceed_struct, (gpointer) _ORBIT_CosNaming_NamingContext_CannotProceed_demarshal}, {(const CORBA_TypeCode) & TC_CosNaming_NamingContext_InvalidName_struct, (gpointer) _ORBIT_CosNaming_NamingContext_InvalidName_demarshal}, {CORBA_OBJECT_NIL, NULL}};
   register GIOP_unsigned_long _ORBIT_request_id,
    _ORBIT_system_exception_minor;
   register CORBA_completion_status _ORBIT_completion_status;
   register GIOPSendBuffer *_ORBIT_send_buffer;
   register GIOPRecvBuffer *_ORBIT_recv_buffer;
   register GIOPConnection *_cnx;
   CORBA_Object _ORBIT_retval;
   if (_obj->servant && _obj->vepv && CosNaming_NamingContext__classid) {
      _ORBIT_retval = ((POA_CosNaming_NamingContext__epv *) _obj->vepv[CosNaming_NamingContext__classid])->resolve(_obj->servant, n, ev);
      return _ORBIT_retval;
   }
   if (0)
      return *(&_ORBIT_retval);
   _cnx = ORBit_object_get_connection(_obj);
_ORBIT_retry_request:
   _ORBIT_send_buffer = NULL;
   _ORBIT_recv_buffer = NULL;
   _ORBIT_completion_status = CORBA_COMPLETED_NO;
   _ORBIT_request_id = GPOINTER_TO_UINT(alloca(0));
   {				/* marshalling */
      static const struct {
	 CORBA_unsigned_long len;
	 char opname[8];
      } _ORBIT_operation_name_data = {
	 8, "resolve"
      };
      static const struct iovec _ORBIT_operation_vec = {(gpointer) & _ORBIT_operation_name_data, 12};
      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;
      _ORBIT_send_buffer =
	 giop_send_request_buffer_use(_cnx, NULL, _ORBIT_request_id, CORBA_TRUE,
				      &(_obj->active_profile->object_key_vec), &_ORBIT_operation_vec, &ORBit_default_principal_iovec);

      _ORBIT_system_exception_minor = ex_CORBA_COMM_FAILURE;
      if (!_ORBIT_send_buffer)
	 goto _ORBIT_system_exception;
      giop_message_buffer_do_alignment(GIOP_MESSAGE_BUFFER(_ORBIT_send_buffer), 4);
      {
	 guchar *_ORBIT_t;
	 _ORBIT_t = alloca(sizeof((*n)._length));
	 memcpy(_ORBIT_t, &((*n)._length), sizeof((*n)._length));
	 giop_message_buffer_append_mem(GIOP_MESSAGE_BUFFER(_ORBIT_send_buffer), (_ORBIT_t), sizeof((*n)._length));
      }
      for (_ORBIT_tmpvar_0 = 0; _ORBIT_tmpvar_0 < (*n)._length; _ORBIT_tmpvar_0++) {
	 _ORBIT_tmpvar_2 = strlen((*n)._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((*n)._buffer[_ORBIT_tmpvar_0].id[_ORBIT_tmpvar_1]) * _ORBIT_tmpvar_2);
	    memcpy(_ORBIT_t, ((*n)._buffer[_ORBIT_tmpvar_0].id), sizeof((*n)._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((*n)._buffer[_ORBIT_tmpvar_0].id[_ORBIT_tmpvar_1]) * _ORBIT_tmpvar_2);
	 }
	 _ORBIT_tmpvar_4 = strlen((*n)._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((*n)._buffer[_ORBIT_tmpvar_0].kind[_ORBIT_tmpvar_3]) * _ORBIT_tmpvar_4);
	    memcpy(_ORBIT_t, ((*n)._buffer[_ORBIT_tmpvar_0].kind), sizeof((*n)._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((*n)._buffer[_ORBIT_tmpvar_0].kind[_ORBIT_tmpvar_3]) * _ORBIT_tmpvar_4);
	 }
      }

      giop_send_buffer_write(_ORBIT_send_buffer);
      _ORBIT_completion_status = CORBA_COMPLETED_MAYBE;
      giop_send_buffer_unuse(_ORBIT_send_buffer);
      _ORBIT_send_buffer = NULL;
   }
   {				/* demarshalling */
      register guchar *_ORBIT_curptr;
      _ORBIT_recv_buffer = giop_recv_reply_buffer_use_2(_cnx, _ORBIT_request_id, TRUE);
      if (!_ORBIT_recv_buffer)
	 goto _ORBIT_system_exception;
      _ORBIT_completion_status = CORBA_COMPLETED_YES;
      if (_ORBIT_recv_buffer->message.u.reply.reply_status != GIOP_NO_EXCEPTION)
	 goto _ORBIT_msg_exception;
      _ORBIT_curptr = GIOP_RECV_BUFFER(_ORBIT_recv_buffer)->cur;
      if (giop_msg_conversion_needed(GIOP_MESSAGE_BUFFER(_ORBIT_recv_buffer))) {
	 GIOP_RECV_BUFFER(_ORBIT_recv_buffer)->cur = _ORBIT_curptr;
	 _ORBIT_retval = ORBit_demarshal_object(_ORBIT_recv_buffer, GIOP_MESSAGE_BUFFER(_ORBIT_recv_buffer)->connection->orb_data);
	 _ORBIT_curptr = GIOP_RECV_BUFFER(_ORBIT_recv_buffer)->cur;
      } else {
	 GIOP_RECV_BUFFER(_ORBIT_recv_buffer)->cur = _ORBIT_curptr;
	 _ORBIT_retval = ORBit_demarshal_object(_ORBIT_recv_buffer, GIOP_MESSAGE_BUFFER(_ORBIT_recv_buffer)->connection->orb_data);
	 _ORBIT_curptr = GIOP_RECV_BUFFER(_ORBIT_recv_buffer)->cur;
      }
      giop_recv_buffer_unuse(_ORBIT_recv_buffer);
      return _ORBIT_retval;
_ORBIT_system_exception:
      CORBA_exception_set_system(ev, _ORBIT_system_exception_minor, _ORBIT_completion_status);
      giop_recv_buffer_unuse(_ORBIT_recv_buffer);
      giop_send_buffer_unuse(_ORBIT_send_buffer);
      return _ORBIT_retval;
_ORBIT_msg_exception:
      if (_ORBIT_recv_buffer->message.u.reply.reply_status == GIOP_LOCATION_FORWARD) {
	 if (_obj->forward_locations != NULL)
	    ORBit_delete_profiles(_obj->forward_locations);
	 _obj->forward_locations = ORBit_demarshal_IOR(_ORBIT_recv_buffer);
	 _cnx = ORBit_object_get_forwarded_connection(_obj);
	 giop_recv_buffer_unuse(_ORBIT_recv_buffer);

	 goto _ORBIT_retry_request;
      } else {
	 ORBit_handle_exception(_ORBIT_recv_buffer, ev, _ORBIT_user_exceptions, _obj->orb);
	 giop_recv_buffer_unuse(_ORBIT_recv_buffer);
	 return _ORBIT_retval;
      }
   }
}
void 
CosNaming_NamingContext_unbind(CosNaming_NamingContext _obj, const CosNaming_Name * n, CORBA_Environment * ev)
{
   static const ORBit_exception_demarshal_info _ORBIT_user_exceptions[] = {{(const CORBA_TypeCode) & TC_CosNaming_NamingContext_NotFound_struct, (gpointer) _ORBIT_CosNaming_NamingContext_NotFound_demarshal}, {(const CORBA_TypeCode) & TC_CosNaming_NamingContext_CannotProceed_struct, (gpointer) _ORBIT_CosNaming_NamingContext_CannotProceed_demarshal}, {(const CORBA_TypeCode) & TC_CosNaming_NamingContext_InvalidName_struct, (gpointer) _ORBIT_CosNaming_NamingContext_InvalidName_demarshal}, {CORBA_OBJECT_NIL, NULL}};
   register GIOP_unsigned_long _ORBIT_request_id,
    _ORBIT_system_exception_minor;
   register CORBA_completion_status _ORBIT_completion_status;
   register GIOPSendBuffer *_ORBIT_send_buffer;
   register GIOPRecvBuffer *_ORBIT_recv_buffer;
   register GIOPConnection *_cnx;
   if (_obj->servant && _obj->vepv && CosNaming_NamingContext__classid) {
      ((POA_CosNaming_NamingContext__epv *) _obj->vepv[CosNaming_NamingContext__classid])->unbind(_obj->servant, n, ev);
      return;
   }
   _cnx = ORBit_object_get_connection(_obj);
_ORBIT_retry_request:
   _ORBIT_send_buffer = NULL;
   _ORBIT_recv_buffer = NULL;
   _ORBIT_completion_status = CORBA_COMPLETED_NO;
   _ORBIT_request_id = GPOINTER_TO_UINT(alloca(0));
   {				/* marshalling */
      static const struct {
	 CORBA_unsigned_long len;
	 char opname[7];
      } _ORBIT_operation_name_data = {
	 7, "unbind"
      };
      static const struct iovec _ORBIT_operation_vec = {(gpointer) & _ORBIT_operation_name_data, 11};
      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;
      _ORBIT_send_buffer =
	 giop_send_request_buffer_use(_cnx, NULL, _ORBIT_request_id, CORBA_TRUE,
				      &(_obj->active_profile->object_key_vec), &_ORBIT_operation_vec, &ORBit_default_principal_iovec);

      _ORBIT_system_exception_minor = ex_CORBA_COMM_FAILURE;
      if (!_ORBIT_send_buffer)
	 goto _ORBIT_system_exception;
      giop_message_buffer_do_alignment(GIOP_MESSAGE_BUFFER(_ORBIT_send_buffer), 4);
      {
	 guchar *_ORBIT_t;
	 _ORBIT_t = alloca(sizeof((*n)._length));
	 memcpy(_ORBIT_t, &((*n)._length), sizeof((*n)._length));
	 giop_message_buffer_append_mem(GIOP_MESSAGE_BUFFER(_ORBIT_send_buffer), (_ORBIT_t), sizeof((*n)._length));
      }
      for (_ORBIT_tmpvar_0 = 0; _ORBIT_tmpvar_0 < (*n)._length; _ORBIT_tmpvar_0++) {
	 _ORBIT_tmpvar_2 = strlen((*n)._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((*n)._buffer[_ORBIT_tmpvar_0].id[_ORBIT_tmpvar_1]) * _ORBIT_tmpvar_2);
	    memcpy(_ORBIT_t, ((*n)._buffer[_ORBIT_tmpvar_0].id), sizeof((*n)._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((*n)._buffer[_ORBIT_tmpvar_0].id[_ORBIT_tmpvar_1]) * _ORBIT_tmpvar_2);
	 }
	 _ORBIT_tmpvar_4 = strlen((*n)._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((*n)._buffer[_ORBIT_tmpvar_0].kind[_ORBIT_tmpvar_3]) * _ORBIT_tmpvar_4);
	    memcpy(_ORBIT_t, ((*n)._buffer[_ORBIT_tmpvar_0].kind), sizeof((*n)._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((*n)._buffer[_ORBIT_tmpvar_0].kind[_ORBIT_tmpvar_3]) * _ORBIT_tmpvar_4);
	 }
      }

      giop_send_buffer_write(_ORBIT_send_buffer);
      _ORBIT_completion_status = CORBA_COMPLETED_MAYBE;
      giop_send_buffer_unuse(_ORBIT_send_buffer);
      _ORBIT_send_buffer = NULL;
   }
   {				/* demarshalling */
      register guchar *_ORBIT_curptr;
      _ORBIT_recv_buffer = giop_recv_reply_buffer_use_2(_cnx, _ORBIT_request_id, TRUE);
      if (!_ORBIT_recv_buffer)
	 goto _ORBIT_system_exception;
      _ORBIT_completion_status = CORBA_COMPLETED_YES;
      if (_ORBIT_recv_buffer->message.u.reply.reply_status != GIOP_NO_EXCEPTION)
	 goto _ORBIT_msg_exception;
      _ORBIT_curptr = GIOP_RECV_BUFFER(_ORBIT_recv_buffer)->cur;
      if (giop_msg_conversion_needed(GIOP_MESSAGE_BUFFER(_ORBIT_recv_buffer))) {
      } else {
      }
      giop_recv_buffer_unuse(_ORBIT_recv_buffer);
      return;
_ORBIT_system_exception:
      CORBA_exception_set_system(ev, _ORBIT_system_exception_minor, _ORBIT_completion_status);
      giop_recv_buffer_unuse(_ORBIT_recv_buffer);
      giop_send_buffer_unuse(_ORBIT_send_buffer);
      return;
_ORBIT_msg_exception:
      if (_ORBIT_recv_buffer->message.u.reply.reply_status == GIOP_LOCATION_FORWARD) {
	 if (_obj->forward_locations != NULL)
	    ORBit_delete_profiles(_obj->forward_locations);
	 _obj->forward_locations = ORBit_demarshal_IOR(_ORBIT_recv_buffer);
	 _cnx = ORBit_object_get_forwarded_connection(_obj);
	 giop_recv_buffer_unuse(_ORBIT_recv_buffer);

	 goto _ORBIT_retry_request;
      } else {
	 ORBit_handle_exception(_ORBIT_recv_buffer, ev, _ORBIT_user_exceptions, _obj->orb);
	 giop_recv_buffer_unuse(_ORBIT_recv_buffer);
	 return;
      }
   }
}
CosNaming_NamingContext 
CosNaming_NamingContext_new_context(CosNaming_NamingContext _obj, CORBA_Environment * ev)
{
   register GIOP_unsigned_long _ORBIT_request_id,
    _ORBIT_system_exception_minor;
   register CORBA_completion_status _ORBIT_completion_status;
   register GIOPSendBuffer *_ORBIT_send_buffer;
   register GIOPRecvBuffer *_ORBIT_recv_buffer;
   register GIOPConnection *_cnx;
   CosNaming_NamingContext _ORBIT_retval;
   if (_obj->servant && _obj->vepv && CosNaming_NamingContext__classid) {
      _ORBIT_retval = ((POA_CosNaming_NamingContext__epv *) _obj->vepv[CosNaming_NamingContext__classid])->new_context(_obj->servant, ev);
      return _ORBIT_retval;
   }
   if (0)
      return *(&_ORBIT_retval);
   _cnx = ORBit_object_get_connection(_obj);
_ORBIT_retry_request:
   _ORBIT_send_buffer = NULL;
   _ORBIT_recv_buffer = NULL;
   _ORBIT_completion_status = CORBA_COMPLETED_NO;
   _ORBIT_request_id = GPOINTER_TO_UINT(alloca(0));
   {				/* marshalling */
      static const struct {
	 CORBA_unsigned_long len;
	 char opname[12];
      } _ORBIT_operation_name_data = {
	 12, "new_context"
      };
      static const struct iovec _ORBIT_operation_vec = {(gpointer) & _ORBIT_operation_name_data, 16};
      _ORBIT_send_buffer =
	 giop_send_request_buffer_use(_cnx, NULL, _ORBIT_request_id, CORBA_TRUE,
				      &(_obj->active_profile->object_key_vec), &_ORBIT_operation_vec, &ORBit_default_principal_iovec);

      _ORBIT_system_exception_minor = ex_CORBA_COMM_FAILURE;
      if (!_ORBIT_send_buffer)
	 goto _ORBIT_system_exception;
      giop_send_buffer_write(_ORBIT_send_buffer);
      _ORBIT_completion_status = CORBA_COMPLETED_MAYBE;
      giop_send_buffer_unuse(_ORBIT_send_buffer);
      _ORBIT_send_buffer = NULL;
   }
   {				/* demarshalling */
      register guchar *_ORBIT_curptr;
      _ORBIT_recv_buffer = giop_recv_reply_buffer_use_2(_cnx, _ORBIT_request_id, TRUE);
      if (!_ORBIT_recv_buffer)
	 goto _ORBIT_system_exception;
      _ORBIT_completion_status = CORBA_COMPLETED_YES;
      if (_ORBIT_recv_buffer->message.u.reply.reply_status != GIOP_NO_EXCEPTION)
	 goto _ORBIT_msg_exception;
      _ORBIT_curptr = GIOP_RECV_BUFFER(_ORBIT_recv_buffer)->cur;
      if (giop_msg_conversion_needed(GIOP_MESSAGE_BUFFER(_ORBIT_recv_buffer))) {
	 GIOP_RECV_BUFFER(_ORBIT_recv_buffer)->cur = _ORBIT_curptr;
	 _ORBIT_retval = ORBit_demarshal_object(_ORBIT_recv_buffer, GIOP_MESSAGE_BUFFER(_ORBIT_recv_buffer)->connection->orb_data);
	 _ORBIT_curptr = GIOP_RECV_BUFFER(_ORBIT_recv_buffer)->cur;
      } else {
	 GIOP_RECV_BUFFER(_ORBIT_recv_buffer)->cur = _ORBIT_curptr;
	 _ORBIT_retval = ORBit_demarshal_object(_ORBIT_recv_buffer, GIOP_MESSAGE_BUFFER(_ORBIT_recv_buffer)->connection->orb_data);
	 _ORBIT_curptr = GIOP_RECV_BUFFER(_ORBIT_recv_buffer)->cur;
      }
      giop_recv_buffer_unuse(_ORBIT_recv_buffer);
      return _ORBIT_retval;
_ORBIT_system_exception:
      CORBA_exception_set_system(ev, _ORBIT_system_exception_minor, _ORBIT_completion_status);
      giop_recv_buffer_unuse(_ORBIT_recv_buffer);
      giop_send_buffer_unuse(_ORBIT_send_buffer);
      return _ORBIT_retval;
_ORBIT_msg_exception:
      if (_ORBIT_recv_buffer->message.u.reply.reply_status == GIOP_LOCATION_FORWARD) {
	 if (_obj->forward_locations != NULL)
	    ORBit_delete_profiles(_obj->forward_locations);
	 _obj->forward_locations = ORBit_demarshal_IOR(_ORBIT_recv_buffer);
	 _cnx = ORBit_object_get_forwarded_connection(_obj);
	 giop_recv_buffer_unuse(_ORBIT_recv_buffer);

	 goto _ORBIT_retry_request;
      } else {
	 ORBit_handle_exception(_ORBIT_recv_buffer, ev, NULL, _obj->orb);
	 giop_recv_buffer_unuse(_ORBIT_recv_buffer);
	 return _ORBIT_retval;
      }
   }
}
CosNaming_NamingContext 
CosNaming_NamingContext_bind_new_context(CosNaming_NamingContext _obj, const CosNaming_Name * n, CORBA_Environment * ev)
{
   static const ORBit_exception_demarshal_info _ORBIT_user_exceptions[] = {{(const CORBA_TypeCode) & TC_CosNaming_NamingContext_NotFound_struct, (gpointer) _ORBIT_CosNaming_NamingContext_NotFound_demarshal}, {(const CORBA_TypeCode) & TC_CosNaming_NamingContext_AlreadyBound_struct, (gpointer) _ORBIT_CosNaming_NamingContext_AlreadyBound_demarshal}, {(const CORBA_TypeCode) & TC_CosNaming_NamingContext_CannotProceed_struct, (gpointer) _ORBIT_CosNaming_NamingContext_CannotProceed_demarshal}, {(const CORBA_TypeCode) & TC_CosNaming_NamingContext_InvalidName_struct, (gpointer) _ORBIT_CosNaming_NamingContext_InvalidName_demarshal}, {CORBA_OBJECT_NIL, NULL}};
   register GIOP_unsigned_long _ORBIT_request_id,
    _ORBIT_system_exception_minor;
   register CORBA_completion_status _ORBIT_completion_status;
   register GIOPSendBuffer *_ORBIT_send_buffer;
   register GIOPRecvBuffer *_ORBIT_recv_buffer;
   register GIOPConnection *_cnx;
   CosNaming_NamingContext _ORBIT_retval;
   if (_obj->servant && _obj->vepv && CosNaming_NamingContext__classid) {
      _ORBIT_retval = ((POA_CosNaming_NamingContext__epv *) _obj->vepv[CosNaming_NamingContext__classid])->bind_new_context(_obj->servant, n, ev);
      return _ORBIT_retval;
   }
   if (0)
      return *(&_ORBIT_retval);
   _cnx = ORBit_object_get_connection(_obj);
_ORBIT_retry_request:
   _ORBIT_send_buffer = NULL;
   _ORBIT_recv_buffer = NULL;
   _ORBIT_completion_status = CORBA_COMPLETED_NO;
   _ORBIT_request_id = GPOINTER_TO_UINT(alloca(0));
   {				/* marshalling */
      static const struct {
	 CORBA_unsigned_long len;
	 char opname[17];
      } _ORBIT_operation_name_data = {
	 17, "bind_new_context"
      };
      static const struct iovec _ORBIT_operation_vec = {(gpointer) & _ORBIT_operation_name_data, 21};
      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;
      _ORBIT_send_buffer =
	 giop_send_request_buffer_use(_cnx, NULL, _ORBIT_request_id, CORBA_TRUE,
				      &(_obj->active_profile->object_key_vec), &_ORBIT_operation_vec, &ORBit_default_principal_iovec);

      _ORBIT_system_exception_minor = ex_CORBA_COMM_FAILURE;
      if (!_ORBIT_send_buffer)
	 goto _ORBIT_system_exception;
      giop_message_buffer_do_alignment(GIOP_MESSAGE_BUFFER(_ORBIT_send_buffer), 4);
      {
	 guchar *_ORBIT_t;
	 _ORBIT_t = alloca(sizeof((*n)._length));
	 memcpy(_ORBIT_t, &((*n)._length), sizeof((*n)._length));
	 giop_message_buffer_append_mem(GIOP_MESSAGE_BUFFER(_ORBIT_send_buffer), (_ORBIT_t), sizeof((*n)._length));
      }
      for (_ORBIT_tmpvar_0 = 0; _ORBIT_tmpvar_0 < (*n)._length; _ORBIT_tmpvar_0++) {
	 _ORBIT_tmpvar_2 = strlen((*n)._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((*n)._buffer[_ORBIT_tmpvar_0].id[_ORBIT_tmpvar_1]) * _ORBIT_tmpvar_2);
	    memcpy(_ORBIT_t, ((*n)._buffer[_ORBIT_tmpvar_0].id), sizeof((*n)._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((*n)._buffer[_ORBIT_tmpvar_0].id[_ORBIT_tmpvar_1]) * _ORBIT_tmpvar_2);
	 }
	 _ORBIT_tmpvar_4 = strlen((*n)._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((*n)._buffer[_ORBIT_tmpvar_0].kind[_ORBIT_tmpvar_3]) * _ORBIT_tmpvar_4);
	    memcpy(_ORBIT_t, ((*n)._buffer[_ORBIT_tmpvar_0].kind), sizeof((*n)._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((*n)._buffer[_ORBIT_tmpvar_0].kind[_ORBIT_tmpvar_3]) * _ORBIT_tmpvar_4);
	 }
      }

      giop_send_buffer_write(_ORBIT_send_buffer);
      _ORBIT_completion_status = CORBA_COMPLETED_MAYBE;
      giop_send_buffer_unuse(_ORBIT_send_buffer);
      _ORBIT_send_buffer = NULL;
   }
   {				/* demarshalling */
      register guchar *_ORBIT_curptr;
      _ORBIT_recv_buffer = giop_recv_reply_buffer_use_2(_cnx, _ORBIT_request_id, TRUE);
      if (!_ORBIT_recv_buffer)
	 goto _ORBIT_system_exception;
      _ORBIT_completion_status = CORBA_COMPLETED_YES;
      if (_ORBIT_recv_buffer->message.u.reply.reply_status != GIOP_NO_EXCEPTION)
	 goto _ORBIT_msg_exception;
      _ORBIT_curptr = GIOP_RECV_BUFFER(_ORBIT_recv_buffer)->cur;
      if (giop_msg_conversion_needed(GIOP_MESSAGE_BUFFER(_ORBIT_recv_buffer))) {
	 GIOP_RECV_BUFFER(_ORBIT_recv_buffer)->cur = _ORBIT_curptr;
	 _ORBIT_retval = ORBit_demarshal_object(_ORBIT_recv_buffer, GIOP_MESSAGE_BUFFER(_ORBIT_recv_buffer)->connection->orb_data);
	 _ORBIT_curptr = GIOP_RECV_BUFFER(_ORBIT_recv_buffer)->cur;
      } else {
	 GIOP_RECV_BUFFER(_ORBIT_recv_buffer)->cur = _ORBIT_curptr;
	 _ORBIT_retval = ORBit_demarshal_object(_ORBIT_recv_buffer, GIOP_MESSAGE_BUFFER(_ORBIT_recv_buffer)->connection->orb_data);
	 _ORBIT_curptr = GIOP_RECV_BUFFER(_ORBIT_recv_buffer)->cur;
      }
      giop_recv_buffer_unuse(_ORBIT_recv_buffer);
      return _ORBIT_retval;
_ORBIT_system_exception:
      CORBA_exception_set_system(ev, _ORBIT_system_exception_minor, _ORBIT_completion_status);
      giop_recv_buffer_unuse(_ORBIT_recv_buffer);
      giop_send_buffer_unuse(_ORBIT_send_buffer);
      return _ORBIT_retval;
_ORBIT_msg_exception:
      if (_ORBIT_recv_buffer->message.u.reply.reply_status == GIOP_LOCATION_FORWARD) {
	 if (_obj->forward_locations != NULL)
	    ORBit_delete_profiles(_obj->forward_locations);
	 _obj->forward_locations = ORBit_demarshal_IOR(_ORBIT_recv_buffer);
	 _cnx = ORBit_object_get_forwarded_connection(_obj);
	 giop_recv_buffer_unuse(_ORBIT_recv_buffer);

	 goto _ORBIT_retry_request;
      } else {
	 ORBit_handle_exception(_ORBIT_recv_buffer, ev, _ORBIT_user_exceptions, _obj->orb);
	 giop_recv_buffer_unuse(_ORBIT_recv_buffer);
	 return _ORBIT_retval;
      }
   }
}
void 
CosNaming_NamingContext_destroy(CosNaming_NamingContext _obj, CORBA_Environment * ev)
{
   static const ORBit_exception_demarshal_info _ORBIT_user_exceptions[] = {{(const CORBA_TypeCode) & TC_CosNaming_NamingContext_NotEmpty_struct, (gpointer) _ORBIT_CosNaming_NamingContext_NotEmpty_demarshal}, {CORBA_OBJECT_NIL, NULL}};
   register GIOP_unsigned_long _ORBIT_request_id,
    _ORBIT_system_exception_minor;
   register CORBA_completion_status _ORBIT_completion_status;
   register GIOPSendBuffer *_ORBIT_send_buffer;
   register GIOPRecvBuffer *_ORBIT_recv_buffer;
   register GIOPConnection *_cnx;
   if (_obj->servant && _obj->vepv && CosNaming_NamingContext__classid) {
      ((POA_CosNaming_NamingContext__epv *) _obj->vepv[CosNaming_NamingContext__classid])->destroy(_obj->servant, ev);
      return;
   }
   _cnx = ORBit_object_get_connection(_obj);
_ORBIT_retry_request:
   _ORBIT_send_buffer = NULL;
   _ORBIT_recv_buffer = NULL;
   _ORBIT_completion_status = CORBA_COMPLETED_NO;
   _ORBIT_request_id = GPOINTER_TO_UINT(alloca(0));
   {				/* marshalling */
      static const struct {
	 CORBA_unsigned_long len;
	 char opname[8];
      } _ORBIT_operation_name_data = {
	 8, "destroy"
      };
      static const struct iovec _ORBIT_operation_vec = {(gpointer) & _ORBIT_operation_name_data, 12};
      _ORBIT_send_buffer =
	 giop_send_request_buffer_use(_cnx, NULL, _ORBIT_request_id, CORBA_TRUE,
				      &(_obj->active_profile->object_key_vec), &_ORBIT_operation_vec, &ORBit_default_principal_iovec);

      _ORBIT_system_exception_minor = ex_CORBA_COMM_FAILURE;
      if (!_ORBIT_send_buffer)
	 goto _ORBIT_system_exception;
      giop_send_buffer_write(_ORBIT_send_buffer);
      _ORBIT_completion_status = CORBA_COMPLETED_MAYBE;
      giop_send_buffer_unuse(_ORBIT_send_buffer);
      _ORBIT_send_buffer = NULL;
   }
   {				/* demarshalling */
      register guchar *_ORBIT_curptr;
      _ORBIT_recv_buffer = giop_recv_reply_buffer_use_2(_cnx, _ORBIT_request_id, TRUE);
      if (!_ORBIT_recv_buffer)
	 goto _ORBIT_system_exception;
      _ORBIT_completion_status = CORBA_COMPLETED_YES;
      if (_ORBIT_recv_buffer->message.u.reply.reply_status != GIOP_NO_EXCEPTION)
	 goto _ORBIT_msg_exception;
      _ORBIT_curptr = GIOP_RECV_BUFFER(_ORBIT_recv_buffer)->cur;
      if (giop_msg_conversion_needed(GIOP_MESSAGE_BUFFER(_ORBIT_recv_buffer))) {
      } else {
      }
      giop_recv_buffer_unuse(_ORBIT_recv_buffer);
      return;
_ORBIT_system_exception:
      CORBA_exception_set_system(ev, _ORBIT_system_exception_minor, _ORBIT_completion_status);
      giop_recv_buffer_unuse(_ORBIT_recv_buffer);
      giop_send_buffer_unuse(_ORBIT_send_buffer);
      return;
_ORBIT_msg_exception:
      if (_ORBIT_recv_buffer->message.u.reply.reply_status == GIOP_LOCATION_FORWARD) {
	 if (_obj->forward_locations != NULL)
	    ORBit_delete_profiles(_obj->forward_locations);
	 _obj->forward_locations = ORBit_demarshal_IOR(_ORBIT_recv_buffer);
	 _cnx = ORBit_object_get_forwarded_connection(_obj);
	 giop_recv_buffer_unuse(_ORBIT_recv_buffer);

	 goto _ORBIT_retry_request;
      } else {
	 ORBit_handle_exception(_ORBIT_recv_buffer, ev, _ORBIT_user_exceptions, _obj->orb);
	 giop_recv_buffer_unuse(_ORBIT_recv_buffer);
	 return;
      }
   }
}
void 
CosNaming_NamingContext_list(CosNaming_NamingContext _obj, const CORBA_unsigned_long how_many, CosNaming_BindingList ** bl, CosNaming_BindingIterator * bi, CORBA_Environment * ev)
{
   register GIOP_unsigned_long _ORBIT_request_id,
    _ORBIT_system_exception_minor;
   register CORBA_completion_status _ORBIT_completion_status;
   register GIOPSendBuffer *_ORBIT_send_buffer;
   register GIOPRecvBuffer *_ORBIT_recv_buffer;
   register GIOPConnection *_cnx;
   register CORBA_unsigned_long _ORBIT_tmpvar_6;
   register CORBA_unsigned_long _ORBIT_tmpvar_7;
   register CORBA_unsigned_long _ORBIT_tmpvar_8;
   CORBA_unsigned_long _ORBIT_tmpvar_9;
   register CORBA_unsigned_long _ORBIT_tmpvar_10;
   CORBA_unsigned_long _ORBIT_tmpvar_11;
   if (_obj->servant && _obj->vepv && CosNaming_NamingContext__classid) {
      ((POA_CosNaming_NamingContext__epv *) _obj->vepv[CosNaming_NamingContext__classid])->list(_obj->servant, how_many, bl, bi, ev);
      return;
   }
   _cnx = ORBit_object_get_connection(_obj);
_ORBIT_retry_request:
   _ORBIT_send_buffer = NULL;
   _ORBIT_recv_buffer = NULL;
   _ORBIT_completion_status = CORBA_COMPLETED_NO;
   _ORBIT_request_id = GPOINTER_TO_UINT(alloca(0));
   {				/* marshalling */
      static const struct {
	 CORBA_unsigned_long len;
	 char opname[5];
      } _ORBIT_operation_name_data = {
	 5, "list"
      };
      static const struct iovec _ORBIT_operation_vec = {(gpointer) & _ORBIT_operation_name_data, 9};
      _ORBIT_send_buffer =
	 giop_send_request_buffer_use(_cnx, NULL, _ORBIT_request_id, CORBA_TRUE,
				      &(_obj->active_profile->object_key_vec), &_ORBIT_operation_vec, &ORBit_default_principal_iovec);

      _ORBIT_system_exception_minor = ex_CORBA_COMM_FAILURE;
      if (!_ORBIT_send_buffer)
	 goto _ORBIT_system_exception;
      giop_message_buffer_do_alignment(GIOP_MESSAGE_BUFFER(_ORBIT_send_buffer), 4);
      giop_message_buffer_append_mem(GIOP_MESSAGE_BUFFER(_ORBIT_send_buffer), &(how_many), sizeof(how_many));
      giop_send_buffer_write(_ORBIT_send_buffer);
      _ORBIT_completion_status = CORBA_COMPLETED_MAYBE;
      giop_send_buffer_unuse(_ORBIT_send_buffer);
      _ORBIT_send_buffer = NULL;
   }
   {				/* demarshalling */
      register guchar *_ORBIT_curptr;
      _ORBIT_recv_buffer = giop_recv_reply_buffer_use_2(_cnx, _ORBIT_request_id, TRUE);
      if (!_ORBIT_recv_buffer)
	 goto _ORBIT_system_exception;
      _ORBIT_completion_status = CORBA_COMPLETED_YES;
      if (_ORBIT_recv_buffer->message.u.reply.reply_status != GIOP_NO_EXCEPTION)
	 goto _ORBIT_msg_exception;
      *bl = CosNaming_BindingList__alloc();
      _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 *) & (((**bl))._length))) = GUINT32_SWAP_LE_BE(*((guint32 *) _ORBIT_curptr));
	 _ORBIT_curptr += 4;
	 ((**bl))._buffer = CORBA_sequence_CosNaming_Binding_allocbuf(((**bl))._length);
	 ((**bl))._release = CORBA_TRUE;
	 for (_ORBIT_tmpvar_6 = 0; _ORBIT_tmpvar_6 < ((**bl))._length; _ORBIT_tmpvar_6++) {
	    (*((guint32 *) & (((**bl))._buffer[_ORBIT_tmpvar_6].binding_name._length))) = GUINT32_SWAP_LE_BE(*((guint32 *) _ORBIT_curptr));
	    _ORBIT_curptr += 4;
	    ((**bl))._buffer[_ORBIT_tmpvar_6].binding_name._buffer = CORBA_sequence_CosNaming_NameComponent_allocbuf(((**bl))._buffer[_ORBIT_tmpvar_6].binding_name._length);
	    ((**bl))._buffer[_ORBIT_tmpvar_6].binding_name._release = CORBA_TRUE;
	    for (_ORBIT_tmpvar_7 = 0; _ORBIT_tmpvar_7 < ((**bl))._buffer[_ORBIT_tmpvar_6].binding_name._length; _ORBIT_tmpvar_7++) {
	       _ORBIT_curptr = ALIGN_ADDRESS(_ORBIT_curptr, 4);
	       (*((guint32 *) & (_ORBIT_tmpvar_9))) = GUINT32_SWAP_LE_BE(*((guint32 *) _ORBIT_curptr));
	       _ORBIT_curptr += 4;
	       ((**bl))._buffer[_ORBIT_tmpvar_6].binding_name._buffer[_ORBIT_tmpvar_7].id = CORBA_string_alloc(_ORBIT_tmpvar_9);
	       memcpy(((**bl))._buffer[_ORBIT_tmpvar_6].binding_name._buffer[_ORBIT_tmpvar_7].id, _ORBIT_curptr, sizeof(((**bl))._buffer[_ORBIT_tmpvar_6].binding_name._buffer[_ORBIT_tmpvar_7].id[_ORBIT_tmpvar_8]) * _ORBIT_tmpvar_9);
	       _ORBIT_curptr += sizeof(((**bl))._buffer[_ORBIT_tmpvar_6].binding_name._buffer[_ORBIT_tmpvar_7].id[_ORBIT_tmpvar_8]) * _ORBIT_tmpvar_9;
	       _ORBIT_curptr = ALIGN_ADDRESS(_ORBIT_curptr, 4);
	       (*((guint32 *) & (_ORBIT_tmpvar_11))) = GUINT32_SWAP_LE_BE(*((guint32 *) _ORBIT_curptr));
	       _ORBIT_curptr += 4;
	       ((**bl))._buffer[_ORBIT_tmpvar_6].binding_name._buffer[_ORBIT_tmpvar_7].kind = CORBA_string_alloc(_ORBIT_tmpvar_11);
	       memcpy(((**bl))._buffer[_ORBIT_tmpvar_6].binding_name._buffer[_ORBIT_tmpvar_7].kind, _ORBIT_curptr, sizeof(((**bl))._buffer[_ORBIT_tmpvar_6].binding_name._buffer[_ORBIT_tmpvar_7].kind[_ORBIT_tmpvar_10]) * _ORBIT_tmpvar_11);
	       _ORBIT_curptr += sizeof(((**bl))._buffer[_ORBIT_tmpvar_6].binding_name._buffer[_ORBIT_tmpvar_7].kind[_ORBIT_tmpvar_10]) * _ORBIT_tmpvar_11;
	    }

	    _ORBIT_curptr = ALIGN_ADDRESS(_ORBIT_curptr, 4);
	    (*((guint32 *) & (((**bl))._buffer[_ORBIT_tmpvar_6].binding_type))) = GUINT32_SWAP_LE_BE(*((guint32 *) _ORBIT_curptr));
	    _ORBIT_curptr += 4;
	 }

	 GIOP_RECV_BUFFER(_ORBIT_recv_buffer)->cur = _ORBIT_curptr;
	 (*bi) = ORBit_demarshal_object(_ORBIT_recv_buffer, GIOP_MESSAGE_BUFFER(_ORBIT_recv_buffer)->connection->orb_data);
	 _ORBIT_curptr = GIOP_RECV_BUFFER(_ORBIT_recv_buffer)->cur;
      } else {
	 _ORBIT_curptr = ALIGN_ADDRESS(_ORBIT_curptr, 4);
	 ((**bl))._length = *((CORBA_unsigned_long *) _ORBIT_curptr);
	 _ORBIT_curptr += 4;
	 ((**bl))._buffer = CORBA_sequence_CosNaming_Binding_allocbuf(((**bl))._length);
	 ((**bl))._release = CORBA_TRUE;
	 for (_ORBIT_tmpvar_6 = 0; _ORBIT_tmpvar_6 < ((**bl))._length; _ORBIT_tmpvar_6++) {
	    ((**bl))._buffer[_ORBIT_tmpvar_6].binding_name._length = *((CORBA_unsigned_long *) _ORBIT_curptr);
	    _ORBIT_curptr += 4;
	    ((**bl))._buffer[_ORBIT_tmpvar_6].binding_name._buffer = CORBA_sequence_CosNaming_NameComponent_allocbuf(((**bl))._buffer[_ORBIT_tmpvar_6].binding_name._length);
	    ((**bl))._buffer[_ORBIT_tmpvar_6].binding_name._release = CORBA_TRUE;
	    for (_ORBIT_tmpvar_7 = 0; _ORBIT_tmpvar_7 < ((**bl))._buffer[_ORBIT_tmpvar_6].binding_name._length; _ORBIT_tmpvar_7++) {
	       _ORBIT_curptr = ALIGN_ADDRESS(_ORBIT_curptr, 4);
	       _ORBIT_tmpvar_9 = *((CORBA_unsigned_long *) _ORBIT_curptr);
	       _ORBIT_curptr += 4;
	       ((**bl))._buffer[_ORBIT_tmpvar_6].binding_name._buffer[_ORBIT_tmpvar_7].id = CORBA_string_alloc(_ORBIT_tmpvar_9);
	       memcpy(((**bl))._buffer[_ORBIT_tmpvar_6].binding_name._buffer[_ORBIT_tmpvar_7].id, _ORBIT_curptr, sizeof(((**bl))._buffer[_ORBIT_tmpvar_6].binding_name._buffer[_ORBIT_tmpvar_7].id[_ORBIT_tmpvar_8]) * _ORBIT_tmpvar_9);
	       _ORBIT_curptr += sizeof(((**bl))._buffer[_ORBIT_tmpvar_6].binding_name._buffer[_ORBIT_tmpvar_7].id[_ORBIT_tmpvar_8]) * _ORBIT_tmpvar_9;
	       _ORBIT_curptr = ALIGN_ADDRESS(_ORBIT_curptr, 4);
	       _ORBIT_tmpvar_11 = *((CORBA_unsigned_long *) _ORBIT_curptr);
	       _ORBIT_curptr += 4;
	       ((**bl))._buffer[_ORBIT_tmpvar_6].binding_name._buffer[_ORBIT_tmpvar_7].kind = CORBA_string_alloc(_ORBIT_tmpvar_11);
	       memcpy(((**bl))._buffer[_ORBIT_tmpvar_6].binding_name._buffer[_ORBIT_tmpvar_7].kind, _ORBIT_curptr, sizeof(((**bl))._buffer[_ORBIT_tmpvar_6].binding_name._buffer[_ORBIT_tmpvar_7].kind[_ORBIT_tmpvar_10]) * _ORBIT_tmpvar_11);
	       _ORBIT_curptr += sizeof(((**bl))._buffer[_ORBIT_tmpvar_6].binding_name._buffer[_ORBIT_tmpvar_7].kind[_ORBIT_tmpvar_10]) * _ORBIT_tmpvar_11;
	    }

	    _ORBIT_curptr = ALIGN_ADDRESS(_ORBIT_curptr, 4);
	    ((**bl))._buffer[_ORBIT_tmpvar_6].binding_type = *((CosNaming_BindingType *) _ORBIT_curptr);
	    _ORBIT_curptr += 4;
	 }

	 GIOP_RECV_BUFFER(_ORBIT_recv_buffer)->cur = _ORBIT_curptr;
	 (*bi) = ORBit_demarshal_object(_ORBIT_recv_buffer, GIOP_MESSAGE_BUFFER(_ORBIT_recv_buffer)->connection->orb_data);
	 _ORBIT_curptr = GIOP_RECV_BUFFER(_ORBIT_recv_buffer)->cur;
      }
      giop_recv_buffer_unuse(_ORBIT_recv_buffer);
      return;
_ORBIT_system_exception:
      CORBA_exception_set_system(ev, _ORBIT_system_exception_minor, _ORBIT_completion_status);
      giop_recv_buffer_unuse(_ORBIT_recv_buffer);
      giop_send_buffer_unuse(_ORBIT_send_buffer);
      return;
_ORBIT_msg_exception:
      if (_ORBIT_recv_buffer->message.u.reply.reply_status == GIOP_LOCATION_FORWARD) {
	 if (_obj->forward_locations != NULL)
	    ORBit_delete_profiles(_obj->forward_locations);
	 _obj->forward_locations = ORBit_demarshal_IOR(_ORBIT_recv_buffer);
	 _cnx = ORBit_object_get_forwarded_connection(_obj);
	 giop_recv_buffer_unuse(_ORBIT_recv_buffer);

	 goto _ORBIT_retry_request;
      } else {
	 ORBit_handle_exception(_ORBIT_recv_buffer, ev, NULL, _obj->orb);
	 giop_recv_buffer_unuse(_ORBIT_recv_buffer);
	 return;
      }
   }
}
CORBA_boolean 
CosNaming_BindingIterator_next_one(CosNaming_BindingIterator _obj, CosNaming_Binding ** b, CORBA_Environment * ev)
{
   register GIOP_unsigned_long _ORBIT_request_id,
    _ORBIT_system_exception_minor;
   register CORBA_completion_status _ORBIT_completion_status;
   register GIOPSendBuffer *_ORBIT_send_buffer;
   register GIOPRecvBuffer *_ORBIT_recv_buffer;
   register GIOPConnection *_cnx;
   CORBA_boolean _ORBIT_retval;
   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;
   if (_obj->servant && _obj->vepv && CosNaming_BindingIterator__classid) {
      _ORBIT_retval = ((POA_CosNaming_BindingIterator__epv *) _obj->vepv[CosNaming_BindingIterator__classid])->next_one(_obj->servant, b, ev);
      return _ORBIT_retval;
   }
   if (0)
      return *(&_ORBIT_retval);
   _cnx = ORBit_object_get_connection(_obj);
_ORBIT_retry_request:
   _ORBIT_send_buffer = NULL;
   _ORBIT_recv_buffer = NULL;
   _ORBIT_completion_status = CORBA_COMPLETED_NO;
   _ORBIT_request_id = GPOINTER_TO_UINT(alloca(0));
   {				/* marshalling */
      static const struct {
	 CORBA_unsigned_long len;
	 char opname[9];
      } _ORBIT_operation_name_data = {
	 9, "next_one"
      };
      static const struct iovec _ORBIT_operation_vec = {(gpointer) & _ORBIT_operation_name_data, 13};
      _ORBIT_send_buffer =
	 giop_send_request_buffer_use(_cnx, NULL, _ORBIT_request_id, CORBA_TRUE,
				      &(_obj->active_profile->object_key_vec), &_ORBIT_operation_vec, &ORBit_default_principal_iovec);

      _ORBIT_system_exception_minor = ex_CORBA_COMM_FAILURE;
      if (!_ORBIT_send_buffer)
	 goto _ORBIT_system_exception;
      giop_send_buffer_write(_ORBIT_send_buffer);
      _ORBIT_completion_status = CORBA_COMPLETED_MAYBE;
      giop_send_buffer_unuse(_ORBIT_send_buffer);
      _ORBIT_send_buffer = NULL;
   }
   {				/* demarshalling */
      register guchar *_ORBIT_curptr;
      _ORBIT_recv_buffer = giop_recv_reply_buffer_use_2(_cnx, _ORBIT_request_id, TRUE);
      if (!_ORBIT_recv_buffer)
	 goto _ORBIT_system_exception;
      _ORBIT_completion_status = CORBA_COMPLETED_YES;
      if (_ORBIT_recv_buffer->message.u.reply.reply_status != GIOP_NO_EXCEPTION)
	 goto _ORBIT_msg_exception;
      *b = CosNaming_Binding__alloc();
      _ORBIT_curptr = GIOP_RECV_BUFFER(_ORBIT_recv_buffer)->cur;
      if (giop_msg_conversion_needed(GIOP_MESSAGE_BUFFER(_ORBIT_recv_buffer))) {
	 _ORBIT_retval = *((CORBA_boolean *) _ORBIT_curptr);
	 _ORBIT_curptr += 1;
	 _ORBIT_curptr = ALIGN_ADDRESS(_ORBIT_curptr, 4);
	 (*((guint32 *) & (((**b)).binding_name._length))) = GUINT32_SWAP_LE_BE(*((guint32 *) _ORBIT_curptr));
	 _ORBIT_curptr += 4;
	 ((**b)).binding_name._buffer = CORBA_sequence_CosNaming_NameComponent_allocbuf(((**b)).binding_name._length);
	 ((**b)).binding_name._release = CORBA_TRUE;
	 for (_ORBIT_tmpvar_5 = 0; _ORBIT_tmpvar_5 < ((**b)).binding_name._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;
	    ((**b)).binding_name._buffer[_ORBIT_tmpvar_5].id = CORBA_string_alloc(_ORBIT_tmpvar_7);
	    memcpy(((**b)).binding_name._buffer[_ORBIT_tmpvar_5].id, _ORBIT_curptr, sizeof(((**b)).binding_name._buffer[_ORBIT_tmpvar_5].id[_ORBIT_tmpvar_6]) * _ORBIT_tmpvar_7);
	    _ORBIT_curptr += sizeof(((**b)).binding_name._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;
	    ((**b)).binding_name._buffer[_ORBIT_tmpvar_5].kind = CORBA_string_alloc(_ORBIT_tmpvar_9);
	    memcpy(((**b)).binding_name._buffer[_ORBIT_tmpvar_5].kind, _ORBIT_curptr, sizeof(((**b)).binding_name._buffer[_ORBIT_tmpvar_5].kind[_ORBIT_tmpvar_8]) * _ORBIT_tmpvar_9);
	    _ORBIT_curptr += sizeof(((**b)).binding_name._buffer[_ORBIT_tmpvar_5].kind[_ORBIT_tmpvar_8]) * _ORBIT_tmpvar_9;
	 }

	 _ORBIT_curptr = ALIGN_ADDRESS(_ORBIT_curptr, 4);
	 (*((guint32 *) & (((**b)).binding_type))) = GUINT32_SWAP_LE_BE(*((guint32 *) _ORBIT_curptr));
      } else {
	 _ORBIT_retval = *((CORBA_boolean *) _ORBIT_curptr);
	 _ORBIT_curptr += 1;
	 _ORBIT_curptr = ALIGN_ADDRESS(_ORBIT_curptr, 4);
	 ((**b)).binding_name._length = *((CORBA_unsigned_long *) _ORBIT_curptr);
	 _ORBIT_curptr += 4;
	 ((**b)).binding_name._buffer = CORBA_sequence_CosNaming_NameComponent_allocbuf(((**b)).binding_name._length);
	 ((**b)).binding_name._release = CORBA_TRUE;
	 for (_ORBIT_tmpvar_5 = 0; _ORBIT_tmpvar_5 < ((**b)).binding_name._length; _ORBIT_tmpvar_5++) {
	    _ORBIT_curptr = ALIGN_ADDRESS(_ORBIT_curptr, 4);
	    _ORBIT_tmpvar_7 = *((CORBA_unsigned_long *) _ORBIT_curptr);
	    _ORBIT_curptr += 4;
	    ((**b)).binding_name._buffer[_ORBIT_tmpvar_5].id = CORBA_string_alloc(_ORBIT_tmpvar_7);
	    memcpy(((**b)).binding_name._buffer[_ORBIT_tmpvar_5].id, _ORBIT_curptr, sizeof(((**b)).binding_name._buffer[_ORBIT_tmpvar_5].id[_ORBIT_tmpvar_6]) * _ORBIT_tmpvar_7);
	    _ORBIT_curptr += sizeof(((**b)).binding_name._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;
	    ((**b)).binding_name._buffer[_ORBIT_tmpvar_5].kind = CORBA_string_alloc(_ORBIT_tmpvar_9);
	    memcpy(((**b)).binding_name._buffer[_ORBIT_tmpvar_5].kind, _ORBIT_curptr, sizeof(((**b)).binding_name._buffer[_ORBIT_tmpvar_5].kind[_ORBIT_tmpvar_8]) * _ORBIT_tmpvar_9);
	    _ORBIT_curptr += sizeof(((**b)).binding_name._buffer[_ORBIT_tmpvar_5].kind[_ORBIT_tmpvar_8]) * _ORBIT_tmpvar_9;
	 }

	 _ORBIT_curptr = ALIGN_ADDRESS(_ORBIT_curptr, 4);
	 ((**b)).binding_type = *((CosNaming_BindingType *) _ORBIT_curptr);
      }
      giop_recv_buffer_unuse(_ORBIT_recv_buffer);
      return _ORBIT_retval;
_ORBIT_system_exception:
      CORBA_exception_set_system(ev, _ORBIT_system_exception_minor, _ORBIT_completion_status);
      giop_recv_buffer_unuse(_ORBIT_recv_buffer);
      giop_send_buffer_unuse(_ORBIT_send_buffer);
      return _ORBIT_retval;
_ORBIT_msg_exception:
      if (_ORBIT_recv_buffer->message.u.reply.reply_status == GIOP_LOCATION_FORWARD) {
	 if (_obj->forward_locations != NULL)
	    ORBit_delete_profiles(_obj->forward_locations);
	 _obj->forward_locations = ORBit_demarshal_IOR(_ORBIT_recv_buffer);
	 _cnx = ORBit_object_get_forwarded_connection(_obj);
	 giop_recv_buffer_unuse(_ORBIT_recv_buffer);

	 goto _ORBIT_retry_request;
      } else {
	 ORBit_handle_exception(_ORBIT_recv_buffer, ev, NULL, _obj->orb);
	 giop_recv_buffer_unuse(_ORBIT_recv_buffer);
	 return _ORBIT_retval;
      }
   }
}
CORBA_boolean 
CosNaming_BindingIterator_next_n(CosNaming_BindingIterator _obj, const CORBA_unsigned_long how_many, CosNaming_BindingList ** bl, CORBA_Environment * ev)
{
   register GIOP_unsigned_long _ORBIT_request_id,
    _ORBIT_system_exception_minor;
   register CORBA_completion_status _ORBIT_completion_status;
   register GIOPSendBuffer *_ORBIT_send_buffer;
   register GIOPRecvBuffer *_ORBIT_recv_buffer;
   register GIOPConnection *_cnx;
   CORBA_boolean _ORBIT_retval;
   register CORBA_unsigned_long _ORBIT_tmpvar_6;
   register CORBA_unsigned_long _ORBIT_tmpvar_7;
   register CORBA_unsigned_long _ORBIT_tmpvar_8;
   CORBA_unsigned_long _ORBIT_tmpvar_9;
   register CORBA_unsigned_long _ORBIT_tmpvar_10;
   CORBA_unsigned_long _ORBIT_tmpvar_11;
   if (_obj->servant && _obj->vepv && CosNaming_BindingIterator__classid) {
      _ORBIT_retval = ((POA_CosNaming_BindingIterator__epv *) _obj->vepv[CosNaming_BindingIterator__classid])->next_n(_obj->servant, how_many, bl, ev);
      return _ORBIT_retval;
   }
   if (0)
      return *(&_ORBIT_retval);
   _cnx = ORBit_object_get_connection(_obj);
_ORBIT_retry_request:
   _ORBIT_send_buffer = NULL;
   _ORBIT_recv_buffer = NULL;
   _ORBIT_completion_status = CORBA_COMPLETED_NO;
   _ORBIT_request_id = GPOINTER_TO_UINT(alloca(0));
   {				/* marshalling */
      static const struct {
	 CORBA_unsigned_long len;
	 char opname[7];
      } _ORBIT_operation_name_data = {
	 7, "next_n"
      };
      static const struct iovec _ORBIT_operation_vec = {(gpointer) & _ORBIT_operation_name_data, 11};
      _ORBIT_send_buffer =
	 giop_send_request_buffer_use(_cnx, NULL, _ORBIT_request_id, CORBA_TRUE,
				      &(_obj->active_profile->object_key_vec), &_ORBIT_operation_vec, &ORBit_default_principal_iovec);

      _ORBIT_system_exception_minor = ex_CORBA_COMM_FAILURE;
      if (!_ORBIT_send_buffer)
	 goto _ORBIT_system_exception;
      giop_message_buffer_do_alignment(GIOP_MESSAGE_BUFFER(_ORBIT_send_buffer), 4);
      giop_message_buffer_append_mem(GIOP_MESSAGE_BUFFER(_ORBIT_send_buffer), &(how_many), sizeof(how_many));
      giop_send_buffer_write(_ORBIT_send_buffer);
      _ORBIT_completion_status = CORBA_COMPLETED_MAYBE;
      giop_send_buffer_unuse(_ORBIT_send_buffer);
      _ORBIT_send_buffer = NULL;
   }
   {				/* demarshalling */
      register guchar *_ORBIT_curptr;
      _ORBIT_recv_buffer = giop_recv_reply_buffer_use_2(_cnx, _ORBIT_request_id, TRUE);
      if (!_ORBIT_recv_buffer)
	 goto _ORBIT_system_exception;
      _ORBIT_completion_status = CORBA_COMPLETED_YES;
      if (_ORBIT_recv_buffer->message.u.reply.reply_status != GIOP_NO_EXCEPTION)
	 goto _ORBIT_msg_exception;
      *bl = CosNaming_BindingList__alloc();
      _ORBIT_curptr = GIOP_RECV_BUFFER(_ORBIT_recv_buffer)->cur;
      if (giop_msg_conversion_needed(GIOP_MESSAGE_BUFFER(_ORBIT_recv_buffer))) {
	 _ORBIT_retval = *((CORBA_boolean *) _ORBIT_curptr);
	 _ORBIT_curptr += 1;
	 _ORBIT_curptr = ALIGN_ADDRESS(_ORBIT_curptr, 4);
	 (*((guint32 *) & (((**bl))._length))) = GUINT32_SWAP_LE_BE(*((guint32 *) _ORBIT_curptr));
	 _ORBIT_curptr += 4;
	 ((**bl))._buffer = CORBA_sequence_CosNaming_Binding_allocbuf(((**bl))._length);
	 ((**bl))._release = CORBA_TRUE;
	 for (_ORBIT_tmpvar_6 = 0; _ORBIT_tmpvar_6 < ((**bl))._length; _ORBIT_tmpvar_6++) {
	    (*((guint32 *) & (((**bl))._buffer[_ORBIT_tmpvar_6].binding_name._length))) = GUINT32_SWAP_LE_BE(*((guint32 *) _ORBIT_curptr));
	    _ORBIT_curptr += 4;
	    ((**bl))._buffer[_ORBIT_tmpvar_6].binding_name._buffer = CORBA_sequence_CosNaming_NameComponent_allocbuf(((**bl))._buffer[_ORBIT_tmpvar_6].binding_name._length);
	    ((**bl))._buffer[_ORBIT_tmpvar_6].binding_name._release = CORBA_TRUE;
	    for (_ORBIT_tmpvar_7 = 0; _ORBIT_tmpvar_7 < ((**bl))._buffer[_ORBIT_tmpvar_6].binding_name._length; _ORBIT_tmpvar_7++) {
	       _ORBIT_curptr = ALIGN_ADDRESS(_ORBIT_curptr, 4);
	       (*((guint32 *) & (_ORBIT_tmpvar_9))) = GUINT32_SWAP_LE_BE(*((guint32 *) _ORBIT_curptr));
	       _ORBIT_curptr += 4;
	       ((**bl))._buffer[_ORBIT_tmpvar_6].binding_name._buffer[_ORBIT_tmpvar_7].id = CORBA_string_alloc(_ORBIT_tmpvar_9);
	       memcpy(((**bl))._buffer[_ORBIT_tmpvar_6].binding_name._buffer[_ORBIT_tmpvar_7].id, _ORBIT_curptr, sizeof(((**bl))._buffer[_ORBIT_tmpvar_6].binding_name._buffer[_ORBIT_tmpvar_7].id[_ORBIT_tmpvar_8]) * _ORBIT_tmpvar_9);
	       _ORBIT_curptr += sizeof(((**bl))._buffer[_ORBIT_tmpvar_6].binding_name._buffer[_ORBIT_tmpvar_7].id[_ORBIT_tmpvar_8]) * _ORBIT_tmpvar_9;
	       _ORBIT_curptr = ALIGN_ADDRESS(_ORBIT_curptr, 4);
	       (*((guint32 *) & (_ORBIT_tmpvar_11))) = GUINT32_SWAP_LE_BE(*((guint32 *) _ORBIT_curptr));
	       _ORBIT_curptr += 4;
	       ((**bl))._buffer[_ORBIT_tmpvar_6].binding_name._buffer[_ORBIT_tmpvar_7].kind = CORBA_string_alloc(_ORBIT_tmpvar_11);
	       memcpy(((**bl))._buffer[_ORBIT_tmpvar_6].binding_name._buffer[_ORBIT_tmpvar_7].kind, _ORBIT_curptr, sizeof(((**bl))._buffer[_ORBIT_tmpvar_6].binding_name._buffer[_ORBIT_tmpvar_7].kind[_ORBIT_tmpvar_10]) * _ORBIT_tmpvar_11);
	       _ORBIT_curptr += sizeof(((**bl))._buffer[_ORBIT_tmpvar_6].binding_name._buffer[_ORBIT_tmpvar_7].kind[_ORBIT_tmpvar_10]) * _ORBIT_tmpvar_11;
	    }

	    _ORBIT_curptr = ALIGN_ADDRESS(_ORBIT_curptr, 4);
	    (*((guint32 *) & (((**bl))._buffer[_ORBIT_tmpvar_6].binding_type))) = GUINT32_SWAP_LE_BE(*((guint32 *) _ORBIT_curptr));
	    _ORBIT_curptr += 4;
	 }

      } else {
	 _ORBIT_retval = *((CORBA_boolean *) _ORBIT_curptr);
	 _ORBIT_curptr += 1;
	 _ORBIT_curptr = ALIGN_ADDRESS(_ORBIT_curptr, 4);
	 ((**bl))._length = *((CORBA_unsigned_long *) _ORBIT_curptr);
	 _ORBIT_curptr += 4;
	 ((**bl))._buffer = CORBA_sequence_CosNaming_Binding_allocbuf(((**bl))._length);
	 ((**bl))._release = CORBA_TRUE;
	 for (_ORBIT_tmpvar_6 = 0; _ORBIT_tmpvar_6 < ((**bl))._length; _ORBIT_tmpvar_6++) {
	    ((**bl))._buffer[_ORBIT_tmpvar_6].binding_name._length = *((CORBA_unsigned_long *) _ORBIT_curptr);
	    _ORBIT_curptr += 4;
	    ((**bl))._buffer[_ORBIT_tmpvar_6].binding_name._buffer = CORBA_sequence_CosNaming_NameComponent_allocbuf(((**bl))._buffer[_ORBIT_tmpvar_6].binding_name._length);
	    ((**bl))._buffer[_ORBIT_tmpvar_6].binding_name._release = CORBA_TRUE;
	    for (_ORBIT_tmpvar_7 = 0; _ORBIT_tmpvar_7 < ((**bl))._buffer[_ORBIT_tmpvar_6].binding_name._length; _ORBIT_tmpvar_7++) {
	       _ORBIT_curptr = ALIGN_ADDRESS(_ORBIT_curptr, 4);
	       _ORBIT_tmpvar_9 = *((CORBA_unsigned_long *) _ORBIT_curptr);
	       _ORBIT_curptr += 4;
	       ((**bl))._buffer[_ORBIT_tmpvar_6].binding_name._buffer[_ORBIT_tmpvar_7].id = CORBA_string_alloc(_ORBIT_tmpvar_9);
	       memcpy(((**bl))._buffer[_ORBIT_tmpvar_6].binding_name._buffer[_ORBIT_tmpvar_7].id, _ORBIT_curptr, sizeof(((**bl))._buffer[_ORBIT_tmpvar_6].binding_name._buffer[_ORBIT_tmpvar_7].id[_ORBIT_tmpvar_8]) * _ORBIT_tmpvar_9);
	       _ORBIT_curptr += sizeof(((**bl))._buffer[_ORBIT_tmpvar_6].binding_name._buffer[_ORBIT_tmpvar_7].id[_ORBIT_tmpvar_8]) * _ORBIT_tmpvar_9;
	       _ORBIT_curptr = ALIGN_ADDRESS(_ORBIT_curptr, 4);
	       _ORBIT_tmpvar_11 = *((CORBA_unsigned_long *) _ORBIT_curptr);
	       _ORBIT_curptr += 4;
	       ((**bl))._buffer[_ORBIT_tmpvar_6].binding_name._buffer[_ORBIT_tmpvar_7].kind = CORBA_string_alloc(_ORBIT_tmpvar_11);
	       memcpy(((**bl))._buffer[_ORBIT_tmpvar_6].binding_name._buffer[_ORBIT_tmpvar_7].kind, _ORBIT_curptr, sizeof(((**bl))._buffer[_ORBIT_tmpvar_6].binding_name._buffer[_ORBIT_tmpvar_7].kind[_ORBIT_tmpvar_10]) * _ORBIT_tmpvar_11);
	       _ORBIT_curptr += sizeof(((**bl))._buffer[_ORBIT_tmpvar_6].binding_name._buffer[_ORBIT_tmpvar_7].kind[_ORBIT_tmpvar_10]) * _ORBIT_tmpvar_11;
	    }

	    _ORBIT_curptr = ALIGN_ADDRESS(_ORBIT_curptr, 4);
	    ((**bl))._buffer[_ORBIT_tmpvar_6].binding_type = *((CosNaming_BindingType *) _ORBIT_curptr);
	    _ORBIT_curptr += 4;
	 }

      }
      giop_recv_buffer_unuse(_ORBIT_recv_buffer);
      return _ORBIT_retval;
_ORBIT_system_exception:
      CORBA_exception_set_system(ev, _ORBIT_system_exception_minor, _ORBIT_completion_status);
      giop_recv_buffer_unuse(_ORBIT_recv_buffer);
      giop_send_buffer_unuse(_ORBIT_send_buffer);
      return _ORBIT_retval;
_ORBIT_msg_exception:
      if (_ORBIT_recv_buffer->message.u.reply.reply_status == GIOP_LOCATION_FORWARD) {
	 if (_obj->forward_locations != NULL)
	    ORBit_delete_profiles(_obj->forward_locations);
	 _obj->forward_locations = ORBit_demarshal_IOR(_ORBIT_recv_buffer);
	 _cnx = ORBit_object_get_forwarded_connection(_obj);
	 giop_recv_buffer_unuse(_ORBIT_recv_buffer);

	 goto _ORBIT_retry_request;
      } else {
	 ORBit_handle_exception(_ORBIT_recv_buffer, ev, NULL, _obj->orb);
	 giop_recv_buffer_unuse(_ORBIT_recv_buffer);
	 return _ORBIT_retval;
      }
   }
}
void 
CosNaming_BindingIterator_destroy(CosNaming_BindingIterator _obj, CORBA_Environment * ev)
{
   register GIOP_unsigned_long _ORBIT_request_id,
    _ORBIT_system_exception_minor;
   register CORBA_completion_status _ORBIT_completion_status;
   register GIOPSendBuffer *_ORBIT_send_buffer;
   register GIOPRecvBuffer *_ORBIT_recv_buffer;
   register GIOPConnection *_cnx;
   if (_obj->servant && _obj->vepv && CosNaming_BindingIterator__classid) {
      ((POA_CosNaming_BindingIterator__epv *) _obj->vepv[CosNaming_BindingIterator__classid])->destroy(_obj->servant, ev);
      return;
   }
   _cnx = ORBit_object_get_connection(_obj);
_ORBIT_retry_request:
   _ORBIT_send_buffer = NULL;
   _ORBIT_recv_buffer = NULL;
   _ORBIT_completion_status = CORBA_COMPLETED_NO;
   _ORBIT_request_id = GPOINTER_TO_UINT(alloca(0));
   {				/* marshalling */
      static const struct {
	 CORBA_unsigned_long len;
	 char opname[8];
      } _ORBIT_operation_name_data = {
	 8, "destroy"
      };
      static const struct iovec _ORBIT_operation_vec = {(gpointer) & _ORBIT_operation_name_data, 12};
      _ORBIT_send_buffer =
	 giop_send_request_buffer_use(_cnx, NULL, _ORBIT_request_id, CORBA_TRUE,
				      &(_obj->active_profile->object_key_vec), &_ORBIT_operation_vec, &ORBit_default_principal_iovec);

      _ORBIT_system_exception_minor = ex_CORBA_COMM_FAILURE;
      if (!_ORBIT_send_buffer)
	 goto _ORBIT_system_exception;
      giop_send_buffer_write(_ORBIT_send_buffer);
      _ORBIT_completion_status = CORBA_COMPLETED_MAYBE;
      giop_send_buffer_unuse(_ORBIT_send_buffer);
      _ORBIT_send_buffer = NULL;
   }
   {				/* demarshalling */
      register guchar *_ORBIT_curptr;
      _ORBIT_recv_buffer = giop_recv_reply_buffer_use_2(_cnx, _ORBIT_request_id, TRUE);
      if (!_ORBIT_recv_buffer)
	 goto _ORBIT_system_exception;
      _ORBIT_completion_status = CORBA_COMPLETED_YES;
      if (_ORBIT_recv_buffer->message.u.reply.reply_status != GIOP_NO_EXCEPTION)
	 goto _ORBIT_msg_exception;
      _ORBIT_curptr = GIOP_RECV_BUFFER(_ORBIT_recv_buffer)->cur;
      if (giop_msg_conversion_needed(GIOP_MESSAGE_BUFFER(_ORBIT_recv_buffer))) {
      } else {
      }
      giop_recv_buffer_unuse(_ORBIT_recv_buffer);
      return;
_ORBIT_system_exception:
      CORBA_exception_set_system(ev, _ORBIT_system_exception_minor, _ORBIT_completion_status);
      giop_recv_buffer_unuse(_ORBIT_recv_buffer);
      giop_send_buffer_unuse(_ORBIT_send_buffer);
      return;
_ORBIT_msg_exception:
      if (_ORBIT_recv_buffer->message.u.reply.reply_status == GIOP_LOCATION_FORWARD) {
	 if (_obj->forward_locations != NULL)
	    ORBit_delete_profiles(_obj->forward_locations);
	 _obj->forward_locations = ORBit_demarshal_IOR(_ORBIT_recv_buffer);
	 _cnx = ORBit_object_get_forwarded_connection(_obj);
	 giop_recv_buffer_unuse(_ORBIT_recv_buffer);

	 goto _ORBIT_retry_request;
      } else {
	 ORBit_handle_exception(_ORBIT_recv_buffer, ev, NULL, _obj->orb);
	 giop_recv_buffer_unuse(_ORBIT_recv_buffer);
	 return;
      }
   }
}
