summaryrefslogtreecommitdiff
path: root/usr/src/cmd/mandoc/config.h
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2014-07-14 20:10:37 -0700
committerGarrett D'Amore <garrett@damore.org>2014-07-21 09:20:34 -0700
commit95c635efb7c3b86efc493e0447eaec7aecca3f0f (patch)
tree3c62b5521fea39ab7bab299052b02576ae802db9 /usr/src/cmd/mandoc/config.h
parent81d43577d1b5e76e6016ba642ecc1a76fde43021 (diff)
downloadillumos-joyent-95c635efb7c3b86efc493e0447eaec7aecca3f0f.tar.gz
5025 import and use mandoc
Reviewed by: Hans Rosenfeld <hans.rosenfeld@nexenta.com> Reviewed by: Igor Kozhukhov <ikozhukhov@gmail.com> Reviewed by: Robert Mustacchi <rm@joyent.com> Reviewed by: Albert Lee <trisk@nexenta.com> Approved by: Dan McDonald <danmcd@omniti.com>
Diffstat (limited to 'usr/src/cmd/mandoc/config.h')
-rw-r--r--usr/src/cmd/mandoc/config.h56
1 files changed, 56 insertions, 0 deletions
diff --git a/usr/src/cmd/mandoc/config.h b/usr/src/cmd/mandoc/config.h
new file mode 100644
index 0000000000..969e1b49bf
--- /dev/null
+++ b/usr/src/cmd/mandoc/config.h
@@ -0,0 +1,56 @@
+#ifndef MANDOC_CONFIG_H
+#define MANDOC_CONFIG_H
+
+#if defined(__linux__) || defined(__MINT__)
+# define _GNU_SOURCE /* strptime(), getsubopt() */
+#endif
+
+#include <stdio.h>
+
+#define HAVE_STRPTIME
+#define HAVE_GETSUBOPT
+#define HAVE_STRLCAT
+#define HAVE_STRLCPY
+
+#include <sys/types.h>
+
+#if !defined(__BEGIN_DECLS)
+# ifdef __cplusplus
+# define __BEGIN_DECLS extern "C" {
+# else
+# define __BEGIN_DECLS
+# endif
+#endif
+#if !defined(__END_DECLS)
+# ifdef __cplusplus
+# define __END_DECLS }
+# else
+# define __END_DECLS
+# endif
+#endif
+
+#if defined(__APPLE__)
+# define htobe32(x) OSSwapHostToBigInt32(x)
+# define betoh32(x) OSSwapBigToHostInt32(x)
+# define htobe64(x) OSSwapHostToBigInt64(x)
+# define betoh64(x) OSSwapBigToHostInt64(x)
+#elif defined(__linux__)
+# define betoh32(x) be32toh(x)
+# define betoh64(x) be64toh(x)
+#endif
+
+#ifndef HAVE_STRLCAT
+extern size_t strlcat(char *, const char *, size_t);
+#endif
+#ifndef HAVE_STRLCPY
+extern size_t strlcpy(char *, const char *, size_t);
+#endif
+#ifndef HAVE_GETSUBOPT
+extern int getsubopt(char **, char * const *, char **);
+extern char *suboptarg;
+#endif
+#ifndef HAVE_FGETLN
+extern char *fgetln(FILE *, size_t *);
+#endif
+
+#endif /* MANDOC_CONFIG_H */