12 |
|
* gmtval(t,s) get GMT as UTC |
13 |
|
* fputdate(t,fp) put out the given UTC |
14 |
|
* fputnow(fp) put out the current date and time |
15 |
– |
* printargs(ac,av,fp) print an argument list to fp, followed by '\n' |
15 |
|
* formatval(r,s) copy the format value in s to r |
16 |
|
* fputformat(s,fp) write "FORMAT=%s" to fp |
17 |
|
* nativebigendian() are we native on big-endian machine? |
157 |
|
time_t tv; |
158 |
|
time(&tv); |
159 |
|
fputdate(tv, fp); |
161 |
– |
} |
162 |
– |
|
163 |
– |
|
164 |
– |
void |
165 |
– |
printargs( /* print arguments to a file */ |
166 |
– |
int ac, |
167 |
– |
char **av, |
168 |
– |
FILE *fp |
169 |
– |
) |
170 |
– |
{ |
171 |
– |
#if defined(_WIN32) || defined(_WIN64) |
172 |
– |
extern char *fixargv0(char *arg0); |
173 |
– |
char myav0[128]; |
174 |
– |
/* clean up Windows executable path */ |
175 |
– |
if (ac-- <= 0) return; |
176 |
– |
fputs(fixargv0(strcpy(myav0, *av++)), fp); |
177 |
– |
fputc(ac ? ' ' : '\n', fp); |
178 |
– |
#endif |
179 |
– |
while (ac-- > 0) { |
180 |
– |
fputword(*av++, fp); |
181 |
– |
fputc(ac ? ' ' : '\n', fp); |
182 |
– |
} |
160 |
|
} |
161 |
|
|
162 |
|
|