From dd0d462afae75ff243f8cd1528963f9ad489706d Mon Sep 17 00:00:00 2001 From: Richard Nyberg Date: Fri, 24 Jun 2005 09:51:38 +0000 Subject: Import btpd-0.1. git-svn-id: file:///home/rnyberg/svngit/btpd/releases/0.1@1 76a1f634-46fa-0310-9943-bd1476092a85 --- misc/subr.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 misc/subr.h (limited to 'misc/subr.h') diff --git a/misc/subr.h b/misc/subr.h new file mode 100644 index 0000000..9467839 --- /dev/null +++ b/misc/subr.h @@ -0,0 +1,21 @@ +#ifndef BTPD_SUBR_H +#define BTPD_SUBR_H + +#define min(x, y) ((x) <= (y) ? (x) : (y)) + +int set_nonblocking(int fd); +int set_blocking(int fd); + +int mkdirs(char *path); + +int vopen(int *resfd, int flags, const char *fmt, ...); + +void set_bit(uint8_t *bits, unsigned long index); +int has_bit(uint8_t *bits, unsigned long index); +void clear_bit(uint8_t *bits, unsigned long index); + +int canon_path(const char *path, char **res); + +size_t round_to_page(size_t size); + +#endif -- cgit 1.4.1