#include <stdio.h>
#include "libiberty.h"
#include "demangle.h"
+#include <string.h>
+#include <stdlib.h>
struct line
{
#define LINELEN 80
static void
-getline(buf)
+get_line(buf)
struct line *buf;
{
char *data = buf->data;
line: copy this line into the buffer and return. */
while (c != EOF && c != '\n')
{
- if (count >= alloc)
+ if (count + 1 >= alloc)
{
alloc *= 2;
data = xrealloc (data, alloc);
for (;;)
{
- getline (&format);
+ get_line (&format);
if (feof (stdin))
break;
- getline (&input);
- getline (&expect);
+ get_line (&input);
+ get_line (&expect);
tests++;
#include "libiberty.h"
#include <stdio.h>
#include <errno.h>
-#ifdef HAVE_STDLIB_H
#include <stdlib.h>
-#endif
-#ifdef HAVE_STRING_H
#include <string.h>
-#endif
+#include <unistd.h>
#ifndef EXIT_SUCCESS
#define EXIT_SUCCESS 0
if (parse == NULL)
fatal_error (__LINE__, "Failed to malloc parse.", errno);
- memcpy (parse, test_data, sizeof (char) * len);
+ memcpy (parse, test_data, sizeof (char) * (len + 1));
/* Run all possible replaces */
run_replaces (parse);
#include <stdio.h>
#include <signal.h>
#include <errno.h>
-#ifdef HAVE_STRING_H
#include <string.h>
-#endif
#include <sys/types.h>
-#ifdef HAVE_STDLIB_H
#include <stdlib.h>
-#endif
-#ifdef HAVE_UNISTD_H
#include <unistd.h>
-#endif
-#ifdef HAVE_SYS_WAIT_H
#include <sys/wait.h>
-#endif
-#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
-#endif
-#ifdef HAVE_SYS_RESOURCE_H
#include <sys/resource.h>
-#endif
+
+extern const char *pex_run (struct pex_obj *obj, int flags,
+ const char *executable, char * const *argv,
+ const char *outname, const char *errname,
+ int *err);
+extern FILE *pex_read_output (struct pex_obj *, int binary);
+extern int pex_get_status (struct pex_obj *, int count, int *vector);
+extern void pex_free (struct pex_obj *);
#ifndef WIFSIGNALED
#define WIFSIGNALED(S) (((S) & 0xff) != 0 && ((S) & 0xff) != 0x7f)