-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.c
20 lines (17 loc) · 806 Bytes
/
init.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "init.h"
int init(FILE* dest)
{
//that function prints current date and program version to destination file
time_t sec;
time(&sec);
struct tm* timex = localtime(&sec);
fprintf( dest, "$date\n" \
"\t%02d-%02d-%04d %02d:%02d:%02d\n" \
"$end\n", \
timex->tm_mday, (timex->tm_mon)+1, (timex->tm_year)+1900, \
timex->tm_hour, timex->tm_min, timex->tm_sec );
fprintf( dest, "$version\n" \
"\tsimtovcd 0.2\n" \
"$end\n" );
return 1;
}