X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/011e85a5e3a80e9229887468aad206a389f67552..2dc7b8bd0e8d4a2d91334b9bb458df146b1700e8:/rsync.h diff --git a/rsync.h b/rsync.h index f044962e..7e9fccf0 100644 --- a/rsync.h +++ b/rsync.h @@ -659,10 +659,7 @@ struct chmod_mode_struct; #include "lib/permstring.h" #include "lib/addrinfo.h" -#if !defined __GNUC__ || defined __APPLE__ -/* Apparently the OS X port of gcc gags on __attribute__. - * - * */ +#ifndef __GNUC__ #define __attribute__(x) #endif @@ -857,6 +854,9 @@ size_t strlcat(char *d, const char *s, size_t bufsize); #ifndef WEXITSTATUS #define WEXITSTATUS(stat) ((int)(((stat)>>8)&0xFF)) #endif +#ifndef WIFEXITED +#define WIFEXITED(stat) ((int)((stat)&0xFF) == 0) +#endif #define exit_cleanup(code) _exit_cleanup(code, __FILE__, __LINE__) @@ -885,3 +885,45 @@ int inet_pton(int af, const char *src, void *dst); #ifdef MAINTAINER_MODE const char *get_panic_action(void); #endif + +static inline int +isDigit(const char *ptr) +{ + return isdigit(*(unsigned char *)ptr); +} + +static inline int +isPrint(const char *ptr) +{ + return isprint(*(unsigned char *)ptr); +} + +static inline int +isSpace(const char *ptr) +{ + return isspace(*(unsigned char *)ptr); +} + +static inline int +isLower(const char *ptr) +{ + return islower(*(unsigned char *)ptr); +} + +static inline int +isUpper(const char *ptr) +{ + return isupper(*(unsigned char *)ptr); +} + +static inline int +toLower(const char *ptr) +{ + return tolower(*(unsigned char *)ptr); +} + +static inline int +toUpper(const char *ptr) +{ + return toupper(*(unsigned char *)ptr); +}