#ifdef HAVE_STDLIB_H
# include <stdlib.h>
#endif
-
+#ifdef HAVE_STRING_H
# include <string.h>
+#endif
+
+#include <assert.h>
+
+#include <libxml/xmlmemory.h>
+#include <libxml/parser.h>
+#include <libxml/encoding.h>
#include "read_t.h"
#include "read.h"
#include "irvrfy.h"
#include "type.h"
#include "tv.h"
+#include "xmalloc.h"
+
+# define MY_ENCODING "ISO-8859-1"
+
+# define CHECK(ptr,msg) assert (ptr && msg)
+
+# define NODE_NAME(n, m) (0 == xmlStrcmp (n->name, (const xmlChar*) #m))
+# define CHECK_NAME(n, m) assert (0 == xmlStrcmp (n->name, (const xmlChar*) #m))
+
+# define NEW(T) (T*)xmalloc(sizeof (T))
+
#define VERBOSE_PRINTING 0
#if VERBOSE_PRINTING
/* this is only used inside a VERBOSE_PRINT() call */
-static char *effect_string[] = {
+static const char *effect_string[] = {
"arg",
"valref",
"select",
return (proc_str);
}
+# ifdef NEEDED
static char*
getNodeClassName (xmlNodePtr node)
{
assert (proc_str);
return ( (proc_str));
}
+# endif /* defined NEEDED */
static const char*
getNodeId (xmlNodePtr node)
/*
was Public Interface
*/
+# ifdef NEEDED
static
type_t *getTypeByIdent (const ident *id)
{
return (NULL);
}
+# endif /* defined NEEDED */
+# ifdef NEEDED
static
type_t *getTypeById (const ident *id)
{
return (NULL);
}
+# endif /* defined NEEDED */
+# ifdef NEEDED
static
entity_t *getEntityByIdents (const ident *name, const ident *tp_ident)
{
return (NULL);
}
+# endif /* defined NEEDED */
static
entity_t *getEntityById (const ident *id)
return (NULL);
}
+# ifdef NEEDED
static
proc_t *getEffectByName (const ident *proc_ident)
{
return (NULL);
}
+# endif /* defined NEEDED */
static
xmlNodePtr get_any_valid_child(xmlNodePtr elem)
free (sel);
if (0 != n_args) {
- const ident **args = (const ident**) malloc(n_args * sizeof(const ident*));
+ const ident **args = (const ident**) xmalloc(n_args * sizeof(const ident*));
int i = 0;
while (NULL != arg) {
child = child->next;
}
- ins = (const ident **) malloc (n_ins * sizeof (const ident *) );
+ ins = (const ident **) xmalloc (n_ins * sizeof (const ident *) );
i = 0;
child = get_valid_child(joinelm);
VERBOSE_PRINT ((stdout, "type node \t0x%08x (%s)\n", (int) typeelm, tp_id));
VERBOSE_PRINT ((stdout, "type = \"%s\"\n", getNodeTypeStr (typeelm)));
- type = (type_t*) malloc (sizeof (type_t));
+ type = (type_t*) xmalloc (sizeof (type_t));
type -> type_ident = new_id_from_str(getNodeTypeStr (typeelm));
type -> id = new_id_from_str(tp_id);
curr_effs = NEW (proc_t);
curr_effs -> proc_ident = new_id_from_str(procname);
curr_effs -> ownerid = new_id_from_str(ownerid);
- curr_effs->effs = (eff_t**) malloc (n_effs * sizeof (eff_t*));
+ curr_effs->effs = (eff_t**) xmalloc (n_effs * sizeof (eff_t*));
cur = effelm -> xmlChildrenNode;
while (NULL != cur) {
c_block = new_immBlock (); /* for the Phi after the branch(es) */
- ins = (ir_node**) malloc (n_ins * sizeof (ir_node*));
+ ins = (ir_node**) xmalloc (n_ins * sizeof (ir_node*));
for (i = 0; i < n_ins; i ++) {
ir_node *projX = NULL;
ir_node *s_block = NULL;
/* fail */
fprintf(stderr,
- "method %s not found\nNo effects generated\nCandidates are:\n",
- get_id_str(proc -> proc_ident));
+ "method %s not found\nNo effects generated\nCandidates are:\n",
+ get_id_str(proc -> proc_ident));
for(i = 0; i < num; i++) {
fent = get_class_member(class_typ, i);
fprintf(stderr, "%s\n", get_entity_name(fent));
\f
/*
* $Log$
+ * Revision 1.19 2004/12/10 15:14:34 beck
+ * used xmalloc instead of malloc
+ *
+ * Revision 1.18 2004/12/02 16:21:42 beck
+ * fixed config.h include
+ *
+ * Revision 1.17 2004/11/23 14:17:31 liekweg
+ * fenced out currently unneeded static functions
+ *
* Revision 1.16 2004/11/11 12:24:52 goetz
* fixes
*