A clone of btpd with my configuration changes.
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

54 lignes
861 B

  1. #include <sys/types.h>
  2. #include <err.h>
  3. #include <errno.h>
  4. #include <getopt.h>
  5. #include <inttypes.h>
  6. #include <stdio.h>
  7. #include <stdlib.h>
  8. #include "metainfo.h"
  9. static void
  10. usage()
  11. {
  12. fprintf(stderr, "Usage: btinfo file ...\n\n");
  13. exit(1);
  14. }
  15. static struct option longopts[] = {
  16. { "help", no_argument, NULL, 1 },
  17. { NULL, 0, NULL, 0 }
  18. };
  19. int
  20. main(int argc, char **argv)
  21. {
  22. int ch;
  23. while ((ch = getopt_long(argc, argv, "", longopts, NULL)) != -1)
  24. usage();
  25. argc -= optind;
  26. argv += optind;
  27. if (argc < 1)
  28. usage();
  29. while (argc > 0) {
  30. struct metainfo *mi;
  31. if ((errno = load_metainfo(*argv, -1, 1, &mi)) != 0)
  32. err(1, "load_metainfo: %s", *argv);
  33. print_metainfo(mi);
  34. clear_metainfo(mi);
  35. free(mi);
  36. argc--;
  37. argv++;
  38. }
  39. return 0;
  40. }