12 int main(int argc
, char *argv
[])
22 fprintf(stderr
, "Too few arguments! Are you using gmake? If you're not, then you really should. :-) \n");
26 fd
= open(argv
[1], O_RDONLY
);
31 f
= fopen(argv
[2], "w+");
36 argv
[1][strlen(argv
[1])-3]='\0';
37 cnt
= strlen(argv
[1]);
38 while (offset
!= cnt
) {
39 if (argv
[1][cnt
- offset
] == '/') {
45 sprintf(file
, "%s", &argv
[1][cnt
- offset
]);
46 fprintf(f
, "static unsigned char %s[] = {\n", file
);
47 read(fd
, buf
, 8); /* id & offset */
48 read(fd
, buf
, 8); /* len & encoding */
49 read(fd
, buf
, 8); /* rate & count */
50 /* no more click :) */
52 while((res
= read(fd
, buf
, BUF_SIZE
)) > 0) {
54 fprintf(f
, "%#x, ", buf
[x
] & 0xff);