You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@etch.apache.org by gr...@apache.org on 2010/09/24 08:48:38 UTC
svn commit: r1000736 - in
/incubator/etch/trunk/examples/helloworld/src/main: c/
csharp/org.apache.etch.examples.helloworld/
java/org/apache/etch/examples/helloworld/
Author: grandyho
Date: Fri Sep 24 06:48:37 2010
New Revision: 1000736
URL: http://svn.apache.org/viewvc?rev=1000736&view=rev
Log:
ETCH-91
unified behavior of all helloworld implementations
Modified:
incubator/etch/trunk/examples/helloworld/src/main/c/helloworld_client_main.c
incubator/etch/trunk/examples/helloworld/src/main/c/helloworld_server_impl.c
incubator/etch/trunk/examples/helloworld/src/main/csharp/org.apache.etch.examples.helloworld/MainHelloWorldClient.cs
incubator/etch/trunk/examples/helloworld/src/main/java/org/apache/etch/examples/helloworld/MainHelloWorldClient.java
Modified: incubator/etch/trunk/examples/helloworld/src/main/c/helloworld_client_main.c
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/examples/helloworld/src/main/c/helloworld_client_main.c?rev=1000736&r1=1000735&r2=1000736&view=diff
==============================================================================
--- incubator/etch/trunk/examples/helloworld/src/main/c/helloworld_client_main.c (original)
+++ incubator/etch/trunk/examples/helloworld/src/main/c/helloworld_client_main.c Fri Sep 24 06:48:37 2010
@@ -87,10 +87,10 @@ int main(int argc, char* argv[])
}
user = new_helloworld_user();
- user->id = 51;
- user->name = new_stringw(L"Test");
+ user->id = 5;
+ user->name = new_stringw(L"User");
result = remote->say_hello(remote, user);
- wprintf(L"%s\n",result->v.valw);
+ printf("%S\n",result->v.valw);
// wait for keypress
waitkey();
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=1000736&r1=1000735&r2=1000736&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 Fri Sep 24 06:48:37 2010
@@ -102,6 +102,10 @@ int destroy_helloworld_server_implx(void
*/
etch_string* say_hello_impl(void* thisx, helloworld_user* to_whom){
- etch_string* ret = new_stringw(L"Hello World from C Binding!");
+ 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);
+ ret = new_stringw(retw);
return ret;
}
Modified: incubator/etch/trunk/examples/helloworld/src/main/csharp/org.apache.etch.examples.helloworld/MainHelloWorldClient.cs
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/examples/helloworld/src/main/csharp/org.apache.etch.examples.helloworld/MainHelloWorldClient.cs?rev=1000736&r1=1000735&r2=1000736&view=diff
==============================================================================
--- incubator/etch/trunk/examples/helloworld/src/main/csharp/org.apache.etch.examples.helloworld/MainHelloWorldClient.cs (original)
+++ incubator/etch/trunk/examples/helloworld/src/main/csharp/org.apache.etch.examples.helloworld/MainHelloWorldClient.cs Fri Sep 24 06:48:37 2010
@@ -37,7 +37,7 @@ namespace org.apache.etch.examples.hello
// Connect to the service
server._StartAndWaitUp( 4000 );
- org.apache.etch.examples.helloworld.types.HelloWorld.user theUser = new user(15,"Test");
+ org.apache.etch.examples.helloworld.types.HelloWorld.user theUser = new user(5,"User");
string s = server.say_hello(theUser);
Console.Write(s);
Modified: incubator/etch/trunk/examples/helloworld/src/main/java/org/apache/etch/examples/helloworld/MainHelloWorldClient.java
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/examples/helloworld/src/main/java/org/apache/etch/examples/helloworld/MainHelloWorldClient.java?rev=1000736&r1=1000735&r2=1000736&view=diff
==============================================================================
--- incubator/etch/trunk/examples/helloworld/src/main/java/org/apache/etch/examples/helloworld/MainHelloWorldClient.java (original)
+++ incubator/etch/trunk/examples/helloworld/src/main/java/org/apache/etch/examples/helloworld/MainHelloWorldClient.java Fri Sep 24 06:48:37 2010
@@ -53,7 +53,7 @@ public class MainHelloWorldClient implem
// Connect to the service
server._startAndWaitUp( 4000 );
- user u = new user(5, "Testuser");
+ user u = new user(5, "User");
System.out.println(server.say_hello(u));
// Disconnect from the service