You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@etch.apache.org by fi...@apache.org on 2011/06/16 10:34:22 UTC
svn commit: r1136323 - in /incubator/etch/trunk:
binding-c/compiler/src/main/resources/org/apache/etch/bindings/c/compiler/
binding-c/runtime/c/ binding-c/runtime/c/include/
binding-c/runtime/c/src/main/bindings/msg/
binding-c/runtime/c/src/main/suppor...
Author: fitzner
Date: Thu Jun 16 08:34:21 2011
New Revision: 1136323
URL: http://svn.apache.org/viewvc?rev=1136323&view=rev
Log:
[ETCH-161]
Naming conflicts in Etch binding-c runtime message module
Modified:
incubator/etch/trunk/binding-c/compiler/src/main/resources/org/apache/etch/bindings/c/compiler/remote_client_c.vm
incubator/etch/trunk/binding-c/compiler/src/main/resources/org/apache/etch/bindings/c/compiler/remote_server_c.vm
incubator/etch/trunk/binding-c/compiler/src/main/resources/org/apache/etch/bindings/c/compiler/stub_c.vm
incubator/etch/trunk/binding-c/runtime/c/README.txt
incubator/etch/trunk/binding-c/runtime/c/include/etch_message.h
incubator/etch/trunk/binding-c/runtime/c/src/main/bindings/msg/etch_binary_tdi.c
incubator/etch/trunk/binding-c/runtime/c/src/main/bindings/msg/etch_default_value_factory.c
incubator/etch/trunk/binding-c/runtime/c/src/main/bindings/msg/etch_message.c
incubator/etch/trunk/binding-c/runtime/c/src/main/support/etch_sessionint.c
incubator/etch/trunk/binding-c/runtime/c/src/main/support/etch_stub.c
incubator/etch/trunk/binding-c/runtime/c/src/main/transport/etch_messagizer.c
incubator/etch/trunk/binding-c/runtime/c/src/main/transport/etch_plain_mailbox.c
incubator/etch/trunk/binding-c/runtime/c/src/main/transport/etch_plain_mailbox_manager.c
incubator/etch/trunk/binding-c/runtime/c/src/main/transport/etch_transport.c
incubator/etch/trunk/binding-c/runtime/c/src/test/message/test_binarytditdo.c
incubator/etch/trunk/binding-c/runtime/c/src/test/message/test_defvalufact.c
incubator/etch/trunk/binding-c/runtime/c/src/test/message/test_message.c
incubator/etch/trunk/binding-c/runtime/c/src/test/transport/test_mailboxmgr.c
incubator/etch/trunk/binding-c/runtime/c/src/test/transport/test_messagizer.c
incubator/etch/trunk/binding-c/runtime/c/src/test/transport/test_plainmailbox.c
incubator/etch/trunk/examples/helloworld/src/main/c/helloworld_server_impl.c
Modified: incubator/etch/trunk/binding-c/compiler/src/main/resources/org/apache/etch/bindings/c/compiler/remote_client_c.vm
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-c/compiler/src/main/resources/org/apache/etch/bindings/c/compiler/remote_client_c.vm?rev=1136323&r1=1136322&r2=1136323&view=diff
==============================================================================
--- incubator/etch/trunk/binding-c/compiler/src/main/resources/org/apache/etch/bindings/c/compiler/remote_client_c.vm (original)
+++ incubator/etch/trunk/binding-c/compiler/src/main/resources/org/apache/etch/bindings/c/compiler/remote_client_c.vm Thu Jun 16 08:34:21 2011
@@ -309,7 +309,7 @@ $sb
if (!_msg) break;
#foreach( $p in $n.iterator() )
- _result = message_putc (_msg, $helper.getVfName($intf)_get_static()->_mf_$helper.getIntfName($intf)_$p.name(), (void**)&$p.name());
+ _result = etch_message_putc (_msg, $helper.getVfName($intf)_get_static()->_mf_$helper.getIntfName($intf)_$p.name(), (void**)&$p.name());
if ($p.name() != NULL && 0 != _result) break;
#end
@@ -412,7 +412,7 @@ $sb
* leaking the un-put parameters, since prior to exit we can destroy each
* parameter which remains non-null.
* @remarks note also that we don't bother to clone the value keys, since they
- * are protected objects, and while message_put will appear to destroy them,
+ * are protected objects, and while etch_message_put will appear to destroy them,
* this will have no effect.
*/
#set ($sb = "$helper.getPointerTypeName($n.type()) $helper.getRemoteName($intf, '')_begin_client_$n.name()(void* thisx")
@@ -434,7 +434,7 @@ $sb
if (!_msg) break;
#foreach( $p in $n.iterator() )
- _result = message_putc (_msg, $helper.getVfName($intf)_get_static()->_mf_$helper.getIntfName($intf)_$p.name(), (void**)&$p.name());
+ _result = etch_message_putc (_msg, $helper.getVfName($intf)_get_static()->_mf_$helper.getIntfName($intf)_$p.name(), (void**)&$p.name());
if ($p.name() != NULL && 0 != _result) break;
#end
Modified: incubator/etch/trunk/binding-c/compiler/src/main/resources/org/apache/etch/bindings/c/compiler/remote_server_c.vm
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-c/compiler/src/main/resources/org/apache/etch/bindings/c/compiler/remote_server_c.vm?rev=1136323&r1=1136322&r2=1136323&view=diff
==============================================================================
--- incubator/etch/trunk/binding-c/compiler/src/main/resources/org/apache/etch/bindings/c/compiler/remote_server_c.vm (original)
+++ incubator/etch/trunk/binding-c/compiler/src/main/resources/org/apache/etch/bindings/c/compiler/remote_server_c.vm Thu Jun 16 08:34:21 2011
@@ -297,7 +297,7 @@ $sb
if (!_msg) break;
#foreach( $p in $n.iterator() )
- _result = message_putc (_msg, $helper.getVfName($intf)_get_static()->_mf_$helper.getIntfName($intf)_$p.name(), (void**)&$p.name());
+ _result = etch_message_putc (_msg, $helper.getVfName($intf)_get_static()->_mf_$helper.getIntfName($intf)_$p.name(), (void**)&$p.name());
if ($p.name() != NULL && 0 != _result) break;
#end
@@ -401,7 +401,7 @@ $sb
* leaking the un-put parameters, since prior to exit we can destroy each
* parameter which remains non-null.
* @remarks note also that we don't bother to clone the value keys, since they
- * are protected objects, and while message_put will appear to destroy them,
+ * are protected objects, and while etch_message_put will appear to destroy them,
* this will have no effect.
*/
#set ($sb = "$helper.getPointerTypeName($n.type()) $helper.getRemoteName($intf, '')_begin_server_$n.name()(void* thisAsVoid")
@@ -428,7 +428,7 @@ $sb
if (!_msg) break;
#foreach( $p in $n.iterator() )
- _result = message_putc (_msg, $helper.getVfName($intf)_get_static()->_mf_$helper.getIntfName($intf)_$p.name(), (void**)&$p.name());
+ _result = etch_message_putc (_msg, $helper.getVfName($intf)_get_static()->_mf_$helper.getIntfName($intf)_$p.name(), (void**)&$p.name());
if ($p.name() != NULL && 0 != _result) break;
#end
Modified: incubator/etch/trunk/binding-c/compiler/src/main/resources/org/apache/etch/bindings/c/compiler/stub_c.vm
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-c/compiler/src/main/resources/org/apache/etch/bindings/c/compiler/stub_c.vm?rev=1136323&r1=1136322&r2=1136323&view=diff
==============================================================================
--- incubator/etch/trunk/binding-c/compiler/src/main/resources/org/apache/etch/bindings/c/compiler/stub_c.vm (original)
+++ incubator/etch/trunk/binding-c/compiler/src/main/resources/org/apache/etch/bindings/c/compiler/stub_c.vm Thu Jun 16 08:34:21 2011
@@ -93,8 +93,8 @@ int $helper.getStubName($intf, $suffix)_
/* nullarg asserts are initial tests only: server impl
* will generate exceptions on nullargs in the real world */
- val_foo = NULL; /* = (etch_int64*) message_get (msg, key_foo); */
- val_bar = NULL; /* = (etch_string*) message_get (msg, key_bar); */
+ val_foo = NULL; /* = (etch_int64*) etch_message_get (msg, key_foo); */
+ val_bar = NULL; /* = (etch_string*) etch_message_get (msg, key_bar); */
ETCH_ASSERT(val_foo && val_bar);
/* execute the service method */
@@ -149,7 +149,7 @@ int $helper.getStubName($intf, '')_run_$
#set($sb = '')
#foreach($p in $n.iterator())
##set($sb = "$sb${op}val_$p.name()")
- val_$p.name() = ($helper.getPointerTypeName($p.type())) message_remove(msg, key_$p.name());
+ val_$p.name() = ($helper.getPointerTypeName($p.type())) etch_message_remove(msg, key_$p.name());
##set($op = ' && ')
#end
##if($sb != '')
Modified: incubator/etch/trunk/binding-c/runtime/c/README.txt
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-c/runtime/c/README.txt?rev=1136323&r1=1136322&r2=1136323&view=diff
==============================================================================
--- incubator/etch/trunk/binding-c/runtime/c/README.txt (original)
+++ incubator/etch/trunk/binding-c/runtime/c/README.txt Thu Jun 16 08:34:21 2011
@@ -118,10 +118,10 @@ for apr-iconv.
A much more easy way to build apr is to use our apr-install.sh script (). For build the apr libraries,
follow the next steps:
-1. create a new folder beside your <ETCH_EXTERNAL_DEPENDS> etc. home/user/projects/etch/external_sources
+1. create a new folder beside your <ETCH_EXTERNAL_DEPENDS> e.g. home/user/projects/etch/external_sources
2. edit apr-install.sh script and set INSTALL_PREFIX to your <ETCH_EXTERNAL_DEPENDS> folde. You can also
set this variables as environment variable.
-3. enter to build folder (etc, ../etch/external_sources, see 1.) and execute the following
+3. enter to build folder (e.g., ../etch/external_sources, see 1.) and execute the following
commands:
- apr-install.sh (downloading apr sources, build apr libraries, install libraries)
Modified: incubator/etch/trunk/binding-c/runtime/c/include/etch_message.h
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-c/runtime/c/include/etch_message.h?rev=1136323&r1=1136322&r2=1136323&view=diff
==============================================================================
--- incubator/etch/trunk/binding-c/runtime/c/include/etch_message.h (original)
+++ incubator/etch/trunk/binding-c/runtime/c/include/etch_message.h Thu Jun 16 08:34:21 2011
@@ -65,18 +65,18 @@ etch_unwanted_message* new_unwanted_mess
etch_message* new_message (etch_type*, const int, etch_value_factory*);
-etch_object* message_get (etch_message*, etch_field* key);
-etch_object* message_remove(etch_message*, etch_field* key);
-int message_put (etch_message*, etch_field* key, etch_object* value);
-int message_putc (etch_message*, etch_field* key, void** valref);
-etch_message* message_reply (etch_message*, etch_type* type);
-etch_type* message_type (etch_message*);
-char* message_aname (etch_message*);
-etch_int64* message_get_id(etch_message*);
-etch_int64* message_get_in_reply_to(etch_message*);
-int message_set_in_reply_to(etch_message*, etch_int64* id);
-int message_set_id(etch_message*, etch_int64* id);
-int message_size (etch_message*);
+etch_object* etch_message_get (etch_message*, etch_field* key);
+etch_object* etch_message_remove(etch_message*, etch_field* key);
+int etch_message_put (etch_message*, etch_field* key, etch_object* value);
+int etch_message_putc (etch_message*, etch_field* key, void** valref);
+etch_message* etch_message_reply (etch_message*, etch_type* type);
+etch_type* etch_message_type (etch_message*);
+char* etch_message_aname (etch_message*);
+etch_int64* etch_message_get_id(etch_message*);
+etch_int64* etch_message_get_in_reply_to(etch_message*);
+int etch_message_set_in_reply_to(etch_message*, etch_int64* id);
+int etch_message_set_id(etch_message*, etch_int64* id);
+int etch_message_size (etch_message*);
#ifdef __cplusplus
}
Modified: incubator/etch/trunk/binding-c/runtime/c/src/main/bindings/msg/etch_binary_tdi.c
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-c/runtime/c/src/main/bindings/msg/etch_binary_tdi.c?rev=1136323&r1=1136322&r2=1136323&view=diff
==============================================================================
--- incubator/etch/trunk/binding-c/runtime/c/src/main/bindings/msg/etch_binary_tdi.c (original)
+++ incubator/etch/trunk/binding-c/runtime/c/src/main/bindings/msg/etch_binary_tdi.c Thu Jun 16 08:34:21 2011
@@ -265,21 +265,21 @@ int bintdi_end_message(tagged_data_input
* message result object both exists and reflects that exception.
*/
- if (message_get_in_reply_to (msg))
+ if (etch_message_get_in_reply_to (msg))
{
etch_field* xkey = builtins._mf_msg;
/* look for an exception in the newly-deserialized message */
- etch_exception* excpobj = (etch_exception*) message_get (msg, xkey);
+ etch_exception* excpobj = (etch_exception*) etch_message_get (msg, xkey);
if (is_etch_exception(excpobj))
{ /* look for a result object in the message */
etch_field* resobj_key = builtins._mf_result;
- etch_object* resobj = message_get (msg, resobj_key);
+ etch_object* resobj = etch_message_get (msg, resobj_key);
ETCH_LOG(LOG_CATEGORY, ETCH_LOG_DEBUG, "exception found in message\n");
//replace result with exception object
//TODO memory leak here? (resobj not destroyed, should we?)
resobj = ((etch_object*)excpobj)->clone(excpobj);
- result = message_put (msg, resobj_key, resobj);
+ result = etch_message_put (msg, resobj_key, resobj);
}
}
Modified: incubator/etch/trunk/binding-c/runtime/c/src/main/bindings/msg/etch_default_value_factory.c
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-c/runtime/c/src/main/bindings/msg/etch_default_value_factory.c?rev=1136323&r1=1136322&r2=1136323&view=diff
==============================================================================
--- incubator/etch/trunk/binding-c/runtime/c/src/main/bindings/msg/etch_default_value_factory.c (original)
+++ incubator/etch/trunk/binding-c/runtime/c/src/main/bindings/msg/etch_default_value_factory.c Thu Jun 16 08:34:21 2011
@@ -563,7 +563,7 @@ int defvf_add_mixin(default_value_factor
*/
etch_int64* defvf_get_message_id (void* data, etch_message* msg)
{
- return (etch_int64*) message_get(msg, builtins._mf__message_id);
+ return (etch_int64*) etch_message_get(msg, builtins._mf__message_id);
}
@@ -573,7 +573,7 @@ etch_int64* defvf_get_message_id (void*
*/
unsigned message_get_id32 (etch_message* msg)
{
- etch_int64* id64 = (etch_int64*) message_get (msg, builtins._mf__message_id);
+ etch_int64* id64 = (etch_int64*) etch_message_get (msg, builtins._mf__message_id);
const int id32 = id64? (unsigned) id64->value: 0;
return id32;
}
@@ -588,7 +588,7 @@ unsigned message_get_id32 (etch_message*
*/
int defvf_set_message_id (void* data, etch_message* msg, etch_int64* id)
{
- return message_put(msg, clone_field(builtins._mf__message_id), (etch_object*) id);
+ return etch_message_put(msg, clone_field(builtins._mf__message_id), (etch_object*) id);
}
@@ -599,7 +599,7 @@ int defvf_set_message_id (void* data, et
*/
etch_int64* defvf_get_in_reply_to (void* data, etch_message* msg)
{
- return (etch_int64*) message_get(msg, builtins._mf__in_reply_to);
+ return (etch_int64*) etch_message_get(msg, builtins._mf__in_reply_to);
}
@@ -612,7 +612,7 @@ etch_int64* defvf_get_in_reply_to (void*
*/
int defvf_set_in_reply_to (void* data, etch_message* msg, etch_int64* id)
{
- return message_put (msg, clone_field(builtins._mf__in_reply_to), (etch_object*) id);
+ return etch_message_put (msg, clone_field(builtins._mf__in_reply_to), (etch_object*) id);
}
Modified: incubator/etch/trunk/binding-c/runtime/c/src/main/bindings/msg/etch_message.c
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-c/runtime/c/src/main/bindings/msg/etch_message.c?rev=1136323&r1=1136322&r2=1136323&view=diff
==============================================================================
--- incubator/etch/trunk/binding-c/runtime/c/src/main/bindings/msg/etch_message.c (original)
+++ incubator/etch/trunk/binding-c/runtime/c/src/main/bindings/msg/etch_message.c Thu Jun 16 08:34:21 2011
@@ -14,7 +14,7 @@
* 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_message.c
@@ -66,7 +66,7 @@ int destroy_message (void* data)
}
destroy_objectex((etch_object*)msg);
- return result;
+ return result;
}
/**
@@ -87,23 +87,18 @@ etch_message* new_message_init(etch_type
return newmsg;
}
-
-
-
/**
- * message_remove()
+ * etch_message_remove()
* removes an element from the message struct, returning the element.
* if the element is found, its key is destroyed, and the object is returned.
* caller owns returned object.
- */
-etch_object* message_remove(etch_message* msg, etch_field* key)
-{
- return structvalue_remove(msg->sv, key);
+ */
+etch_object* etch_message_remove(etch_message* msg, etch_field* key) {
+ return structvalue_remove(msg->sv, key);
}
-
/**
- * message_put()
+ * etch_message_put()
* insert key/value pair
*
* @param key an etch_field whose destructor will be invoked when the struct is
@@ -120,23 +115,21 @@ etch_object* message_remove(etch_message
* relinquishes ownership of parameters (other than this of course), regardless
* of outcome. should caller wish to retain ownership on failure, the parameter
* object could be marked such that the destructor invoked here becomes benign.
- */
-int message_put(etch_message* msg, etch_field* key, etch_object* value)
-{
- /* on success, struct owns key and value */
- if (0 == structvalue_put(msg->sv, key, value))
- return 0;
+ */
+int etch_message_put(etch_message* msg, etch_field* key, etch_object* value) {
+ /* on success, struct owns key and value */
+ if (0 == structvalue_put(msg->sv, key, value))
+ return 0;
- etch_object_destroy(value);
- value = NULL;
+ etch_object_destroy(value);
+ value = NULL;
- destroy_field(key); /* note we are often passed protected vf keys */
- return -1;
+ destroy_field(key); /* note we are often passed protected vf keys */
+ return -1;
}
-
/**
- * message_putc()
+ * etch_message_putc()
* insert key/value pair and clear value reference
*
* @param key an etch_field whose destructor will be invoked when the struct is
@@ -154,10 +147,9 @@ int message_put(etch_message* msg, etch_
* relinquishes ownership of parameters (other than this of course), regardless
* of outcome. should caller wish to retain ownership on failure, the parameter
* object could be marked such that the destructor invoked here becomes benign.
- */
-int message_putc(etch_message* msg, etch_field* key, void** valref)
-{
- etch_object* value = NULL;
+ */
+int etch_message_putc(etch_message* msg, etch_field* key, void** valref) {
+ etch_object* value = NULL;
if (valref)
{ value = (etch_object*) *valref;
@@ -168,91 +160,89 @@ int message_putc(etch_message* msg, etch
if (0 == structvalue_put (msg->sv, key, value)){
return 0;
}
- }
+ }
- /* a struct put was not successful so destroy parameter objects */
- etch_object_destroy(value);
- value = NULL;
+ /* a struct put was not successful so destroy parameter objects */
+ etch_object_destroy(value);
+ value = NULL;
- destroy_field(key); /* note we are often passed protected vf keys */
- return -1;
+ destroy_field(key); /* note we are often passed protected vf keys */
+ return -1;
}
-
/**
- * message_get()
+ * etch_message_get()
* fetch value for key.
* @return a non-disposable reference to the value, not a copy, or null.
*/
-etch_object* message_get(etch_message* msg, etch_field* key)
+etch_object* etch_message_get(etch_message* msg, etch_field* key)
{
- etch_object* retobj = NULL;
+ etch_object* retobj = NULL;
- if (msg && key && msg->sv)
- retobj = structvalue_get(msg->sv, key);
+ if (msg && key && msg->sv)
+ retobj = structvalue_get(msg->sv, key);
- #if(0)
- if (NULL == msg || NULL == key || NULL == msg->sv)
- return throw_from(EXCPTYPE_ILLEGALARG, ETCHTYPEB_UNDEFINED, 0, 0);
- retobj = structvalue_get(msg->sv, key);
- #endif
-
- return retobj;
-}
+#if(0)
+ if (NULL == msg || NULL == key || NULL == msg->sv)
+ return throw_from(EXCPTYPE_ILLEGALARG, ETCHTYPEB_UNDEFINED, 0, 0);
+ retobj = structvalue_get(msg->sv, key);
+#endif
+ return retobj;
+}
/**
- * message_type()
+ * etch_message_type()
* return etch type of specified message
*/
-etch_type* message_type(etch_message* msg)
+etch_type* etch_message_type(etch_message* msg)
{
- return msg && msg->sv? msg->sv->struct_type: NULL;
+ return msg && msg->sv ? msg->sv->struct_type : NULL;
}
-
/**
- * message_aname()
+ * etch_message_aname()
* return name of specified message in 8-bit encoding.
* @return a reference to the message name, caller does not own it.
*/
-char* message_aname (etch_message* msg)
+char* etch_message_aname(etch_message* msg)
{
- etch_type* msgtype = message_type(msg);
- char* msgname = msgtype && msgtype->aname? msgtype->aname: "";
- return msgname;
+ etch_type* msgtype = etch_message_type(msg);
+ char* msgname = msgtype && msgtype->aname ? msgtype->aname : "";
+ return msgname;
}
-
/**
- * message_reply()
+ * etch_message_reply()
* creates a message which is a reply to the current message.
* the current message's value factory is copied to the new message.
* message id of the current message (if any) is copied into the
* in-reply-to field of the new message.
* @param newtype the type of the reply. caller retains ownership.
* @return a reply message, which will contain exception if error.
- */
-etch_message* message_reply (etch_message* msg, etch_type* newtype)
+ */
+etch_message* etch_message_reply(etch_message* msg, etch_type* newtype)
{
- int result = -1;
- etch_int64* msgid = NULL;
- etch_message* newmsg = NULL;
+ int result = -1;
+ etch_int64* msgid = NULL;
+ etch_message* newmsg = NULL;
- if (NULL == msg) return NULL;
+ if (NULL == msg)
+ return NULL;
- if (NULL == newtype) /* use message type's result type */
- newtype = etchtype_get_result_type (msg->sv->struct_type);
+ if (NULL == newtype) /* use message type's result type */
+ newtype = etchtype_get_result_type(msg->sv->struct_type);
- if (NULL == newtype) return NULL;
+ if (NULL == newtype)
+ return NULL;
- /* construct message. caller retains ownership of type */
- newmsg = new_message (newtype, 0, msg->vf);
+ /* construct message. caller retains ownership of type */
+ newmsg = new_message(newtype, 0, msg->vf);
- msgid = message_get_id (msg); /* get back a ref to ID or null */
+ msgid = etch_message_get_id(msg); /* get back a ref to ID or null */
if (msgid)
- result = message_set_in_reply_to (newmsg, ((etch_object*)msgid)->clone(msgid));
+ result = etch_message_set_in_reply_to (newmsg, ((etch_object*)msgid)->clone(msgid));
if (0 != result)
{
@@ -263,78 +253,77 @@ etch_message* message_reply (etch_messag
return newmsg;
}
-
/**
- * message_set_id()
+ * etch_message_set_id()
* sets the message-id field of this message.
* @param id a *disposable* long object wrapping the connection specific
* unique identifier of this message, or NULL if the message has not yet
* been sent. NOTE that the send process overwrites any value which might
* otherwise be set here.
- */
-int message_set_id(etch_message* msg, etch_int64* id)
+ */
+int etch_message_set_id(etch_message* msg, etch_int64* id)
{
- int result = 0;
- if (!id) return -1;
+ int result = 0;
+ if (!id)
+ return -1;
/* id object ownership is relinquished here even if the call fails */
result = ((struct i_value_factory*)((etch_object*)msg->vf)->vtab)->set_message_id(msg->vf, msg, id);
return result;
}
-
/**
- * message_get_id()
+ * etch_message_get_id()
* @return a non-disposable reference to the connection specific unique
* identifier of this message, or null if there was no such identifier.
- */
-etch_int64* message_get_id(etch_message* msg)
-{
- etch_int64* id = ((struct i_value_factory*)((etch_object*)msg->vf)->vtab)->get_message_id(msg->vf, msg);
- return id;
+ */
+etch_int64* etch_message_get_id(etch_message* msg) {
+ etch_int64* id = NULL;
+ id = ((struct i_value_factory*) ((etch_object*) msg->vf)->vtab)->get_message_id(msg->vf, msg);
+ return id;
}
-
/**
* message_get_in_reply_to()
* @return a non-disposable reference to the message-id of the message that
* this message is a response to, or null if this is an original message
* or if the original message did not have a message-id.
* caller does not own the returned object.
- */
-etch_int64* message_get_in_reply_to(etch_message* msg)
-{
- /* vf returns to us a reference to its value */
- etch_int64* id = ((struct i_value_factory*)((etch_object*)msg->vf)->vtab)->get_in_reply_to(msg->vf, msg);
- return id;
+ */
+etch_int64* etch_message_get_in_reply_to(etch_message* msg) {
+ /* vf returns to us a reference to its value */
+ etch_int64
+ * id =
+ ((struct i_value_factory*) ((etch_object*) msg->vf)->vtab)->get_in_reply_to(
+ msg->vf, msg);
+ return id;
}
-
/**
- * message_set_in_reply_to()
+ * etch_message_set_in_reply_to()
* sets the in-reply-to field of this message.
* @param msgid a *disposable* long object wrapping the message-id of the
* message that this message is a response to. note that caller must clone
* or otherwise supply a disposable object as this parameter.
- */
-int message_set_in_reply_to(etch_message* msg, etch_int64* msgid)
-{
- int result = 0;
- if (!msgid) return -1;
+ */
+int etch_message_set_in_reply_to(etch_message* msg, etch_int64* msgid) {
+ int result = 0;
+ if (!msgid)
+ return -1;
- /* msgid ownership is relinquished here even if the call fails */
- result = ((struct i_value_factory*)((etch_object*)msg->vf)->vtab)->set_in_reply_to(msg->vf, msg, msgid);
- return result;
+ /* msgid ownership is relinquished here even if the call fails */
+ result
+ = ((struct i_value_factory*) ((etch_object*) msg->vf)->vtab)->set_in_reply_to(
+ msg->vf, msg, msgid);
+ return result;
}
-
/**
- * message_size()
- */
+ * etch_message_size()
+ */
-int message_size (etch_message* msg)
-{
- return msg? structvalue_count(msg->sv): 0;
+int etch_message_size(etch_message* msg) {
+ return msg ? structvalue_count(msg->sv) : 0;
}
Modified: incubator/etch/trunk/binding-c/runtime/c/src/main/support/etch_sessionint.c
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-c/runtime/c/src/main/support/etch_sessionint.c?rev=1136323&r1=1136322&r2=1136323&view=diff
==============================================================================
--- incubator/etch/trunk/binding-c/runtime/c/src/main/support/etch_sessionint.c (original)
+++ incubator/etch/trunk/binding-c/runtime/c/src/main/support/etch_sessionint.c Thu Jun 16 08:34:21 2011
@@ -135,14 +135,14 @@ void etchsession_get_objinfo (etch_objse
if (is_etch_message (p->msg))
{
p->is_message = TRUE;
- p->msg_aname = message_aname ((etch_message*) p->msg);
+ p->msg_aname = etch_message_aname ((etch_message*) p->msg);
if (is_etch_exception(p->msg))
{ p->is_exception = TRUE;
p->exception = ((etch_exception*) p->msg);
}
else
- { p->resobj = message_get ((etch_message*) p->msg, builtins._mf_result);
+ { p->resobj = etch_message_get ((etch_message*) p->msg, builtins._mf_result);
if (is_etch_exception(p->resobj))
{ p->is_exception = TRUE;
p->exception = (etch_exception*) p->resobj;
Modified: incubator/etch/trunk/binding-c/runtime/c/src/main/support/etch_stub.c
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-c/runtime/c/src/main/support/etch_stub.c?rev=1136323&r1=1136322&r2=1136323&view=diff
==============================================================================
--- incubator/etch/trunk/binding-c/runtime/c/src/main/support/etch_stub.c (original)
+++ incubator/etch/trunk/binding-c/runtime/c/src/main/support/etch_stub.c Thu Jun 16 08:34:21 2011
@@ -278,10 +278,10 @@ int etchstub_put_resultobj (etch_stub* s
etch_field* key_result = builtins._mf_result;
/* check if the message already has a result object, i.e., an exception */
- if (message_get (replymsg, key_result))
+ if (etch_message_get (replymsg, key_result))
etch_object_destroy(resultobj); /* if so, discard the passed result */
else /* resultobj is relinquished here regardless of result */
- result = message_put (replymsg, clone_field(key_result), (etch_object*) resultobj);
+ result = etch_message_put (replymsg, clone_field(key_result), (etch_object*) resultobj);
return result;
}
@@ -305,20 +305,20 @@ int etchstub_send_reply (etch_stub* stub
* exception was thrown by the implementation, and the exception is
* therefore to be the reply. in such a case, the etch compiler generates
* a message type as newtype above, which is the second parameter to
- * message_reply(), in order that in_reply_to can be instantiated.
+ * etch_message_reply(), in order that in_reply_to can be instantiated.
* (our example below makes newtype the 1-way exception reply type in
* this case). for two-way messages, newtype, and thus the second parameter
- * to message_reply() is null.
+ * to etch_message_reply() is null.
*/
- etch_message* replymsg = message_reply (msg, newtype);
+ etch_message* replymsg = etch_message_reply (msg, newtype);
if (NULL == replymsg && is_exception_resobj)
{ newtype = builtins._mt__exception;
- replymsg = message_reply (msg, newtype);
+ replymsg = etch_message_reply (msg, newtype);
}
if (NULL == replymsg) {
- etch_type* replytype = newtype? newtype: message_type(msg);
+ etch_type* replytype = newtype? newtype: etch_message_type(msg);
char* logmask = "could not create reply message for type %s\n";
ETCH_LOG(LOG_CATEGORY, ETCH_LOG_ERROR, logmask, replytype->aname);
return -1;
@@ -589,7 +589,7 @@ int etchstub_session_message (void* data
unsigned char async_mode = 0;
/* get the message type object associated with this message */
- etch_type* thistype = message_type(msg);
+ etch_type* thistype = etch_message_type(msg);
ETCH_ASSERT(thistype);
ETCH_ASSERT(is_etch_stub(stubimpl));
Modified: incubator/etch/trunk/binding-c/runtime/c/src/main/transport/etch_messagizer.c
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-c/runtime/c/src/main/transport/etch_messagizer.c?rev=1136323&r1=1136322&r2=1136323&view=diff
==============================================================================
--- incubator/etch/trunk/binding-c/runtime/c/src/main/transport/etch_messagizer.c (original)
+++ incubator/etch/trunk/binding-c/runtime/c/src/main/transport/etch_messagizer.c Thu Jun 16 08:34:21 2011
@@ -417,7 +417,7 @@ int etch_msgizer_session_packet (void* d
*/
if (!is_message_handled) {
ETCH_LOG(LOG_CATEGORY, ETCH_LOG_DEBUG, "unable to post message to a mailbox\n");
- ETCH_LOG(LOG_CATEGORY, ETCH_LOG_DEBUG, "deferring '%s' to session\n", message_aname(msg));
+ ETCH_LOG(LOG_CATEGORY, ETCH_LOG_DEBUG, "deferring '%s' to session\n", etch_message_aname(msg));
thisx->session->session_notify(thisx->session->thisx, (etch_event*)new_unwanted_message(whofrom, msg));
//etch_object_destroy(msg);
return -1;
Modified: incubator/etch/trunk/binding-c/runtime/c/src/main/transport/etch_plain_mailbox.c
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-c/runtime/c/src/main/transport/etch_plain_mailbox.c?rev=1136323&r1=1136322&r2=1136323&view=diff
==============================================================================
--- incubator/etch/trunk/binding-c/runtime/c/src/main/transport/etch_plain_mailbox.c (original)
+++ incubator/etch/trunk/binding-c/runtime/c/src/main/transport/etch_plain_mailbox.c Thu Jun 16 08:34:21 2011
@@ -675,7 +675,7 @@ int etchmbox_close_read (void* data)
if (0 != etchmbox_read_withwait(ibox, ETCHQUEUE_CLEARING_CLOSED_QUEUE, &qitem))
break;
- msgidobj = qitem->msg? message_get_id(qitem->msg): NULL;
+ msgidobj = qitem->msg? etch_message_get_id(qitem->msg): NULL;
msgid = msgidobj? msgidobj->value: 0;
is_destroyentry = FALSE;
Modified: incubator/etch/trunk/binding-c/runtime/c/src/main/transport/etch_plain_mailbox_manager.c
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-c/runtime/c/src/main/transport/etch_plain_mailbox_manager.c?rev=1136323&r1=1136322&r2=1136323&view=diff
==============================================================================
--- incubator/etch/trunk/binding-c/runtime/c/src/main/transport/etch_plain_mailbox_manager.c (original)
+++ incubator/etch/trunk/binding-c/runtime/c/src/main/transport/etch_plain_mailbox_manager.c Thu Jun 16 08:34:21 2011
@@ -116,11 +116,11 @@ int pmboxmgr_transport_message (void* da
etch_message* msg = (etch_message*)messageData;
int result = 0;
- etch_int64* msgid = message_get_id(msg); /* expect NULL (not yet sent) */
+ etch_int64* msgid = etch_message_get_id(msg); /* expect NULL (not yet sent) */
if (NULL != msgid) return -1; /* already sent */
msgid = new_int64(etch_plain_mailbox_manager_generate_message_id()); /* assign ID to message */
- result = message_set_id(msg, msgid); /* relinquish msgid object */
+ result = etch_message_set_id(msg, msgid); /* relinquish msgid object */
if (0 == result)
result = mgr->transport->transport_message (mgr->transport->thisx, whoto, msg);
@@ -364,7 +364,7 @@ int pmboxmgr_session_message (void* data
return -1;
}
- if (NULL == (msgid = message_get_in_reply_to (msg))) /* msgid not ours */
+ if (NULL == (msgid = etch_message_get_in_reply_to (msg))) /* msgid not ours */
return session->session_message (session->thisx, whofrom, msg);
/* fyi no mailbox will exist for a one-way message */
@@ -531,13 +531,13 @@ i_session* pmboxmgr_get_session (void* d
mgr = imgr->thisx;
ETCH_ASSERT(is_etch_mailboxmgr(mgr));
- msgid = message_get_id(msg); /* expect NULL (not yet sent) */
- inreplyto = message_get_in_reply_to(msg);
+ msgid = etch_message_get_id(msg); /* expect NULL (not yet sent) */
+ inreplyto = etch_message_get_in_reply_to(msg);
if (NULL != msgid) return -1; /* already sent */
if (NULL != inreplyto) return -1; /* marked as reply */
msgid = new_int64(etch_plain_mailbox_manager_generate_message_id());
- result = message_set_id(msg, msgid); /* assign ID to message */
+ result = etch_message_set_id(msg, msgid); /* assign ID to message */
if (0 != result) return -1;
mbox = new_mailbox (imgr, msgid->value, mgr->max_delay, lifetime, MAXMESSAGES_ONE);
Modified: incubator/etch/trunk/binding-c/runtime/c/src/main/transport/etch_transport.c
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-c/runtime/c/src/main/transport/etch_transport.c?rev=1136323&r1=1136322&r2=1136323&view=diff
==============================================================================
--- incubator/etch/trunk/binding-c/runtime/c/src/main/transport/etch_transport.c (original)
+++ incubator/etch/trunk/binding-c/runtime/c/src/main/transport/etch_transport.c Thu Jun 16 08:34:21 2011
@@ -596,7 +596,7 @@ int tcpdelsvc_endcall (i_delivery_servic
*out = (etch_object*) mbe;
}
/* find the result object expected in the reply message */
- else if (NULL == (result_obj = message_get (mbe->msg, typeinfo->response_field)))
+ else if (NULL == (result_obj = etch_message_get (mbe->msg, typeinfo->response_field)))
{
etch_object_destroy(mbe);
*out = NULL;
Modified: incubator/etch/trunk/binding-c/runtime/c/src/test/message/test_binarytditdo.c
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-c/runtime/c/src/test/message/test_binarytditdo.c?rev=1136323&r1=1136322&r2=1136323&view=diff
==============================================================================
--- incubator/etch/trunk/binding-c/runtime/c/src/test/message/test_binarytditdo.c (original)
+++ incubator/etch/trunk/binding-c/runtime/c/src/test/message/test_binarytditdo.c Thu Jun 16 08:34:21 2011
@@ -789,7 +789,7 @@ static etch_object* do_tdo_tdi_test(defa
thismsg = new_message(mt_footype, ETCH_DEFSIZE, (etch_value_factory*) vf);
- result = message_put(thismsg, clone_field(mf_fookey), thisobj);
+ result = etch_message_put(thismsg, clone_field(mf_fookey), thisobj);
CU_ASSERT_EQUAL_FATAL(result, 0);
/* serialize thismsg. relinquish thismsg, assume msgbytes */
@@ -804,7 +804,7 @@ static etch_object* do_tdo_tdi_test(defa
result = structvalue_is_type(resultmsg->sv, mt_footype);
CU_ASSERT_EQUAL(result, TRUE);
- result = message_size(resultmsg);
+ result = etch_message_size(resultmsg);
CU_ASSERT_EQUAL(result, 1);
result = etchmap_map_find(resultmsg->sv->items, (etch_object*) mf_fookey, &thisitem);
@@ -819,7 +819,7 @@ static etch_object* do_tdo_tdi_test(defa
* except for the value object itself, including the key.
*/
if (result == 0)
- returnobj = message_remove(resultmsg, mf_fookey);
+ returnobj = etch_message_remove(resultmsg, mf_fookey);
etch_object_destroy(resultmsg);
clear_etchobj_static_all(thisobj); /* unprotect caller's object protected above */
@@ -1470,9 +1470,9 @@ static void test_add_perf(void)
msg = new_message(addtype, ETCH_DEFSIZE, (etch_value_factory*) vf);
CU_ASSERT_PTR_NOT_NULL_FATAL(msg);
- message_put(msg, clone_field(xfield), (etch_object*) new_int32(1)); /* relinquish all content */
- message_put(msg, clone_field(yfield), (etch_object*) new_int32(2));
- message_put(msg, clone_field(builtins._mf__message_id), (etch_object*) new_int64(0x0123456789abcdefLL));
+ etch_message_put(msg, clone_field(xfield), (etch_object*) new_int32(1)); /* relinquish all content */
+ etch_message_put(msg, clone_field(yfield), (etch_object*) new_int32(2));
+ etch_message_put(msg, clone_field(builtins._mf__message_id), (etch_object*) new_int64(0x0123456789abcdefLL));
/* we relinquish vf to the resources destructor here */
etch_resources_add(resx, ETCH_RESXKEY_MSGIZER_VALUFACT, (etch_object*) vf);
Modified: incubator/etch/trunk/binding-c/runtime/c/src/test/message/test_defvalufact.c
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-c/runtime/c/src/test/message/test_defvalufact.c?rev=1136323&r1=1136322&r2=1136323&view=diff
==============================================================================
--- incubator/etch/trunk/binding-c/runtime/c/src/test/message/test_defvalufact.c (original)
+++ incubator/etch/trunk/binding-c/runtime/c/src/test/message/test_defvalufact.c Thu Jun 16 08:34:21 2011
@@ -76,7 +76,7 @@ static int do_test_type_field(default_va
{
etch_message* msg = new_message(type, 1, (etch_value_factory*)vf);
- const int result = message_put(msg, key, value);
+ const int result = etch_message_put(msg, key, value);
etch_object_destroy(msg);
Modified: incubator/etch/trunk/binding-c/runtime/c/src/test/message/test_message.c
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-c/runtime/c/src/test/message/test_message.c?rev=1136323&r1=1136322&r2=1136323&view=diff
==============================================================================
--- incubator/etch/trunk/binding-c/runtime/c/src/test/message/test_message.c (original)
+++ incubator/etch/trunk/binding-c/runtime/c/src/test/message/test_message.c Thu Jun 16 08:34:21 2011
@@ -208,7 +208,7 @@ static etch_int64* fvf_get_message_id (v
etch_int64* id = NULL;
fake_vf_impl* data = (fake_vf_impl*) vf->impl;
- id = (etch_int64*) message_get(msg, data->mf_message_id);
+ id = (etch_int64*) etch_message_get(msg, data->mf_message_id);
/* return (etch_int64*) verifyx((etch_object*) id, 0,
CLASSID_PRIMITIVE_INT64, EXCPTYPE_INTERNALERR); */
@@ -226,7 +226,7 @@ static int fvf_set_message_id (void* vfD
fake_vf_impl* data = (fake_vf_impl*) vf->impl;
etch_field* keycopy = (etch_field*)etch_object_clone_func(data->mf_message_id);
- const int result = message_put(msg, keycopy, (etch_object*) id);
+ const int result = etch_message_put(msg, keycopy, (etch_object*) id);
return result;
}
@@ -240,7 +240,7 @@ static etch_int64* fvf_get_in_reply_to (
etch_int64* id = NULL;
fake_vf_impl* data = (fake_vf_impl*) vf->impl;
- id = (etch_int64*) message_get(msg, data->mf_in_reply_to);
+ id = (etch_int64*) etch_message_get(msg, data->mf_in_reply_to);
return id;
}
@@ -258,7 +258,7 @@ static int fvf_set_in_reply_to (void* vf
/* FYI this copy of the key is put to etch_message* sent message, and gets
* freed in msg.destroy(), message owns memory other than vf and type
*/
- return message_put(msg, keycopy, (etch_object*) id);
+ return etch_message_put(msg, keycopy, (etch_object*) id);
}
/*
@@ -1017,7 +1017,7 @@ static int run_iterator_test(etch_messag
{
testcount++;
- result = message_put(msg, iterator->current_key, iterator->current_value);
+ result = etch_message_put(msg, iterator->current_key, iterator->current_value);
CU_ASSERT_EQUAL(result,0);
@@ -1125,12 +1125,12 @@ static void reply_test(void)
msg = new_message (data->mt1, 0, vf); /* message owns neither arg */
- result = message_set_id(msg, (etch_int64*)etch_object_clone_func(id_original));
+ result = etch_message_set_id(msg, (etch_int64*)etch_object_clone_func(id_original));
CU_ASSERT_EQUAL_FATAL(result,0);
replytype = data->rmt; /* again, a message does not own a type */
- newmsg = message_reply (msg, replytype);
+ newmsg = etch_message_reply (msg, replytype);
CU_ASSERT_PTR_NOT_NULL_FATAL(newmsg);
CU_ASSERT_FALSE_FATAL(is_etch_exception(newmsg));
@@ -1139,7 +1139,7 @@ static void reply_test(void)
CU_ASSERT_TRUE(result);
CU_ASSERT_EQUAL(vf, newmsg->vf);
- id_replied_to = message_get_in_reply_to(newmsg);
+ id_replied_to = etch_message_get_in_reply_to(newmsg);
CU_ASSERT_PTR_NOT_NULL_FATAL(id_replied_to);
CU_ASSERT_FALSE_FATAL(is_etch_exception(id_replied_to));
@@ -1192,7 +1192,7 @@ static void run_exception_test(const int
}
}
- msg = message_read(NULL); /* pass NULL for TDI */
+ msg = etch_message_read(NULL); /* pass NULL for TDI */
CU_ASSERT_PTR_NOT_NULL_FATAL(msg);
CU_ASSERT_TRUE(is_exception(msg));
excp = get_exception(msg);
Modified: incubator/etch/trunk/binding-c/runtime/c/src/test/transport/test_mailboxmgr.c
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-c/runtime/c/src/test/transport/test_mailboxmgr.c?rev=1136323&r1=1136322&r2=1136323&view=diff
==============================================================================
--- incubator/etch/trunk/binding-c/runtime/c/src/test/transport/test_mailboxmgr.c (original)
+++ incubator/etch/trunk/binding-c/runtime/c/src/test/transport/test_mailboxmgr.c Thu Jun 16 08:34:21 2011
@@ -1023,9 +1023,9 @@ static void test_transport_message_1(voi
addmsg = new_add_message();
CU_ASSERT_PTR_NOT_NULL_FATAL(addmsg);
- addmsg_id = message_get_id(addmsg);
+ addmsg_id = etch_message_get_id(addmsg);
CU_ASSERT_PTR_NULL(addmsg_id);
- addmsg_inreplyto = message_get_in_reply_to(addmsg);
+ addmsg_inreplyto = etch_message_get_in_reply_to(addmsg);
CU_ASSERT_PTR_NULL(addmsg_inreplyto);
result = g_manager->transport_message(g_manager, g_who1, addmsg);
@@ -1035,9 +1035,9 @@ static void test_transport_message_1(voi
CU_ASSERT_EQUAL(my_transport_impl->recipient, g_who1);
CU_ASSERT_PTR_EQUAL(my_transport_impl->msg, addmsg);
- addmsg_id = message_get_id(addmsg);
+ addmsg_id = etch_message_get_id(addmsg);
CU_ASSERT_PTR_NOT_NULL(addmsg_id);
- addmsg_inreplyto = message_get_in_reply_to(addmsg);
+ addmsg_inreplyto = etch_message_get_in_reply_to(addmsg);
CU_ASSERT_PTR_NULL(addmsg_inreplyto);
mailbox = pmboxmgr_get_mailbox(g_manager, addmsg_id);
@@ -1087,12 +1087,12 @@ static void test_transport_message_2(voi
add_resultmsg = new_add_result_message();
CU_ASSERT_PTR_NOT_NULL_FATAL(add_resultmsg);
- add_resultmsg_id = message_get_id(add_resultmsg);
+ add_resultmsg_id = etch_message_get_id(add_resultmsg);
CU_ASSERT_PTR_NULL(add_resultmsg_id);
- add_resultmsg_inreplyto = message_get_in_reply_to(add_resultmsg);
+ add_resultmsg_inreplyto = etch_message_get_in_reply_to(add_resultmsg);
CU_ASSERT_PTR_NULL(add_resultmsg_inreplyto);
- result = message_set_in_reply_to(add_resultmsg, new_int64(THISTESTID));
+ result = etch_message_set_in_reply_to(add_resultmsg, new_int64(THISTESTID));
CU_ASSERT_EQUAL(result, 0);
result = g_manager->transport_message(g_manager, g_who1, add_resultmsg);
@@ -1101,9 +1101,9 @@ static void test_transport_message_2(voi
CU_ASSERT_EQUAL(my_transport_impl->recipient, g_who1);
CU_ASSERT_PTR_EQUAL(my_transport_impl->msg, add_resultmsg);
- add_resultmsg_id = message_get_id(add_resultmsg);
+ add_resultmsg_id = etch_message_get_id(add_resultmsg);
CU_ASSERT_PTR_NOT_NULL(add_resultmsg_id);
- add_resultmsg_inreplyto = message_get_in_reply_to(add_resultmsg);
+ add_resultmsg_inreplyto = etch_message_get_in_reply_to(add_resultmsg);
CU_ASSERT_PTR_NOT_NULL(add_resultmsg_inreplyto);
if (add_resultmsg_inreplyto)
{ CU_ASSERT_EQUAL(add_resultmsg_inreplyto->value, THISTESTID);
@@ -1156,11 +1156,11 @@ static void test_transport_message_3(voi
addmsg = new_add_message();
CU_ASSERT_PTR_NOT_NULL_FATAL(addmsg);
- addmsg_id = message_get_id(addmsg);
+ addmsg_id = etch_message_get_id(addmsg);
CU_ASSERT_PTR_NULL(addmsg_id);
- result = message_set_id(addmsg, new_int64(THISTESTID));
+ result = etch_message_set_id(addmsg, new_int64(THISTESTID));
CU_ASSERT_EQUAL(result, 0);
- addmsg_id = message_get_id(addmsg);
+ addmsg_id = etch_message_get_id(addmsg);
CU_ASSERT_PTR_NOT_NULL_FATAL(addmsg_id);
result = g_manager->transport_message(g_manager, g_who1, addmsg);
@@ -1219,9 +1219,9 @@ static void test_transport_call_1(void)
result = pmboxmgr_size(g_manager);
CU_ASSERT_EQUAL(result, 1);
- addmsg_id = message_get_id(addmsg);
+ addmsg_id = etch_message_get_id(addmsg);
CU_ASSERT_PTR_NOT_NULL(addmsg_id);
- addmsg_inreplyto = message_get_in_reply_to(addmsg);
+ addmsg_inreplyto = etch_message_get_in_reply_to(addmsg);
CU_ASSERT_PTR_NULL(addmsg_inreplyto);
got_mailbox = pmboxmgr_get_mailbox(g_manager, addmsg_id);
@@ -1294,9 +1294,9 @@ static void test_transport_call_2(void)
result = pmboxmgr_size(g_manager);
CU_ASSERT_EQUAL(result, 1);
- addmsg_id = message_get_id(addmsg);
+ addmsg_id = etch_message_get_id(addmsg);
CU_ASSERT_PTR_NOT_NULL(addmsg_id);
- addmsg_inreplyto = message_get_in_reply_to(addmsg);
+ addmsg_inreplyto = etch_message_get_in_reply_to(addmsg);
CU_ASSERT_PTR_NULL(addmsg_inreplyto);
got_mailbox = pmboxmgr_get_mailbox(g_manager, addmsg_id);
@@ -1347,7 +1347,7 @@ static void test_transport_call_3(void)
etch_message* addmsg = new_add_message();
CU_ASSERT_PTR_NOT_NULL_FATAL(addmsg);
- result = message_set_id(addmsg, new_int64(1)); /* set ID essentially marking message sent */
+ result = etch_message_set_id(addmsg, new_int64(1)); /* set ID essentially marking message sent */
CU_ASSERT_EQUAL(result, 0);
result = g_manager->transport_call(g_manager->imanager, g_who1, addmsg, &mailbox);
@@ -1357,7 +1357,7 @@ static void test_transport_call_3(void)
result = pmboxmgr_size(g_manager);
CU_ASSERT_EQUAL(result, 0);
- addmsg_id = message_get_id(addmsg);
+ addmsg_id = etch_message_get_id(addmsg);
CU_ASSERT_PTR_NOT_NULL_FATAL(addmsg_id);
mailbox = pmboxmgr_get_mailbox(g_manager, addmsg_id);
CU_ASSERT_PTR_NULL(mailbox); /* no mailbox should have been created */
@@ -1389,7 +1389,7 @@ static void test_transport_call_4(void)
{ int result = 0;
etch_message* addresultmsg = new_add_result_message();
CU_ASSERT_PTR_NOT_NULL_FATAL(addresultmsg);
- result = message_set_in_reply_to(addresultmsg, new_int64(1)); /* set in reply to ID */
+ result = etch_message_set_in_reply_to(addresultmsg, new_int64(1)); /* set in reply to ID */
CU_ASSERT_EQUAL(result, 0);
result = g_manager->transport_call(g_manager->imanager, g_who1, addresultmsg, NULL);
@@ -1523,7 +1523,7 @@ static void test_session_message_3(void)
etch_message* addresultmsg = new_add_result_message();
/* no mailbox should be found for this reply to ID */
- message_set_in_reply_to(addresultmsg, new_int64(1));
+ etch_message_set_in_reply_to(addresultmsg, new_int64(1));
my_sessionimpl->is_msg_handled = TRUE;
@@ -1586,7 +1586,7 @@ static void test_session_message_5(void)
result = pmboxmgr_size(g_manager);
CU_ASSERT_EQUAL(result, 1);
- msgid = message_get_id(addmsg);
+ msgid = etch_message_get_id(addmsg);
CU_ASSERT_PTR_NOT_NULL_FATAL(msgid);
got_mailbox = pmboxmgr_get_mailbox(g_manager, msgid);
CU_ASSERT_PTR_EQUAL(got_mailbox, mailbox);
@@ -1596,7 +1596,7 @@ static void test_session_message_5(void)
mt_add_result = get_add_result_type();
/* construct a reply message */
- replymsg = message_reply(addmsg, mt_add_result);
+ replymsg = etch_message_reply(addmsg, mt_add_result);
result = is_etch_exception(replymsg);
CU_ASSERT_EQUAL_FATAL(result, FALSE);
my_sessionimpl->what = WHAT_NONE;
@@ -1683,7 +1683,7 @@ static void test_session_message_6(void)
result = pmboxmgr_size(g_manager);
CU_ASSERT_EQUAL(result, 1);
- msgid = message_get_id(addmsg);
+ msgid = etch_message_get_id(addmsg);
CU_ASSERT_PTR_NOT_NULL_FATAL(msgid);
got_mailbox = pmboxmgr_get_mailbox(g_manager, msgid);
CU_ASSERT_PTR_EQUAL(got_mailbox, mailbox);
@@ -1696,7 +1696,7 @@ static void test_session_message_6(void)
/* construct a reply message */
mt_add_result = get_add_result_type();
- replymsg = message_reply(addmsg, mt_add_result);
+ replymsg = etch_message_reply(addmsg, mt_add_result);
result = is_etch_exception(replymsg);
CU_ASSERT_EQUAL_FATAL(result, FALSE);
my_sessionimpl->what = WHAT_NONE;
Modified: incubator/etch/trunk/binding-c/runtime/c/src/test/transport/test_messagizer.c
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-c/runtime/c/src/test/transport/test_messagizer.c?rev=1136323&r1=1136322&r2=1136323&view=diff
==============================================================================
--- incubator/etch/trunk/binding-c/runtime/c/src/test/transport/test_messagizer.c (original)
+++ incubator/etch/trunk/binding-c/runtime/c/src/test/transport/test_messagizer.c Thu Jun 16 08:34:21 2011
@@ -1175,10 +1175,10 @@ static void test_packet_1(void)
CU_ASSERT_EQUAL(my_session->what, SESSION_MESSAGE);
result = is_equal_who(my_session->sender, g_who);
CU_ASSERT_EQUAL(result, TRUE);
- CU_ASSERT_EQUAL(message_size(my_session->msg), 0);
+ CU_ASSERT_EQUAL(etch_message_size(my_session->msg), 0);
CU_ASSERT_PTR_NULL(my_session->eventx);
/* assert that message type is "add" (since we buffered FAKEID_TYPE_ADD above) */
- msgtype = message_type(my_session->msg);
+ msgtype = etch_message_type(my_session->msg);
CU_ASSERT_PTR_NOT_NULL_FATAL(msgtype);
CU_ASSERT_EQUAL(msgtype->id, FAKEID_TYPE_ADD);
@@ -1235,7 +1235,7 @@ static void test_packet_2(void)
if (-1 != result) break;
CU_ASSERT_EQUAL(my_session->what, SESSION_NOTIFY);
- CU_ASSERT_EQUAL(message_size(my_session->msg), 0);
+ CU_ASSERT_EQUAL(etch_message_size(my_session->msg), 0);
CU_ASSERT_PTR_NOT_NULL_FATAL(my_session->eventx);
@@ -1250,7 +1250,7 @@ static void test_packet_2(void)
CU_ASSERT_PTR_NOT_NULL_FATAL(thismessage);
/* assert that message type is "add" (since we buffered FAKEID_TYPE_ADD above) */
- msgtype = message_type(thismessage);
+ msgtype = etch_message_type(thismessage);
CU_ASSERT_PTR_NOT_NULL_FATAL(msgtype);
CU_ASSERT_EQUAL(msgtype->id, FAKEID_TYPE_ADD);
@@ -1303,11 +1303,11 @@ static void test_packet_3(void)
if (0 != result) break;
CU_ASSERT_EQUAL(my_session->what, SESSION_MESSAGE);
- CU_ASSERT_EQUAL(message_size(my_session->msg), 0);
+ CU_ASSERT_EQUAL(etch_message_size(my_session->msg), 0);
/* assert that message type is "add_result" (since we buffered FAKEID_TYPE_ADD_RESULT above) */
CU_ASSERT_PTR_NOT_NULL_FATAL(my_session->msg);
- msgtype = message_type(my_session->msg);
+ msgtype = etch_message_type(my_session->msg);
CU_ASSERT_PTR_NOT_NULL_FATAL(msgtype);
CU_ASSERT_EQUAL(msgtype->id, FAKEID_TYPE_ADD_RESULT);
Modified: incubator/etch/trunk/binding-c/runtime/c/src/test/transport/test_plainmailbox.c
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-c/runtime/c/src/test/transport/test_plainmailbox.c?rev=1136323&r1=1136322&r2=1136323&view=diff
==============================================================================
--- incubator/etch/trunk/binding-c/runtime/c/src/test/transport/test_plainmailbox.c (original)
+++ incubator/etch/trunk/binding-c/runtime/c/src/test/transport/test_plainmailbox.c Thu Jun 16 08:34:21 2011
@@ -581,7 +581,7 @@ static void test_closedelivery2(void)
do
{ etch_plainmailbox* mbox = new_mailbox (g_manager->imanager, 1, -1, 0, 2);
etch_message *mymessage1 = new_message(g_type1, 0, (etch_value_factory*) g_vf);
- message_set_id(mymessage1, new_int64(1));
+ etch_message_set_id(mymessage1, new_int64(1));
check_deliver(mbox, TRUE, g_who1, mymessage1);
check_mailbox(mbox, FALSE, FALSE, FALSE, FALSE, 0);
@@ -832,7 +832,7 @@ static void test_notify4(void)
check_mailbox_status(FALSE, NULL, NULL, FALSE);
mymessage = new_message(g_type1, 0, (etch_value_factory*) g_vf);
- message_set_id(mymessage, new_int64(MYMSGID));
+ etch_message_set_id(mymessage, new_int64(MYMSGID));
printf("\n");
/* relinquish message on successful queue of message to mailbox, retain message
@@ -879,7 +879,7 @@ static void test_read1(void)
etch_plainmailbox* mbox = new_mailbox (g_manager->imanager, 1, -1, 0, 2);
check_mailbox(mbox, TRUE, FALSE, FALSE, FALSE, 0);
mymessage = new_message(g_type1, 0, (etch_value_factory*) g_vf);
- message_set_id(mymessage, new_int64(MYMSGID));
+ etch_message_set_id(mymessage, new_int64(MYMSGID));
check_deliver(mbox, TRUE, g_who2, mymessage);
check_mailbox(mbox, FALSE, FALSE, FALSE, FALSE, 0);
@@ -919,7 +919,7 @@ static void test_read2(void)
etch_plainmailbox* mbox = new_mailbox (g_manager->imanager, 1, -1, 0, 2);
check_mailbox(mbox, TRUE, FALSE, FALSE, FALSE, 0);
mymessage = new_message(g_type1, 0, (etch_value_factory*) g_vf);
- message_set_id(mymessage, new_int64(MYMSGID));
+ etch_message_set_id(mymessage, new_int64(MYMSGID));
check_deliver(mbox, TRUE, g_who2, mymessage);
check_mailbox(mbox, FALSE, FALSE, FALSE, FALSE, 0);
@@ -1110,7 +1110,7 @@ static void test_closeread2(void)
do
{ etch_plainmailbox* mbox = new_mailbox (g_manager->imanager, 1, -1, 0, 2);
etch_message *mymessage1 = new_message(g_type1, 0, (etch_value_factory*) g_vf);
- message_set_id(mymessage1, new_int64(1));
+ etch_message_set_id(mymessage1, new_int64(1));
#if IS_DEBUG_CONSOLE
printf("\n");
#endif
@@ -1180,7 +1180,7 @@ static void test_closeread4(void)
do
{ etch_plainmailbox* mbox = new_mailbox (g_manager->imanager, 1, -1, 0, 2);
etch_message *mymessage1 = new_message(g_type1, 0, (etch_value_factory*) g_vf);
- message_set_id(mymessage1, new_int64(1));
+ etch_message_set_id(mymessage1, new_int64(1));
#if IS_DEBUG_CONSOLE
printf("\n");
#endif
@@ -1223,8 +1223,8 @@ static void test_full1(void)
etch_plainmailbox* mbox = new_mailbox (g_manager->imanager, 1, -1, 0, CAPACITY_2);
etch_message *mymessage1 = new_message(g_type1, 0, (etch_value_factory*) g_vf);
etch_message *mymessage2 = new_message(g_type2, 0, (etch_value_factory*) g_vf);
- message_set_id(mymessage1, new_int64(1));
- message_set_id(mymessage2, new_int64(2));
+ etch_message_set_id(mymessage1, new_int64(1));
+ etch_message_set_id(mymessage2, new_int64(2));
#if IS_DEBUG_CONSOLE
printf("\n");
#endif
@@ -1264,8 +1264,8 @@ static void test_full2(void)
etch_plainmailbox* mbox = new_mailbox (g_manager->imanager, 1, -1, 0, CAPACITY_2);
etch_message *mymessage1 = new_message(g_type1, 0, (etch_value_factory*) g_vf);
etch_message *mymessage2 = new_message(g_type2, 0, (etch_value_factory*) g_vf);
- message_set_id(mymessage1, new_int64(1));
- message_set_id(mymessage2, new_int64(2));
+ etch_message_set_id(mymessage1, new_int64(1));
+ etch_message_set_id(mymessage2, new_int64(2));
#if IS_DEBUG_CONSOLE
printf("\n");
#endif
Modified: incubator/etch/trunk/examples/helloworld/src/main/c/helloworld_server_impl.c
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/examples/helloworld/src/main/c/helloworld_server_impl.c?rev=1136323&r1=1136322&r2=1136323&view=diff
==============================================================================
--- incubator/etch/trunk/examples/helloworld/src/main/c/helloworld_server_impl.c (original)
+++ incubator/etch/trunk/examples/helloworld/src/main/c/helloworld_server_impl.c Thu Jun 16 08:34:21 2011
@@ -100,7 +100,7 @@ etch_string* say_hello_impl(void* thisx,
int len = (6 + wcslen(to_whom->name->v.valw) + 1);
wchar_t* retw = (wchar_t*) malloc(len * sizeof(wchar_t));
etch_string* ret = NULL;
- etch_snwprintf(retw, len, L"Hello %s", to_whom->name->v.valw);
+ etch_snwprintf(retw, len, L"Hello %S\n", to_whom->name->v.valw);
ret = new_stringw(retw);
etch_object_destroy(to_whom);
free(retw);