From 221135d6bf256c85b4aeb08881d6262f6eaadff4 Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Fri, 31 Mar 2000 23:30:21 +0000 Subject: [PATCH] Include "lib/string.h" instead of . It should give us bzero() and other non-portable functions on all systems. --- client/client.c | 2 +- client/commands.c | 2 +- client/util.c | 1 - conf/cf-lex.l | 1 - conf/confbase.Y | 1 + filter/config.Y | 9 --------- lib/ip.c | 2 +- lib/ipv4.c | 1 - lib/ipv6.c | 3 +-- lib/ipv6.h | 2 +- lib/md5.c | 2 +- lib/mempool.c | 2 +- lib/printf.c | 1 - lib/resource.c | 2 +- lib/slab.c | 2 +- lib/string.h | 1 + lib/unaligned.h | 2 +- nest/cli.c | 2 -- nest/proto.c | 2 -- nest/rt-attr.c | 2 +- nest/rt-dev.c | 3 +-- nest/rt-fib.c | 3 +-- nest/rt-table.c | 3 +-- proto/ospf/ospf.h | 2 -- proto/ospf/topology.c | 3 +-- proto/rip/auth.c | 2 +- proto/rip/rip.c | 2 +- proto/static/static.c | 2 -- sysdep/linux/krt-scan.c | 2 +- sysdep/linux/netlink/netlink.c | 2 +- sysdep/unix/io.c | 1 - sysdep/unix/krt-iface.c | 2 +- sysdep/unix/krt-set.c | 2 +- sysdep/unix/main.c | 2 +- 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 -#include #include #include #include @@ -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 -#include #include #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 -#include #include #include 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 #include -#include #include #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 - #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 #include #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 #include #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 * * Can be freely distributed and used under the terms of the GNU GPL. - * */ #include -#include #include #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 -#include +#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 */ -#include /* 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 -#include #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 -#include /* 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 #include -#include #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 -#include #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 +#include 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 +#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 - #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 - #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 #include #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 - #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 - #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 - #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 - #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 - #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 #include #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 #include #include @@ -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 - #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 #include #include #include @@ -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 #include #include #include @@ -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 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 #include -#include #include #include #include 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 #include #include #include @@ -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 #include #include #include @@ -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 -#include #include #include #include @@ -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"