1
0
mirror of synced 2026-04-27 20:37:51 +00:00

added ushow for sim output

This commit is contained in:
brad
2010-04-13 13:59:00 +00:00
parent e5953e3cb9
commit 9d89453b0f
5 changed files with 90 additions and 1 deletions

9
utils/skipz/Makefile Normal file
View File

@@ -0,0 +1,9 @@
all: skipz
skipz: skipz.c
cc -o skipz skipz.c
clean:
rm -f skipz

48
utils/skipz/skipz.c Normal file
View File

@@ -0,0 +1,48 @@
/*
* brad@heeltoe.com
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
size_t binfile_size;
unsigned char binfile[64*1024];
main(int argc, char *argv[])
{
if (argc > 1) {
int f, ret;
char ch;
f = open(argv[1], O_RDONLY);
if (f < 0) {
perror(argv[1]);
return -1;
}
while (1) {
ret = read(f, &ch, 1);
if (ret != 1)
return -1;
if (ch == 'Z'-'@')
break;
}
binfile_size = read(f, binfile, sizeof(binfile));
ret = write(1, binfile, binfile_size);
close(f);
}
exit(0);
}
/*
* Local Variables:
* indent-tabs-mode:nil
* c-basic-offset:4
* End:
*/