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

Function show

tools/json-graph/src/jgflib.c:282–303  ·  view source on GitHub ↗

Outputs the token to open file fp. When do_quote is > 0, output token double-quoted, when do_quote is < 0, output token without double-quotes, otherwise first investigate and quote appropriately when needed. */

Source from the content-addressed store, hash-verified

280 otherwise first investigate and quote appropriately when needed.
281*/
282void show(FILE *fp, jsmntok_t *tok, int do_quote)
283{
284 /* start (0-based), end (= 1 beyond last): byte positions in input
285 meaning of size depends on token type:
286 object: number of keys
287 array: number of elements
288 string: 0 for value, 1 for key
289 primitive (number,false,true,null): no meaning, 0
290 */
291 if (!do_quote) {
292 /* Observe dot ID syntax; must quote when non-alnum. */
293 const char *p;
294 for (p = input + tok->start; p < input + tok->end; p++)
295 if (isspace(*p) || ispunct(*p) && *p != '_') {
296 do_quote = 1;
297 break;
298 }
299 }
300 if (do_quote > 0) fputc('"', fp);
301 fwrite(input + tok->start, 1, tok->end - tok->start, fp);
302 if (do_quote > 0) fputc('"', fp);
303}
304
305/** Outputs up to the first 16 chars of token to fp. */
306static void show_16(FILE *fp, jsmntok_t *tok)

Callers 10

graph_show_adjFunction · 0.85
graph_show_jgfFunction · 0.85
CSV_escapeFunction · 0.85
show_tokens_auxFunction · 0.85
graph_show_list_dotFunction · 0.85
show_attrsFunction · 0.85
node_infoFunction · 0.85
edge_infoFunction · 0.85
show_spt_auxFunction · 0.85
show_sptFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected