127 |
|
} |
128 |
|
|
129 |
|
|
130 |
+ |
void |
131 |
+ |
mygets(char *s, FILE *fp) /* get string from file (with nul) */ |
132 |
+ |
{ |
133 |
+ |
int c; |
134 |
+ |
|
135 |
+ |
while ((c = getc(fp)) != EOF) |
136 |
+ |
if ((*s++ = c) == '\0') |
137 |
+ |
return; |
138 |
+ |
*s = '\0'; |
139 |
+ |
} |
140 |
+ |
|
141 |
+ |
|
142 |
+ |
void |
143 |
+ |
myputs(const char *s, FILE *fp) /* put string to file (with nul) */ |
144 |
+ |
{ |
145 |
+ |
do |
146 |
+ |
putc(*s, fp); |
147 |
+ |
while (*s++); |
148 |
+ |
} |
149 |
+ |
|
150 |
+ |
|
151 |
|
r_comout() /* print string to command line */ |
152 |
|
{ |
153 |
|
char str[256]; |
176 |
|
} |
177 |
|
|
178 |
|
|
158 |
– |
mygets(s, fp) /* get string from file (with nul) */ |
159 |
– |
register char *s; |
160 |
– |
register FILE *fp; |
161 |
– |
{ |
162 |
– |
register int c; |
163 |
– |
|
164 |
– |
while ((c = getc(fp)) != EOF) |
165 |
– |
if ((*s++ = c) == '\0') |
166 |
– |
return; |
167 |
– |
*s = '\0'; |
168 |
– |
} |
169 |
– |
|
170 |
– |
|
171 |
– |
myputs(s, fp) /* put string to file (with nul) */ |
172 |
– |
register char *s; |
173 |
– |
register FILE *fp; |
174 |
– |
{ |
175 |
– |
do |
176 |
– |
putc(*s, fp); |
177 |
– |
while (*s++); |
178 |
– |
} |
179 |
– |
|
180 |
– |
|
179 |
|
void |
180 |
< |
eputs(s) /* put string to stderr */ |
183 |
< |
register char *s; |
180 |
> |
eputs(const char *s) /* put string to stderr */ |
181 |
|
{ |
182 |
|
static int midline = 0; |
183 |
|
|