aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorBrent Cook <busterb@gmail.com>2014-07-10 06:21:51 -0500
committerBrent Cook <busterb@gmail.com>2014-07-10 06:22:54 -0500
commit2b6dbc39ef274d5298daad1ff864be8fc3c56537 (patch)
treebed05f6232bad0278f952bcfa173c50c202f4309 /include
parente9eff5016a4ec2153c037c1b888acd2755965755 (diff)
downloadportable-2b6dbc39ef274d5298daad1ff864be8fc3c56537.tar.gz
portable-2b6dbc39ef274d5298daad1ff864be8fc3c56537.tar.bz2
portable-2b6dbc39ef274d5298daad1ff864be8fc3c56537.zip
initial top-level import of subdirectories
Diffstat (limited to 'include')
-rw-r--r--include/Makefile.am3
-rw-r--r--include/machine/endian.h14
-rw-r--r--include/openssl/Makefile.am.tpl5
-rw-r--r--include/stdlib.h16
-rw-r--r--include/string.h25
-rw-r--r--include/sys/types.h13
-rw-r--r--include/unistd.h9
7 files changed, 85 insertions, 0 deletions
diff --git a/include/Makefile.am b/include/Makefile.am
new file mode 100644
index 0000000..f2860a4
--- /dev/null
+++ b/include/Makefile.am
@@ -0,0 +1,3 @@
1SUBDIRS = openssl
2
3noinst_HEADERS = pqueue.h stdlib.h string.h machine/endian.h
diff --git a/include/machine/endian.h b/include/machine/endian.h
new file mode 100644
index 0000000..4d96a6d
--- /dev/null
+++ b/include/machine/endian.h
@@ -0,0 +1,14 @@
1#ifndef _COMPAT_BYTE_ORDER_H_
2#define _COMPAT_BYTE_ORDER_H_
3
4#ifdef __linux__
5#include <endian.h>
6#else
7#ifdef __sun
8#include <arpa/nameser_compat.h>
9#else
10#include_next <machine/endian.h>
11#endif
12#endif
13
14#endif
diff --git a/include/openssl/Makefile.am.tpl b/include/openssl/Makefile.am.tpl
new file mode 100644
index 0000000..1375956
--- /dev/null
+++ b/include/openssl/Makefile.am.tpl
@@ -0,0 +1,5 @@
1include $(top_srcdir)/Makefile.am.common
2
3opensslincludedir=$(includedir)/openssl
4
5opensslinclude_HEADERS =
diff --git a/include/stdlib.h b/include/stdlib.h
new file mode 100644
index 0000000..6c2de93
--- /dev/null
+++ b/include/stdlib.h
@@ -0,0 +1,16 @@
1#include_next <stdlib.h>
2
3#ifndef LIBCRYPTOCOMPAT_STDLIB_H
4#define LIBCRYPTOCOMPAT_STDLIB_H
5
6#include <sys/stat.h>
7#include <sys/time.h>
8#include <stdint.h>
9
10uint32_t arc4random(void);
11void arc4random_buf(void *_buf, size_t n);
12void *reallocarray(void *, size_t, size_t);
13long long strtonum(const char *nptr, long long minval,
14 long long maxval, const char **errstr);
15
16#endif
diff --git a/include/string.h b/include/string.h
new file mode 100644
index 0000000..acdde6c
--- /dev/null
+++ b/include/string.h
@@ -0,0 +1,25 @@
1#include_next <string.h>
2
3#ifndef LIBCRYPTOCOMPAT_STRING_H
4#define LIBCRYPTOCOMPAT_STRING_H
5
6#include <sys/types.h>
7
8#ifdef __sun
9/* Some functions historically defined in string.h were placed in strings.h by
10 * SUS. Use the same hack as OS X and FreeBSD use to work around on Solaris.
11 */
12#include <strings.h>
13#endif
14
15size_t strlcpy(char *dst, const char *src, size_t siz);
16
17size_t strlcat(char *dst, const char *src, size_t siz);
18
19void explicit_bzero(void *, size_t);
20
21int timingsafe_bcmp(const void *b1, const void *b2, size_t n);
22
23int timingsafe_memcmp(const void *b1, const void *b2, size_t len);
24
25#endif
diff --git a/include/sys/types.h b/include/sys/types.h
new file mode 100644
index 0000000..05fc05b
--- /dev/null
+++ b/include/sys/types.h
@@ -0,0 +1,13 @@
1#include_next <sys/types.h>
2
3#ifndef LIBCRYPTOCOMPAT_SYS_TYPES_H
4#define LIBCRYPTOCOMPAT_SYS_TYPES_H
5
6#include <stdint.h>
7
8#ifdef __sun
9typedef uint8_t u_int8_t;
10typedef uint32_t u_int32_t;
11#endif
12
13#endif
diff --git a/include/unistd.h b/include/unistd.h
new file mode 100644
index 0000000..ae82b95
--- /dev/null
+++ b/include/unistd.h
@@ -0,0 +1,9 @@
1#include_next <unistd.h>
2
3#ifndef LIBCRYPTOCOMPAT_UNISTD_H
4#define LIBCRYPTOCOMPAT_UNISTD_H
5
6int getentropy(void *buf, size_t buflen);
7int issetugid(void);
8
9#endif