A clone of btpd with my configuration changes.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
760 B

  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. int set_nonblocking(int fd);
  7. int set_blocking(int fd);
  8. int mkdirs(char *path);
  9. int vaopen(int *resfd, int flags, const char *fmt, va_list ap);
  10. int vopen(int *resfd, int flags, const char *fmt, ...);
  11. int vfopen(FILE **ret, const char *mode, const char *fmt, ...);
  12. int vfsync(const char *fmt, ...);
  13. void set_bit(uint8_t *bits, unsigned long index);
  14. int has_bit(const uint8_t *bits, unsigned long index);
  15. void clear_bit(uint8_t *bits, unsigned long index);
  16. long rand_between(long min, long max);
  17. int read_fully(int fd, void *buf, size_t len);
  18. int write_fully(int fd, const void *buf, size_t len);
  19. char *find_btpd_dir(void);
  20. #endif