MCPcopy Index your code
hub / github.com/IBM/Project_CodeNet / main

Function main

tools/json-graph/src/jgf2spt.c:200–239  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

198}
199
200int main(int argc, char *argv[])
201{
202 filename = "stdin";
203
204 /* Read from a file argument or stdin: */
205 while (argc > 1 && argv[1]) {
206 if (!strcmp(argv[1], "-d")) {
207 debug = 1;
208 /*shift*/
209 argc--; argv[1] = argv[2]; argv[2] = argv[3];
210 }
211 else
212 if (!strcmp(argv[1], "-p")) {
213 pprint = 1;
214 /*shift*/
215 argc--; argv[1] = argv[2]; argv[2] = argv[3];
216 }
217 if (*argv[1] != '-') {
218 filename = argv[1];
219 if (!freopen (filename, "r", stdin)) {
220 fprintf (stderr, "(E): Cannot read file %s.\n", filename);
221 exit(4);
222 }
223 break;
224 }
225 }
226
227 if (debug) fprintf(stderr, "(D): Processing file %s.\n", filename);
228
229 Graph graph = jgf_parse();
230
231 if (debug)
232 fprintf(stderr, "(D): Converting JSON-Graph to Aroma SPT JSON...\n");
233
234 mk_adjacency_graph(graph);
235 show_spt(graph, stdout);
236
237 /*graph_free(graph); */
238 return 0;
239}

Callers

nothing calls this directly

Calls 3

jgf_parseFunction · 0.85
mk_adjacency_graphFunction · 0.85
show_sptFunction · 0.85

Tested by

no test coverage detected