| 58 | ****************************************************************************/ |
| 59 | |
| 60 | int main(int argc, char **argv, char **envp) |
| 61 | { |
| 62 | char *filepath; |
| 63 | FILE *stream; |
| 64 | |
| 65 | if (argc != 2) |
| 66 | { |
| 67 | fprintf(stderr, "Unexpected number of arguments\n"); |
| 68 | show_usage(argv[0]); |
| 69 | } |
| 70 | |
| 71 | filepath = getfilepath(argv[1]); |
| 72 | if (!filepath) |
| 73 | { |
| 74 | fprintf(stderr, "getfilepath failed\n"); |
| 75 | exit(2); |
| 76 | } |
| 77 | |
| 78 | stream = fopen(filepath, "r"); |
| 79 | if (!stream) |
| 80 | { |
| 81 | fprintf(stderr, "open %s failed: %s\n", filepath, strerror(errno)); |
| 82 | exit(3); |
| 83 | } |
| 84 | |
| 85 | printf("/* version.h -- Autogenerated! Do not edit. */\n\n"); |
| 86 | printf("#ifndef __INCLUDE_NUTTX_VERSION_H\n"); |
| 87 | printf("#define __INCLUDE_NUTTX_VERSION_H\n\n"); |
| 88 | generate_definitions(stream); |
| 89 | printf("\n#define CONFIG_VERSION ((CONFIG_VERSION_MAJOR << 16) |\\\n" |
| 90 | " (CONFIG_VERSION_MINOR << 8) |\\\n" |
| 91 | " (CONFIG_VERSION_PATCH))\n\n"); |
| 92 | printf("#endif /* __INCLUDE_NUTTX_VERSION_H */\n"); |
| 93 | fclose(stream); |
| 94 | |
| 95 | /* Exit (without bothering to clean up allocations) */ |
| 96 | |
| 97 | free(filepath); |
| 98 | return 0; |
| 99 | } |
nothing calls this directly
no test coverage detected