From: Wayne Davison Date: Tue, 2 Sep 2008 02:09:21 +0000 (-0700) Subject: Split up the ifuncs.h file into 3 .h files. X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/commitdiff_plain/5dd14f0c3388f69932d521915e039e32b9e6d970?hp=2a147e9fcb6ed2caf2fd04f1713249cb17ad2b1f Split up the ifuncs.h file into 3 .h files. --- 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; diff --git a/fileio.c b/fileio.c index 38f9eb4b..5b55a0ca 100644 --- a/fileio.c +++ b/fileio.c @@ -20,7 +20,7 @@ */ #include "rsync.h" -#include "ifuncs.h" +#include "inums.h" #ifndef ENODATA #define ENODATA EAGAIN diff --git a/flist.c b/flist.c index 7c64d86d..766f1b37 100644 --- a/flist.c +++ b/flist.c @@ -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; diff --git a/hlink.c b/hlink.c index 212f5153..5f0f5a6f 100644 --- a/hlink.c +++ b/hlink.c @@ -21,7 +21,7 @@ */ #include "rsync.h" -#include "ifuncs.h" +#include "inums.h" extern int dry_run; extern int list_only; diff --git a/ifuncs.h b/ifuncs.h index 6562764e..0fe900a3 100644 --- a/ifuncs.h +++ b/ifuncs.h @@ -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); +} diff --git a/io.c b/io.c index d3ae5368..ed556b15 100644 --- a/io.c +++ b/io.c @@ -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; diff --git a/loadparm.c b/loadparm.c index bc33b901..e2046125 100644 --- a/loadparm.c +++ b/loadparm.c @@ -44,7 +44,7 @@ */ #include "rsync.h" -#include "ifuncs.h" +#include "itypes.h" extern item_list dparam_list; diff --git a/log.c b/log.c index adf3a4ad..991b7cc9 100644 --- a/log.c +++ b/log.c @@ -20,7 +20,8 @@ */ #include "rsync.h" -#include "ifuncs.h" +#include "itypes.h" +#include "inums.h" extern int dry_run; extern int am_daemon; diff --git a/main.c b/main.c index 942fec36..f342150b 100644 --- a/main.c +++ b/main.c @@ -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 diff --git a/match.c b/match.c index c459af84..80619a49 100644 --- a/match.c +++ b/match.c @@ -20,7 +20,7 @@ */ #include "rsync.h" -#include "ifuncs.h" +#include "inums.h" extern int checksum_seed; extern int append_mode; diff --git a/options.c b/options.c index e0a84017..2d049744 100644 --- a/options.c +++ b/options.c @@ -20,7 +20,7 @@ */ #include "rsync.h" -#include "ifuncs.h" +#include "itypes.h" #include #include "zlib/zlib.h" diff --git a/params.c b/params.c index aa79953f..a14242e8 100644 --- a/params.c +++ b/params.c @@ -75,6 +75,7 @@ #include "rsync.h" #include "ifuncs.h" +#include "itypes.h" /* -------------------------------------------------------------------------- ** * Constants... diff --git a/progress.c b/progress.c index 5d445a13..e6cdd437 100644 --- a/progress.c +++ b/progress.c @@ -21,7 +21,7 @@ */ #include "rsync.h" -#include "ifuncs.h" +#include "inums.h" extern int am_server; extern int need_unsorted_flist; diff --git a/receiver.c b/receiver.c index 9b353f56..3afc40fb 100644 --- a/receiver.c +++ b/receiver.c @@ -20,7 +20,7 @@ */ #include "rsync.h" -#include "ifuncs.h" +#include "inums.h" extern int dry_run; extern int do_xfers; diff --git a/sender.c b/sender.c index 2919e553..3937a10f 100644 --- a/sender.c +++ b/sender.c @@ -20,7 +20,7 @@ */ #include "rsync.h" -#include "ifuncs.h" +#include "inums.h" extern int dry_run; extern int do_xfers; diff --git a/socket.c b/socket.c index 2b3271cf..87b1ec34 100644 --- a/socket.c +++ b/socket.c @@ -25,7 +25,7 @@ * emulate it using the KAME implementation. */ #include "rsync.h" -#include "ifuncs.h" +#include "itypes.h" #include #include #include diff --git a/token.c b/token.c index 5e761485..08c1190d 100644 --- a/token.c +++ b/token.c @@ -20,7 +20,7 @@ */ #include "rsync.h" -#include "ifuncs.h" +#include "itypes.h" #include "zlib/zlib.h" extern int do_compression; diff --git a/util.c b/util.c index e3402845..7569981d 100644 --- a/util.c +++ b/util.c @@ -22,6 +22,8 @@ #include "rsync.h" #include "ifuncs.h" +#include "itypes.h" +#include "inums.h" extern int dry_run; extern int module_id; diff --git a/xattrs.c b/xattrs.c index 2855e583..28d147d9 100644 --- a/xattrs.c +++ b/xattrs.c @@ -21,6 +21,7 @@ #include "rsync.h" #include "ifuncs.h" +#include "inums.h" #include "lib/sysxattrs.h" #ifdef SUPPORT_XATTRS