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

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

void
_ORBIT_skel_Galeon_Browser_loadurl(POA_Galeon_Browser * _ORBIT_servant,
				   GIOPRecvBuffer * _ORBIT_recv_buffer,
				   CORBA_Environment * ev,
				   CORBA_boolean(*_impl_loadurl)
				   (PortableServer_Servant _servant,
				    const CORBA_char * url,
				    const Galeon_ViewState viewstate,
				    CORBA_Environment * ev))
{
   CORBA_boolean _ORBIT_retval;
   CORBA_char *url;
   Galeon_ViewState viewstate;

   {				/* demarshalling */
      guchar *_ORBIT_curptr;
      register CORBA_unsigned_long _ORBIT_tmpvar_2;
      CORBA_unsigned_long _ORBIT_tmpvar_3;

      _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_tmpvar_3))) =
	    GUINT32_SWAP_LE_BE(*((guint32 *) _ORBIT_curptr));
	 _ORBIT_curptr += 4;
	 url = (void *) _ORBIT_curptr;
	 _ORBIT_curptr += sizeof(url[_ORBIT_tmpvar_2]) * _ORBIT_tmpvar_3;
	 _ORBIT_curptr = ALIGN_ADDRESS(_ORBIT_curptr, 4);
	 (*((guint32 *) & (viewstate))) =
	    GUINT32_SWAP_LE_BE(*((guint32 *) _ORBIT_curptr));
      } else {
	 _ORBIT_curptr = ALIGN_ADDRESS(_ORBIT_curptr, 4);
	 _ORBIT_tmpvar_3 = *((CORBA_unsigned_long *) _ORBIT_curptr);
	 _ORBIT_curptr += 4;
	 url = (void *) _ORBIT_curptr;
	 _ORBIT_curptr += sizeof(url[_ORBIT_tmpvar_2]) * _ORBIT_tmpvar_3;
	 _ORBIT_curptr = ALIGN_ADDRESS(_ORBIT_curptr, 4);
	 viewstate = *((Galeon_ViewState *) _ORBIT_curptr);
      }
   }
   _ORBIT_retval = _impl_loadurl(_ORBIT_servant, url, viewstate, 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) {
	    {
	       guchar *_ORBIT_t;

	       _ORBIT_t = alloca(sizeof(_ORBIT_retval));
	       memcpy(_ORBIT_t, &(_ORBIT_retval), sizeof(_ORBIT_retval));
	       giop_message_buffer_append_mem(GIOP_MESSAGE_BUFFER
					      (_ORBIT_send_buffer),
					      (_ORBIT_t),
					      sizeof(_ORBIT_retval));
	    }
	 } else
	    ORBit_send_system_exception(_ORBIT_send_buffer, ev);
	 giop_send_buffer_write(_ORBIT_send_buffer);
	 giop_send_buffer_unuse(_ORBIT_send_buffer);
      }
   }
}
void
_ORBIT_skel_Galeon_Browser_configure(POA_Galeon_Browser * _ORBIT_servant,
				     GIOPRecvBuffer * _ORBIT_recv_buffer,
				     CORBA_Environment * ev,
				     CORBA_boolean(*_impl_configure)
				     (PortableServer_Servant _servant,
				      CORBA_Environment * ev))
{
   CORBA_boolean _ORBIT_retval;

   _ORBIT_retval = _impl_configure(_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) {
	    {
	       guchar *_ORBIT_t;

	       _ORBIT_t = alloca(sizeof(_ORBIT_retval));
	       memcpy(_ORBIT_t, &(_ORBIT_retval), sizeof(_ORBIT_retval));
	       giop_message_buffer_append_mem(GIOP_MESSAGE_BUFFER
					      (_ORBIT_send_buffer),
					      (_ORBIT_t),
					      sizeof(_ORBIT_retval));
	    }
	 } else
	    ORBit_send_system_exception(_ORBIT_send_buffer, ev);
	 giop_send_buffer_write(_ORBIT_send_buffer);
	 giop_send_buffer_unuse(_ORBIT_send_buffer);
      }
   }
}
void
_ORBIT_skel_Galeon_Browser_addTempBookmark(POA_Galeon_Browser *
					   _ORBIT_servant,
					   GIOPRecvBuffer *
					   _ORBIT_recv_buffer,
					   CORBA_Environment * ev,
					   CORBA_boolean
					   (*_impl_addTempBookmark)
					   (PortableServer_Servant _servant,
					    const CORBA_char * name,
					    const CORBA_char * url,
					    CORBA_Environment * ev))
{
   CORBA_boolean _ORBIT_retval;
   CORBA_char *name;
   CORBA_char *url;

   {				/* demarshalling */
      guchar *_ORBIT_curptr;
      register CORBA_unsigned_long _ORBIT_tmpvar_4;
      CORBA_unsigned_long _ORBIT_tmpvar_5;
      register CORBA_unsigned_long _ORBIT_tmpvar_6;
      CORBA_unsigned_long _ORBIT_tmpvar_7;

      _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_tmpvar_5))) =
	    GUINT32_SWAP_LE_BE(*((guint32 *) _ORBIT_curptr));
	 _ORBIT_curptr += 4;
	 name = (void *) _ORBIT_curptr;
	 _ORBIT_curptr += sizeof(name[_ORBIT_tmpvar_4]) * _ORBIT_tmpvar_5;
	 _ORBIT_curptr = ALIGN_ADDRESS(_ORBIT_curptr, 4);
	 (*((guint32 *) & (_ORBIT_tmpvar_7))) =
	    GUINT32_SWAP_LE_BE(*((guint32 *) _ORBIT_curptr));
	 _ORBIT_curptr += 4;
	 url = (void *) _ORBIT_curptr;
	 _ORBIT_curptr += sizeof(url[_ORBIT_tmpvar_6]) * _ORBIT_tmpvar_7;
      } else {
	 _ORBIT_curptr = ALIGN_ADDRESS(_ORBIT_curptr, 4);
	 _ORBIT_tmpvar_5 = *((CORBA_unsigned_long *) _ORBIT_curptr);
	 _ORBIT_curptr += 4;
	 name = (void *) _ORBIT_curptr;
	 _ORBIT_curptr += sizeof(name[_ORBIT_tmpvar_4]) * _ORBIT_tmpvar_5;
	 _ORBIT_curptr = ALIGN_ADDRESS(_ORBIT_curptr, 4);
	 _ORBIT_tmpvar_7 = *((CORBA_unsigned_long *) _ORBIT_curptr);
	 _ORBIT_curptr += 4;
	 url = (void *) _ORBIT_curptr;
	 _ORBIT_curptr += sizeof(url[_ORBIT_tmpvar_6]) * _ORBIT_tmpvar_7;
      }
   }
   _ORBIT_retval = _impl_addTempBookmark(_ORBIT_servant, name, url, 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) {
	    {
	       guchar *_ORBIT_t;

	       _ORBIT_t = alloca(sizeof(_ORBIT_retval));
	       memcpy(_ORBIT_t, &(_ORBIT_retval), sizeof(_ORBIT_retval));
	       giop_message_buffer_append_mem(GIOP_MESSAGE_BUFFER
					      (_ORBIT_send_buffer),
					      (_ORBIT_t),
					      sizeof(_ORBIT_retval));
	    }
	 } else
	    ORBit_send_system_exception(_ORBIT_send_buffer, ev);
	 giop_send_buffer_write(_ORBIT_send_buffer);
	 giop_send_buffer_unuse(_ORBIT_send_buffer);
      }
   }
}
void
_ORBIT_skel_Galeon_Browser_quit(POA_Galeon_Browser * _ORBIT_servant,
				GIOPRecvBuffer * _ORBIT_recv_buffer,
				CORBA_Environment * ev,
				CORBA_boolean(*_impl_quit)
				(PortableServer_Servant _servant,
				 const CORBA_boolean disableServer,
				 CORBA_Environment * ev))
{
   CORBA_boolean _ORBIT_retval;
   CORBA_boolean disableServer;

   {				/* demarshalling */
      guchar *_ORBIT_curptr;

      _ORBIT_curptr = GIOP_RECV_BUFFER(_ORBIT_recv_buffer)->cur;
      if (giop_msg_conversion_needed(GIOP_MESSAGE_BUFFER(_ORBIT_recv_buffer))) {
	 disableServer = *((CORBA_boolean *) _ORBIT_curptr);
      } else {
	 disableServer = *((CORBA_boolean *) _ORBIT_curptr);
      }
   }
   _ORBIT_retval = _impl_quit(_ORBIT_servant, disableServer, 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) {
	    {
	       guchar *_ORBIT_t;

	       _ORBIT_t = alloca(sizeof(_ORBIT_retval));
	       memcpy(_ORBIT_t, &(_ORBIT_retval), sizeof(_ORBIT_retval));
	       giop_message_buffer_append_mem(GIOP_MESSAGE_BUFFER
					      (_ORBIT_send_buffer),
					      (_ORBIT_t),
					      sizeof(_ORBIT_retval));
	    }
	 } else
	    ORBit_send_system_exception(_ORBIT_send_buffer, ev);
	 giop_send_buffer_write(_ORBIT_send_buffer);
	 giop_send_buffer_unuse(_ORBIT_send_buffer);
      }
   }
}
static ORBitSkeleton
get_skel_Galeon_Browser(POA_Galeon_Browser * servant,
			GIOPRecvBuffer * _ORBIT_recv_buffer, gpointer * impl)
{
   gchar *opname = _ORBIT_recv_buffer->message.u.request.operation;

   switch (opname[0]) {
     case 'a':
	if (strcmp((opname + 1), "ddTempBookmark"))
	   break;
	*impl = (gpointer) servant->vepv->Galeon_Browser_epv->addTempBookmark;
	return (ORBitSkeleton) _ORBIT_skel_Galeon_Browser_addTempBookmark;
	break;
     case 'c':
	if (strcmp((opname + 1), "onfigure"))
	   break;
	*impl = (gpointer) servant->vepv->Galeon_Browser_epv->configure;
	return (ORBitSkeleton) _ORBIT_skel_Galeon_Browser_configure;
	break;
     case 'l':
	if (strcmp((opname + 1), "oadurl"))
	   break;
	*impl = (gpointer) servant->vepv->Galeon_Browser_epv->loadurl;
	return (ORBitSkeleton) _ORBIT_skel_Galeon_Browser_loadurl;
	break;
     case 'q':
	if (strcmp((opname + 1), "uit"))
	   break;
	*impl = (gpointer) servant->vepv->Galeon_Browser_epv->quit;
	return (ORBitSkeleton) _ORBIT_skel_Galeon_Browser_quit;
	break;
     default:
	break;
   }
   return NULL;
}

static void
init_local_objref_Galeon_Browser(CORBA_Object obj,
				 POA_Galeon_Browser * servant)
{
   obj->vepv[Galeon_Browser__classid] = servant->vepv->Galeon_Browser_epv;
}

void
POA_Galeon_Browser__init(PortableServer_Servant servant,
			 CORBA_Environment * env)
{
   static const PortableServer_ClassInfo class_info =
      { (ORBit_impl_finder) & get_skel_Galeon_Browser,
"IDL:Galeon/Browser:1.0", (ORBit_local_objref_init) & init_local_objref_Galeon_Browser };
   PortableServer_ServantBase__init(((PortableServer_ServantBase *) servant),
				    env);
   ORBIT_OBJECT_KEY(((PortableServer_ServantBase *) servant)->_private)->
      class_info = (PortableServer_ClassInfo *) & class_info;
   if (!Galeon_Browser__classid)
      Galeon_Browser__classid = ORBit_register_class(&class_info);
}

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