diff options
-rw-r--r-- | Makefile.in | 3 | ||||
-rw-r--r-- | clientserver.c | 2 | ||||
-rw-r--r-- | fileio.c | 2 | ||||
-rw-r--r-- | flist.c | 1 | ||||
-rw-r--r-- | generator.c | 2 | ||||
-rw-r--r-- | hlink.c | 2 | ||||
-rw-r--r-- | ifuncs.h | 82 | ||||
-rw-r--r-- | inums.h | 57 | ||||
-rw-r--r-- | io.c | 1 | ||||
-rw-r--r-- | itypes.h | 59 | ||||
-rw-r--r-- | lib/compat.c | 2 | ||||
-rw-r--r-- | loadparm.c | 2 | ||||
-rw-r--r-- | log.c | 3 | ||||
-rw-r--r-- | main.c | 2 | ||||
-rw-r--r-- | match.c | 2 | ||||
-rw-r--r-- | options.c | 2 | ||||
-rw-r--r-- | params.c | 1 | ||||
-rw-r--r-- | progress.c | 2 | ||||
-rw-r--r-- | receiver.c | 2 | ||||
-rw-r--r-- | sender.c | 2 | ||||
-rw-r--r-- | socket.c | 2 | ||||
-rw-r--r-- | token.c | 2 | ||||
-rw-r--r-- | util.c | 2 | ||||
-rw-r--r-- | xattrs.c | 1 |
24 files changed, 140 insertions, 98 deletions
diff --git a/Makefile.in b/Makefile.in index 0d77f175..be2235a0 100644 --- a/Makefile.in +++ b/Makefile.in @@ -27,7 +27,8 @@ VERSION=@VERSION@ .SUFFIXES: .c .o GENFILES=configure.sh config.h.in proto.h proto.h-tstamp rsync.1 rsyncd.conf.5 -HEADERS=byteorder.h config.h errcode.h proto.h rsync.h ifuncs.h lib/pool_alloc.h +HEADERS=byteorder.h config.h errcode.h proto.h rsync.h ifuncs.h itypes.h inums.h \ + lib/pool_alloc.h LIBOBJ=lib/wildmatch.o lib/compat.o lib/snprintf.o lib/mdfour.o lib/md5.o \ lib/permstring.o lib/pool_alloc.o lib/sysacls.o lib/sysxattrs.o @LIBOBJS@ ZLIBOBJ=zlib/deflate.o zlib/inffast.o zlib/inflate.o zlib/inftrees.o \ diff --git a/clientserver.c b/clientserver.c index 3750694e..ba9b150b 100644 --- a/clientserver.c +++ b/clientserver.c @@ -20,7 +20,7 @@ */ #include "rsync.h" -#include "ifuncs.h" +#include "itypes.h" extern int quiet; extern int dry_run; @@ -20,7 +20,7 @@ */ #include "rsync.h" -#include "ifuncs.h" +#include "inums.h" #ifndef ENODATA #define ENODATA EAGAIN @@ -23,6 +23,7 @@ #include "rsync.h" #include "ifuncs.h" #include "rounding.h" +#include "inums.h" #include "io.h" extern int am_root; diff --git a/generator.c b/generator.c index af6f22a2..85577408 100644 --- a/generator.c +++ b/generator.c @@ -21,7 +21,7 @@ */ #include "rsync.h" -#include "ifuncs.h" +#include "inums.h" extern int dry_run; extern int do_xfers; @@ -21,7 +21,7 @@ */ #include "rsync.h" -#include "ifuncs.h" +#include "inums.h" extern int dry_run; extern int list_only; @@ -66,85 +66,3 @@ d_name(struct dirent *di) return di->d_name; #endif } - -static inline char * -big_num(int64 num) -{ - return do_big_num(num, 0, NULL); -} - -static inline char * -comma_num(int64 num) -{ - extern int human_readable; - return do_big_num(num, human_readable != 0, NULL); -} - -static inline char * -human_num(int64 num) -{ - extern int human_readable; - return do_big_num(num, human_readable, NULL); -} - -static inline char * -big_dnum(double dnum, int decimal_digits) -{ - return do_big_dnum(dnum, 0, decimal_digits); -} - -static inline char * -comma_dnum(double dnum, int decimal_digits) -{ - extern int human_readable; - return do_big_dnum(dnum, human_readable != 0, decimal_digits); -} - -static inline char * -human_dnum(double dnum, int decimal_digits) -{ - extern int human_readable; - return do_big_dnum(dnum, human_readable, decimal_digits); -} - -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); -} diff --git a/inums.h b/inums.h new file mode 100644 index 00000000..62eea046 --- /dev/null +++ b/inums.h @@ -0,0 +1,57 @@ +/* Inline functions for rsync. + * + * Copyright (C) 2008 Wayne Davison + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, visit the http://fsf.org website. + */ + +static inline char * +big_num(int64 num) +{ + return do_big_num(num, 0, NULL); +} + +static inline char * +comma_num(int64 num) +{ + extern int human_readable; + return do_big_num(num, human_readable != 0, NULL); +} + +static inline char * +human_num(int64 num) +{ + extern int human_readable; + return do_big_num(num, human_readable, NULL); +} + +static inline char * +big_dnum(double dnum, int decimal_digits) +{ + return do_big_dnum(dnum, 0, decimal_digits); +} + +static inline char * +comma_dnum(double dnum, int decimal_digits) +{ + extern int human_readable; + return do_big_dnum(dnum, human_readable != 0, decimal_digits); +} + +static inline char * +human_dnum(double dnum, int decimal_digits) +{ + extern int human_readable; + return do_big_dnum(dnum, human_readable, decimal_digits); +} @@ -29,6 +29,7 @@ #include "rsync.h" #include "ifuncs.h" +#include "inums.h" /** If no timeout is specified then use a 60 second select timeout */ #define SELECT_TIMEOUT 60 diff --git a/itypes.h b/itypes.h new file mode 100644 index 00000000..df34140c --- /dev/null +++ b/itypes.h @@ -0,0 +1,59 @@ +/* Inline functions for rsync. + * + * Copyright (C) 2007-2008 Wayne Davison + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, visit the http://fsf.org website. + */ + +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); +} diff --git a/lib/compat.c b/lib/compat.c index 20beeca3..f756f76d 100644 --- a/lib/compat.c +++ b/lib/compat.c @@ -20,7 +20,7 @@ */ #include "rsync.h" -#include "ifuncs.h" +#include "itypes.h" extern char number_separator; @@ -44,7 +44,7 @@ */ #include "rsync.h" -#include "ifuncs.h" +#include "itypes.h" extern item_list dparam_list; @@ -20,7 +20,8 @@ */ #include "rsync.h" -#include "ifuncs.h" +#include "itypes.h" +#include "inums.h" extern int dry_run; extern int am_daemon; @@ -21,7 +21,7 @@ */ #include "rsync.h" -#include "ifuncs.h" +#include "inums.h" #include "io.h" #if defined CONFIG_LOCALE && defined HAVE_LOCALE_H #include <locale.h> @@ -20,7 +20,7 @@ */ #include "rsync.h" -#include "ifuncs.h" +#include "inums.h" extern int checksum_seed; extern int append_mode; @@ -20,7 +20,7 @@ */ #include "rsync.h" -#include "ifuncs.h" +#include "itypes.h" #include <popt.h> #include "zlib/zlib.h" @@ -75,6 +75,7 @@ #include "rsync.h" #include "ifuncs.h" +#include "itypes.h" /* -------------------------------------------------------------------------- ** * Constants... @@ -21,7 +21,7 @@ */ #include "rsync.h" -#include "ifuncs.h" +#include "inums.h" extern int am_server; extern int need_unsorted_flist; @@ -20,7 +20,7 @@ */ #include "rsync.h" -#include "ifuncs.h" +#include "inums.h" extern int dry_run; extern int do_xfers; @@ -20,7 +20,7 @@ */ #include "rsync.h" -#include "ifuncs.h" +#include "inums.h" extern int dry_run; extern int do_xfers; @@ -25,7 +25,7 @@ * emulate it using the KAME implementation. */ #include "rsync.h" -#include "ifuncs.h" +#include "itypes.h" #include <netinet/in_systm.h> #include <netinet/ip.h> #include <netinet/tcp.h> @@ -20,7 +20,7 @@ */ #include "rsync.h" -#include "ifuncs.h" +#include "itypes.h" #include "zlib/zlib.h" extern int do_compression; @@ -22,6 +22,8 @@ #include "rsync.h" #include "ifuncs.h" +#include "itypes.h" +#include "inums.h" extern int dry_run; extern int module_id; @@ -21,6 +21,7 @@ #include "rsync.h" #include "ifuncs.h" +#include "inums.h" #include "lib/sysxattrs.h" #ifdef SUPPORT_XATTRS |