Split up the ifuncs.h file into 3 .h files.
authorWayne Davison <wayned@samba.org>
Tue, 2 Sep 2008 02:09:21 +0000 (19:09 -0700)
committerWayne Davison <wayned@samba.org>
Tue, 2 Sep 2008 02:11:36 +0000 (19:11 -0700)
24 files changed:
Makefile.in
clientserver.c
fileio.c
flist.c
generator.c
hlink.c
ifuncs.h
inums.h [new file with mode: 0644]
io.c
itypes.h [new file with mode: 0644]
lib/compat.c
loadparm.c
log.c
main.c
match.c
options.c
params.c
progress.c
receiver.c
sender.c
socket.c
token.c
util.c
xattrs.c

index 0d77f175f373c3a959561aa58c8c40e2dc3c433a..be2235a09bc05b66baacbe2a0fdac006a211967e 100644 (file)
@@ -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 \
index 3750694e91a69ee261c7da6b7f1178431d60902b..ba9b150b3fd2a032f8ca4f71d50dc82c9972fdd0 100644 (file)
@@ -20,7 +20,7 @@
  */
 
 #include "rsync.h"
-#include "ifuncs.h"
+#include "itypes.h"
 
 extern int quiet;
 extern int dry_run;
index 38f9eb4b462855962a5dcf203555b8b000045146..5b55a0ca62c96a847b46b48ebdf688cd5d7ba00b 100644 (file)
--- 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 7c64d86d17c6d167e08e3377e79f68dad777fabe..766f1b37083beb8b7c06de431a4bd7423978c007 100644 (file)
--- 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;
index af6f22a21f37dd4bb4c0fb723943596672a1735d..855774088dfbdae7687832fb87cf25a30a579071 100644 (file)
@@ -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 212f515315149813ab68074f7da0e7f06df3e9bb..5f0f5a6fbc017ebc17c7343dd1a087f4b60fbc8b 100644 (file)
--- 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;
index 6562764e1941168168f18a40cba43e898c32d712..0fe900a3db5e55979ef46a27682f9f4321183c1f 100644 (file)
--- 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 (file)
index 0000000..62eea04
--- /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 d3ae5368bfa3e93b7858ebf59961022aedfcdaad..ed556b15efaa1364fe853c696cf8210d578e1fdb 100644 (file)
--- 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 (file)
index 0000000..df34140
--- /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);
+}
index 20beeca3f067d36f47c74a671f52ff8d56632bf7..f756f76d6b6dd82333200e6748c171e80eb17fd8 100644 (file)
@@ -20,7 +20,7 @@
  */
 
 #include "rsync.h"
-#include "ifuncs.h"
+#include "itypes.h"
 
 extern char number_separator;
 
index bc33b90101c5998ba1a7bfbe7468f162633e1a4f..e20461254f5fca437d01284a8110eac98f8ae8a1 100644 (file)
@@ -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 adf3a4ad739e65a55f229cd49aedd8e7093d63e8..991b7cc9b415b4452cfbc2cbb4b7ca9eecde013f 100644 (file)
--- 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 942fec36c2c9fbc3b2f5c70c1754ddec54e3e917..f342150bab60bcb7beeb4dd773a4b606efc762af 100644 (file)
--- 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 <locale.h>
diff --git a/match.c b/match.c
index c459af84e68359cfc59ac0483113477fff1a0466..80619a49ee8ce983068f57d95b9814c396fd09f2 100644 (file)
--- 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;
index e0a84017b8c66aac56373cf2da695e8efba8b623..2d049744795f2af9f39ffa78bd3c1607ad18dffc 100644 (file)
--- a/options.c
+++ b/options.c
@@ -20,7 +20,7 @@
  */
 
 #include "rsync.h"
-#include "ifuncs.h"
+#include "itypes.h"
 #include <popt.h>
 #include "zlib/zlib.h"
 
index aa79953f8787dc0162cb5b395d060563deedfc67..a14242e8794946098095e125fef63e6eec6c8342 100644 (file)
--- a/params.c
+++ b/params.c
@@ -75,6 +75,7 @@
 
 #include "rsync.h"
 #include "ifuncs.h"
+#include "itypes.h"
 
 /* -------------------------------------------------------------------------- **
  * Constants...
index 5d445a1334e6d404d4db03a81a67f6e1ec6aa889..e6cdd437560c344f2f63e761e62bd8d14c612e5e 100644 (file)
@@ -21,7 +21,7 @@
  */
 
 #include "rsync.h"
-#include "ifuncs.h"
+#include "inums.h"
 
 extern int am_server;
 extern int need_unsorted_flist;
index 9b353f5677507896190286ef86e71c5e676d999b..3afc40fbea4d772d9e02faba07394fe74ed8125c 100644 (file)
@@ -20,7 +20,7 @@
  */
 
 #include "rsync.h"
-#include "ifuncs.h"
+#include "inums.h"
 
 extern int dry_run;
 extern int do_xfers;
index 2919e55300ca4a7c89406afb62c1b550e633e2d9..3937a10fb5feb9f419264871cd487bbb0161c19a 100644 (file)
--- 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;
index 2b3271cf9331be271463ae47ac153f22b5c7c60c..87b1ec34706d3028ebee608bbae0a19db921c18b 100644 (file)
--- 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 <netinet/in_systm.h>
 #include <netinet/ip.h>
 #include <netinet/tcp.h>
diff --git a/token.c b/token.c
index 5e76148590441c0f955521971351a0b1521a0181..08c1190dd4bee70f3df60a862db94629ea7ae509 100644 (file)
--- 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 e3402845e8ed38f89491e7e74c6f883ff3a90b16..7569981d83e40c25bcaa8ff22f92b62fb987ad65 100644 (file)
--- 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;
index 2855e583a47cf2eef46ff9a1c76d5a021d66fb1d..28d147d9862702a8dfa5647520210e2bea2b6523 100644 (file)
--- 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