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 0d77f17..be2235a 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 3750694..ba9b150 100644 (file)
@@ -20,7 +20,7 @@
  */
 
 #include "rsync.h"
-#include "ifuncs.h"
+#include "itypes.h"
 
 extern int quiet;
 extern int dry_run;
index 38f9eb4..5b55a0c 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 7c64d86..766f1b3 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 af6f22a..8557740 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 212f515..5f0f5a6 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 6562764..0fe900a 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 d3ae536..ed556b1 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 20beeca..f756f76 100644 (file)
@@ -20,7 +20,7 @@
  */
 
 #include "rsync.h"
-#include "ifuncs.h"
+#include "itypes.h"
 
 extern char number_separator;
 
index bc33b90..e204612 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 adf3a4a..991b7cc 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 942fec3..f342150 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 c459af8..80619a4 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 e0a8401..2d04974 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 aa79953..a14242e 100644 (file)
--- a/params.c
+++ b/params.c
@@ -75,6 +75,7 @@
 
 #include "rsync.h"
 #include "ifuncs.h"
+#include "itypes.h"
 
 /* -------------------------------------------------------------------------- **
  * Constants...
index 5d445a1..e6cdd43 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 9b353f5..3afc40f 100644 (file)
@@ -20,7 +20,7 @@
  */
 
 #include "rsync.h"
-#include "ifuncs.h"
+#include "inums.h"
 
 extern int dry_run;
 extern int do_xfers;
index 2919e55..3937a10 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 2b3271c..87b1ec3 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 5e76148..08c1190 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 e340284..7569981 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 2855e58..28d147d 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