MCPcopy Create free account
hub / github.com/IBM/Project_CodeNet / coords

Function coords

tools/json-graph/src/jsonml2jgf.c:59–74  ·  view source on GitHub ↗

Decode the coordinates attribute. */

Source from the content-addressed store, hash-verified

57
58/* Decode the coordinates attribute. */
59static void coords(Attr attr, unsigned *line, unsigned *column)
60{
61 if (attr) {
62 /* Find the colon separator: */
63 const char *start = input + attr->value->start;
64 const char *end = input + attr->value->end;
65 const char *p;
66 for (p = start; p < end; ++p)
67 if (*p == ':') {
68 /* Get value line:col */
69 *line = atoi(start);
70 *column = atoi(p+1);
71 return;
72 }
73 }
74}
75
76/* Determine correct coordinates for all tokens (leaf nodes)
77 and adjust all labels by removing leading and trailing white-space.

Callers 1

det_coords_adjust_labelsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected