| OLD | NEW |
| 1 // Copyright (c) 2015, the Dartino project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dartino project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE.md file. | 3 // BSD-style license that can be found in the LICENSE.md file. |
| 4 | 4 |
| 5 #include <stdio.h> | 5 #include <stdio.h> |
| 6 #include <sys/errno.h> | 6 #include <sys/errno.h> |
| 7 | 7 |
| 8 #include "src/shared/assert.h" | 8 #include "src/shared/assert.h" |
| 9 | 9 |
| 10 #include "src/shared/names.h" | 10 #include "src/shared/names.h" |
| 11 #include "src/shared/natives.h" | 11 #include "src/shared/natives.h" |
| 12 | 12 |
| 13 namespace fletch { | 13 namespace dartino { |
| 14 | 14 |
| 15 static int Main(int argc, char** argv) { | 15 static int Main(int argc, char** argv) { |
| 16 if (argc != 2) { | 16 if (argc != 2) { |
| 17 fprintf(stderr, "Usage: %s <output_file>", argv[0]); | 17 fprintf(stderr, "Usage: %s <output_file>", argv[0]); |
| 18 return 1; | 18 return 1; |
| 19 } | 19 } |
| 20 FILE* output = fopen(argv[1], "w"); | 20 FILE* output = fopen(argv[1], "w"); |
| 21 if (output == NULL) { | 21 if (output == NULL) { |
| 22 fprintf(stderr, "%s: Unable to write \"%s\": %s\n", argv[0], argv[1], | 22 fprintf(stderr, "%s: Unable to write \"%s\": %s\n", argv[0], argv[1], |
| 23 strerror(errno)); | 23 strerror(errno)); |
| (...skipping 26 matching lines...) Expand all Loading... |
| 50 fprintf(output, "}\n"); | 50 fprintf(output, "}\n"); |
| 51 | 51 |
| 52 if (fclose(output) != 0) { | 52 if (fclose(output) != 0) { |
| 53 fprintf(stderr, "%s: Unable to close \"%s\": %s\n", argv[0], argv[1], | 53 fprintf(stderr, "%s: Unable to close \"%s\": %s\n", argv[0], argv[1], |
| 54 strerror(errno)); | 54 strerror(errno)); |
| 55 return 1; | 55 return 1; |
| 56 } | 56 } |
| 57 return 0; | 57 return 0; |
| 58 } | 58 } |
| 59 | 59 |
| 60 } // namespace fletch | 60 } // namespace dartino |
| 61 | 61 |
| 62 // Forward main calls to fletch::Main. | 62 // Forward main calls to dartino::Main. |
| 63 int main(int argc, char** argv) { return fletch::Main(argc, argv); } | 63 int main(int argc, char** argv) { return dartino::Main(argc, argv); } |
| OLD | NEW |