X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=include%2Fatalk%2Futil.h;h=5149acd9c308104913e0955d399e1507f95689fa;hb=b0bcb8f6b0571592a50ce039882c9319e012a270;hp=7b1b10fbe5f1ef56201089a88beee5818659eb3c;hpb=5ab4f0463c00263b3d842f1e1a3648ecf35b4d65;p=netatalk.git diff --git a/include/atalk/util.h b/include/atalk/util.h index 7b1b10fb..5149acd9 100644 --- a/include/atalk/util.h +++ b/include/atalk/util.h @@ -15,7 +15,9 @@ #include #include #include + #include +#include /* exit error codes */ #define EXITERR_CLNT 1 /* client related error */ @@ -53,6 +55,15 @@ #define ZERO_STRUCT(a) memset(&(a), 0, sizeof(a)) #define ZERO_STRUCTP(a) memset((a), 0, sizeof(a)) +#if BYTE_ORDER == BIG_ENDIAN +#define hton64(x) (x) +#define ntoh64(x) (x) +#else /* BYTE_ORDER == BIG_ENDIAN */ +#define hton64(x) ((uint64_t) (htonl(((x) >> 32) & 0xffffffffLL)) | \ + (uint64_t) ((htonl(x) & 0xffffffffLL) << 32)) +#define ntoh64(x) (hton64(x)) +#endif /* BYTE_ORDER == BIG_ENDIAN */ + #ifdef WITH_SENDFILE extern ssize_t sys_sendfile (int __out_fd, int __in_fd, off_t *__offset,size_t __count); #endif @@ -129,7 +140,7 @@ extern void apply_ip_mask(struct sockaddr *ai, int maskbits); extern int compare_ip(const struct sockaddr *sa1, const struct sockaddr *sa2); /* Structures and functions dealing with dynamic pollfd arrays */ -enum fdtype {IPC_FD, LISTEN_FD}; +enum fdtype {IPC_FD, LISTEN_FD, DISASOCIATED_IPC_FD}; struct polldata { enum fdtype fdtype; /* IPC fd or listening socket fd */ void *data; /* pointer to AFPconfig for listening socket and * @@ -161,3 +172,9 @@ extern char *stripped_slashes_basename(char *p); extern int lchdir(const char *dir); extern void randombytes(void *buf, int n); #endif /* _ATALK_UTIL_H */ + +/****************************************************************** + * cnid.c + *****************************************************************/ + +extern bstring rel_path_in_vol(const char *path, const char *volpath);