예제 #1
0
int
main (int argc, char **argv)
{
  strtol_error s_err;
  int i;

  program_name = argv[0];
  error_print_progname = print_no_progname;

  for (i = 1; i < argc; i++)
    {
      char *p;
      __strtol_t val;

      s_err = __xstrtol (argv[i], &p, 0, &val, "bckMw0");
      if (s_err == LONGINT_OK)
        {
          printf ("%s->%" __spec " (%s)\n", argv[i], val, p);
        }
      else
        {
          xstrtol_fatal (s_err, -2, 'X', NULL, argv[i]);
        }
    }
  exit (0);
}
예제 #2
0
int
main (int argc, char** argv)
{
  strtol_error s_err;
  int i;

  program_name = argv[0];
  for (i=1; i<argc; i++)
    {
      char *p;
      __strtol_t val;

      s_err = __xstrtol (argv[i], &p, 0, &val, "bckmw");
      if (s_err == LONGINT_OK)
	{
	  printf ("%s->%lu (%s)\n", argv[i], val, p);
	}
      else
	{
	  STRTOL_FATAL_ERROR (argv[i], "arg", s_err);
	}
    }
  exit (0);
}