#include <ctype.h>
#include <stdio.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include <io.h>
Go to the source code of this file.
|
int | main (int argc, char **argv) |
|
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 46 of file lexdump.c.
54 fprintf(stderr,
"usage: %s <datapath/datafilebasename> <index>\n", argv[0]);
58 tmpbuf = calloc(strlen(argv[1]) + 11,1);
59 sprintf(tmpbuf,
"%s.idx", argv[1]);
60 idxfd = open(tmpbuf, O_RDONLY|
O_BINARY);
61 sprintf(tmpbuf,
"%s.dat", argv[1]);
62 datfd = open(tmpbuf, O_RDONLY|
O_BINARY);
65 offset = atoi(argv[2]) * 6;
67 read(idxfd, &offset, 4);
68 read(idxfd, &size, 2);
69 printf(
"offset: %ld; size: %d\n", offset, size);
71 read(datfd, datbuf, 40);
73 printf(
"%s\n", datbuf);