10 |
|
#include "copyright.h" |
11 |
|
|
12 |
|
#include <ctype.h> |
13 |
– |
#include <string.h> |
13 |
|
|
14 |
|
#include "rtio.h" |
15 |
|
|
16 |
|
char * |
17 |
|
atos(char *rs, int nb, char *s) /* get word from string, returning rs */ |
18 |
|
{ |
19 |
< |
register char *cp = rs; |
19 |
> |
char *cp = rs; |
20 |
|
|
21 |
|
while (isspace(*s)) |
22 |
|
s++; |
82 |
|
{ |
83 |
|
while (isspace(*s)) |
84 |
|
s++; |
85 |
< |
if (*s == '-' || *s == '+') |
85 |
> |
if ((*s == '-') | (*s == '+')) |
86 |
|
s++; |
87 |
|
if (!isdigit(*s)) |
88 |
|
return(NULL); |
96 |
|
char * |
97 |
|
fskip(char *s) /* skip float in string */ |
98 |
|
{ |
99 |
< |
register char *cp; |
99 |
> |
char *cp; |
100 |
|
|
101 |
|
while (isspace(*s)) |
102 |
|
s++; |
103 |
< |
if (*s == '-' || *s == '+') |
103 |
> |
if ((*s == '-') | (*s == '+')) |
104 |
|
s++; |
105 |
|
cp = s; |
106 |
|
while (isdigit(*cp)) |
112 |
|
} |
113 |
|
if (cp == s) |
114 |
|
return(NULL); |
115 |
< |
if (*cp == 'e' || *cp == 'E') |
116 |
< |
return(iskip(cp+1)); |
115 |
> |
if ((*cp == 'e') | (*cp == 'E')) |
116 |
> |
return(isspace(*++cp) ? NULL : iskip(cp)); |
117 |
|
return(cp); |
118 |
|
} |
119 |
|
|
121 |
|
int |
122 |
|
isint(char *s) /* check integer format */ |
123 |
|
{ |
124 |
< |
register char *cp; |
124 |
> |
char *cp; |
125 |
|
|
126 |
|
cp = iskip(s); |
127 |
|
return(cp != NULL && *cp == '\0'); |
131 |
|
int |
132 |
|
isintd(char *s, char *ds) /* check integer format with delimiter set */ |
133 |
|
{ |
134 |
< |
register char *cp; |
134 |
> |
char *cp; |
135 |
|
|
136 |
|
cp = iskip(s); |
137 |
|
return(cp != NULL && strchr(ds, *cp) != NULL); |
141 |
|
int |
142 |
|
isflt(char *s) /* check float format */ |
143 |
|
{ |
144 |
< |
register char *cp; |
144 |
> |
char *cp; |
145 |
|
|
146 |
|
cp = fskip(s); |
147 |
|
return(cp != NULL && *cp == '\0'); |
151 |
|
int |
152 |
|
isfltd(char *s, char *ds) /* check integer format with delimiter set */ |
153 |
|
{ |
154 |
< |
register char *cp; |
154 |
> |
char *cp; |
155 |
|
|
156 |
|
cp = fskip(s); |
157 |
|
return(cp != NULL && strchr(ds, *cp) != NULL); |