A number of smaller adpations

This commit is contained in:
2016-02-08 09:23:42 +01:00
parent 4d5468458b
commit 3ec4658208
6 changed files with 91 additions and 10 deletions

29
utils/decodehmdata.c Executable file
View File

@@ -0,0 +1,29 @@
/**
* This is a little program which reads the content of a historgram
* memory data file and prints the values to stdout
*
* Mark Koennecke, Gerd Theidel, September 2005
*/
#include <stdio.h>
int main(int argc, char *argv[]){
FILE *fd = NULL;
int val;
if(argc < 2){
puts("Usage:\n\tdecodehmdata datafile\n");
exit(1);
}
fd = fopen(argv[1],"r");
if(fd == NULL){
puts("Cannot open data file\n");
exit(1);
}
while(fread(&val,sizeof(int),1,fd) == 1){
fprintf(stdout,"%d\n",ntohl(val));
}
fclose(fd);
exit(0);
}