general: remove inline qualifiers and move in-header functions to objects
* (general) Move functions in headers into files, to be compiled into
shared object files. Remove inline qualifier from functions. Let the
compiler do the work.
diff --git a/lib/prefix.h b/lib/prefix.h
index dab4202..7f0d360 100644
--- a/lib/prefix.h
+++ b/lib/prefix.h
@@ -128,26 +128,14 @@
/* Prefix's family member. */
#define PREFIX_FAMILY(p) ((p)->family)
-/* Check bit of the prefix. */
-static inline unsigned int
-prefix_bit (const u_char *prefix, const u_char prefixlen)
-{
- unsigned int offset = prefixlen / 8;
- unsigned int shift = 7 - (prefixlen % 8);
-
- return (prefix[offset] >> shift) & 1;
-}
-
-static inline unsigned int
-prefix6_bit (const struct in6_addr *prefix, const u_char prefixlen)
-{
- return prefix_bit((const u_char *) &prefix->s6_addr, prefixlen);
-}
-
/* Prototypes. */
extern int afi2family (afi_t);
extern afi_t family2afi (int);
+/* Check bit of the prefix. */
+extern unsigned int prefix_bit (const u_char *prefix, const u_char prefixlen);
+extern unsigned int prefix6_bit (const struct in6_addr *prefix, const u_char prefixlen);
+
extern struct prefix *prefix_new (void);
extern void prefix_free (struct prefix *);
extern const char *prefix_family_str (const struct prefix *);