diff options
| author | Richard Nyberg <rnyberg@murmeldjur.se> | 2005-06-24 09:51:38 +0000 |
|---|---|---|
| committer | Richard Nyberg <rnyberg@murmeldjur.se> | 2005-06-24 09:51:38 +0000 |
| commit | dd0d462afae75ff243f8cd1528963f9ad489706d (patch) | |
| tree | 2ef874a1fe5212245814d16f4c9b389524aed9d1 /misc/subr.h | |
| download | btpd-dd0d462afae75ff243f8cd1528963f9ad489706d.tar.gz btpd-dd0d462afae75ff243f8cd1528963f9ad489706d.zip | |
Import btpd-0.1.
git-svn-id: file:///home/rnyberg/svngit/btpd/releases/0.1@1 76a1f634-46fa-0310-9943-bd1476092a85
Diffstat (limited to 'misc/subr.h')
| -rw-r--r-- | misc/subr.h | 21 |
1 files changed, 21 insertions, 0 deletions
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 |