hello_world.c revision 5d1f7b1de12d16ceb2c938c56701a3e8bfa558f7
1/* Copyright (c) 2013 The Chromium Authors. All rights reserved. 2 * Use of this source code is governed by a BSD-style license that can be 3 * found in the LICENSE file. 4 */ 5 6#include <stdio.h> 7#include <string.h> 8 9#include "ppapi_simple/ps_main.h" 10 11#ifdef SEL_LDR 12#define example_main main 13#endif 14 15int example_main(int argc, char* argv[]) { 16 /* Use ppb_messaging to send "Hello World" to JavaScript. */ 17 printf("Hello World STDOUT.\n"); 18 19 /* Use ppb_console send "Hello World" to the JavaScript Console. */ 20 fprintf(stderr, "Hello World STDERR.\n"); 21 return 0; 22} 23 24/* 25 * Register the function to call once the Instance Object is initialized. 26 * see: pappi_simple/ps_main.h 27 * 28 * This is not needed when building the sel_ldr version of this example 29 * which does not link against ppapi_simple. 30 */ 31#ifndef SEL_LDR 32PPAPI_SIMPLE_REGISTER_MAIN(example_main) 33#endif 34