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

Side by Side Diff: ports/ipython-ppapi/kernel.cc

Issue 1417223003: Switch from using 'nacl_main' to 'main' entry point (Closed) Base URL: https://chromium.googlesource.com/external/naclports.git@master
Patch Set: Created 5 years, 1 month 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
OLDNEW
1 /* Copyright (c) 2014 Google Inc. All rights reserved. 1 /* Copyright (c) 2014 The Native Client 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 #include <python2.7/Python.h> 5 #include <python2.7/Python.h>
6 #include <libtar.h> 6 #include <libtar.h>
7 #include <locale.h> 7 #include <locale.h>
8 #include <stdio.h> 8 #include <stdio.h>
9 #include <fcntl.h> 9 #include <fcntl.h>
10 #include <sys/mount.h> 10 #include <sys/mount.h>
11 #include <errno.h> 11 #include <errno.h>
12 12
13 #include "ppapi/cpp/var.h" 13 #include "ppapi/cpp/var.h"
14 #include "ppapi/cpp/var_array.h" 14 #include "ppapi/cpp/var_array.h"
15 #include "ppapi/cpp/var_dictionary.h" 15 #include "ppapi/cpp/var_dictionary.h"
16 #include "ppapi_simple/ps_interface.h" 16 #include "ppapi_simple/ps_interface.h"
17 17
18 #include "nacl_io/nacl_io.h" 18 #include "nacl_io/nacl_io.h"
19 #include "ppapi_simple/ps_main.h"
20 #include "ppapi_simple/ps_instance.h" 19 #include "ppapi_simple/ps_instance.h"
21 20
22 #ifdef __pnacl__ 21 #ifdef __pnacl__
23 #define DATA_FILE "pydata_pnacl.tar" 22 #define DATA_FILE "pydata_pnacl.tar"
24 #else 23 #else
25 #error "Unknown arch" 24 #error "Unknown arch"
26 #endif 25 #endif
27 26
28 /* TODO(bradnelson): Switch ipython to use cli_main and drop this. */ 27 /* TODO(bradnelson): Switch ipython to use cli_main and drop this. */
29 28
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 "Post a message encoded as JSON" 137 "Post a message encoded as JSON"
139 }, 138 },
140 { 139 {
141 "_AcquireJSONMessageWait", 140 "_AcquireJSONMessageWait",
142 acquire_json_message_wait, 141 acquire_json_message_wait,
143 METH_VARARGS, 142 METH_VARARGS,
144 "Acquire a message encoded as JSON (blocking)"}, 143 "Acquire a message encoded as JSON (blocking)"},
145 {NULL, NULL, 0, NULL} 144 {NULL, NULL, 0, NULL}
146 }; 145 };
147 146
148 int ipython_kernel_main(int argc, char **argv) { 147 int main(int argc, char **argv) {
149 printf("Setting up unix environment...\n"); 148 printf("Setting up unix environment...\n");
150 if (setup_unix_environment()) { 149 if (setup_unix_environment()) {
151 printf("Error: %s\n", strerror(errno)); 150 printf("Error: %s\n", strerror(errno));
152 return -1; 151 return -1;
153 } 152 }
154 printf("done\n"); 153 printf("done\n");
155 154
156 // Initialize Pepper API 155 // Initialize Pepper API
157 PSInterfaceInit(); 156 PSInterfaceInit();
158 157
(...skipping 15 matching lines...) Expand all
174 return -1; 173 return -1;
175 } 174 }
176 175
177 quit = PyRun_SimpleFileEx(main, main_filename, 1); 176 quit = PyRun_SimpleFileEx(main, main_filename, 1);
178 177
179 Py_Finalize(); 178 Py_Finalize();
180 } 179 }
181 180
182 return 0; 181 return 0;
183 } 182 }
184
185 PPAPI_SIMPLE_REGISTER_MAIN(ipython_kernel_main)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698