Skip to content

Instantly share code, notes, and snippets.

@ekoontz
Created June 1, 2010 06:23
Show Gist options
  • Save ekoontz/420633 to your computer and use it in GitHub Desktop.
Save ekoontz/420633 to your computer and use it in GitHub Desktop.
Agraph_t* graphml_parse(FILE * fp) {
// 1. use libxml2 to (try) to parse contents
// of fp into a DOM.
return (Agraph_t*)NULL;
// 2. if DOM parsing was successful, convert DOM into an Agraph_t*.
}
Agraph_t *agread(FILE * fp)
{
/* check if this is a graphml (XML) file by trying to
parse it with an XML DOM parser. */
Agraph_t* retval;
if ((retval = graphml_parse(fp)) != (Agraph_t*)NULL) {
return retval;
}
else {
aglexinit(fp, (fgets)); /* use system fgets */
agparse();
return AG.parsed_g;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment