/* Dump hexa + ascii (if printable) more friendly than od -xc output JMM */ #include #include #include #define MAX_CHARS_PER_OUTPUTLINE 64 int chars_per_outputline=16; main(argc,argv) int argc; char **argv; { int opt; extern int optind; extern char *optarg; /* Options treatment */ while ((opt=getopt(argc,argv,"w:")) != EOF) { switch (opt) { case 'w': /* width -> number of decoded chars per output line */ chars_per_outputline=((MAX_CHARS_PER_OUTPUTLINE)<(atoi(optarg)) ? (MAX_CHARS_PER_OUTPUTLINE) : (atoi(optarg))); break; case '?': /* wrong option */ fprintf(stderr,"Usage: %s [-w linewidth] [file1 [file2 [...]]]\n",argv[0]); exit(2); } /* switch */ } /* while */ if (optind == argc) odxa_output(stdin); else { FILE *fd; for ( ; optind