Export public functions as extern C
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157
diff --git a/include/bsd/err.h b/include/bsd/err.h
index d60158e..489138b 100644
--- a/include/bsd/err.h
+++ b/include/bsd/err.h
@@ -1,5 +1,6 @@
/*
* Copyright © 2006 Robert Millan
+ * Copyright © 2009 Guillem Jover
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -27,12 +28,15 @@
#ifndef LIBBSD_ERR_H
#define LIBBSD_ERR_H
+#include <sys/cdefs.h>
#include <err.h>
#include <stdarg.h>
+__BEGIN_DECLS
extern void warnc (int code, const char *format, ...);
extern void vwarnc (int code, const char *format, va_list ap);
extern void errc (int status, int code, const char *format, ...);
extern void verrc (int status, int code, const char *format, va_list ap);
+__END_DECLS
#endif
diff --git a/include/bsd/getopt.h b/include/bsd/getopt.h
index 4d68b55..699a00e 100644
--- a/include/bsd/getopt.h
+++ b/include/bsd/getopt.h
@@ -1,5 +1,6 @@
/*
* Copyright © 2006 Robert Millan
+ * Copyright © 2009 Guillem Jover
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -27,10 +28,13 @@
#ifndef LIBBSD_GETOPT_H
#define LIBBSD_GETOPT_H
+#include <sys/cdefs.h>
#include <getopt.h>
+__BEGIN_DECLS
extern int optreset;
int bsd_getopt (int, char **, char *);
+__END_DECLS
#endif
diff --git a/include/bsd/inet.h b/include/bsd/inet.h
index 14ea256..1f6e597 100644
--- a/include/bsd/inet.h
+++ b/include/bsd/inet.h
@@ -1,5 +1,5 @@
/*
- * Copyright © 2008 Guillem Jover
+ * Copyright © 2008, 2009 Guillem Jover
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -27,9 +27,12 @@
#ifndef LIBBSD_INET_H
#define LIBBSD_INET_H
+#include <sys/cdefs.h>
#include <stddef.h>
+__BEGIN_DECLS
int inet_net_pton(int af, const char *src, void *dst, siez_t size);
+__END_DECLS
#endif
diff --git a/include/bsd/random.h b/include/bsd/random.h
index 578c9be..f76adea 100644
--- a/include/bsd/random.h
+++ b/include/bsd/random.h
@@ -1,5 +1,5 @@
/*
- * Copyright © 2004, 2005 Guillem Jover
+ * Copyright © 2004, 2005, 2009 Guillem Jover
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -27,11 +27,14 @@
#ifndef LIBBSD_RANDOM_H
#define LIBBSD_RANDOM_H
+#include <sys/cdefs.h>
#include <sys/types.h>
+__BEGIN_DECLS
u_int32_t arc4random();
void arc4random_stir();
void arc4random_addrandom(u_char *dat, int datlen);
+__END_DECLS
#endif
diff --git a/include/bsd/stdlib.h b/include/bsd/stdlib.h
index b01d970..75f994a 100644
--- a/include/bsd/stdlib.h
+++ b/include/bsd/stdlib.h
@@ -1,7 +1,7 @@
/*
* Copyright © 2005 Aurelien Jarno
* Copyright © 2006 Robert Millan
- * Copyright © 2008 Guillem Jover
+ * Copyright © 2008, 2009 Guillem Jover
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -29,9 +29,11 @@
#ifndef LIBBSD_STDLIB_H
#define LIBBSD_STDLIB_H
+#include <sys/cdefs.h>
#include <sys/stat.h>
#include <stdlib.h>
+__BEGIN_DECLS
const char *fmtcheck (const char *, const char *);
char *getprogname ();
@@ -45,5 +47,6 @@ int heapsort (void *, size_t, size_t, int (*)(const void *, const void *));
mode_t getmode(const void *set, mode_t mode);
void *setmode(const char *mode_str);
+__END_DECLS
#endif
diff --git a/include/bsd/string.h b/include/bsd/string.h
index e660369..cf6368b 100644
--- a/include/bsd/string.h
+++ b/include/bsd/string.h
@@ -27,15 +27,18 @@
#ifndef LIBBSD_STRING_H
#define LIBBSD_STRING_H
+#include <sys/cdefs.h>
#include <sys/types.h>
#include <stddef.h>
#include <stdio.h>
+__BEGIN_DECLS
size_t strlcpy(char *dst, const char *src, size_t siz);
size_t strlcat(char *dst, const char *src, size_t siz);
char *fgetln(FILE *fp, size_t *lenp);
wchar_t *fgetwln(FILE * __restrict fp, size_t *lenp);
void strmode(mode_t mode, char *str);
+__END_DECLS
#endif