Tests/BuildDepends/Project/generator.cxx
raw| 1 | #include <stdio.h> |
| 2 | |
| 3 | extern char const* foo(); |
| 4 | |
| 5 | int main(int argc, char const* argv[]) |
| 6 | { |
| 7 | if (argc < 3) { |
| 8 | fprintf(stderr, "Must specify output file and symbol prefix!"); |
| 9 | return 1; |
| 10 | } |
| 11 | if (FILE* fout = fopen(argv[1], "w")) { |
| 12 | fprintf(fout, "static const char* %s_string = \"%s\";\n", argv[2], foo()); |
| 13 | fclose(fout); |
| 14 | } else { |
| 15 | fprintf(stderr, "Could not open output file \"%s\"", argv[1]); |
| 16 | return 1; |
| 17 | } |
| 18 | return 0; |
| 19 | } |