[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: configuration patch - final version
From: |
Jan-Henrik Haukeland |
Subject: |
RE: configuration patch - final version |
Date: |
Tue, 11 Feb 2003 22:35:11 +0100 |
Elaborations (I'm on windows right now, and cannot try, this is more thinking
aloud)
Write:
1) first write the timestamp:
time_t now;
fwrite(time(&now), 1, sizeof (time_t), binaryfile);
2) Then the length of the process list
int length= get_process_list_length();
fwrite(length, 1, sizeof (int), binaryfile);
2) Then the list:
for(p= processlist; p; p= p->next)
fwrite(p, 1, sizeof *(p), binaryfile);
Read:
1) Get state file timestamp
time_t stamp;
fread(now, 1, sizeof (time_t), binaryfile);
2) Get length
int length;
fread(length, 1, sizeof (int), binaryfile);
Process_T new;
Process_T temp= NEW(temp);
for(i=0; i<length; i++) {
if(fread(temp, 1, sizeof *(temp), binaryfile) != sizeof *(temp))
error_exit;
}
if((new= get_process(temp->name))
copy temp.do_validate to new.do_validate;
}
Simple and effective (if it works that is :)
Jan-Henrik
- configuration patch - final version, Martin Pala, 2003/02/11
- RE: configuration patch - final version, Jan-Henrik Haukeland, 2003/02/11
- Re: configuration patch - final version, Martin Pala, 2003/02/11
- RE: configuration patch - final version, Jan-Henrik Haukeland, 2003/02/11
- RE: configuration patch - final version, Christian Hopp, 2003/02/11
- RE: configuration patch - final version,
Jan-Henrik Haukeland <=
- Re: configuration patch - final version, Martin Pala, 2003/02/11
- RE: configuration patch - final version, Jan-Henrik Haukeland, 2003/02/12
- RE: configuration patch - final version, Christian Hopp, 2003/02/12
- Re: configuration patch - final version, Jan-Henrik Haukeland, 2003/02/12
- Re: configuration patch - final version, Martin Pala, 2003/02/11
- Re: configuration patch - final version, Oliver Jehle, 2003/02/12
TO-DO - update boiler plate, Jan-Henrik Haukeland, 2003/02/11