summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--INSTALL5
-rw-r--r--compat_fts.h3
-rw-r--r--compat_ohash.h3
-rw-r--r--compat_stringlist.h3
-rwxr-xr-xconfigure19
-rw-r--r--html.h3
-rw-r--r--libman.h3
-rw-r--r--libmandoc.h3
-rw-r--r--libmdoc.h3
-rw-r--r--libroff.h3
-rw-r--r--main.h4
-rw-r--r--man.h3
-rw-r--r--manconf.h3
-rw-r--r--mandoc.h3
-rw-r--r--mandoc_aux.h4
-rw-r--r--mandoc_ohash.h4
-rw-r--r--mansearch.h3
-rw-r--r--mdoc.h3
-rw-r--r--out.h3
-rw-r--r--roff.h3
-rw-r--r--roff_int.h4
-rw-r--r--tag.h3
-rw-r--r--term.h3
23 files changed, 12 insertions, 79 deletions
diff --git a/INSTALL b/INSTALL
index 78bc61d1..dd1f4429 100644
--- a/INSTALL
+++ b/INSTALL
@@ -110,6 +110,11 @@ If you run into that problem, set "HAVE_FTS=0" in configure.local.
If your system does not have it, the bundled compatibility version
will be used, so you probably need not worry about it.
+One of the chief design goals of the mandoc toolbox is to make
+sure that nothing related to documentation requires C++.
+Consequently, linking mandoc against any kind of C++ program
+would defeat the purpose and is not supported.
+
Checking autoconfiguration quality
----------------------------------
diff --git a/compat_fts.h b/compat_fts.h
index 426eaac3..1eed2ae3 100644
--- a/compat_fts.h
+++ b/compat_fts.h
@@ -92,11 +92,10 @@ typedef struct _ftsent {
char fts_name[1]; /* file name */
} FTSENT;
-__BEGIN_DECLS
+
int fts_close(FTS *);
FTS *fts_open(char * const *, int, void *);
FTSENT *fts_read(FTS *);
int fts_set(FTS *, FTSENT *, int);
-__END_DECLS
#endif /* !_FTS_H_ */
diff --git a/compat_ohash.h b/compat_ohash.h
index e3124c96..58fb220c 100644
--- a/compat_ohash.h
+++ b/compat_ohash.h
@@ -49,7 +49,6 @@ struct ohash {
* a hashing table index (opaque) to be used in find/insert/remove.
* The keys are stored at a known position in the client data.
*/
-__BEGIN_DECLS
void ohash_init(struct ohash *, unsigned, struct ohash_info *);
void ohash_delete(struct ohash *);
@@ -69,5 +68,5 @@ uint32_t ohash_interval(const char *, const char **);
unsigned int ohash_qlookupi(struct ohash *, const char *, const char **);
unsigned int ohash_qlookup(struct ohash *, const char *);
-__END_DECLS
+
#endif
diff --git a/compat_stringlist.h b/compat_stringlist.h
index 301373c2..b1c20746 100644
--- a/compat_stringlist.h
+++ b/compat_stringlist.h
@@ -38,9 +38,8 @@ typedef struct _stringlist {
size_t sl_cur;
} StringList;
-__BEGIN_DECLS
+
StringList *sl_init(void);
int sl_add(StringList *, char *);
void sl_free(StringList *, int);
char *sl_find(StringList *, const char *);
-__END_DECLS
diff --git a/configure b/configure
index 54ebfca1..cae2f5c9 100755
--- a/configure
+++ b/configure
@@ -276,6 +276,10 @@ fi
exec > config.h
cat << __HEREDOC__
+#ifdef __cplusplus
+#error "Do not use C++. See the INSTALL file."
+#endif
+
#ifndef MANDOC_CONFIG_H
#define MANDOC_CONFIG_H
@@ -331,21 +335,6 @@ cat << __HEREDOC__
#define BINM_SOELIM "${BINM_SOELIM}"
#define BINM_WHATIS "${BINM_WHATIS}"
-#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
-
__HEREDOC__
if [ ${HAVE_ERR} -eq 0 ]; then
diff --git a/html.h b/html.h
index 1e62d3da..500c2c0a 100644
--- a/html.h
+++ b/html.h
@@ -142,7 +142,6 @@ struct html {
#define HTML_FRAGMENT (1 << 0) /* don't emit HTML/HEAD/BODY */
};
-__BEGIN_DECLS
struct tbl_span;
struct eqn;
@@ -175,5 +174,3 @@ void buffmt_man(struct html *,
void buffmt_includes(struct html *, const char *);
int html_strlen(const char *);
-
-__END_DECLS
diff --git a/libman.h b/libman.h
index a83ebd02..3529edcf 100644
--- a/libman.h
+++ b/libman.h
@@ -34,11 +34,8 @@ struct man_macro {
extern const struct man_macro *const man_macros;
-__BEGIN_DECLS
int man_hash_find(const char *);
void man_node_validate(struct roff_man *);
void man_state(struct roff_man *, struct roff_node *);
void man_unscope(struct roff_man *, const struct roff_node *);
-
-__END_DECLS
diff --git a/libmandoc.h b/libmandoc.h
index f570a557..5a489a32 100644
--- a/libmandoc.h
+++ b/libmandoc.h
@@ -32,7 +32,6 @@ struct buf {
size_t sz;
};
-__BEGIN_DECLS
struct mparse;
struct tbl_span;
@@ -84,5 +83,3 @@ int roff_getformat(const struct roff *);
const struct tbl_span *roff_span(const struct roff *);
const struct eqn *roff_eqn(const struct roff *);
-
-__END_DECLS
diff --git a/libmdoc.h b/libmdoc.h
index 71c36800..1d5b0780 100644
--- a/libmdoc.h
+++ b/libmdoc.h
@@ -62,7 +62,6 @@ enum mdelim {
extern const struct mdoc_macro *const mdoc_macros;
-__BEGIN_DECLS
void mdoc_macro(MACRO_PROT_ARGS);
void mdoc_elem_alloc(struct roff_man *, int, int,
@@ -87,5 +86,3 @@ void mdoc_argv(struct roff_man *, int, int,
enum margserr mdoc_args(struct roff_man *, int,
int *, char *, int, char **);
enum mdelim mdoc_isdelim(const char *);
-
-__END_DECLS
diff --git a/libroff.h b/libroff.h
index 537b9f5b..70290455 100644
--- a/libroff.h
+++ b/libroff.h
@@ -60,7 +60,6 @@ struct eqn_def {
size_t valsz;
};
-__BEGIN_DECLS
struct tbl_node *tbl_alloc(int, int, struct mparse *);
void tbl_restart(int, int, struct tbl_node *);
@@ -78,5 +77,3 @@ enum rofferr eqn_end(struct eqn_node **);
void eqn_free(struct eqn_node *);
enum rofferr eqn_read(struct eqn_node **, int,
const char *, int, int *);
-
-__END_DECLS
diff --git a/main.h b/main.h
index 0a2dd851..376d4b7f 100644
--- a/main.h
+++ b/main.h
@@ -18,8 +18,6 @@
#define UNCONST(a) ((void *)(uintptr_t)(const void *)(a))
-__BEGIN_DECLS
-
struct roff_man;
struct manoutput;
@@ -53,5 +51,3 @@ void pspdf_free(void *);
void terminal_mdoc(void *, const struct roff_man *);
void terminal_man(void *, const struct roff_man *);
-
-__END_DECLS
diff --git a/man.h b/man.h
index bc8cdbd8..34c6c4ef 100644
--- a/man.h
+++ b/man.h
@@ -59,11 +59,8 @@
/* Names of macros. */
extern const char *const *man_macronames;
-__BEGIN_DECLS
struct roff_man;
const struct mparse *man_mparse(const struct roff_man *);
void man_validate(struct roff_man *);
-
-__END_DECLS
diff --git a/manconf.h b/manconf.h
index 0784b8d6..782269e7 100644
--- a/manconf.h
+++ b/manconf.h
@@ -42,10 +42,7 @@ struct manconf {
struct manpaths manpath;
};
-__BEGIN_DECLS
void manconf_parse(struct manconf *, const char *, char *, char *);
void manconf_output(struct manoutput *, const char *);
void manconf_free(struct manconf *);
-
-__END_DECLS
diff --git a/mandoc.h b/mandoc.h
index cfa88345..8db4ed56 100644
--- a/mandoc.h
+++ b/mandoc.h
@@ -408,7 +408,6 @@ enum mandoc_esc {
typedef void (*mandocmsg)(enum mandocerr, enum mandoclevel,
const char *, int, int, const char *);
-__BEGIN_DECLS
struct mparse;
struct roff_man;
@@ -434,5 +433,3 @@ void mparse_result(struct mparse *,
const char *mparse_getkeep(const struct mparse *);
const char *mparse_strerror(enum mandocerr);
const char *mparse_strlevel(enum mandoclevel);
-
-__END_DECLS
diff --git a/mandoc_aux.h b/mandoc_aux.h
index 2130c5ea..feb84994 100644
--- a/mandoc_aux.h
+++ b/mandoc_aux.h
@@ -16,8 +16,6 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-__BEGIN_DECLS
-
int mandoc_asprintf(char **, const char *, ...);
void *mandoc_calloc(size_t, size_t);
void *mandoc_malloc(size_t);
@@ -25,5 +23,3 @@ void *mandoc_realloc(void *, size_t);
void *mandoc_reallocarray(void *, size_t, size_t);
char *mandoc_strdup(const char *);
char *mandoc_strndup(const char *, size_t);
-
-__END_DECLS
diff --git a/mandoc_ohash.h b/mandoc_ohash.h
index c0a4460d..8c2e6282 100644
--- a/mandoc_ohash.h
+++ b/mandoc_ohash.h
@@ -20,8 +20,4 @@
#include "compat_ohash.h"
#endif
-__BEGIN_DECLS
-
void mandoc_ohash_init(struct ohash *, unsigned int, ptrdiff_t);
-
-__END_DECLS
diff --git a/mansearch.h b/mansearch.h
index 504707cc..c6171f7b 100644
--- a/mansearch.h
+++ b/mansearch.h
@@ -95,7 +95,6 @@ struct mansearch {
int firstmatch; /* first matching database only */
};
-__BEGIN_DECLS
struct manpaths;
@@ -107,5 +106,3 @@ int mansearch(const struct mansearch *cfg, /* options */
struct manpage **res, /* results */
size_t *ressz); /* results returned */
void mansearch_free(struct manpage *, size_t);
-
-__END_DECLS
diff --git a/mdoc.h b/mdoc.h
index edfef65f..a106eccb 100644
--- a/mdoc.h
+++ b/mdoc.h
@@ -280,8 +280,5 @@ extern const char *const *mdoc_macronames;
/* Names of macro args. Index is enum mdocargt. */
extern const char *const *mdoc_argnames;
-__BEGIN_DECLS
void mdoc_validate(struct roff_man *);
-
-__END_DECLS
diff --git a/out.h b/out.h
index c30cfe59..0bee63a7 100644
--- a/out.h
+++ b/out.h
@@ -60,12 +60,9 @@ struct rofftbl {
(p)->scale = (v); } \
while (/* CONSTCOND */ 0)
-__BEGIN_DECLS
struct tbl_span;
int a2roffsu(const char *, struct roffsu *, enum roffscale);
void tblcalc(struct rofftbl *tbl,
const struct tbl_span *, size_t);
-
-__END_DECLS
diff --git a/roff.h b/roff.h
index f32ffd25..cbee3822 100644
--- a/roff.h
+++ b/roff.h
@@ -161,8 +161,5 @@ struct roff_man {
enum roff_next next; /* Where to put the next node. */
};
-__BEGIN_DECLS
void deroff(char **, const struct roff_node *);
-
-__END_DECLS
diff --git a/roff_int.h b/roff_int.h
index 21954e41..a0d3caae 100644
--- a/roff_int.h
+++ b/roff_int.h
@@ -16,8 +16,6 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-__BEGIN_DECLS
-
struct roff_node *roff_node_alloc(struct roff_man *, int, int,
enum roff_type, int);
void roff_node_append(struct roff_man *, struct roff_node *);
@@ -41,5 +39,3 @@ void roff_node_delete(struct roff_man *, struct roff_node *);
void man_breakscope(struct roff_man *, int);
void mdoc_argv_free(struct mdoc_arg *);
-
-__END_DECLS
diff --git a/tag.h b/tag.h
index 8a32c11c..325dc7d7 100644
--- a/tag.h
+++ b/tag.h
@@ -22,11 +22,8 @@ struct tag_files {
int tfd;
};
-__BEGIN_DECLS
struct tag_files *tag_init(void);
void tag_put(const char *, int, size_t);
void tag_write(void);
void tag_unlink(void);
-
-__END_DECLS
diff --git a/term.h b/term.h
index 503fcc55..cc8764cc 100644
--- a/term.h
+++ b/term.h
@@ -105,7 +105,6 @@ struct termp {
struct termp_ps *ps;
};
-__BEGIN_DECLS
struct tbl_span;
struct eqn;
@@ -134,5 +133,3 @@ void term_fontpop(struct termp *);
void term_fontpopq(struct termp *, int);
void term_fontrepl(struct termp *, enum termfont);
void term_fontlast(struct termp *);
-
-__END_DECLS