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

Side by Side Diff: tests/contest_issues/issue52.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/autoloader/autoloader_default.c ('k') | tests/contest_issues/issue55.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::sssssssssssssssssssssssssssssssssssssssss" 44 { "helloworld::sssssssssssssssssssssssssssssssssssssssss"
45 "sssssssssssssssssssssssssssssssssssssssssssssssssssss" 45 "sssssssssssssssssssssssssssssssssssssssssssssssssssss"
46 "sssssssssssssssssssssssssssssssssssssssssssssssssssss" 46 "sssssssssssssssssssssssssssssssssssssssssssssssssssss"
47 "sssssssssssssssssssssssssssssssssssssssssssssssssssss", 47 "sssssssssssssssssssssssssssssssssssssssssssssssssssss",
48 HelloWorld }, 48 HelloWorld },
49 { NULL, NULL }, 49 { NULL, NULL },
50 }; 50 };
51 51
52 int main() { 52 int main() {
53 if (!NaClSrpcModuleInit()) { 53 if (!NaClSrpcModuleInit()) {
54 return 1; 54 return 1;
55 } 55 }
56 if (!NaClSrpcAcceptClientConnection(srpc_methods)) { 56 if (!NaClSrpcAcceptClientConnection(srpc_methods)) {
57 return 1; 57 return 1;
58 } 58 }
59 NaClSrpcModuleFini(); 59 NaClSrpcModuleFini();
60 return 0; 60 return 0;
61 } 61 }
OLDNEW
« no previous file with comments | « tests/autoloader/autoloader_default.c ('k') | tests/contest_issues/issue55.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698