[1d97c1]: nouveau-pm / tools / timestrip.c Maximize Restore History

Download this file

timestrip.c    35 lines (29 with data), 811 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/*
A small program that removes the timestamp and the map from a dump
XXX: any possible improvements, possibly replace with script if it is faster
*/
#include <stdio.h>
#include <string.h>
int main(int argc, char **argv)
{
char infilename[255];
char mode;
FILE *inFile;
float time;
unsigned int r_size, mapid, address, data;
if (argc != 2) {
printf("Argument count mismatch\nUsage \"%s file_to_strip\"", argv[0]);
return(1);
}
sprintf(infilename,"%s",argv[1]);
inFile = fopen( infilename, "r");
if (!inFile) {
printf("\nCannot open src file");
return(1);
}
while ((!feof(inFile)) & (fscanf(inFile, "%c %i %f %i %x %x 0x0 0\n", &mode, &r_size, &time, &mapid, &address, &data) != 0)) {
printf("%c %i 0x%x 0x%x 0x0 0\n", mode, r_size, address, data);
}
fclose(inFile);
return 0;
}