2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
10 #include <toollib/toollib.h>
16 _xstrdup (const char * str
, const char * file
, int line
)
26 fprintf (stderr
, "Out of memory in %s:%d", file
, line
);
34 _xmalloc (size_t size
, const char * file
, int line
)
42 fprintf (stderr
, "Out of memory in %s:%d", file
, line
);
50 _xrealloc (void * optr
, size_t size
, const char * file
, int line
)
54 ptr
= realloc (optr
, size
);
58 fprintf (stderr
, "Out of memory in %s:%d", file
, line
);
66 _xfree (void * ptr
, const char * file
, int line
)
71 fprintf (stderr
, "Illegal free(NULL) in %s:%d", file
, line
);
75 _xcalloc (size_t number
, size_t size
, const char * file
, int line
)
79 ptr
= calloc (number
, size
);
83 fprintf (stderr
, "Out of memory in %s:%d", file
, line
);
91 FindNode (const List
* l
, const char * name
)
97 if (!strcmp (n
->name
, name
))
105 FindNodeNC (const List
* l
, const char * name
)
111 if (!strcasecmp (n
->name
, name
))
119 printlist (const List
* l
)
125 printf (" \"%s\"\n", n
->name
);
130 execute (const char * cmd
, const char * args
,
131 const char * in
, const char * out
)
136 strcpy (buffer
, cmd
);
137 strcat (buffer
, " ");
139 if (strcmp (in
, "-"))
141 strcat (buffer
, "<");
143 strcat (buffer
, " ");
146 if (strcmp (out
, "-"))
148 strcat (buffer
, ">");
149 strcat (buffer
, out
);
150 strcat (buffer
, " ");
153 strcat (buffer
, args
);
156 printf ("Executing %s...\n", buffer
);
158 rc
= system (buffer
);
162 printf ("%s failed: %d\n", buffer
, rc
);
171 Node
* node
= GetHead (l
);