A clone of btpd with my configuration changes.

66 line
1.3 KiB

  1. #ifndef BTPD_H
  2. #define BTPD_H
  3. #include <sys/types.h>
  4. #include <sys/socket.h>
  5. #include <sys/time.h>
  6. #include <assert.h>
  7. #include <errno.h>
  8. #include <event.h>
  9. #include <inttypes.h>
  10. #include <limits.h>
  11. #include <stddef.h>
  12. #include <stdlib.h>
  13. #include "queue.h"
  14. #include "benc.h"
  15. #include "metainfo.h"
  16. #include "iobuf.h"
  17. #include "net_buf.h"
  18. #include "net_types.h"
  19. #include "net.h"
  20. #include "peer.h"
  21. #include "torrent.h"
  22. #include "download.h"
  23. #include "upload.h"
  24. #include "subr.h"
  25. #include "content.h"
  26. #include "opts.h"
  27. #define BTPD_VERSION (PACKAGE_NAME "/" PACKAGE_VERSION)
  28. #define BTPD_L_ALL 0xffffffff
  29. #define BTPD_L_ERROR 0x00000001
  30. #define BTPD_L_TRACKER 0x00000002
  31. #define BTPD_L_CONN 0x00000004
  32. #define BTPD_L_MSG 0x00000008
  33. #define BTPD_L_BTPD 0x00000010
  34. #define BTPD_L_POL 0x00000020
  35. void btpd_init(void);
  36. void btpd_log(uint32_t type, const char *fmt, ...);
  37. void btpd_err(const char *fmt, ...);
  38. void *btpd_malloc(size_t size);
  39. void *btpd_calloc(size_t nmemb, size_t size);
  40. void btpd_shutdown(int grace_seconds);
  41. int btpd_is_stopping(void);
  42. const uint8_t *btpd_get_peer_id(void);
  43. void td_acquire_lock(void);
  44. void td_release_lock(void);
  45. #define td_post_begin td_acquire_lock
  46. void td_post(void (*fun)(void *), void *arg);
  47. void td_post_end(void);
  48. void btpd_on_no_torrents(void);
  49. #endif