summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Mares <mj@ucw.cz>2000-03-31 23:30:21 +0000
committerMartin Mares <mj@ucw.cz>2000-03-31 23:30:21 +0000
commit221135d6bf256c85b4aeb08881d6262f6eaadff4 (patch)
treeb2e09621cefeb03e184e80ea0373c3f7bb26c913
parentc00d31befab5a7e932231f7a8050547c72c94631 (diff)
Include "lib/string.h" instead of <string.h>. It should give us bzero()
and other non-portable functions on all systems.
-rw-r--r--client/client.c2
-rw-r--r--client/commands.c2
-rw-r--r--client/util.c1
-rw-r--r--conf/cf-lex.l1
-rw-r--r--conf/confbase.Y1
-rw-r--r--filter/config.Y9
-rw-r--r--lib/ip.c2
-rw-r--r--lib/ipv4.c1
-rw-r--r--lib/ipv6.c3
-rw-r--r--lib/ipv6.h2
-rw-r--r--lib/md5.c2
-rw-r--r--lib/mempool.c2
-rw-r--r--lib/printf.c1
-rw-r--r--lib/resource.c2
-rw-r--r--lib/slab.c2
-rw-r--r--lib/string.h1
-rw-r--r--lib/unaligned.h2
-rw-r--r--nest/cli.c2
-rw-r--r--nest/proto.c2
-rw-r--r--nest/rt-attr.c2
-rw-r--r--nest/rt-dev.c3
-rw-r--r--nest/rt-fib.c3
-rw-r--r--nest/rt-table.c3
-rw-r--r--proto/ospf/ospf.h2
-rw-r--r--proto/ospf/topology.c3
-rw-r--r--proto/rip/auth.c2
-rw-r--r--proto/rip/rip.c2
-rw-r--r--proto/static/static.c2
-rw-r--r--sysdep/linux/krt-scan.c2
-rw-r--r--sysdep/linux/netlink/netlink.c2
-rw-r--r--sysdep/unix/io.c1
-rw-r--r--sysdep/unix/krt-iface.c2
-rw-r--r--sysdep/unix/krt-set.c2
-rw-r--r--sysdep/unix/main.c2
34 files changed, 24 insertions, 49 deletions
diff --git a/client/client.c b/client/client.c
index 568ea2f6..5381577f 100644
--- a/client/client.c
+++ b/client/client.c
@@ -7,7 +7,6 @@
*/
#include <stdio.h>
-#include <string.h>
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
@@ -21,6 +20,7 @@
#include "nest/bird.h"
#include "lib/resource.h"
+#include "lib/string.h"
#include "client/client.h"
static char *opt_list = "s:v";
diff --git a/client/commands.c b/client/commands.c
index fdcb6d27..aa00be08 100644
--- a/client/commands.c
+++ b/client/commands.c
@@ -7,11 +7,11 @@
*/
#include <stdio.h>
-#include <string.h>
#include <ctype.h>
#include "nest/bird.h"
#include "lib/resource.h"
+#include "lib/string.h"
#include "client/client.h"
struct cmd_info {
diff --git a/client/util.c b/client/util.c
index 9f1a16b6..451bb60c 100644
--- a/client/util.c
+++ b/client/util.c
@@ -7,7 +7,6 @@
*/
#include <stdio.h>
-#include <string.h>
#include <stdlib.h>
#include <stdarg.h>
diff --git a/conf/cf-lex.l b/conf/cf-lex.l
index 557d8374..483bcaf3 100644
--- a/conf/cf-lex.l
+++ b/conf/cf-lex.l
@@ -11,7 +11,6 @@
#include <errno.h>
#include <stdlib.h>
-#include <string.h>
#include <stdarg.h>
#include "nest/bird.h"
diff --git a/conf/confbase.Y b/conf/confbase.Y
index 0b9f3d30..656fc890 100644
--- a/conf/confbase.Y
+++ b/conf/confbase.Y
@@ -13,6 +13,7 @@ CF_HDR
#include "lib/resource.h"
#include "lib/socket.h"
#include "lib/timer.h"
+#include "lib/string.h"
#include "nest/protocol.h"
#include "nest/iface.h"
#include "nest/route.h"
diff --git a/filter/config.Y b/filter/config.Y
index 413e88cb..39085792 100644
--- a/filter/config.Y
+++ b/filter/config.Y
@@ -71,15 +71,6 @@ atributy, je budou moci pridat do tmp_attrs, aniz by sahly na rta.
CF_HDR
-#include "nest/bird.h"
-#include "lib/resource.h"
-#include "lib/socket.h"
-#include "lib/timer.h"
-#include "nest/protocol.h"
-#include "nest/iface.h"
-#include "nest/route.h"
-#include <string.h>
-
#define P(a,b) ((a<<8) | b)
CF_DECLS
diff --git a/lib/ip.c b/lib/ip.c
index 06cc42cf..143f50e8 100644
--- a/lib/ip.c
+++ b/lib/ip.c
@@ -6,11 +6,11 @@
* Can be freely distributed and used under the terms of the GNU GPL.
*/
-#include <string.h>
#include <stdlib.h>
#include "nest/bird.h"
#include "lib/ip.h"
+#include "lib/string.h"
char *
ip_scope_text(unsigned scope)
diff --git a/lib/ipv4.c b/lib/ipv4.c
index bf5474a0..db3b54aa 100644
--- a/lib/ipv4.c
+++ b/lib/ipv4.c
@@ -6,7 +6,6 @@
* Can be freely distributed and used under the terms of the GNU GPL.
*/
-#include <string.h>
#include <stdlib.h>
#include "nest/bird.h"
diff --git a/lib/ipv6.c b/lib/ipv6.c
index 3c01a4f4..9f49be3a 100644
--- a/lib/ipv6.c
+++ b/lib/ipv6.c
@@ -4,17 +4,16 @@
* (c) 1999 Martin Mares <mj@ucw.cz>
*
* Can be freely distributed and used under the terms of the GNU GPL.
- *
*/
#include <stdio.h>
-#include <string.h>
#include <stdlib.h>
#include "nest/bird.h"
#include "lib/ip.h"
#include "lib/bitops.h"
#include "lib/endian.h"
+#include "lib/string.h"
/*
* See RFC 2373 for explanation of IPv6 addressing issues.
diff --git a/lib/ipv6.h b/lib/ipv6.h
index 6f157cd6..cf7a9bbe 100644
--- a/lib/ipv6.h
+++ b/lib/ipv6.h
@@ -10,7 +10,7 @@
#define _BIRD_IPV6_H_
#include <netinet/in.h>
-#include <string.h>
+#include "lib/string.h"
typedef struct ipv6_addr {
u32 addr[4];
diff --git a/lib/md5.c b/lib/md5.c
index 9fec594c..ad284f07 100644
--- a/lib/md5.c
+++ b/lib/md5.c
@@ -19,8 +19,8 @@
* Adapted for BIRD by Martin Mares <mj@atrey.karlin.mff.cuni.cz>
*/
-#include <string.h> /* for memcpy() */
#include "nest/bird.h"
+#include "lib/string.h"
#include "md5.h"
#ifdef CPU_LITTLE_ENDIAN
diff --git a/lib/mempool.c b/lib/mempool.c
index faf0334a..c9c1dd63 100644
--- a/lib/mempool.c
+++ b/lib/mempool.c
@@ -7,10 +7,10 @@
*/
#include <stdlib.h>
-#include <string.h>
#include "nest/bird.h"
#include "lib/resource.h"
+#include "lib/string.h"
struct lp_chunk {
struct lp_chunk *next;
diff --git a/lib/printf.c b/lib/printf.c
index a8259ab5..64fcf728 100644
--- a/lib/printf.c
+++ b/lib/printf.c
@@ -11,7 +11,6 @@
#include "string.h"
#include <errno.h>
-#include <string.h>
/* we use this so that we can do without the ctype library */
#define is_digit(c) ((c) >= '0' && (c) <= '9')
diff --git a/lib/resource.c b/lib/resource.c
index ceaa0add..98bfe4e1 100644
--- a/lib/resource.c
+++ b/lib/resource.c
@@ -8,10 +8,10 @@
#include <stdio.h>
#include <stdlib.h>
-#include <string.h>
#include "nest/bird.h"
#include "lib/resource.h"
+#include "lib/string.h"
struct pool {
resource r;
diff --git a/lib/slab.c b/lib/slab.c
index 98c3ec5c..e2e741c8 100644
--- a/lib/slab.c
+++ b/lib/slab.c
@@ -9,10 +9,10 @@
*/
#include <stdlib.h>
-#include <string.h>
#include "nest/bird.h"
#include "lib/resource.h"
+#include "lib/string.h"
#undef FAKE_SLAB /* Turn on if you want to debug memory allocations */
diff --git a/lib/string.h b/lib/string.h
index 03affacc..14eaa360 100644
--- a/lib/string.h
+++ b/lib/string.h
@@ -10,6 +10,7 @@
#define _BIRD_STRING_H_
#include <stdarg.h>
+#include <string.h>
int bsprintf(char *str, const char *fmt, ...);
int bvsprintf(char *str, const char *fmt, va_list args);
diff --git a/lib/unaligned.h b/lib/unaligned.h
index fa17a837..af655204 100644
--- a/lib/unaligned.h
+++ b/lib/unaligned.h
@@ -17,7 +17,7 @@
* if possible.
*/
-#include <string.h>
+#include "lib/string.h"
static inline u16
get_u16(void *p)
diff --git a/nest/cli.c b/nest/cli.c
index 661178c4..f7432a55 100644
--- a/nest/cli.c
+++ b/nest/cli.c
@@ -6,8 +6,6 @@
* Can be freely distributed and used under the terms of the GNU GPL.
*/
-#include <string.h>
-
#include "nest/bird.h"
#include "nest/cli.h"
#include "conf/conf.h"
diff --git a/nest/proto.c b/nest/proto.c
index 95988ce5..c6a3d7d4 100644
--- a/nest/proto.c
+++ b/nest/proto.c
@@ -8,8 +8,6 @@
#undef LOCAL_DEBUG
-#include <string.h>
-
#include "nest/bird.h"
#include "nest/protocol.h"
#include "lib/resource.h"
diff --git a/nest/rt-attr.c b/nest/rt-attr.c
index 8dc2e7eb..63f596ef 100644
--- a/nest/rt-attr.c
+++ b/nest/rt-attr.c
@@ -6,7 +6,6 @@
* Can be freely distributed and used under the terms of the GNU GPL.
*/
-#include <string.h>
#include <alloca.h>
#include "nest/bird.h"
@@ -15,6 +14,7 @@
#include "nest/iface.h"
#include "nest/cli.h"
#include "lib/resource.h"
+#include "lib/string.h"
static slab *rta_slab;
static pool *rta_pool;
diff --git a/nest/rt-dev.c b/nest/rt-dev.c
index d42ed157..1ad56009 100644
--- a/nest/rt-dev.c
+++ b/nest/rt-dev.c
@@ -8,8 +8,6 @@
#undef LOCAL_DEBUG
-#include <string.h>
-
#include "nest/bird.h"
#include "nest/iface.h"
#include "nest/protocol.h"
@@ -17,6 +15,7 @@
#include "nest/rt-dev.h"
#include "conf/conf.h"
#include "lib/resource.h"
+#include "lib/string.h"
static void
dev_ifa_notify(struct proto *p, unsigned c, struct ifa *ad)
diff --git a/nest/rt-fib.c b/nest/rt-fib.c
index 4d898763..6a8f8009 100644
--- a/nest/rt-fib.c
+++ b/nest/rt-fib.c
@@ -8,10 +8,9 @@
#undef LOCAL_DEBUG
-#include <string.h>
-
#include "nest/bird.h"
#include "nest/route.h"
+#include "lib/string.h"
#define HASH_DEF_ORDER 10
#define HASH_HI_MARK *4
diff --git a/nest/rt-table.c b/nest/rt-table.c
index 68ef52a9..d04d06e2 100644
--- a/nest/rt-table.c
+++ b/nest/rt-table.c
@@ -6,8 +6,6 @@
* Can be freely distributed and used under the terms of the GNU GPL.
*/
-#include <string.h>
-
#undef LOCAL_DEBUG
#include "nest/bird.h"
@@ -20,6 +18,7 @@
#include "lib/string.h"
#include "conf/conf.h"
#include "filter/filter.h"
+#include "lib/string.h"
static slab *rte_slab;
static linpool *rte_update_pool;
diff --git a/proto/ospf/ospf.h b/proto/ospf/ospf.h
index c07d3347..c2db08d1 100644
--- a/proto/ospf/ospf.h
+++ b/proto/ospf/ospf.h
@@ -13,8 +13,6 @@
#define SIPH 64 /* FIXME Size Of IP header */
-#include <string.h>
-
#include "nest/bird.h"
#include "lib/checksum.h"
diff --git a/proto/ospf/topology.c b/proto/ospf/topology.c
index 12eff1e8..f32476df 100644
--- a/proto/ospf/topology.c
+++ b/proto/ospf/topology.c
@@ -9,9 +9,8 @@
#define LOCAL_DEBUG
-#include <string.h>
-
#include "nest/bird.h"
+#include "lib/string.h"
#include "ospf.h"
diff --git a/proto/rip/auth.c b/proto/rip/auth.c
index a14cb95a..b18c2b4f 100644
--- a/proto/rip/auth.c
+++ b/proto/rip/auth.c
@@ -9,7 +9,6 @@
#define LOCAL_DEBUG
-#include <string.h>
#include <stdlib.h>
#include "nest/bird.h"
@@ -21,6 +20,7 @@
#include "lib/lists.h"
#include "lib/timer.h"
#include "lib/md5.h"
+#include "lib/string.h"
#include "rip.h"
diff --git a/proto/rip/rip.c b/proto/rip/rip.c
index 09bf5a2e..4634ae1f 100644
--- a/proto/rip/rip.c
+++ b/proto/rip/rip.c
@@ -27,7 +27,6 @@
#define LOCAL_DEBUG
-#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -39,6 +38,7 @@
#include "lib/resource.h"
#include "lib/lists.h"
#include "lib/timer.h"
+#include "lib/string.h"
#include "rip.h"
diff --git a/proto/static/static.c b/proto/static/static.c
index 1aee2c7b..7df62ed0 100644
--- a/proto/static/static.c
+++ b/proto/static/static.c
@@ -8,8 +8,6 @@
#undef LOCAL_DEBUG
-#include <string.h>
-
#include "nest/bird.h"
#include "nest/iface.h"
#include "nest/protocol.h"
diff --git a/sysdep/linux/krt-scan.c b/sysdep/linux/krt-scan.c
index c7a5a860..42f92877 100644
--- a/sysdep/linux/krt-scan.c
+++ b/sysdep/linux/krt-scan.c
@@ -6,7 +6,6 @@
* Can be freely distributed and used under the terms of the GNU GPL.
*/
-#include <string.h>
#include <stdio.h>
#include <ctype.h>
#include <fcntl.h>
@@ -22,6 +21,7 @@
#include "lib/timer.h"
#include "lib/unix.h"
#include "lib/krt.h"
+#include "lib/string.h"
static int krt_scan_fd = -1;
diff --git a/sysdep/linux/netlink/netlink.c b/sysdep/linux/netlink/netlink.c
index 9168e9f9..86f13f0b 100644
--- a/sysdep/linux/netlink/netlink.c
+++ b/sysdep/linux/netlink/netlink.c
@@ -6,7 +6,6 @@
* Can be freely distributed and used under the terms of the GNU GPL.
*/
-#include <string.h>
#include <stdio.h>
#include <fcntl.h>
#include <net/if.h>
@@ -24,6 +23,7 @@
#include "lib/unix.h"
#include "lib/krt.h"
#include "lib/socket.h"
+#include "lib/string.h"
#include "conf/conf.h"
#include <asm/types.h>
diff --git a/sysdep/unix/io.c b/sysdep/unix/io.c
index 0925609b..1ee1c073 100644
--- a/sysdep/unix/io.c
+++ b/sysdep/unix/io.c
@@ -8,7 +8,6 @@
#include <stdio.h>
#include <stdlib.h>
-#include <string.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/socket.h>
diff --git a/sysdep/unix/krt-iface.c b/sysdep/unix/krt-iface.c
index da3df2d2..bd4a40a7 100644
--- a/sysdep/unix/krt-iface.c
+++ b/sysdep/unix/krt-iface.c
@@ -6,7 +6,6 @@
* Can be freely distributed and used under the terms of the GNU GPL.
*/
-#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
@@ -22,6 +21,7 @@
#include "nest/protocol.h"
#include "lib/timer.h"
#include "lib/krt.h"
+#include "lib/string.h"
#include "unix.h"
diff --git a/sysdep/unix/krt-set.c b/sysdep/unix/krt-set.c
index 72424506..bd564486 100644
--- a/sysdep/unix/krt-set.c
+++ b/sysdep/unix/krt-set.c
@@ -6,7 +6,6 @@
* Can be freely distributed and used under the terms of the GNU GPL.
*/
-#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
@@ -21,6 +20,7 @@
#include "nest/protocol.h"
#include "lib/unix.h"
#include "lib/krt.h"
+#include "lib/string.h"
int
krt_capable(rte *e)
diff --git a/sysdep/unix/main.c b/sysdep/unix/main.c
index dcd921f0..121ec9dc 100644
--- a/sysdep/unix/main.c
+++ b/sysdep/unix/main.c
@@ -9,7 +9,6 @@
#define LOCAL_DEBUG
#include <stdio.h>
-#include <string.h>
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
@@ -20,6 +19,7 @@
#include "lib/resource.h"
#include "lib/socket.h"
#include "lib/event.h"
+#include "lib/string.h"
#include "nest/route.h"
#include "nest/protocol.h"
#include "nest/iface.h"