Chromium Code Reviews| Index: native_client_sdk/src/examples/getting_started/simple_hello_world/hello_world.c |
| diff --git a/native_client_sdk/src/examples/getting_started/simple_hello_world/hello_world.c b/native_client_sdk/src/examples/getting_started/simple_hello_world/hello_world.c |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..9fafc69e6f7ffe7097ac33692c5643619b27033b |
| --- /dev/null |
| +++ b/native_client_sdk/src/examples/getting_started/simple_hello_world/hello_world.c |
| @@ -0,0 +1,28 @@ |
| +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| + * Use of this source code is governed by a BSD-style license that can be |
| + * found in the LICENSE file. |
| + */ |
| + |
| +#include <stdio.h> |
| +#include <string.h> |
| + |
| +#include "ppapi/c/ppb_var.h" |
| +#include "ppapi/c/ppb_messaging.h" |
| +#include "ppapi/c/ppb_console.h" |
| + |
| +#include "ppapi_simple/ppapi_simple_main.h" |
| + |
| + |
| +int example_main(int argc, const char* argv[]) { |
| + // Use PostMessage to send "Hello World" to JavaScript. |
|
nfullagar1
2013/05/30 18:04:52
/* */ style comments for c files?
noelallen1
2013/05/30 21:01:44
Done.
|
| + printf("Hello World STDOUT.\n"); |
| + |
| + // Use PPAPI Console interface to send "Hello World" to the |
| + // JavaScript Console. |
| + fprintf(stderr, "Hello World STDERR.\n"); |
| + return 0; |
| +} |
| + |
| +// Regsiter the function to call once the Instance Object is initialized. |
|
binji
2013/05/30 05:07:50
sp: Register
noelallen1
2013/05/30 18:07:19
Done.
|
| +// see: pappi_simple/ppapi_simple_main.h |
|
binji
2013/05/30 05:07:50
ps_main.h
noelallen1
2013/05/30 18:07:19
Done.
|
| +PPAPI_SIMPLE_REGISTER_MAIN(example_main) |