Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / native_client_sdk / src / libraries / ppapi_simple / ps_main.h
blob2ffcccd47ea35f75ac23b18914fbfd735bc0d7be
1 /* Copyright 2012 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. */
5 #ifndef PPAPI_SIMPLE_PS_MAIN_H_
6 #define PPAPI_SIMPLE_PS_MAIN_H_
8 #include "ppapi_simple/ps.h"
9 #include "ppapi_simple/ps_event.h"
11 EXTERN_C_BEGIN
13 typedef int (*PSMainFunc_t)(int argc, char *argv[]);
15 /**
16 * PSUserMainGet
18 * Prototype for the user provided function which retrieves the user's main
19 * function.
20 * This is normally defined using the PPAPI_SIMPLE_REGISTER_MAIN macro.
22 PSMainFunc_t PSUserMainGet();
24 /**
25 * PPAPI_SIMPLE_REGISTER_MAIN
27 * Constructs a PSInstance object and configures it to use call the provided
28 * 'main' function on its own thread once initialization is complete.
30 * The ps_entrypoint_*.o and ps_main.o objects will not be linked by default,
31 * so we force them to be linked here.
33 #define PPAPI_SIMPLE_REGISTER_MAIN(main_func) \
34 EXTERN_C_BEGIN \
35 FORCE_LINK_THAT(ps_entry) \
36 FORCE_LINK_THAT(ps_main) \
37 EXTERN_C_END \
38 PSMainFunc_t PSUserMainGet() { return main_func; }
40 EXTERN_C_END
42 #endif /* PPAPI_SIMPLE_PS_MAIN_H_ */