MCPcopy Create free account
hub / github.com/Kitware/VTK / xmlXPathDebugDumpObject

Function xmlXPathDebugDumpObject

ThirdParty/libxml2/vtklibxml2/xpath.c:1223–1327  ·  view source on GitHub ↗

* xmlXPathDebugDumpObject: * @output: the FILE * to dump the output * @cur: the object to inspect * @depth: indentation level * * Dump the content of the object for debugging purposes */

Source from the content-addressed store, hash-verified

1221 * Dump the content of the object for debugging purposes
1222 */
1223void
1224xmlXPathDebugDumpObject(FILE *output, xmlXPathObjectPtr cur, int depth) {
1225 int i;
1226 char shift[100];
1227
1228 if (output == NULL) return;
1229
1230 for (i = 0;((i < depth) && (i < 25));i++)
1231 shift[2 * i] = shift[2 * i + 1] = ' ';
1232 shift[2 * i] = shift[2 * i + 1] = 0;
1233
1234
1235 fprintf(output, "%s", shift);
1236
1237 if (cur == NULL) {
1238 fprintf(output, "Object is empty (NULL)\n");
1239 return;
1240 }
1241 switch(cur->type) {
1242 case XPATH_UNDEFINED:
1243 fprintf(output, "Object is uninitialized\n");
1244 break;
1245 case XPATH_NODESET:
1246 fprintf(output, "Object is a Node Set :\n");
1247 xmlXPathDebugDumpNodeSet(output, cur->nodesetval, depth);
1248 break;
1249 case XPATH_XSLT_TREE:
1250 fprintf(output, "Object is an XSLT value tree :\n");
1251 xmlXPathDebugDumpValueTree(output, cur->nodesetval, depth);
1252 break;
1253 case XPATH_BOOLEAN:
1254 fprintf(output, "Object is a Boolean : ");
1255 if (cur->boolval) fprintf(output, "true\n");
1256 else fprintf(output, "false\n");
1257 break;
1258 case XPATH_NUMBER:
1259 switch (xmlXPathIsInf(cur->floatval)) {
1260 case 1:
1261 fprintf(output, "Object is a number : Infinity\n");
1262 break;
1263 case -1:
1264 fprintf(output, "Object is a number : -Infinity\n");
1265 break;
1266 default:
1267 if (xmlXPathIsNaN(cur->floatval)) {
1268 fprintf(output, "Object is a number : NaN\n");
1269 } else if (cur->floatval == 0) {
1270 /* Omit sign for negative zero. */
1271 fprintf(output, "Object is a number : 0\n");
1272 } else {
1273 fprintf(output, "Object is a number : %0g\n", cur->floatval);
1274 }
1275 }
1276 break;
1277 case XPATH_STRING:
1278 fprintf(output, "Object is a string : ");
1279 xmlDebugDumpString(output, cur->stringval);
1280 fprintf(output, "\n");

Callers 4

xmlXPathDebugDumpStepOpFunction · 0.85
runtest.cFile · 0.85
xmlShellFunction · 0.85

Calls 8

fprintfFunction · 0.85
xmlXPathDebugDumpNodeSetFunction · 0.85
xmlXPathIsInfFunction · 0.85
xmlXPathIsNaNFunction · 0.85
xmlDebugDumpStringFunction · 0.85
xmlXPathDebugDumpNodeFunction · 0.85

Tested by

no test coverage detected