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

Function xmlShellList

ThirdParty/libxml2/vtklibxml2/debugXML.c:1986–2015  ·  view source on GitHub ↗

* xmlShellList: * @ctxt: the shell context * @arg: unused * @node: a node * @node2: unused * * Implements the XML shell function "ls" * Does an Unix like listing of the given node (like a directory) * * Returns 0 */

Source from the content-addressed store, hash-verified

1984 * Returns 0
1985 */
1986int
1987xmlShellList(xmlShellCtxtPtr ctxt,
1988 char *arg ATTRIBUTE_UNUSED, xmlNodePtr node,
1989 xmlNodePtr node2 ATTRIBUTE_UNUSED)
1990{
1991 xmlNodePtr cur;
1992 if (!ctxt)
1993 return (0);
1994 if (node == NULL) {
1995 fprintf(ctxt->output, "NULL\n");
1996 return (0);
1997 }
1998 if ((node->type == XML_DOCUMENT_NODE) ||
1999 (node->type == XML_HTML_DOCUMENT_NODE)) {
2000 cur = ((xmlDocPtr) node)->children;
2001 } else if (node->type == XML_NAMESPACE_DECL) {
2002 xmlLsOneNode(ctxt->output, node);
2003 return (0);
2004 } else if (node->children != NULL) {
2005 cur = node->children;
2006 } else {
2007 xmlLsOneNode(ctxt->output, node);
2008 return (0);
2009 }
2010 while (cur != NULL) {
2011 xmlLsOneNode(ctxt->output, cur);
2012 cur = cur->next;
2013 }
2014 return (0);
2015}
2016
2017/**
2018 * xmlShellBase:

Callers 2

xmlShellGrepFunction · 0.85
xmlShellFunction · 0.85

Calls 2

fprintfFunction · 0.85
xmlLsOneNodeFunction · 0.85

Tested by

no test coverage detected