static
-void read_extern (const char *filename)
+int read_extern (const char *filename)
{
/* xmlNsPtr ns = NULL; */ /* no namespace for us */
xmlDocPtr doc; /* whole document */
LIBXML_TEST_VERSION xmlKeepBlanksDefault (0);
VERBOSE_PRINT((stdout, "read file %s\n", filename));
doc = xmlParseFile (filename);
- CHECK (doc, "xmlParseFile");
+ if (! doc)
+ return 0;
cur = xmlDocGetRootElement (doc);
CHECK (cur, "xmlDocGetRootElement");
module -> next = modules;
modules = module;
+
+ return 1;
}
/********************************************************************/
}
-void create_abstraction(const char *filename)
+int create_abstraction(const char *filename)
{
module_t *module;
/* read and parse XML file */
- read_extern(filename);
+ if (! read_extern(filename))
+ return 0;
/* finished reading and parsing here */
/* build FIRM graphs */
entities = NULL;
procs = NULL;
modules = NULL;
+
+ return 1;
}
\f
/*
* $Log$
+ * Revision 1.22 2005/08/16 10:18:35 beck
+ * create_abstraction() now returns an error code if the file could not
+ * be opened.
+ *
* Revision 1.21 2005/03/10 10:05:38 goetz
* chanmged method name
*
/*
The public interface
*/
-/** read the file and build the graphs */
-void create_abstraction(const char *filename);
+/**
+ * read the file and build the graphs
+ *
+ * @return 0 on I/O error, non-zero else
+ */
+int create_abstraction(const char *filename);
void free_abstraction(void);
/*
$Log$
+ Revision 1.9 2005/08/16 10:18:35 beck
+ create_abstraction() now returns an error code if the file could not
+ be opened.
+
Revision 1.8 2004/11/11 09:28:32 goetz
treat pseudo irgs special
parse 'local' from xml files