#else
#include <varargs.h>
#endif
-#include <stdio.h>
+#include "system.h"
#ifndef __SABER__
#define saber_stop()
#undef rindex
#undef index
-#include <sys/types.h>
-#include <string.h>
-#include <ctype.h>
-#include <fcntl.h>
-#include <errno.h>
#include <signal.h>
#include <sys/stat.h>
#define STAB_CODE_TYPE int
#endif
-#ifdef _OSF_SOURCE
-#define HAS_STDLIB_H
-#define HAS_UNISTD_H
-#endif
-
-#ifdef HAS_STDLIB_H
-#include <stdlib.h>
-#endif
-
-#ifdef HAS_UNISTD_H
-#include <unistd.h>
-#endif
-
-#ifndef errno
-extern int errno; /* MIPS errno.h doesn't declare this */
-#endif
-
#ifndef MALLOC_CHECK
#ifdef __SABER__
#define MALLOC_CHECK
#endif
#define IS_ASM_IDENT(ch) \
- (isalnum (ch) || (ch) == '_' || (ch) == '.' || (ch) == '$')
+ (ISALNUM (ch) || (ch) == '_' || (ch) == '.' || (ch) == '$')
\f
/* Redefinition of of storage classes as an enumeration for better
STATIC char *local_index __proto((const char *, int));
STATIC char *local_rindex __proto((const char *, int));
-#ifdef NEED_DECLARATION_SBRK
-extern char *sbrk __proto((int));
-#endif
-#ifdef NEED_DECLARATION_FREE
-extern void free __proto((PTR_T));
-#endif
-
extern char *mktemp __proto((char *));
extern long strtol __proto((const char *, char **, int));
#endif
#endif
-#ifndef SEEK_SET /* Symbolic constants for the "fseek" function: */
-#define SEEK_SET 0 /* Set file pointer to offset */
-#define SEEK_CUR 1 /* Set file pointer to its current value plus offset */
-#define SEEK_END 2 /* Set file pointer to the size of the file plus offset */
-#endif
-
\f
/* List of assembler pseudo ops and beginning sequences that need
special actions. Someday, this should be a hash table, and such,
return;
}
- for (end_p1 = start; (ch = *end_p1) != '\0' && !isspace (ch); end_p1++)
+ for (end_p1 = start; (ch = *end_p1) != '\0' && !ISSPACE (ch); end_p1++)
;
hash_ptr = hash_string (start,
return;
}
- for (end_p1 = start; (ch = *end_p1) != '\0' && !isspace (ch); end_p1++)
+ for (end_p1 = start; (ch = *end_p1) != '\0' && !ISSPACE (ch); end_p1++)
;
hash_ptr = hash_string (start,
(ch = *dir_end_p1) != ' ' && ch != '\t';
dir_end_p1++)
{
- if (ch == '\0' || isspace (ch))
+ if (ch == '\0' || ISSPACE (ch))
{
error_line = __LINE__;
saber_stop ();
while (ch == ' ' || ch == '\t')
ch = *++arg_start;
- if (isdigit (ch) || ch == '-' || ch == '+')
+ if (ISDIGIT (ch) || ch == '-' || ch == '+')
{
int ch2;
arg_number = strtol (arg_start, (char **) &arg_end_p1, 0);
arg_was_number++;
}
- else if (ch == '\0' || isspace (ch))
+ else if (ch == '\0' || ISSPACE (ch))
{
error_line = __LINE__;
saber_stop ();
ch = *++arg_start;
arg_was_number = 0;
- if (isdigit (ch) || ch == '-' || ch == '+')
+ if (ISDIGIT (ch) || ch == '-' || ch == '+')
{
int ch2;
arg_number = strtol (arg_start, (char **) &arg_end_p1, 0);
ch = *++arg_start;
arg_was_number = 0;
- if (isdigit (ch) || ch == '-' || ch == '+')
+ if (ISDIGIT (ch) || ch == '-' || ch == '+')
{
int ch2;
arg_number = strtol (arg_start, (char **) &arg_end_p1, 0);
}
/* Get the function name, skipping whitespace. */
- for (start_func = start; isspace (*start_func); start_func++)
+ for (start_func = start; ISSPACE (*start_func); start_func++)
;
ch = *start_func;
return;
}
- for (start_func = start; isspace (*start_func); start_func++)
+ for (start_func = start; ISSPACE (*start_func); start_func++)
;
ch = *start_func;
mark_stabs ("");
/* Read code from stabs. */
- if (!isdigit (*rest))
+ if (!ISDIGIT (*rest))
{
error ("Invalid .stabs/.stabn directive, code is non-numeric");
return;
shash_t *shash_ptr;
/* Skip ,0, */
- if (p[0] != ',' || p[1] != '0' || p[2] != ',' || !isdigit (p[3]))
+ if (p[0] != ',' || p[1] != '0' || p[2] != ',' || !ISDIGIT (p[3]))
{
error ("Invalid line number .stabs/.stabn directive");
return;
code = strtol (p+3, &p, 0);
ch = *++p;
- if (p[-1] != ',' || isdigit (ch) || !IS_ASM_IDENT (ch))
+ if (p[-1] != ',' || ISDIGIT (ch) || !IS_ASM_IDENT (ch))
{
error ("Invalid line number .stabs/.stabn directive");
return;
/* Skip ,<num>,<num>, */
if (*p++ != ',')
goto failure;
- for (; isdigit (*p); p++)
+ for (; ISDIGIT (*p); p++)
;
if (*p++ != ',')
goto failure;
- for (; isdigit (*p); p++)
+ for (; ISDIGIT (*p); p++)
;
if (*p++ != ',')
goto failure;
return;
}
- if (isdigit (ch) || ch == '-')
+ if (ISDIGIT (ch) || ch == '-')
{
st = st_Nil;
sc = sc_Nil;
ch = *end_p1++;
if (ch != '\n')
{
- if (((!isdigit (*end_p1)) && (*end_p1 != '-'))
+ if (((!ISDIGIT (*end_p1)) && (*end_p1 != '-'))
|| ((ch != '+') && (ch != '-')))
{
error ("Invalid .stabs/.stabn directive, badly formed value");
while ((p = read_line ()) != (char *) 0)
{
/* Skip leading blanks */
- while (isspace (*p))
+ while (ISSPACE (*p))
p++;
/* See if it's a directive we handle. If so, dispatch handler. */
for (i = 0; i < sizeof (pseudo_ops) / sizeof (pseudo_ops[0]); i++)
if (memcmp (p, pseudo_ops[i].name, pseudo_ops[i].len) == 0
- && isspace (p[pseudo_ops[i].len]))
+ && ISSPACE (p[pseudo_ops[i].len]))
{
p += pseudo_ops[i].len; /* skip to first argument */
- while (isspace (*p))
+ while (ISSPACE (*p))
p++;
(*pseudo_ops[i].func)( p );