Initial import of the ircii-pana-1.1-final source tree.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/tags/ircii-pana-1.1-final@1 13b04d17-f746-0410-82c6-800466cd88b0
This commit is contained in:
81
dll/europa/corba/orbit/ai-client.c
Normal file
81
dll/europa/corba/orbit/ai-client.c
Normal file
@@ -0,0 +1,81 @@
|
||||
#include <stdio.h>
|
||||
#include <orb/orbit.h>
|
||||
|
||||
#include "europa.h"
|
||||
|
||||
EuropaAI_Europa ai_client;
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
CORBA_Environment ev;
|
||||
CORBA_ORB orb;
|
||||
FILE *ifp;
|
||||
char *ior;
|
||||
char filebuffer[1024];
|
||||
|
||||
/*
|
||||
* Standard initalisation of the orb. Notice that
|
||||
* ORB_init 'eats' stuff off the command line
|
||||
*/
|
||||
|
||||
CORBA_exception_init(&ev);
|
||||
orb = CORBA_ORB_init(&argc, argv, "orbit-local-orb", &ev);
|
||||
|
||||
/*
|
||||
* Get the IOR (object reference). It should be written out
|
||||
* by the echo-server into the file echo.ior. So - if you
|
||||
* are running the server in the same place as the client,
|
||||
* this should be fine!
|
||||
*/
|
||||
|
||||
ifp = fopen("ai.ior","r");
|
||||
if( ifp == NULL ) {
|
||||
g_error("No ai.ior file!");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
fgets(filebuffer,1024,ifp);
|
||||
ior = g_strdup(filebuffer);
|
||||
|
||||
fclose(ifp);
|
||||
|
||||
/*
|
||||
* Actually get the object. So easy!
|
||||
*/
|
||||
ai_client = CORBA_ORB_string_to_object(orb, ior, &ev);
|
||||
if(!ai_client) {
|
||||
printf("Cannot bind to %s\n", ior);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Ok. Now we use the echo object...
|
||||
*/
|
||||
printf("Type messages to the server\n. as the only thing on the line stops\n
|
||||
");
|
||||
while( fgets(filebuffer,1024,stdin) ) {
|
||||
if( filebuffer[0] == '.' && filebuffer[1] == '\n' )
|
||||
break;
|
||||
|
||||
/* chop the newline off */
|
||||
filebuffer[strlen(filebuffer)-1] = '\0';
|
||||
|
||||
/* using the echoString method in the Echo object */
|
||||
/* this is defined in the echo.h header, compiled from echo.idl */
|
||||
|
||||
EuropaAI_Europa_inputChat(ai_client, filebuffer, &ev);
|
||||
|
||||
/* catch any exceptions (eg, network is down) */
|
||||
|
||||
if(ev._major != CORBA_NO_EXCEPTION) {
|
||||
printf("we got exception %d from inputChat!\n", ev._major);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Clean up */
|
||||
CORBA_Object_release(ai_client, &ev);
|
||||
CORBA_Object_release((CORBA_Object)orb, &ev);
|
||||
|
||||
return 0;
|
||||
}
|
||||
23
dll/europa/corba/orbit/europa-common.c
Normal file
23
dll/europa/corba/orbit/europa-common.c
Normal file
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
* This file was generated by orbit-idl - DO NOT EDIT!
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include "europa.h"
|
||||
|
||||
#if (TC_IMPL_TC_EuropaAI_Europa == ORBIT_FILE_ID_europa) && !defined(TC_DEF_TC_EuropaAI_Europa)
|
||||
#define TC_DEF_TC_EuropaAI_Europa 1
|
||||
const struct CORBA_TypeCode_struct TC_EuropaAI_Europa_struct = {
|
||||
|
||||
{{(ORBit_RootObject_Interface *) & ORBit_TypeCode_epv, TRUE, -1},
|
||||
ORBIT_PSEUDO_TYPECODE},
|
||||
|
||||
CORBA_tk_objref, "Europa", "IDL:EuropaAI/Europa:1.0",
|
||||
0, 0,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
CORBA_OBJECT_NIL, 0, -1, 0, 0
|
||||
};
|
||||
#endif
|
||||
CORBA_unsigned_long EuropaAI_Europa__classid = 0;
|
||||
104
dll/europa/corba/orbit/europa-skels.c
Normal file
104
dll/europa/corba/orbit/europa-skels.c
Normal file
@@ -0,0 +1,104 @@
|
||||
/*
|
||||
* This file was generated by orbit-idl - DO NOT EDIT!
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include "europa.h"
|
||||
|
||||
void
|
||||
_ORBIT_skel_EuropaAI_Europa_inputChat(POA_EuropaAI_Europa * _ORBIT_servant,
|
||||
GIOPRecvBuffer * _ORBIT_recv_buffer,
|
||||
CORBA_Environment * ev,
|
||||
void (*_impl_inputChat)
|
||||
(PortableServer_Servant _servant,
|
||||
CORBA_char * text,
|
||||
CORBA_Environment * ev))
|
||||
{
|
||||
CORBA_char *text;
|
||||
|
||||
{ /* 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);
|
||||
_ORBIT_tmpvar_3 =
|
||||
(CORBA_unsigned_long)
|
||||
GUINT32_SWAP_LE_BE(*((guint32 *) _ORBIT_curptr));
|
||||
_ORBIT_curptr += 4;
|
||||
text = (void *) _ORBIT_curptr;
|
||||
_ORBIT_curptr += sizeof(text[_ORBIT_tmpvar_2]) * _ORBIT_tmpvar_3;
|
||||
} else {
|
||||
_ORBIT_curptr = ALIGN_ADDRESS(_ORBIT_curptr, 4);
|
||||
_ORBIT_tmpvar_3 = *((CORBA_unsigned_long *) _ORBIT_curptr);
|
||||
_ORBIT_curptr += 4;
|
||||
text = (void *) _ORBIT_curptr;
|
||||
_ORBIT_curptr += sizeof(text[_ORBIT_tmpvar_2]) * _ORBIT_tmpvar_3;
|
||||
}
|
||||
}
|
||||
_impl_inputChat(_ORBIT_servant, text, 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 (ev->_major == CORBA_NO_EXCEPTION) {
|
||||
} else
|
||||
ORBit_send_system_exception(_ORBIT_send_buffer, ev);
|
||||
giop_send_buffer_write(_ORBIT_send_buffer);
|
||||
giop_send_buffer_unuse(_ORBIT_send_buffer);
|
||||
}
|
||||
}
|
||||
static ORBitSkeleton
|
||||
get_skel_EuropaAI_Europa(POA_EuropaAI_Europa * servant,
|
||||
GIOPRecvBuffer * _ORBIT_recv_buffer, gpointer * impl)
|
||||
{
|
||||
gchar *opname = _ORBIT_recv_buffer->message.u.request.operation;
|
||||
|
||||
switch (opname[0]) {
|
||||
case 'i':
|
||||
if (strcmp((opname + 1), "nputChat"))
|
||||
break;
|
||||
*impl = (gpointer) servant->vepv->EuropaAI_Europa_epv->inputChat;
|
||||
return (ORBitSkeleton) _ORBIT_skel_EuropaAI_Europa_inputChat;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
init_local_objref_EuropaAI_Europa(CORBA_Object obj,
|
||||
POA_EuropaAI_Europa * servant)
|
||||
{
|
||||
obj->vepv[EuropaAI_Europa__classid] = servant->vepv->EuropaAI_Europa_epv;
|
||||
}
|
||||
void
|
||||
POA_EuropaAI_Europa__init(PortableServer_Servant servant,
|
||||
CORBA_Environment * env)
|
||||
{
|
||||
static const PortableServer_ClassInfo class_info =
|
||||
{ (ORBit_impl_finder) & get_skel_EuropaAI_Europa,
|
||||
"IDL:EuropaAI/Europa:1.0",
|
||||
(ORBit_local_objref_init) & init_local_objref_EuropaAI_Europa };
|
||||
|
||||
PortableServer_ServantBase__init(((PortableServer_ServantBase *) servant),
|
||||
env);
|
||||
ORBIT_OBJECT_KEY(((PortableServer_ServantBase *) servant)->_private)->
|
||||
class_info = (PortableServer_ClassInfo *) & class_info;
|
||||
if (!EuropaAI_Europa__classid)
|
||||
EuropaAI_Europa__classid = ORBit_register_class(&class_info);
|
||||
}
|
||||
|
||||
void
|
||||
POA_EuropaAI_Europa__fini(PortableServer_Servant servant,
|
||||
CORBA_Environment * env)
|
||||
{
|
||||
PortableServer_ServantBase__fini(servant, env);
|
||||
}
|
||||
114
dll/europa/corba/orbit/europa-stubs.c
Normal file
114
dll/europa/corba/orbit/europa-stubs.c
Normal file
@@ -0,0 +1,114 @@
|
||||
/*
|
||||
* This file was generated by orbit-idl - DO NOT EDIT!
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include "europa.h"
|
||||
|
||||
void
|
||||
EuropaAI_Europa_inputChat(EuropaAI_Europa _obj, CORBA_char * text,
|
||||
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 && EuropaAI_Europa__classid) {
|
||||
|
||||
((POA_EuropaAI_Europa__epv *) _obj->vepv[EuropaAI_Europa__classid])->
|
||||
inputChat(_obj->servant, text, 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[10];
|
||||
}
|
||||
_ORBIT_operation_name_data =
|
||||
{
|
||||
10, "inputChat"};
|
||||
static const struct iovec _ORBIT_operation_vec =
|
||||
{ (gpointer) & _ORBIT_operation_name_data, 14 };
|
||||
register CORBA_unsigned_long _ORBIT_tmpvar_0;
|
||||
CORBA_unsigned_long _ORBIT_tmpvar_1;
|
||||
|
||||
_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;
|
||||
_ORBIT_tmpvar_1 = strlen(text) + 1;
|
||||
giop_message_buffer_do_alignment(GIOP_MESSAGE_BUFFER
|
||||
(_ORBIT_send_buffer), 4);
|
||||
{
|
||||
guchar *_ORBIT_t;
|
||||
|
||||
_ORBIT_t = alloca(sizeof(_ORBIT_tmpvar_1));
|
||||
memcpy(_ORBIT_t, &(_ORBIT_tmpvar_1), sizeof(_ORBIT_tmpvar_1));
|
||||
giop_message_buffer_append_mem(GIOP_MESSAGE_BUFFER
|
||||
(_ORBIT_send_buffer), (_ORBIT_t),
|
||||
sizeof(_ORBIT_tmpvar_1));
|
||||
}
|
||||
giop_message_buffer_append_mem(GIOP_MESSAGE_BUFFER(_ORBIT_send_buffer),
|
||||
(text),
|
||||
sizeof(text[_ORBIT_tmpvar_0]) *
|
||||
_ORBIT_tmpvar_1);
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
68
dll/europa/corba/orbit/europa.h
Normal file
68
dll/europa/corba/orbit/europa.h
Normal file
@@ -0,0 +1,68 @@
|
||||
/*
|
||||
* This file was generated by orbit-idl - DO NOT EDIT!
|
||||
*/
|
||||
|
||||
#include <glib.h>
|
||||
#define ORBIT_IDL_SERIAL 9
|
||||
#include <orb/orbit.h>
|
||||
|
||||
#ifndef europa_H
|
||||
#define europa_H 1
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/** typedefs **/
|
||||
#if !defined(ORBIT_DECL_EuropaAI_Europa) && !defined(_EuropaAI_Europa_defined)
|
||||
#define ORBIT_DECL_EuropaAI_Europa 1
|
||||
#define _EuropaAI_Europa_defined 1
|
||||
#define EuropaAI_Europa__free CORBA_Object__free
|
||||
typedef CORBA_Object EuropaAI_Europa;
|
||||
extern CORBA_unsigned_long EuropaAI_Europa__classid;
|
||||
#endif
|
||||
|
||||
/** POA structures **/
|
||||
typedef struct
|
||||
{
|
||||
void *_private;
|
||||
void (*inputChat) (PortableServer_Servant _servant, CORBA_char * text,
|
||||
CORBA_Environment * ev);
|
||||
}
|
||||
POA_EuropaAI_Europa__epv;
|
||||
typedef struct
|
||||
{
|
||||
PortableServer_ServantBase__epv *_base_epv;
|
||||
POA_EuropaAI_Europa__epv *EuropaAI_Europa_epv;
|
||||
}
|
||||
POA_EuropaAI_Europa__vepv;
|
||||
typedef struct
|
||||
{
|
||||
void *_private;
|
||||
POA_EuropaAI_Europa__vepv *vepv;
|
||||
}
|
||||
POA_EuropaAI_Europa;
|
||||
extern void POA_EuropaAI_Europa__init(PortableServer_Servant servant,
|
||||
CORBA_Environment * ev);
|
||||
extern void POA_EuropaAI_Europa__fini(PortableServer_Servant servant,
|
||||
CORBA_Environment * ev);
|
||||
|
||||
/** prototypes **/
|
||||
void EuropaAI_Europa_inputChat(EuropaAI_Europa _obj, CORBA_char * text,
|
||||
CORBA_Environment * ev);
|
||||
|
||||
void _ORBIT_skel_EuropaAI_Europa_inputChat(POA_EuropaAI_Europa *
|
||||
_ORBIT_servant,
|
||||
GIOPRecvBuffer *
|
||||
_ORBIT_recv_buffer,
|
||||
CORBA_Environment * ev,
|
||||
void (*_impl_inputChat)
|
||||
(PortableServer_Servant
|
||||
_servant, CORBA_char * text,
|
||||
CORBA_Environment * ev));
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif
|
||||
#undef ORBIT_IDL_SERIAL
|
||||
Reference in New Issue
Block a user