| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef PPAPI_MAIN_PPAPI_MAIN_H_ | 5 #ifndef PPAPI_MAIN_PPAPI_MAIN_H_ |
| 6 #define PPAPI_MAIN_PPAPI_MAIN_H_ | 6 #define PPAPI_MAIN_PPAPI_MAIN_H_ |
| 7 | 7 |
| 8 #include "ppapi/c/pp_instance.h" | 8 #include "ppapi/c/pp_instance.h" |
| 9 #include "ppapi/c/pp_module.h" | 9 #include "ppapi/c/pp_module.h" |
| 10 #include "utils/macros.h" | 10 #include "utils/macros.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 | 23 |
| 24 // Provided by library for basic instance types | 24 // Provided by library for basic instance types |
| 25 void* PPAPI_CreateInstance(PP_Instance inst, const char *args[]); | 25 void* PPAPI_CreateInstance(PP_Instance inst, const char *args[]); |
| 26 void* PPAPI_CreateInstance2D(PP_Instance inst, const char *args[]); | 26 void* PPAPI_CreateInstance2D(PP_Instance inst, const char *args[]); |
| 27 void* PPAPI_CreateInstance3D(PP_Instance inst, const char *args[]); | 27 void* PPAPI_CreateInstance3D(PP_Instance inst, const char *args[]); |
| 28 | 28 |
| 29 EXTERN_C_END | 29 EXTERN_C_END |
| 30 | 30 |
| 31 #define PPAPI_MAIN_DEFAULT_ARGS \ | 31 #define PPAPI_MAIN_DEFAULT_ARGS \ |
| 32 { \ | 32 { \ |
| 33 "PM_STDIN", "/dev/tty", \ | 33 "PM_STDIN", "/dev/null", \ |
| 34 "PM_STDIO", "/dev/console0", \ | 34 "PM_STDIO", "/dev/console0", \ |
| 35 "PM_STDERR", "/dev/console3", \ | 35 "PM_STDERR", "/dev/console3", \ |
| 36 NULL, NULL \ | 36 NULL, NULL \ |
| 37 } | 37 } |
| 38 | 38 |
| 39 | 39 |
| 40 #define PPAPI_MAIN_USE(factory, args) \ | 40 #define PPAPI_MAIN_USE(factory, args) \ |
| 41 void* UserCreateInstance(PP_Instance inst) { \ | 41 void* UserCreateInstance(PP_Instance inst) { \ |
| 42 static const char *params[] = args; \ | 42 static const char *params[] = args; \ |
| 43 return factory(inst, params); \ | 43 return factory(inst, params); \ |
| 44 } | 44 } |
| 45 | 45 |
| 46 #define PPAPI_MAIN_WITH_DEFAULT_ARGS \ | 46 #define PPAPI_MAIN_WITH_DEFAULT_ARGS \ |
| 47 PPAPI_MAIN_USE(PPAPI_CreateInstance, PPAPI_MAIN_DEFAULT_ARGS) | 47 PPAPI_MAIN_USE(PPAPI_CreateInstance, PPAPI_MAIN_DEFAULT_ARGS) |
| 48 | 48 |
| 49 #define PPAPI_MAIN_WITH_ARGS(args) \ | 49 #define PPAPI_MAIN_WITH_ARGS(args) \ |
| 50 PPAPI_MAIN_USE(PPAPI_CreateInstance, args) | 50 PPAPI_MAIN_USE(PPAPI_CreateInstance, args) |
| 51 | 51 |
| 52 | 52 |
| 53 #endif // PPAPI_MAIN_PPAPI_MAIN_H_ | 53 #endif // PPAPI_MAIN_PPAPI_MAIN_H_ |
| OLD | NEW |