A clone of btpd with my configuration changes.
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

42 行
1.1 KiB

  1. #ifndef BTPD_SUBR_H
  2. #define BTPD_SUBR_H
  3. #include <stdio.h>
  4. #include <stdarg.h>
  5. #define min(x, y) ((x) <= (y) ? (x) : (y))
  6. #define SHAHEXSIZE 41
  7. int set_nonblocking(int fd);
  8. int set_blocking(int fd);
  9. int mkdirs(char *path);
  10. __attribute__((format (printf, 3, 0)))
  11. int vaopen(int *resfd, int flags, const char *fmt, va_list ap);
  12. __attribute__((format (printf, 3, 4)))
  13. int vopen(int *resfd, int flags, const char *fmt, ...);
  14. __attribute__((format (printf, 3, 4)))
  15. int vfopen(FILE **ret, const char *mode, const char *fmt, ...);
  16. int vfsync(const char *fmt, ...);
  17. void set_bit(uint8_t *bits, unsigned long index);
  18. int has_bit(const uint8_t *bits, unsigned long index);
  19. void clear_bit(uint8_t *bits, unsigned long index);
  20. char *bin2hex(const uint8_t *bin, char *hex, size_t bsize);
  21. uint8_t *hex2bin(const char *hex, uint8_t *bin, size_t bsize);
  22. uint8_t hex2i(char c);
  23. int ishex(char *str);
  24. long rand_between(long min, long max);
  25. int read_fully(int fd, void *buf, size_t len);
  26. int write_fully(int fd, const void *buf, size_t len);
  27. __attribute__((format (printf, 3, 4)))
  28. int read_whole_file(void **out, size_t *size, const char *fmt, ...);
  29. char *find_btpd_dir(void);
  30. #endif