Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(661)

Side by Side Diff: tests/contest_issues/issue55.c

Issue 5622003: Restructure the structs/unions involved in SRPC argument passing. This will... (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client/
Patch Set: '' Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tests/contest_issues/issue52.c ('k') | tests/contest_issues/issue63.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2008 The Native Client Authors. All rights reserved. 2 * Copyright 2008 The Native Client Authors. All rights reserved.
3 * Use of this source code is governed by a BSD-style license that can 3 * Use of this source code is governed by a BSD-style license that can
4 * be found in the LICENSE file. 4 * be found in the LICENSE file.
5 */ 5 */
6 6
7 /* 7 /*
8 * Simple test for simple rpc. 8 * Simple test for simple rpc.
9 */ 9 */
10 10
(...skipping 16 matching lines...) Expand all
27 /* 27 /*
28 * Return a clever string. 28 * Return a clever string.
29 */ 29 */
30 void HelloWorld(NaClSrpcRpc *rpc, 30 void HelloWorld(NaClSrpcRpc *rpc,
31 NaClSrpcArg **in_args, 31 NaClSrpcArg **in_args,
32 NaClSrpcArg **out_args, 32 NaClSrpcArg **out_args,
33 NaClSrpcClosure *done) { 33 NaClSrpcClosure *done) {
34 /* 34 /*
35 * Strdup must be used because the SRPC layer frees the string passed to it. 35 * Strdup must be used because the SRPC layer frees the string passed to it.
36 */ 36 */
37 out_args[0]->u.sval.str = strdup("hello, world."); 37 out_args[0]->arrays.str = strdup("hello, world.");
38 rpc->result = NACL_SRPC_RESULT_OK; 38 rpc->result = NACL_SRPC_RESULT_OK;
39 done->Run(done); 39 done->Run(done);
40 } 40 }
41 41
42 const struct NaClSrpcHandlerDesc srpc_methods[] = { 42 const struct NaClSrpcHandlerDesc srpc_methods[] = {
43 { "fortytwo::i", FortyTwo }, 43 { "fortytwo::i", FortyTwo },
44 { "helloworld:I:s", HelloWorld }, 44 { "helloworld:I:s", HelloWorld },
45 { NULL, NULL }, 45 { NULL, NULL },
46 }; 46 };
47 47
48 int main() { 48 int main() {
49 if (!NaClSrpcModuleInit()) { 49 if (!NaClSrpcModuleInit()) {
50 return 1; 50 return 1;
51 } 51 }
52 if (!NaClSrpcAcceptClientConnection(srpc_methods)) { 52 if (!NaClSrpcAcceptClientConnection(srpc_methods)) {
53 return 1; 53 return 1;
54 } 54 }
55 NaClSrpcModuleFini(); 55 NaClSrpcModuleFini();
56 return 0; 56 return 0;
57 } 57 }
OLDNEW
« no previous file with comments | « tests/contest_issues/issue52.c ('k') | tests/contest_issues/issue63.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698