1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
|
#include <stdio.h>
#include <stdlib.h>
static void usage (void)
{
printf ("USAGE : hexdump <fichier>\n");
}
static int process (char const *fname)
{
int err = 0;
FILE *fp = fopen (fname, "rb");
if (fp != NULL)
{
/* c'est la que ca devient interessant ! */
}
else
{
perror (fname);
}
return err;
}
int main (int argc, char *argv[])
{
int ret = EXIT_FAILURE;
if (argc > 1)
{
int err = process (argv[1]);
if (!err)
{
ret = EXIT_SUCCESS;
}
}
else
{
usage ();
}
return ret;
} |
Partager