A clone of btpd with my configuration changes.
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

del.c 782 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #include "btcli.h"
  2. void
  3. usage_del(void)
  4. {
  5. printf(
  6. "Remove torrents from btpd.\n"
  7. "\n"
  8. "Usage: del torrent ...\n"
  9. "\n"
  10. "Arguments:\n"
  11. "torrent ...\n"
  12. "\tThe torrents to remove.\n"
  13. "\n");
  14. exit(1);
  15. }
  16. static struct option del_opts [] = {
  17. { "help", no_argument, NULL, 'H' },
  18. {NULL, 0, NULL, 0}
  19. };
  20. void
  21. cmd_del(int argc, char **argv)
  22. {
  23. int ch;
  24. struct ipc_torrent t;
  25. while ((ch = getopt_long(argc, argv, "", del_opts, NULL)) != -1)
  26. usage_del();
  27. argc -= optind;
  28. argv += optind;
  29. if (argc < 1)
  30. usage_del();
  31. btpd_connect();
  32. for (int i = 0; i < argc; i++)
  33. if (torrent_spec(argv[i], &t))
  34. handle_ipc_res(btpd_del(ipc, &t), "del", argv[i]);
  35. }