X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=netatalk.git;a=blobdiff_plain;f=include%2Fatalk%2Futil.h;fp=include%2Fatalk%2Futil.h;h=5149acd9c308104913e0955d399e1507f95689fa;hp=277ac98975d7d430d50d999cfe6eb57ba7447bbb;hb=b0bcb8f6b0571592a50ce039882c9319e012a270;hpb=e22bbf78a53bf739dd38383de42a23c95d43c15d diff --git a/include/atalk/util.h b/include/atalk/util.h index 277ac989..5149acd9 100644 --- a/include/atalk/util.h +++ b/include/atalk/util.h @@ -11,13 +11,10 @@ #ifndef _ATALK_UTIL_H #define _ATALK_UTIL_H 1 -#include #include -#ifdef HAVE_UNISTD_H +#include #include -#endif /* HAVE_UNISTD_H */ #include -#include #include #include @@ -46,7 +43,17 @@ #define AFP_ASSERT(b) #endif /* NDEBUG */ +#ifndef MIN +#define MIN(a, b) ((a) < (b) ? (a) : (b)) +#endif + +#ifndef MAX +#define MAX(a, b) ((a) > (b) ? (a) : (b)) +#endif + #define STRCMP(a,b,c) (strcmp(a,c) b 0) +#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) @@ -68,7 +75,6 @@ extern void freeifacelist(char **); #define diatolower(x) _dialowermap[(unsigned char) (x)] #define diatoupper(x) _diacasemap[(unsigned char) (x)] -extern int atalk_aton (char *, struct at_addr *); extern void bprint (char *, int); extern int strdiacasecmp (const char *, const char *); extern int strndiacasecmp (const char *, const char *, size_t); @@ -77,19 +83,6 @@ extern void fault_setup (void (*fn)(void *)); extern void netatalk_panic(const char *why); #define server_unlock(x) (unlink(x)) -/* strlcpy and strlcat are used by pam modules */ -#ifndef UAM_MODULE_EXPORT -#define UAM_MODULE_EXPORT -#endif - -#ifndef HAVE_STRLCPY -UAM_MODULE_EXPORT size_t strlcpy (char *, const char *, size_t); -#endif - -#ifndef HAVE_STRLCAT -UAM_MODULE_EXPORT size_t strlcat (char *, const char *, size_t); -#endif - #ifndef HAVE_DLFCN_H extern void *mod_open (const char *); extern void *mod_symbol (void *, const char *); @@ -173,6 +166,7 @@ extern int recv_fd(int fd, int nonblocking); * unix.c *****************************************************************/ +extern const char *abspath(const char *name); extern const char *getcwdpath(void); extern char *stripped_slashes_basename(char *p); extern int lchdir(const char *dir);