You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@etch.apache.org by jd...@apache.org on 2009/04/22 19:25:51 UTC
svn commit: r767594 [4/43] - in /incubator/etch/trunk/binding-c/runtime/c:
./ ext/ ext/hashtab/ ext/lib/ inc/ lib/ project/ project/$etchstop/
project/bin/ project/etch/ project/logcli/ project/logsrv/ project/notes/
project/test/ project/test/logcli/ ...
Added: incubator/etch/trunk/binding-c/runtime/c/inc/etch_sessiondata.h
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-c/runtime/c/inc/etch_sessiondata.h?rev=767594&view=auto
==============================================================================
--- incubator/etch/trunk/binding-c/runtime/c/inc/etch_sessiondata.h (added)
+++ incubator/etch/trunk/binding-c/runtime/c/inc/etch_sessiondata.h Wed Apr 22 17:25:43 2009
@@ -0,0 +1,90 @@
+/* $Id$
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to you under the Apache License, Version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * etch_sessiondata.h
+ * i_sessiondata interface
+ * interface used to deliver packets to the session from the transport
+ */
+#ifndef ETCHISESSIONDATA_H
+#define ETCHISESSIONDATA_H
+
+#if(0)
+
+ SESSIONDATA
+ | int sessionData(Who from, buffer)
+ - SESSION
+ sessionQuery(); sessionControl(); sessionNotify();
+
+#endif
+
+
+#include "etch_sessionint.h"
+
+typedef int (*etch_session_data) (void* thisx, void* whofrom, void* buffer);
+
+
+/**
+ * i_sessiondata
+ * sessiondata interface
+ * a message handler delivers messages from a message source
+ */
+typedef struct i_sessiondata
+{
+ unsigned int hashkey;
+ unsigned short obj_type;
+ unsigned short class_id;
+ struct objmask* vtab;
+ int (*destroy)(void*);
+ void*(*clone) (void*);
+ obj_gethashkey get_hashkey;
+ struct objmask* parent;
+ etchresult* result;
+ unsigned int refcount;
+ unsigned int length;
+ unsigned char is_null;
+ unsigned char is_copy;
+ unsigned char is_static;
+ unsigned char reserved;
+
+ void* thisx; /* object which is the interface implementor */
+
+ /* session interface */
+ i_session* isession;
+ etch_session_control session_control;
+ etch_session_notify session_notify;
+ etch_session_query session_query;
+
+ /**
+ * session_data()
+ * delivers packets to the session from the transport
+ * @param from whofrom who sent the message.
+ * caller relinquishes this object on success, retains on failure.
+ * @param buf the packet buffer from the packet source.
+ * caller relinquishes this object on success, retains on failure.
+ * @return 0 success, -1 error
+ */
+ etch_session_data session_data;
+
+} i_sessiondata;
+
+
+i_sessiondata* new_sessiondata_interface(void* thisx, etch_session_data, i_session*);
+
+
+#endif /* ETCHISESSIONDATA_H */
\ No newline at end of file
Added: incubator/etch/trunk/binding-c/runtime/c/inc/etch_sessionint.h
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-c/runtime/c/inc/etch_sessionint.h?rev=767594&view=auto
==============================================================================
--- incubator/etch/trunk/binding-c/runtime/c/inc/etch_sessionint.h (added)
+++ incubator/etch/trunk/binding-c/runtime/c/inc/etch_sessionint.h Wed Apr 22 17:25:43 2009
@@ -0,0 +1,149 @@
+/* $Id$
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to you under the Apache License, Version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * etch_sessionint.h
+ * session interface
+ */
+#ifndef ETCHISESSION_H
+#define ETCHISESSION_H
+
+#include "etchobj.h"
+
+char* ETCHDSIF;
+#define ETCHEVT_SESSION_UP 0x80
+#define ETCHEVT_SESSION_DOWN 0x81
+
+/*
+ * the memory ownership contracts for control, notify, and query, are:
+ * caller relinquishes all arguments except of course the this pointer,
+ * regardless of outcome. it follows that only simple and temporal
+ * objects are passed as parameters.
+ */
+typedef int (*etch_session_control)(void* thisx, void* evt, void* obj);
+typedef int (*etch_session_notify) (void* thisx, void* evt);
+typedef void* (*etch_session_query) (void* thisx, void* query);
+
+
+/**
+ * i_session
+ * session interface
+ * not an etch object, ergo no ->desroy(), no ->clone()
+ */
+typedef struct i_session
+{
+ etch_session_control session_control;
+ etch_session_notify session_notify;
+ etch_session_query session_query;
+
+ void* thisx;
+
+} i_session;
+
+
+/**
+ * i_session_mask
+ * mask over any implemented session interface
+ */
+typedef struct i_session_mask
+{
+ unsigned int hashkey;
+ unsigned short obj_type;
+ unsigned short class_id;
+ struct objmask* vtab;
+ int (*destroy)(void*);
+ void*(*clone) (void*);
+ obj_gethashkey get_hashkey;
+ struct objmask* parent;
+ etchresult* result;
+ unsigned int refcount;
+ unsigned int length;
+ unsigned char is_null;
+ unsigned char is_copy;
+ unsigned char is_static;
+ unsigned char reserved;
+
+ void* thisx; /* object which is the interface implementor */
+
+ /* session interface */
+ i_session* isession;
+ etch_session_control session_control;
+ etch_session_notify session_notify;
+ etch_session_query session_query;
+
+ void* main_session_method;
+
+} i_session_mask;
+
+
+i_session* new_default_session_interface(void* thisx);
+
+i_session* new_session_interface(void* thisx,
+ etch_session_control sc, etch_session_notify sn, etch_session_query sq);
+
+i_session* clone_session(void* thisx, const i_session*);
+
+
+/**
+ * i_objsession
+ * obj_session interface
+ * same interface, names changed to avoid collisions.
+ * not determined whether this is necessary in the c binding.
+ * not an etch object, ergo no ->destroy(), no ->clone()
+ */
+typedef struct i_objsession
+{
+ etch_session_control _session_control;
+ etch_session_notify _session_notify;
+ etch_session_query _session_query;
+
+ void* thisx;
+
+} i_objsession;
+
+
+/**
+ * etch_objsession_objinfo
+ * session methods parameter info struct
+ */
+typedef struct etch_objsession_objinfo
+{
+ objmask* obj;
+ objmask* resobj;
+ objmask* msg;
+ etch_who* whofrom;
+ char* msg_aname;
+ void* exception;
+ unsigned short obj_type;
+ unsigned short class_id;
+ unsigned char is_message;
+ unsigned char is_exception;
+
+} etch_objsession_objinfo;
+
+
+
+i_objsession* new_default_objsession_interface(void* thisx);
+
+i_objsession* new_objsession_interface(void* thisx,
+ etch_session_control sc, etch_session_notify sn, etch_session_query sq);
+
+void etchsession_get_objinfo(etch_objsession_objinfo* objinfo, void* evt);
+
+
+#endif /* ETCHISESSION_H */
Added: incubator/etch/trunk/binding-c/runtime/c/inc/etch_sessionlisten.h
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-c/runtime/c/inc/etch_sessionlisten.h?rev=767594&view=auto
==============================================================================
--- incubator/etch/trunk/binding-c/runtime/c/inc/etch_sessionlisten.h (added)
+++ incubator/etch/trunk/binding-c/runtime/c/inc/etch_sessionlisten.h Wed Apr 22 17:25:43 2009
@@ -0,0 +1,154 @@
+/* $Id$
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to you under the Apache License, Version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * etch_sessionmsg.h
+ * i_sessionmessage interface
+ * interface used to deliver messages to the session from the transport
+ */
+#ifndef ETCHISESSIONLISTEN_H
+#define ETCHISESSIONLISTEN_H
+
+#if(0)
+
+ SESSIONLISTENER
+ | int sessionAccepted(socket)
+ - SESSION
+ sessionQuery(); sessionControl(); sessionNotify();
+
+#endif
+
+#include "etch_sessionint.h"
+#include "etch_transportint.h"
+#include "etch_resources.h"
+
+/* session accepted interface */ // 11/16
+typedef int (*etch_session_accepted) (void* thisx, void* acceptedconx);
+
+/* server factory constructor signature */
+typedef struct i_delivery_service i_delivery_service;
+
+/* this is the signature that must be called from accept */
+/* this function is defined in servermain */
+typedef void* (*funcptr_new_impl_server) (void* thisx, void* remote_client);
+
+typedef int (*etchlistener_waitexit) (i_sessionlistener);
+
+
+
+/**
+ * i_server_factory
+ * server factory interface
+ */
+typedef struct i_server_factory
+{
+ unsigned int hashkey;
+ unsigned short obj_type;
+ unsigned short class_id;
+ struct objmask* vtab;
+ int (*destroy)(void*);
+ void*(*clone) (void*);
+ obj_gethashkey get_hashkey;
+ struct objmask* parent;
+ etchresult* result;
+ unsigned int refcount;
+ unsigned int length;
+ unsigned char is_null;
+ unsigned char is_copy;
+ unsigned char is_static;
+ unsigned char reserved;
+
+ void* thisx; /* object which is the interface implementor */
+ funcptr_new_impl_server new_server; /* server constructor */
+
+ objmask* session; /* not owned */
+ i_session* isession; /* not owned */
+ etch_session_control session_control;
+ etch_session_notify session_notify;
+ etch_session_query session_query;
+
+} i_server_factory;
+
+
+/**
+ * i_sessionlistener
+ * sessionlistener interface
+ */
+typedef struct i_sessionlistener
+{
+ unsigned int hashkey;
+ unsigned short obj_type;
+ unsigned short class_id;
+ struct objmask* vtab;
+ int (*destroy)(void*);
+ void*(*clone) (void*);
+ obj_gethashkey get_hashkey;
+ struct objmask* parent;
+ etchresult* result;
+ unsigned int refcount;
+ unsigned int length;
+ unsigned char is_null;
+ unsigned char is_copy;
+ unsigned char is_static;
+ unsigned char reserved;
+
+ void* thisx; /* object which is the interface implementor */
+
+ /* session interface */
+ void* session; /* not owned */
+ i_session* isession; /* may be owned or not */
+ etch_session_control session_control;
+ etch_session_notify session_notify;
+ etch_session_query session_query;
+
+ /**
+ * session_accepted()
+ * delivers a socket to the session from the listener
+ * @param socket caller retains
+ * @return 0 success, -1 failure
+ */
+ etch_session_accepted session_accepted;
+
+ /* transport interface */
+ void* transport; /* not owned */
+ i_transport* itransport; /* may be owned or not */
+ /* these virtuals are proxied up to this level since [main]
+ * does not see the specific transport header e.g. tcpserver */
+ etch_transport_control transport_control;
+ etch_transport_notify transport_notify;
+ etch_transport_query transport_query;
+ etch_transport_set_session set_session;
+ etch_transport_get_session get_session;
+
+ void* url; /* owned */
+ void* server_params; /* owned */
+ etch_resources* resources; /* owned */
+ etchlistener_waitexit wait_exit; /* listener thread exit wait */
+
+ unsigned char is_session_owned;
+ unsigned char is_transport_owned;
+ unsigned char is_resources_owned;
+ unsigned char unused;
+
+} i_sessionlistener;
+
+
+i_sessionlistener* new_sessionlistener_interface (void* thisx, etch_session_accepted, i_session*);
+
+
+#endif /* ETCHISESSIONLISTEN_H */
\ No newline at end of file
Added: incubator/etch/trunk/binding-c/runtime/c/inc/etch_sessionmsg.h
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-c/runtime/c/inc/etch_sessionmsg.h?rev=767594&view=auto
==============================================================================
--- incubator/etch/trunk/binding-c/runtime/c/inc/etch_sessionmsg.h (added)
+++ incubator/etch/trunk/binding-c/runtime/c/inc/etch_sessionmsg.h Wed Apr 22 17:25:43 2009
@@ -0,0 +1,91 @@
+/* $Id$
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to you under the Apache License, Version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * etch_sessionmsg.h
+ * i_sessionmessage interface
+ * interface used to deliver messages to the session from the transport
+ */
+#ifndef ETCHISESSIONMSG_H
+#define ETCHISESSIONMSG_H
+
+#if(0)
+
+ SESSIONMESSAGE
+ | int sessionMessage(Who from, message)
+ - SESSION
+ sessionQuery(); sessionControl(); sessionNotify();
+
+#endif
+
+
+#include "etch_sessionint.h"
+
+typedef int (*etch_session_message) (void* thisx, void* whofrom, void* message);
+
+
+/**
+ * i_sessionmessage
+ * sessionmessage interface
+ * a message handler delivers messages from a message source
+ */
+typedef struct i_sessionmessage
+{
+ unsigned int hashkey;
+ unsigned short obj_type;
+ unsigned short class_id;
+ struct objmask* vtab;
+ int (*destroy)(void*);
+ void*(*clone) (void*);
+ obj_gethashkey get_hashkey;
+ struct objmask* parent;
+ etchresult* result;
+ unsigned int refcount;
+ unsigned int length;
+ unsigned char is_null;
+ unsigned char is_copy;
+ unsigned char is_static;
+ unsigned char reserved;
+
+ void* thisx; /* object which is the interface implementor */
+
+ /* session interface */
+ i_session* isession;
+ etch_session_control session_control;
+ etch_session_notify session_notify;
+ etch_session_query session_query;
+
+ /**
+ * session_message()
+ * delivers data to the session from the transport
+ * @param from whofrom who sent the message.
+ * caller relinquishes this object on success, retains on failure.
+ * @param message the message from the message source.
+ * caller relinquishes this object on success, retains on failure.
+ * @return 0 success, -1 error
+ */
+ etch_session_message session_message;
+
+} i_sessionmessage;
+
+
+i_sessionmessage* new_sessionmsg_interface(void* thisx, etch_session_message, i_session*);
+int destroy_sessionmessage(i_sessionmessage*);
+
+
+#endif /* ETCHISESSIONMSG_H */
\ No newline at end of file
Added: incubator/etch/trunk/binding-c/runtime/c/inc/etch_sessionpkt.h
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-c/runtime/c/inc/etch_sessionpkt.h?rev=767594&view=auto
==============================================================================
--- incubator/etch/trunk/binding-c/runtime/c/inc/etch_sessionpkt.h (added)
+++ incubator/etch/trunk/binding-c/runtime/c/inc/etch_sessionpkt.h Wed Apr 22 17:25:43 2009
@@ -0,0 +1,88 @@
+/* $Id$
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to you under the Apache License, Version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * etch_sessionpkt.h
+ * i_sessionpacket interface
+ * interface used to deliver packets to the session from the transport
+ */
+#ifndef ETCHISESSIONPACKET_H
+#define ETCHISESSIONPACKET_H
+
+#if(0)
+
+ SESSIONPACKET
+ | int sessionPacket(Who from, packet)
+ - SESSION
+ sessionQuery(); sessionControl(); sessionNotify();
+
+#endif
+
+
+#include "etch_sessionint.h"
+
+typedef int (*etch_session_packet) (void* thisx, void* whofrom, void* buffer);
+
+
+/**
+ * i_sessionpacket
+ * sessionpacket interface
+ */
+typedef struct i_sessionpacket
+{
+ unsigned int hashkey;
+ unsigned short obj_type;
+ unsigned short class_id;
+ struct objmask* vtab;
+ int (*destroy)(void*);
+ void*(*clone) (void*);
+ obj_gethashkey get_hashkey;
+ struct objmask* parent;
+ etchresult* result;
+ unsigned int refcount;
+ unsigned int length;
+ unsigned char is_null;
+ unsigned char is_copy;
+ unsigned char is_static;
+ unsigned char reserved;
+
+ void* thisx; /* object which is the interface implementor */
+
+ /* session interface */
+ i_session* isession;
+ etch_session_control session_control;
+ etch_session_notify session_notify;
+ etch_session_query session_query;
+
+ /**
+ * session_packet()
+ * delivers data to the session from the transport.
+ * @param from whofrom who sent the packet
+ * @param packet the packet from the packet source
+ * @return 0 OK, -1 buffer contents invalid.
+ */
+ etch_session_packet session_packet;
+
+
+} i_sessionpacket;
+
+
+i_sessionpacket* new_sessionpkt_interface(void* thisx, etch_session_packet, i_session*);
+
+
+#endif /* ETCHISESSIONPACKET_H */
\ No newline at end of file
Added: incubator/etch/trunk/binding-c/runtime/c/inc/etch_simpletimer.h
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-c/runtime/c/inc/etch_simpletimer.h?rev=767594&view=auto
==============================================================================
--- incubator/etch/trunk/binding-c/runtime/c/inc/etch_simpletimer.h (added)
+++ incubator/etch/trunk/binding-c/runtime/c/inc/etch_simpletimer.h Wed Apr 22 17:25:43 2009
@@ -0,0 +1,77 @@
+/* $Id$
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to you under the Apache License, Version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * etch_simpletimer.h
+ * thread-per-use one-shot relative timer
+ * this should be replaced with a timer pool implementation when development resources permit
+ */
+
+#ifndef ETCH_SIMPLETIMER_H
+#define ETCH_SIMPLETIMER_H
+
+#include "apr_thread_proc.h" /* must be included first */
+#include "etchthread.h" /* must be included second */
+
+#define ETCH_TIMER_REASON_TIMEOUT ETCH_TIMEOUT
+#define ETCH_TIMER_REASON_INTERRUPTED ETCH_INTERRUPTED
+#define ETCH_TIMER_REASON_ERROR (-1)
+
+
+typedef etch_thread etch_timer;
+
+
+/**
+ * etch_timer_callback
+ * signature of timer expiration callback.
+ * @param passthrudata user object passed to timer constructor.
+ * @param reason expiration reason 1 timeout, 0 signaled, -1 error.
+ */
+typedef void (*etch_timer_callback) (void* passthrudata, const int reason);
+
+
+/**
+ * new_timer()
+ * etch_timer constructor
+ * @param durationms timer duration in milliseconds.
+ * @param passthrudata user data to be returned in expiration callback.
+ * caller retains ownership of this memory.
+ * @param callback expiration callback void (*callback) (void*, int);
+ * in which creator's passthrudata is passed as the first parameter, and the timeout
+ * reason passed in parameter 2 (reason value 0 is signaled, 1 is timeout, -1 error).
+ * @return the timer object. caller owns this object but must not destroy it until
+ * after the expiration callback has completed and returned.
+ */
+etch_timer* new_timer(const int durationms, void* passthrudata, etch_timer_callback);
+
+
+/**
+ * etch_timer_start()
+ * start the specified timer. a timer must always be explicitly started.
+ */
+int etch_timer_start(etch_timer*);
+
+
+/**
+ * etch_timer_stop()
+ * signal specified timer to stop waiting and exit its thread.
+ */
+int etch_timer_stop (etch_timer*);
+
+
+#endif /* #ifndef ETCH_SIMPLETIMER_H */
\ No newline at end of file
Added: incubator/etch/trunk/binding-c/runtime/c/inc/etch_sourceint.h
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-c/runtime/c/inc/etch_sourceint.h?rev=767594&view=auto
==============================================================================
--- incubator/etch/trunk/binding-c/runtime/c/inc/etch_sourceint.h (added)
+++ incubator/etch/trunk/binding-c/runtime/c/inc/etch_sourceint.h Wed Apr 22 17:25:43 2009
@@ -0,0 +1,82 @@
+/* $Id$
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to you under the Apache License, Version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * etch_sourceint.h
+ * source interface
+ */
+#ifndef ETCHISOURCE_H
+#define ETCHISOURCE_H
+
+#include "etch_transportint.h"
+
+typedef void* (*etch_source_get_handler) (void* thisx);
+typedef void (*etch_source_set_handler) (void* thisx, void* handler);
+
+
+/**
+ * i_source
+ * source interface
+ * common interface to sources of data, packets, or messages.
+ * models the various handlers' view of a communication channel
+ */
+typedef struct i_source
+{
+ unsigned int hashkey;
+ unsigned short obj_type;
+ unsigned short class_id;
+ struct objmask* vtab;
+ int (*destroy)(void*);
+ void*(*clone) (void*);
+ obj_gethashkey get_hashkey;
+ struct objmask* parent;
+ etchresult* result;
+ unsigned int refcount;
+ unsigned int length;
+ unsigned char is_null;
+ unsigned char is_copy;
+ unsigned char is_static;
+ unsigned char reserved;
+
+ void* thisx; /* object which is the i_source */
+
+ /**
+ * get_handler(this) returns an object implementing i_sourcehandler
+ */
+ etch_source_get_handler get_handler;
+
+ /**
+ * set_handler(this, handler) expects an object implementing i_sourcehandler
+ */
+ etch_source_set_handler set_handler;
+
+ /**
+ * transport interface (query, control, notify), not an etch object
+ */
+ i_transport* itransport;
+
+} i_source;
+
+
+i_source* new_default_source_interface();
+
+i_source* new_source_interface(void* thisx,
+ etch_source_get_handler gh, etch_source_set_handler sh, i_transport* xp);
+
+
+#endif /* ETCHISOURCE_H */
Added: incubator/etch/trunk/binding-c/runtime/c/inc/etch_structval.h
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-c/runtime/c/inc/etch_structval.h?rev=767594&view=auto
==============================================================================
--- incubator/etch/trunk/binding-c/runtime/c/inc/etch_structval.h (added)
+++ incubator/etch/trunk/binding-c/runtime/c/inc/etch_structval.h Wed Apr 22 17:25:43 2009
@@ -0,0 +1,72 @@
+/* $Id$
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to you under the Apache License, Version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * etch_structval.h -- defines the etch_structvalue object.
+ * etch_structvalue is a typed map of key/value pairs, where type is an etch_type,
+ * a key is an etch_field, and value is an etch object. all values are the same
+ * class, corresponding to the struct type.
+ */
+
+#ifndef ETCHSTRUCTVAL_H
+#define ETCHSTRUCTVAL_H
+
+#include "etchmsgutl.h"
+#include "etch_tagdata_inp.h"
+#include "etch_tagdata_out.h"
+#include "etchhash.h"
+
+
+/**
+ * etch_structvalue
+ */
+typedef struct etch_structvalue
+{
+ unsigned int hashkey;
+ unsigned short obj_type;
+ unsigned short class_id;
+ struct objmask* vtab;
+ int (*destroy)(void*);
+ void*(*clone) (void*);
+ obj_gethashkey get_hashkey;
+ struct objmask* parent;
+ etchresult* result;
+ unsigned int refcount;
+ unsigned int length;
+ unsigned char is_null;
+ unsigned char is_copy;
+ unsigned char is_static;
+ unsigned char reserved;
+
+ etch_hashtable* items; /* owned */
+ etch_type* struct_type; /* not owned */
+
+} etch_structvalue;
+
+
+etch_structvalue* new_structvalue(etch_type*, const int initialsize);
+int destroy_structvalue (etch_structvalue*);
+int structvalue_put (etch_structvalue*, etch_field* key, objmask* value);
+int structvalue_is_type (etch_structvalue*, etch_type*);
+objmask* structvalue_get(etch_structvalue*, etch_field* key);
+objmask* structvalue_remove(etch_structvalue*, etch_field* key);
+etch_hashtable* new_structvalue_hashtable();
+int structvalue_count(etch_structvalue*);
+
+
+#endif /* #ifndef ETCHSTRUCTVAL_H */
\ No newline at end of file
Added: incubator/etch/trunk/binding-c/runtime/c/inc/etch_stub.h
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-c/runtime/c/inc/etch_stub.h?rev=767594&view=auto
==============================================================================
--- incubator/etch/trunk/binding-c/runtime/c/inc/etch_stub.h (added)
+++ incubator/etch/trunk/binding-c/runtime/c/inc/etch_stub.h Wed Apr 22 17:25:43 2009
@@ -0,0 +1,141 @@
+/* $Id$
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to you under the Apache License, Version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * etch_stub.h
+ * a translation of the java binding StubBase
+ */
+
+#ifndef ETCH_STUB_H
+#define ETCH_STUB_H
+
+#include "etchobj.h"
+#include "etchthread.h"
+#include "etch_transport.h"
+#include "etch_sessionmsg.h"
+#include "etch_message.h"
+#include "etch_defvalufact.h"
+
+#define ETCH_STUBTYPE_NONE 0
+#define ETCH_STUBTYPE_CLIENT 1
+#define ETCH_STUBTYPE_SERVER 2
+
+char* ETCHSTUB;
+
+
+/*
+ * etch_stub
+ * stub base quasi interface
+ */
+typedef struct etch_stub
+{
+ unsigned int hashkey;
+ unsigned short obj_type;
+ unsigned short class_id;
+ struct objmask* vtab;
+ int (*destroy)(void*);
+ void*(*clone) (void*);
+ obj_gethashkey get_hashkey;
+ struct objmask* parent;
+ etchresult* result;
+ unsigned int refcount;
+ unsigned int length;
+ unsigned char is_null;
+ unsigned char is_copy;
+ unsigned char is_static;
+ unsigned char reserved;
+
+ objmask* obj; /* concrete client or server object, not owned */
+ objmask* stubobj; /* stub xxxx_either_stub* container, not owned */
+ i_objsession* impl_callbacks; /* impl's session callbacks, not owned */
+ i_delivery_service* delivery_service; /* not owned */
+
+ /* - - - - - - - - - -
+ * i_sessionmessage
+ * - - - - - - - - - -
+ */
+ i_session* isession; /* owned by isessionmsg */
+ i_sessionmessage* isessionmsg; /* owned */
+ etch_session_message session_message;
+ etch_session_control session_control;
+ etch_session_notify session_notify;
+ etch_session_query session_query;
+
+ /* TODO lose threadpools and delivery params, they are here */
+ etch_server_factory* params; /* not owned */
+
+ unsigned char stub_type;
+ unsigned char is_implobj_owned;
+
+ /* session interface notes:
+ * the stub base itself implements i_sessionmessage and its associated
+ * i_session. the client or server implementor implements, or not, the
+ * objession interface methods, which are the callbacks to which the
+ * i_session calls will be forwarded, if present, to the implementation.
+ * when we construct a stub, we copy the implementor's objsession* to
+ * the stub's impl_callbacks member for convenience. so, the presence
+ * of objession callbacks indicates the desire to have exceptions, etc.
+ * forwarded to the implementation.
+ */
+
+} etch_stub;
+
+
+/*
+ * etchstub_runparams
+ * parameters to a stub helper thread.
+ */
+typedef struct etchstub_runparams
+{
+ unsigned int sig; /* signature */
+ etch_stub* stub; /* stub's this pointer */
+ opaque_stubhelper run; /* stub helper function */
+ void* server; /* i_xxx_server impl mask */
+ i_delivery_service* ds;
+ etch_who* who;
+ etch_message* msg;
+
+} etchstub_runparams;
+
+#define ETCH_STUBPARAMS_SIGNATURE 0xe1d2c3b4
+
+
+etch_stub* new_stub (void* thisx, unsigned char stubtype,
+ i_delivery_service*, etch_threadpool* qp, etch_threadpool* fp);
+
+void* new_clientstub_init (void* implobj, const int bytelen, etch_destructor userdtor,
+ i_delivery_service*, etch_threadpool* qp, etch_threadpool* fp, void*);
+
+void* new_serverstub_init (void* implobj, const int bytelen, etch_destructor userdtor,
+ i_delivery_service*, etch_threadpool* qp, etch_threadpool* fp, void*);
+
+void* new_stubimpl_init (void* implobj, const int objsize,
+ const unsigned char stubtype, etch_destructor userdtor,
+ i_delivery_service* ids, etch_threadpool* qp, etch_threadpool* fp,
+ void* params);
+
+int etchstub_validate_args (etch_stub*, i_delivery_service*, etch_message*,
+ void* iclient, default_value_factory**, void** vfimpl, void** clientimpl);
+
+int etchstub_send_reply (etch_stub*, i_delivery_service*,
+ etch_who*, etch_message*, objmask*);
+
+int is_etch_stub(void*);
+
+
+#endif /* #ifndef ETCH_STUB_H */
\ No newline at end of file
Added: incubator/etch/trunk/binding-c/runtime/c/inc/etch_svcobj_masks.h
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-c/runtime/c/inc/etch_svcobj_masks.h?rev=767594&view=auto
==============================================================================
--- incubator/etch/trunk/binding-c/runtime/c/inc/etch_svcobj_masks.h (added)
+++ incubator/etch/trunk/binding-c/runtime/c/inc/etch_svcobj_masks.h Wed Apr 22 17:25:43 2009
@@ -0,0 +1,493 @@
+/* $Id$
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to you under the Apache License, Version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * etch_svcobj_masks.h
+ * masks over generated objects
+ */
+
+#ifndef ETCHSVCOBJMASKS_H
+#define ETCHSVCOBJMASKS_H
+
+#include "etch_transport.h"
+#include "etch_stub.h"
+
+
+
+/**
+ * i_xxx_server
+ * server base interface
+ * not instantiated, mask over a server base.
+ */
+typedef struct i_xxxx_server
+{
+ unsigned int hashkey;
+ unsigned short obj_type;
+ unsigned short class_id;
+ struct objmask* vtab;
+ int (*destroy)(void*);
+ void*(*clone) (void*);
+ obj_gethashkey get_hashkey;
+ struct objmask* parent;
+ etchresult* result;
+ unsigned int refcount;
+ unsigned int length;
+ unsigned char is_null;
+ unsigned char is_copy;
+ unsigned char is_static;
+ unsigned char reserved;
+
+ objmask* thisx; /* xxxx_server_impl* */
+ objmask* ixxxx; /* service interface */
+ int session_id;
+ unsigned char is_service_interface_owned;
+ unsigned char unused[3];
+
+ /* - - - - - - - - - - -
+ * objsession
+ * - - - - - - - - - - -
+ */
+ i_objsession* iobjsession;
+ etch_session_control _session_control;
+ etch_session_notify _session_notify;
+ etch_session_query _session_query;
+
+ /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ * methods and data specific to the service follow in the implementation
+ * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ */
+
+} i_xxxx_server;
+
+
+
+/**
+ * i_xxxx_client
+ * xxxx client base interface
+ * this object is not instantiated, it is merely a mask over any
+ * i_xxxx_client object, where xxxx is the etch service
+ */
+typedef struct i_xxxx_client
+{
+ unsigned int hashkey;
+ unsigned short obj_type;
+ unsigned short class_id;
+ struct objmask* vtab;
+ int (*destroy)(void*);
+ void*(*clone) (void*);
+ obj_gethashkey get_hashkey;
+ struct objmask* parent;
+ etchresult* result;
+ unsigned int refcount;
+ unsigned int length;
+ unsigned char is_null;
+ unsigned char is_copy;
+ unsigned char is_static;
+ unsigned char reserved;
+
+ objmask* thisx; /* xxxx_client_impl* */
+ objmask* ixxxx; /* service interface */
+ int server_id;
+
+ /* - - - - - - - - - - -
+ * objsession
+ * - - - - - - - - - - -
+ */
+ i_objsession* iobjsession;
+ etch_session_control _session_control;
+ etch_session_notify _session_notify;
+ etch_session_query _session_query;
+
+ /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ * methods and data specific to the service follow in the implementation
+ * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ */
+
+} i_xxxx_client;
+
+
+
+/**
+ * i_xxxx_either
+ * mask over xxxx client base or xxxx_server_base
+ */
+typedef struct i_xxxx_either
+{
+ unsigned int hashkey;
+ unsigned short obj_type;
+ unsigned short class_id;
+ struct objmask* vtab;
+ int (*destroy)(void*);
+ void*(*clone) (void*);
+ obj_gethashkey get_hashkey;
+ struct objmask* parent;
+ etchresult* result;
+ unsigned int refcount;
+ unsigned int length;
+ unsigned char is_null;
+ unsigned char is_copy;
+ unsigned char is_static;
+ unsigned char reserved;
+
+ objmask* thisx; /* xxxx_yyyy_impl* */
+ objmask* ixxxx; /* service interface */
+ int owner_id;
+
+ /* - - - - - - - - - - -
+ * objsession
+ * - - - - - - - - - - -
+ */
+ i_objsession* iobjsession;
+ etch_session_control _session_control;
+ etch_session_notify _session_notify;
+ etch_session_query _session_query;
+
+} i_xxxx_either;
+
+
+/**
+ * xxxx_remote
+ * not instantiated, mask over any xxxx_remote object,
+ * where xxxx is the service name
+ */
+typedef struct xxxx_remote
+{
+ unsigned int hashkey;
+ unsigned short obj_type;
+ unsigned short class_id;
+ struct objmask* vtab;
+ int (*destroy)(void*);
+ void*(*clone) (void*);
+ obj_gethashkey get_hashkey;
+ struct objmask* parent;
+ etchresult* result;
+ unsigned int refcount;
+ unsigned int length;
+ unsigned char is_null;
+ unsigned char is_copy;
+ unsigned char is_static;
+ unsigned char reserved;
+
+ objmask* ixxxx; /* possibly owned */
+ i_delivery_service* dsvc; /* not owned */
+ etch_value_factory* vf; /* not owned */
+ unsigned char remote_type; /* client or server */
+ unsigned char is_service_interface_owned;
+ unsigned short unused; /* alignment */
+
+ etch_message* (*new_message) (void*, etch_type*);
+ int (*send) (void*, etch_message*);
+ void* (*sendex) (void*, etch_message*);
+ etch_delivsvc_begincall begin_call; /* i_mailbox** out */
+ etch_delvisvc_endcall end_call; /* objmask** out */
+
+ int (*start_waitup) (void*, const int waitms);
+ int (*stop_waitdown) (void*, const int waitms);
+
+ /* - - - - - - - - - - - - -
+ * transport functionality
+ * - - - - - - - - - - - - -
+ */
+ etch_transport_control transport_control;
+ etch_transport_notify transport_notify;
+ etch_transport_query transport_query;
+ etch_transport_get_session get_session;
+ etch_transport_set_session set_session;
+
+ /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ * methods and data specific to the service follow in the implementation
+ * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ */
+
+} xxxx_remote;
+
+typedef xxxx_remote etch_remote;
+
+
+
+/**
+ * xxxx_remote_client
+ * this object is not instantiated, it is merely a mask over any
+ * xxxx_remote_client object, where xxxx is the etch service
+ */
+typedef struct xxxx_remote_client
+{
+ unsigned int hashkey;
+ unsigned short obj_type;
+ unsigned short class_id;
+ struct objmask* vtab;
+ int (*destroy)(void*);
+ void*(*clone) (void*);
+ obj_gethashkey get_hashkey;
+ struct objmask* parent;
+ etchresult* result;
+ unsigned int refcount;
+ unsigned int length;
+ unsigned char is_null;
+ unsigned char is_copy;
+ unsigned char is_static;
+ unsigned char reserved;
+
+ i_xxxx_client* xxxx_client_base; /* owned */
+ xxxx_remote* xxxx_remote_base; /* owned */
+ etch_server_factory* server_factory; /* owned */
+ default_value_factory* vf; /* owned by base */
+ int session_id;
+
+ /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ * methods and data specific to the service follow in the implementation
+ * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ */
+
+} xxxx_remote_client;
+
+
+
+/**
+ * xxxx_remote_server
+ */
+typedef struct xxxx_remote_server
+{
+ unsigned int hashkey;
+ unsigned short obj_type;
+ unsigned short class_id;
+ struct objmask* vtab;
+ int (*destroy)(void*);
+ void*(*clone) (void*);
+ obj_gethashkey get_hashkey;
+ struct objmask* parent;
+ etchresult* result;
+ unsigned int refcount;
+ unsigned int length;
+ unsigned char is_null;
+ unsigned char is_copy;
+ unsigned char is_static;
+ unsigned char reserved;
+
+ i_xxxx_server* server_base; /* owned */
+ xxxx_remote* remote_base; /* owned */
+ etch_client_factory* client_factory; /* owned */
+ default_value_factory* vf; /* owned by base */
+ int server_id;
+
+ /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ * methods and data specific to the service follow in the implementation
+ * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ */
+
+} xxxx_remote_server;
+
+
+/**
+ * xxxx_remote_either
+ */
+typedef struct xxxx_remote_either
+{
+ unsigned int hashkey;
+ unsigned short obj_type;
+ unsigned short class_id;
+ struct objmask* vtab;
+ int (*destroy)(void*);
+ void*(*clone) (void*);
+ obj_gethashkey get_hashkey;
+ struct objmask* parent;
+ etchresult* result;
+ unsigned int refcount;
+ unsigned int length;
+ unsigned char is_null;
+ unsigned char is_copy;
+ unsigned char is_static;
+ unsigned char reserved;
+
+ i_xxxx_either* either_base; /* owned */
+ xxxx_remote* remote_base; /* owned */
+ void* either_factory; /* owned */
+ default_value_factory* vf; /* owned by base */
+ int owner_id;
+
+} xxxx_remote_either;
+
+
+/**
+ * xxxx_either_stub
+ * mask over xxxx_client_stub or xxxx_server_stub
+ */
+typedef struct xxxx_either_stub
+{
+ unsigned int hashkey;
+ unsigned short obj_type;
+ unsigned short class_id;
+ struct objmask* vtab;
+ int (*destroy)(void*);
+ void*(*clone) (void*);
+ obj_gethashkey get_hashkey;
+ struct objmask* parent;
+ etchresult* result;
+ unsigned int refcount;
+ unsigned int length;
+ unsigned char is_null;
+ unsigned char is_copy;
+ unsigned char is_static;
+ unsigned char reserved;
+
+ etch_stub* stub_base;
+ int owner_id; /* e.g. session_id */
+ int (*destroyex) (void*); /* user memory destructor */
+
+} xxxx_either_stub;
+
+
+
+/**
+ * xxxx_server_impl
+ * this object is not instantiated, it is merely a mask over any
+ * xxxx_server_impl object, where xxxx is the etch service
+ */
+typedef struct xxxx_server_impl
+{
+ unsigned int hashkey;
+ unsigned short obj_type;
+ unsigned short class_id;
+ struct objmask* vtab;
+ int (*destroy)(void*);
+ void*(*clone) (void*);
+ obj_gethashkey get_hashkey;
+ struct objmask* parent;
+ etchresult* result;
+ unsigned int refcount;
+ unsigned int length;
+ unsigned char is_null;
+ unsigned char is_copy;
+ unsigned char is_static;
+ unsigned char reserved;
+
+ i_xxxx_server* xxxx_server_base; /* owned */
+ objmask* ixxxx; /* not owned */
+ xxxx_remote_client* client; /* not owned */
+
+ int (*destroyex) (void*); /* user memory destructor */
+
+ /* - - - - - - - - - - - -
+ * objsession
+ * - - - - - - - - - - - -
+ */
+ i_objsession* iobjsession; /* owned by base */
+ /* note that iobjsession->thisx is set to this xxxx_server_impl* */
+ etch_session_control _session_control;
+ etch_session_notify _session_notify;
+ etch_session_query _session_query;
+
+ /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ * methods and data specific to the service follow in the implementation
+ * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ */
+
+} xxxx_server_impl;
+
+
+
+/**
+ * xxxx_client_impl
+ * this object is not instantiated, it is merely a mask over any
+ * xxxx_client_impl object, where xxxx is the etch service
+ */
+typedef struct xxxx_client_impl
+{
+ unsigned int hashkey;
+ unsigned short obj_type;
+ unsigned short class_id;
+ struct objmask* vtab;
+ int (*destroy)(void*);
+ void*(*clone) (void*);
+ obj_gethashkey get_hashkey;
+ struct objmask* parent;
+ etchresult* result;
+ unsigned int refcount;
+ unsigned int length;
+ unsigned char is_null;
+ unsigned char is_copy;
+ unsigned char is_static;
+ unsigned char reserved;
+
+ i_xxxx_client* client_base; /* owned */
+ objmask* ixxxx; /* not owned */
+ xxxx_remote_server* server; /* not owned */
+
+ int (*destroyex) (void*); /* user memory destructor */
+
+ /* - - - - - - - - - - - -
+ * objsession
+ * - - - - - - - - - - - -
+ */
+ i_objsession* iobjsession; /* owned by base */
+ /* note that iobjsession->thisx is set to this perf_client_impl* */
+ etch_session_control _session_control;
+ etch_session_notify _session_notify;
+ etch_session_query _session_query;
+
+ /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ * methods and data specific to the service follow in the implementation
+ * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ */
+
+} xxxx_client_impl;
+
+
+/**
+ * xxxx_either_impl
+ * mask over any xxxx_client_impl or xxxx_server_impl
+ */
+typedef struct xxxx_either_impl
+{
+ unsigned int hashkey;
+ unsigned short obj_type;
+ unsigned short class_id;
+ struct objmask* vtab;
+ int (*destroy)(void*);
+ void*(*clone) (void*);
+ obj_gethashkey get_hashkey;
+ struct objmask* parent;
+ etchresult* result;
+ unsigned int refcount;
+ unsigned int length;
+ unsigned char is_null;
+ unsigned char is_copy;
+ unsigned char is_static;
+ unsigned char reserved;
+
+ i_xxxx_either* either_base; /* owned */
+ objmask* ixxxx; /* not owned */
+ xxxx_remote_either* either; /* not owned */
+
+ int (*destroyex) (void*); /* user memory destructor */
+
+ /* - - - - - - - - - - - -
+ * objsession
+ * - - - - - - - - - - - -
+ */
+ i_objsession* iobjsession; /* owned by base */
+ /* note that iobjsession->thisx is set to this perf_client_impl* */
+ etch_session_control _session_control;
+ etch_session_notify _session_notify;
+ etch_session_query _session_query;
+
+} xxxx_either_impl;
+
+
+
+#endif /* ETCHSVCOBJMASKS_H */
Added: incubator/etch/trunk/binding-c/runtime/c/inc/etch_syncobj.h
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-c/runtime/c/inc/etch_syncobj.h?rev=767594&view=auto
==============================================================================
--- incubator/etch/trunk/binding-c/runtime/c/inc/etch_syncobj.h (added)
+++ incubator/etch/trunk/binding-c/runtime/c/inc/etch_syncobj.h Wed Apr 22 17:25:43 2009
@@ -0,0 +1,39 @@
+/* $Id$
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to you under the Apache License, Version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * etch_syncobj.h
+ * constructors for synchronized objects
+ * we separate construction of objects which instantiate mutexes
+ * in order to avoid circular header references in collections ,
+ */
+
+#ifndef ETCHSYNCOBJ_H
+#define ETCHSYNCOBJ_H
+
+#include "etchhash.h"
+#include "etch_arrayval.h"
+
+struct etch_hashtable* new_synchronized_hashtable(const int isize);
+
+struct etch_arraylist* new_synchronized_arraylist(const int isize, const int dsize);
+
+struct etch_arraylist* new_synchronized_arraylist_from(etch_arraylist*);
+
+
+#endif /* #ifndef ETCHSYNCOBJ_H */
\ No newline at end of file
Added: incubator/etch/trunk/binding-c/runtime/c/inc/etch_tagdata.h
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-c/runtime/c/inc/etch_tagdata.h?rev=767594&view=auto
==============================================================================
--- incubator/etch/trunk/binding-c/runtime/c/inc/etch_tagdata.h (added)
+++ incubator/etch/trunk/binding-c/runtime/c/inc/etch_tagdata.h Wed Apr 22 17:25:43 2009
@@ -0,0 +1,200 @@
+/* $Id$
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to you under the Apache License, Version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * etch_tagdata.h
+ * tagged data
+ */
+
+#ifndef ETCH_TAGDATA_H
+#define ETCH_TAGDATA_H
+
+#include "etchobj.h"
+#include "etch_type.h"
+#include "etch_validator.h"
+
+struct etch_arrayvalue;
+
+#define ETCH_BINTAGDATA_CURRENT_VERSION 3
+
+/**
+ * i_tagdata virtual function signatures
+ */
+typedef signed char (*tagdata_check_value) (etch_object* value);
+typedef signed char (*tagdata_get_native_type_code)
+ (const unsigned short obj_type, const unsigned short class_id);
+typedef int (*tagdata_get_native_type)(const signed char, etch_array_id_params*);
+typedef etch_type* (*tagdata_get_custom_structtype) (etch_object* thisx,
+ const unsigned short obj_type, const unsigned short class_id);
+
+/**
+ * tagged data static function signatures
+ */
+struct etch_arrayvalue* etchtagdata_to_arrayvalue(etch_object* thisx,
+ etch_nativearray* value, tagdata_get_native_type_code get_native_type_code);
+
+int etchtagdata_adjust_small_value (const byte in, etch_object* value, signed char* out);
+int etchtagdata_validate_value(etch_object* valobj, struct etch_validator*, signed char* out);
+int etchtagdata_get_number(etch_object* valobj,
+ const double fminval, const double fmaxval, int64* out);
+int etchtagdata_get_double_number(etch_object* valobj,
+ const double fmin, const double fmax, double* outd);
+int etchtagdata_get_float_number(etch_object* valobj,
+ const double fmin, const double fmax, float* outf);
+int etchtagdata_bool_value (etch_object* valobj, boolean* out);
+int etchtagdata_byte_value (etch_object* valobj, byte* out);
+int etchtagdata_int16_value (etch_object* valobj, short* out);
+int etchtagdata_int32_value (etch_object* valobj, int* out);
+int etchtagdata_int64_value (etch_object* valobj, int64* out);
+int etchtagdata_float_value (etch_object* valobj, float* out);
+int etchtagdata_double_value(etch_object* valobj, double* out);
+int etchtagdata_is_eod (etch_object*);
+int etchtagdata_is_null(etch_object*);
+objmask* etchtagdata_new_eodmarker(const int is_static);
+objmask* etchtagdata_new_nullobj (const int is_static);
+etch_string* etchtagdata_new_emptystring(const int is_static);
+signed char etchtagdata_check_value (etch_object*);
+signed char etchtagdata_check_byte (const signed char);
+signed char etchtagdata_check_short (const short);
+signed char etchtagdata_check_integer (const int);
+signed char etchtagdata_check_long (const int64);
+
+
+/**
+ * etch_typecode
+ * enumeration of values denoting type of an encoded value
+ * rage 1: -128 to -65 defined types
+ * range 2: -64 to 127 tiny integer values
+ */
+typedef enum etch_typecode
+{
+ /**
+ * denotes a null value.
+ */
+ ETCH_XTRNL_TYPECODE_NULL = -128,
+ /**
+ * denotes no value, which is different than null. for example, an array is a
+ * sequence of values (some of which may be null) terminated by a NONE.
+ */
+ ETCH_XTRNL_TYPECODE_NONE = -127,
+ ETCH_XTRNL_TYPECODE_ENDDATA = ETCH_XTRNL_TYPECODE_NONE,
+
+ /* - - - - - - - - - - - - - - - - - -
+ * scalars (also see tiny int below)
+ * - - - - - - - - - - - - - - - - - -
+ */
+
+ /**
+ * denotes a false boolean value.
+ */
+ ETCH_XTRNL_TYPECODE_BOOLEAN_FALSE = -126,
+ /**
+ * denotes a true boolean value.
+ */
+ ETCH_XTRNL_TYPECODE_BOOLEAN_TRUE = -125,
+ ETCH_XTRNL_TYPECODE_BOOLEAN_CONTENT = ETCH_XTRNL_TYPECODE_BOOLEAN_TRUE,
+
+ /**
+ * signed byte.
+ */
+ ETCH_XTRNL_TYPECODE_BYTE = -124,
+ /**
+ * two byte signed short, msb first
+ */
+ ETCH_XTRNL_TYPECODE_SHORT = -123,
+ /**
+ * four byte signed integer, msb first.
+ */
+ ETCH_XTRNL_TYPECODE_INT = -122,
+ /**
+ * eight byte byte signed long, msb first
+ */
+ ETCH_XTRNL_TYPECODE_LONG = -121,
+ /**
+ * four byte ieee floating format number
+ */
+ ETCH_XTRNL_TYPECODE_FLOAT = -120,
+ /**
+ * eight byte ieee floating format number.
+ */
+ ETCH_XTRNL_TYPECODE_DOUBLE = -119,
+
+ /* - - - - - - - - - - - - - - - - - -
+ * arrays
+ * - - - - - - - - - - - - - - - - - -
+ */
+
+ /**
+ * an array of bytes.
+ */
+ ETCH_XTRNL_TYPECODE_BYTES = -117,
+ /**
+ * a sequence of values.
+ */
+ ETCH_XTRNL_TYPECODE_ARRAY = -111,
+
+ /* - - - - - - - - - - - - - - - - - -
+ * strings
+ * - - - - - - - - - - - - - - - - - -
+ */
+
+ /**
+ * denotes an empty string.
+ */
+ ETCH_XTRNL_TYPECODE_EMPTY_STRING = -110,
+ /**
+ * utf-8 encoded string
+ */
+ ETCH_XTRNL_TYPECODE_STRING = -109,
+
+ /* - - - - - - - - - - - - - - - - - -
+ * structures
+ * - - - - - - - - - - - - - - - - - -
+ */
+
+ /**
+ * a sequence of key / value pairs.
+ */
+ ETCH_XTRNL_TYPECODE_STRUCT = -108,
+
+ /**
+ * a custom value from a value factory (struct, exception, enum, extern).
+ * an associated value identifies the specific type. the wire format of
+ * STRUCT and CUSTOM are the same, i.e. can use CUSTOM in place of STRUCT
+ * and accept STRUCT as if CUSTOM.
+ */
+ ETCH_XTRNL_TYPECODE_CUSTOM = -107,
+ /**
+ * denotes that any value is ok (as long as we know how to serialize it).
+ * dynamic methods should be applied to determine type.
+ * this type never appears on the wire.
+ */
+ ETCH_XTRNL_TYPECODE_ANY = -106,
+
+ /* - - - - - - - - - - - - - - - - - -
+ * tiny integers (no value follows)
+ * - - - - - - - - - - - - - - - - - -
+ */
+
+ ETCH_XTRNL_TYPECODE_MIN_TINY_INT = -64,
+ ETCH_XTRNL_TYPECODE_MAX_TINY_INT = 127,
+
+} etch_typecode;
+
+
+#endif /* #ifndef ETCH_TAGDATA_H */
\ No newline at end of file
Added: incubator/etch/trunk/binding-c/runtime/c/inc/etch_tagdata_inp.h
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-c/runtime/c/inc/etch_tagdata_inp.h?rev=767594&view=auto
==============================================================================
--- incubator/etch/trunk/binding-c/runtime/c/inc/etch_tagdata_inp.h (added)
+++ incubator/etch/trunk/binding-c/runtime/c/inc/etch_tagdata_inp.h Wed Apr 22 17:25:43 2009
@@ -0,0 +1,130 @@
+/* $Id$
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to you under the Apache License, Version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * etch_tagdata_inp.h
+ * tagged data input base class
+ */
+
+#ifndef ETCH_TAGDATA_INP_H
+#define ETCH_TAGDATA_INP_H
+
+#include "etchmsgutl.h"
+#include "etch_tagdata.h"
+
+struct etch_message;
+typedef struct etch_message etch_message;
+struct etch_structvalue;
+typedef struct etch_structvalue etch_structvalue;
+struct etch_arrayvalue;
+typedef struct etch_arrayvalue etch_arrayvalue;
+struct etch_flexbuffer;
+typedef struct etch_flexbuffer etch_flexbuffer;
+
+
+/**
+ * tagged_data_input
+ * tagged data input implementation
+ */
+typedef struct tagged_data_input
+{
+ unsigned int hashkey;
+ unsigned short obj_type;
+ unsigned short class_id;
+ struct i_tagged_data_input* vtab;
+ int (*destroy)(void*);
+ void*(*clone) (void*);
+ obj_gethashkey get_hashkey;
+ struct objmask* parent;
+ etchresult* result;
+ unsigned int refcount;
+ unsigned int length;
+ unsigned char is_null;
+ unsigned char is_copy;
+ unsigned char is_static;
+ unsigned char reserved;
+
+ objmask* impl;
+
+} tagged_data_input;
+
+
+/**
+ * i_tagged_data_input virtual function signatures
+ */
+typedef etch_message* (*etchtdi_start_message)(tagged_data_input*);
+typedef etch_message* (*etchtdi_read_message) (tagged_data_input*, etch_flexbuffer*);
+typedef int (*etchtdi_end_message) (tagged_data_input*, etch_message*);
+
+typedef etch_structvalue*(*etchtdi_start_struct) (tagged_data_input*);
+typedef etch_structvalue*(*etchtdi_read_struct) (tagged_data_input*);
+typedef int (*etchtdi_read_struct_element) (tagged_data_input*, struct etch_struct_element*);
+typedef int (*etchtdi_end_struct) (tagged_data_input*, etch_structvalue*);
+
+typedef etch_arrayvalue* (*etchtdi_start_array)(tagged_data_input*);
+typedef etch_arrayvalue* (*etchtdi_read_array) (tagged_data_input*, etch_validator*);
+typedef int (*etchtdi_read_array_element) (tagged_data_input*, ETCH_ARRAY_ELEMENT**);
+typedef int (*etchtdi_end_array)(tagged_data_input*, etch_arrayvalue*);
+
+
+/**
+ * i_tagged_data_input
+ * virtual function table for tagged data input
+ */
+struct i_tagged_data_input
+{
+ unsigned int hashkey;
+ unsigned short obj_type;
+ unsigned short class_id;
+ struct i_tagged_data_input* vtab;
+ int (*destroy)(void*);
+ void*(*clone) (void*);
+ obj_gethashkey get_hashkey;
+ struct objmask* parent;
+ etchresult* result;
+ unsigned int refcount;
+ unsigned int length;
+ unsigned char is_null;
+ unsigned char is_copy;
+ unsigned char is_static;
+ unsigned char reserved;
+
+ etchparentinfo* inherits_from;
+
+ etchtdi_start_message start_message;
+ etchtdi_read_message read_message;
+ etchtdi_end_message end_message;
+ etchtdi_start_struct start_struct;
+ etchtdi_read_struct read_struct;
+ etchtdi_end_struct end_struct;
+ etchtdi_start_array start_array;
+ etchtdi_read_array read_array;
+ etchtdi_end_array end_array;
+
+ tagdata_get_native_type_code get_native_type_code;
+ tagdata_get_custom_structtype get_custom_structtype;
+ tagdata_check_value check_value;
+};
+
+typedef struct i_tagged_data_input i_tagged_data_input;
+
+
+tagged_data_input* new_tagged_data_input();
+
+
+#endif /* #ifndef ETCH_TAGDATA_INP_H */
\ No newline at end of file
Added: incubator/etch/trunk/binding-c/runtime/c/inc/etch_tagdata_out.h
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-c/runtime/c/inc/etch_tagdata_out.h?rev=767594&view=auto
==============================================================================
--- incubator/etch/trunk/binding-c/runtime/c/inc/etch_tagdata_out.h (added)
+++ incubator/etch/trunk/binding-c/runtime/c/inc/etch_tagdata_out.h Wed Apr 22 17:25:43 2009
@@ -0,0 +1,123 @@
+/* $Id$
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to you under the Apache License, Version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * etch_tagdata_out.h
+ * tagged data output
+ */
+
+#ifndef ETCH_TAGDATA_OUT_H
+#define ETCH_TAGDATA_OUT_H
+
+#include "etchmsgutl.h"
+#include "etch_tagdata.h"
+
+struct etch_message;
+typedef struct etch_message etch_message;
+struct etch_structvalue;
+typedef struct etch_structvalue etch_structvalue;
+struct etch_arrayvalue;
+typedef struct etch_arrayvalue etch_arrayvalue;
+struct etch_flexbuffer;
+typedef struct etch_flexbuffer etch_flexbuffer;
+
+
+/**
+ * tagged_data_output
+ * tagged data output implementation
+ */
+struct tagged_data_output
+{
+ unsigned int hashkey;
+ unsigned short obj_type;
+ unsigned short class_id;
+ struct i_tagged_data_output* vtab;
+ int (*destroy)(void*);
+ void*(*clone) (void*);
+ obj_gethashkey get_hashkey;
+ struct objmask* parent;
+ etchresult* result;
+ unsigned int refcount;
+ unsigned int length;
+ unsigned char is_null;
+ unsigned char is_copy;
+ unsigned char is_static;
+ unsigned char reserved;
+
+ objmask* impl;
+};
+
+typedef struct tagged_data_output tagged_data_output;
+
+
+/**
+ * i_tagged_data_output virtual function signatures
+ */
+typedef int (*etchtdo_start_message)(tagged_data_output*, etch_message*);
+typedef int (*etchtdo_write_message)(tagged_data_output*, etch_message*, etch_flexbuffer*);
+typedef int (*etchtdo_end_message) (tagged_data_output*, etch_message*);
+
+typedef int (*etchtdo_start_struct) (tagged_data_output*, etch_structvalue*);
+typedef int (*etchtdo_write_struct) (tagged_data_output*, etch_structvalue*);
+typedef int (*etchtdo_end_struct) (tagged_data_output*, etch_structvalue*);
+
+typedef int (*etchtdo_start_array) (tagged_data_output*, etch_arrayvalue*);
+typedef int (*etchtdo_write_array) (tagged_data_output*, etch_arrayvalue*, etch_validator*);
+typedef int (*etchtdo_end_array) (tagged_data_output*, etch_arrayvalue*);
+
+
+/**
+ * i_tagged_data_output
+ */
+struct i_tagged_data_output
+{
+ unsigned int hashkey;
+ unsigned short obj_type;
+ unsigned short class_id;
+ struct i_tagged_data_output* vtab;
+ int (*destroy)(void*);
+ void*(*clone) (void*);
+ obj_gethashkey get_hashkey;
+ struct objmask* parent;
+ etchresult* result;
+ unsigned int refcount;
+ unsigned int length;
+ unsigned char is_null;
+ unsigned char is_copy;
+ unsigned char is_static;
+ unsigned char reserved;
+
+ etchparentinfo* inherits_from;
+
+ etchtdo_start_message start_message;
+ etchtdo_write_message write_message;
+ etchtdo_end_message end_message;
+ etchtdo_start_struct start_struct;
+ etchtdo_write_struct write_struct;
+ etchtdo_end_struct end_struct;
+ etchtdo_start_array start_array;
+ etchtdo_write_array write_array;
+ etchtdo_end_array end_array;
+};
+
+typedef struct i_tagged_data_output i_tagged_data_output;
+
+tagged_data_output* new_tagged_data_output();
+
+
+#endif /* #ifndef ETCH_TAGDATA_OUT_H */
\ No newline at end of file
Added: incubator/etch/trunk/binding-c/runtime/c/inc/etch_tcpconxn.h
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-c/runtime/c/inc/etch_tcpconxn.h?rev=767594&view=auto
==============================================================================
--- incubator/etch/trunk/binding-c/runtime/c/inc/etch_tcpconxn.h (added)
+++ incubator/etch/trunk/binding-c/runtime/c/inc/etch_tcpconxn.h Wed Apr 22 17:25:43 2009
@@ -0,0 +1,159 @@
+/* $Id$
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to you under the Apache License, Version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * etch_connection.h
+ * connection client and server classes - tcp, udp
+ */
+
+#ifndef ETCHTCPCONXN_H
+#define ETCHTCPCONXN_H
+
+#include "apr_thread_proc.h"
+#include "etch_connection.h"
+#include "etch_transportdata.h"
+#include "etch_transportint.h"
+#include "etch_sessiondata.h"
+#include "etch_url.h"
+
+typedef struct etch_tcp_client etch_tcp_client;
+
+
+/*
+ * tcp specific connection type
+ */
+typedef struct etch_tcp_connection
+{
+ unsigned int hashkey;
+ unsigned short obj_type;
+ unsigned short class_id;
+ struct objmask* vtab;
+ int (*destroy) (void*);
+ void*(*clone) (void*);
+ obj_gethashkey get_hashkey;
+ struct objmask* parent;
+ etchresult* result;
+ unsigned int refcount;
+ unsigned int length;
+ unsigned char is_null;
+ unsigned char is_copy;
+ unsigned char is_static;
+ unsigned char reserved;
+
+ etch_connection cx;
+ etch_tcp_client* rcvlxr; /* owned */
+
+ i_transportdata* itd; /* owned */
+
+ i_sessiondata* session; /* not owned */
+
+ int linger;
+ int traffic_class;
+
+ unsigned char is_nodelay;
+ unsigned char is_keepalive;
+ unsigned char is_autoflush;
+ unsigned char is_session_owned;
+
+} etch_tcp_connection;
+
+
+/*
+ * udp connection
+ * placeholder - this will go in etch_udpconxn.h when we implement udp transport
+ */
+typedef struct etch_udp_connection
+{
+ unsigned int hashkey;
+ unsigned short obj_type;
+ unsigned short class_id;
+ struct objmask* vtab;
+ int (*destroy)(void*);
+ void*(*clone) (void*);
+ obj_gethashkey get_hashkey;
+ struct objmask* parent;
+ etchresult* result;
+ unsigned int refcount;
+ unsigned int length;
+ unsigned char is_null;
+ unsigned char is_copy;
+ unsigned char is_static;
+ unsigned char reserved;
+
+ etch_connection cx;
+
+ apr_sockaddr_t *last_from;
+
+} etch_udp_connection;
+
+
+/**
+ * etch_tcp_client
+ * tcp client listener class
+ */
+typedef struct etch_tcp_client
+{
+ unsigned int hashkey;
+ unsigned short obj_type;
+ unsigned short class_id;
+ struct objmask* vtab;
+ int (*destroy)(void*);
+ void*(*clone) (void*);
+ obj_gethashkey get_hashkey;
+ struct objmask* parent;
+ etchresult* result;
+ unsigned int refcount;
+ unsigned int length;
+ unsigned char is_null;
+ unsigned char is_copy;
+ unsigned char is_static;
+ unsigned char reserved;
+
+ etch_tcp_connection* cxlisten; /* not owned */
+ etch_threadpool* threadpool; /* owned */
+ unsigned listener_id;
+
+ unsigned char is_started;
+ unsigned char is_threadpool_owned;
+
+} etch_tcp_client;
+
+
+unsigned connection_id_farm;
+
+etch_tcp_connection* new_tcp_connection(etch_url*, void* resources, etch_rawsocket*);
+int init_etch_tcpconx_interfaces (etch_tcp_connection*);
+int new_tcpsocket (apr_socket_t**, apr_pool_t*);
+int destroy_etch_tcp_connection(etch_tcp_connection*);
+int etch_tcpconx_start(etch_tcp_connection*);
+int etch_tcpclient_start_listener (etch_tcp_connection*);
+int etch_tcpconx_open (etch_tcp_connection*, const int is_reconnect);
+int etch_tcpconx_close(etch_tcp_connection*, const int is_linger);
+int etch_tcpconx_wait_until(etch_tcp_connection*, const int64 waitval, const int timeoutms);
+int etch_tcpconx_on_event(etch_tcp_connection*, const int e, int p1, void* p2);
+int etch_tcpclient_send (etch_tcp_connection*, char* buf, const size_t, int*);
+int etch_tcpclient_sendex(etch_tcp_connection*, char* buf, const size_t, const int, int*);
+int etch_tcpclient_receive (etch_tcp_connection*, char*, const size_t, int*);
+int etch_tcpclient_receivex(etch_tcp_connection*, char*, const size_t, const int, int*);
+int etch_tcpclient_stop(etch_tcp_connection*);
+int etch_tcpclient_stop_listener (etch_tcp_connection*);
+int etch_tcpclient_listenerproc(etch_threadparams*);
+int is_good_tcp_params(etch_url*, void* resources, etch_rawsocket*);
+
+
+#endif /* ETCHTCPCONXN_H */
\ No newline at end of file
Added: incubator/etch/trunk/binding-c/runtime/c/inc/etch_tcpserver.h
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-c/runtime/c/inc/etch_tcpserver.h?rev=767594&view=auto
==============================================================================
--- incubator/etch/trunk/binding-c/runtime/c/inc/etch_tcpserver.h (added)
+++ incubator/etch/trunk/binding-c/runtime/c/inc/etch_tcpserver.h Wed Apr 22 17:25:43 2009
@@ -0,0 +1,126 @@
+/* $Id$
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to you under the Apache License, Version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * etch_connection.h
+ * connection client and server classes - tcp, udp
+ */
+
+#ifndef ETCHTCPSERVER_H
+#define ETCHTCPSERVER_H
+
+#include "apr_thread_proc.h"
+#include "etch_tcpconxn.h"
+#include "etch_resources.h"
+#include "etch_sessionlisten.h"
+
+typedef struct etch_tcp_server etch_tcp_server;
+typedef int (*etch_listener_event_handler)
+ (struct etch_tcp_server*, struct etch_tcp_connection*, const int, int, void*);
+char* ETCHTCPS;
+
+#define ETCH_TCPSERVER_STATE_CLOSED 0
+#define ETCH_TCPSERVER_STATE_CLOSING 1
+#define ETCH_TCPSERVER_STATE_STOPPED 2
+#define ETCH_TCPSERVER_STATE_STOPPING 3
+#define ETCH_TCPSERVER_STATE_STARTING 4
+#define ETCH_TCPSERVER_STATE_STARTED 5
+
+
+/**
+ * etch_tcp_server
+ * tcp listener class
+ */
+typedef struct etch_tcp_server
+{
+ unsigned int hashkey;
+ unsigned short obj_type;
+ unsigned short class_id;
+ struct objmask* vtab;
+ int (*destroy)(void*);
+ void*(*clone) (void*);
+ obj_gethashkey get_hashkey;
+ struct objmask* parent;
+ etchresult* result;
+ unsigned int refcount;
+ unsigned int length;
+ unsigned char is_null;
+ unsigned char is_copy;
+ unsigned char is_static;
+ unsigned char reserved;
+
+ etch_tcp_connection* cxlisten; /* owned */
+ etch_threadpool* threadpool; /* not owned */
+ etch_threadpool* subpool; /* not owned */
+ etch_listener_event_handler on_event;
+ etch_connection_event_handler on_data;
+
+ /* - - - - - - - - - - - - - - - - - -
+ * i_sessionlistener - set externally
+ * - - - - - - - - - - - - - - - - - -
+ */
+ i_session* isession; /* not owned */
+ i_sessionlistener* session; /* owned or not */
+ etch_session_control session_control;
+ etch_session_notify session_notify;
+ etch_session_query session_query;
+ etch_session_accepted on_session_accepted;
+
+ /* - - - - - - - - - - - - - - - - - -
+ * i_transport
+ * - - - - - - - - - - - - - - - - - -
+ */
+ i_transport* itransport; /* owned */
+ etch_transport_control transport_control;
+ etch_transport_notify transport_notify;
+ etch_transport_query transport_query;
+ etch_transport_get_session get_session;
+ etch_transport_set_session set_session;
+
+ /* - - - - - - - - - - - - - - - - -
+ * instance data
+ * - - - - - - - - - - - - - - - - -
+ */
+ unsigned listener_id;
+ int backlog;
+ int connections;
+ etch_url* url;
+ etchwait* waiter; /* not owned */
+ etch_resources* resxmap; /* not owned */
+
+ unsigned char state;
+ unsigned char is_started;
+ unsigned char is_session_owned;
+ unsigned char is_threadpool_owned;
+
+} etch_tcp_server;
+
+unsigned tcpserver_id_farm;
+
+etch_tcp_server* new_tcp_server(etch_url*, etch_threadpool*, etch_threadpool*,
+ etch_resources*, i_sessionlistener*);
+int destroy_etch_tcp_server(etch_tcp_server*);
+void etch_tcpserver_listenerproc(etch_threadparams*);
+int etch_tcpsvr_open (etch_tcp_server*, const int is_reconnect);
+int etch_tcpsvr_start(etch_tcp_server*);
+int etch_tcpsvr_stop (etch_tcp_server*);
+int etch_tcpsvr_close(etch_tcp_server*);
+int etch_deftcplistener_on_event(etch_tcp_server*, etch_tcp_connection*, const int e, int p1, void* p2);
+
+
+#endif /* ETCHTCPSERVER_H */
\ No newline at end of file
Added: incubator/etch/trunk/binding-c/runtime/c/inc/etch_tdformat.h
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-c/runtime/c/inc/etch_tdformat.h?rev=767594&view=auto
==============================================================================
--- incubator/etch/trunk/binding-c/runtime/c/inc/etch_tdformat.h (added)
+++ incubator/etch/trunk/binding-c/runtime/c/inc/etch_tdformat.h Wed Apr 22 17:25:43 2009
@@ -0,0 +1,79 @@
+/* $Id$
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to you under the Apache License, Version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * etch_tdformat.h
+ * a factory used to construct tagged data processors for messagizer
+ */
+
+#ifndef ETCHTDFORMAT_H
+#define ETCHTDFORMAT_H
+
+#include "etch_tagdata_inp.h"
+#include "etch_tagdata_out.h"
+#include "etch_binary_tdi.h"
+#include "etch_binary_tdo.h"
+#include "etch_valufact.h"
+
+
+/**
+ * tagdata_format_factory
+ */
+typedef struct tagdata_format_factory
+{
+ unsigned int hashkey;
+ unsigned short obj_type;
+ unsigned short class_id;
+ struct vtabmask* vtab;
+ int (*destroy) (void*);
+ void*(*clone) (void*);
+ obj_gethashkey get_hashkey;
+ struct objmask* parent;
+ etchresult* result;
+ unsigned int refcount;
+ unsigned int length;
+ unsigned char is_null;
+ unsigned char is_copy;
+ unsigned char is_static;
+ unsigned char reserved;
+
+ tagged_data_input* (*new_tagdata_input) (etch_value_factory*);
+ tagged_data_output* (*new_tagdata_output) (etch_value_factory*);
+
+} tagdata_format_factory;
+
+
+
+typedef enum etchtdf /* tagged data format IDs */
+{ ETCH_TAGDATA_FORMAT_BINARY,
+ ETCH_TAGDATA_FORMAT_XML,
+ ETCH_TAGDATA_FORMAT_COUNT /* must be last in list */
+} etchtdf;
+
+const wchar_t* tdformat_names[ETCH_TAGDATA_FORMAT_COUNT];
+
+const wchar_t* tdfname_binary;
+const wchar_t* tdfname_xml;
+
+int is_tdf_initialized;
+
+tagdata_format_factory* get_format_factory(wchar_t* format_name);
+int etchtdf_name_to_id(wchar_t* format_name);
+
+
+#endif /* ETCHTDFORMAT_H */
\ No newline at end of file