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

Side by Side Diff: ports/devenv/jseval.c

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
« no previous file with comments | « ports/devenv/build.sh ('k') | ports/devenv/tests/devenv_small_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014 The Native Client Authors. 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 <assert.h> 5 #include <assert.h>
6 #include <spawn.h> 6 #include <spawn.h>
7 #include <stdio.h> 7 #include <stdio.h>
8 #include <stdlib.h> 8 #include <stdlib.h>
9 #include <string.h> 9 #include <string.h>
10 10
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 } 58 }
59 wrote_len = fwrite(data, 1, len, file); 59 wrote_len = fwrite(data, 1, len, file);
60 if (wrote_len != len) { 60 if (wrote_len != len) {
61 fprintf(stderr, "ERROR: Failed writting to: %s\n", filename); 61 fprintf(stderr, "ERROR: Failed writting to: %s\n", filename);
62 fclose(file); 62 fclose(file);
63 exit(1); 63 exit(1);
64 } 64 }
65 fclose(file); 65 fclose(file);
66 } 66 }
67 67
68 int nacl_main(int argc, char** argv) { 68 int main(int argc, char** argv) {
69 char* indata = 0; 69 char* indata = 0;
70 const char* cmd; 70 const char* cmd;
71 char* outdata; 71 char* outdata;
72 size_t outdata_len; 72 size_t outdata_len;
73 73
74 if ((argc != 3 && argc != 4) || 74 if ((argc != 3 && argc != 4) ||
75 (strcmp(argv[1], "-f") != 0 && strcmp(argv[1], "-e") != 0)) { 75 (strcmp(argv[1], "-f") != 0 && strcmp(argv[1], "-e") != 0)) {
76 usage(); 76 usage();
77 return 1; 77 return 1;
78 } 78 }
(...skipping 11 matching lines...) Expand all
90 } else { 90 } else {
91 jseval(cmd, NULL, NULL); 91 jseval(cmd, NULL, NULL);
92 } 92 }
93 93
94 if (strcmp(argv[1], "-f") == 0) { 94 if (strcmp(argv[1], "-f") == 0) {
95 free(indata); 95 free(indata);
96 } 96 }
97 97
98 return 0; 98 return 0;
99 } 99 }
OLDNEW
« no previous file with comments | « ports/devenv/build.sh ('k') | ports/devenv/tests/devenv_small_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698