Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/bsd/mdocml/dist Reduce diffs with upstream and enab...



details:   https://anonhg.NetBSD.org/src/rev/b017ffc32559
branches:  trunk
changeset: 997538:b017ffc32559
user:      christos <christos%NetBSD.org@localhost>
date:      Mon Mar 11 17:59:28 2019 +0000

description:
Reduce diffs with upstream and enable the built-in database code.

diffstat:

 external/bsd/mdocml/bin/mandoc/Makefile |  10 +++++++++-
 external/bsd/mdocml/dist/dba.c          |   4 ++--
 external/bsd/mdocml/dist/dbm.c          |   2 +-
 external/bsd/mdocml/dist/main.c         |  17 -----------------
 external/bsd/mdocml/dist/mandocdb.c     |   4 ++--
 external/bsd/mdocml/dist/mdoc.c         |   2 +-
 external/bsd/mdocml/dist/read.c         |   1 -
 7 files changed, 15 insertions(+), 25 deletions(-)

diffs (165 lines):

diff -r d41435395763 -r b017ffc32559 external/bsd/mdocml/bin/mandoc/Makefile
--- a/external/bsd/mdocml/bin/mandoc/Makefile   Mon Mar 11 17:50:19 2019 +0000
+++ b/external/bsd/mdocml/bin/mandoc/Makefile   Mon Mar 11 17:59:28 2019 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.17 2018/08/16 06:24:40 kre Exp $
+# $NetBSD: Makefile,v 1.18 2019/03/11 17:59:28 christos Exp $
 
 .include <bsd.own.mk>
 
@@ -8,10 +8,18 @@
 eqn_html.c \
 eqn_term.c \
 html.c \
+dba.c \
+dba_array.c \
+dba_read.c \
+dba_write.c \
+dbm.c \
+dbm_map.c \
 main.c \
 man_html.c \
 man_term.c \
+mandocdb.c \
 manpath.c \
+mansearch.c \
 mdoc_html.c \
 mdoc_markdown.c \
 mdoc_term.c \
diff -r d41435395763 -r b017ffc32559 external/bsd/mdocml/dist/dba.c
--- a/external/bsd/mdocml/dist/dba.c    Mon Mar 11 17:50:19 2019 +0000
+++ b/external/bsd/mdocml/dist/dba.c    Mon Mar 11 17:59:28 2019 +0000
@@ -167,7 +167,7 @@
        dba_array_add(page, entry);
        if (arch != NULL && *arch != '\0') {
                entry = dba_array_new(1, DBA_STR | DBA_GROW);
-               dba_array_add(entry, (void *)arch);
+               dba_array_add(entry, __UNCONST(arch));
        } else
                entry = NULL;
        dba_array_add(page, entry);
@@ -208,7 +208,7 @@
                if (strcmp(entry, str) == 0)
                        return;
        }
-       dba_array_add(entries, (void *)str);
+       dba_array_add(entries, __UNCONST(str));
 }
 
 /*
diff -r d41435395763 -r b017ffc32559 external/bsd/mdocml/dist/dbm.c
--- a/external/bsd/mdocml/dist/dbm.c    Mon Mar 11 17:50:19 2019 +0000
+++ b/external/bsd/mdocml/dist/dbm.c    Mon Mar 11 17:59:28 2019 +0000
@@ -114,7 +114,7 @@
                        goto fail;
                }
                nvals[im] = be32toh(*ep);
-               macros[im] = (struct macro *)++ep;
+               macros[im] = (struct macro *)__UNCONST(++ep);
        }
        return 0;
 
diff -r d41435395763 -r b017ffc32559 external/bsd/mdocml/dist/main.c
--- a/external/bsd/mdocml/dist/main.c   Mon Mar 11 17:50:19 2019 +0000
+++ b/external/bsd/mdocml/dist/main.c   Mon Mar 11 17:59:28 2019 +0000
@@ -87,9 +87,7 @@
 };
 
 
-#ifdef HAVE_SQLITE3
 int                      mandocdb(int, char *[]);
-#endif
 
 static void              check_xr(void);
 static int               fs_lookup(const struct manpaths *,
@@ -151,11 +149,9 @@
 #endif
 
        mandoc_msg_setoutfile(stderr);
-#ifdef HAVE_SQLITE3
        if (strncmp(progname, "mandocdb", 8) == 0 ||
            strcmp(progname, BINM_MAKEWHATIS) == 0)
                return mandocdb(argc, argv);
-#endif
 
 #if HAVE_PLEDGE
        if (pledge("stdio rpath tmppath tty proc exec", NULL) == -1)
@@ -394,18 +390,9 @@
                /* Access the mandoc database. */
 
                manconf_parse(&conf, conf_file, defpaths, auxpaths);
-#if HAVE_SQLITE3
                if ( ! mansearch(&search, &conf.manpath,
                    argc, argv, &res, &sz))
                        usage(search.argmode);
-#else
-               if (search.argmode != ARG_NAME) {
-                       fputs("mandoc: database support not compiled in\n",
-                           stderr);
-                       return (int)MANDOCLEVEL_BADARG;
-               }
-               sz = 0;
-#endif
 
                if (sz == 0 && search.argmode == ARG_NAME)
                        fs_search(&search, &conf.manpath,
@@ -616,9 +603,7 @@
 out:
        if (search.argmode != ARG_FILE) {
                manconf_free(&conf);
-#ifdef HAVE_SQLITE3
                mansearch_free(res, sz);
-#endif
        }
 
        free(curp.os_s);
@@ -932,10 +917,8 @@
                search.outkey = NULL;
                search.argmode = ARG_NAME;
                search.firstmatch = 1;
-#ifdef HAVE_SQLITE3
                if (mansearch(&search, &paths, 1, &xr->name, NULL, &sz))
                        continue;
-#endif
                if (fs_search(&search, &paths, 1, &xr->name, NULL, &sz))
                        continue;
                if (xr->count == 1)
diff -r d41435395763 -r b017ffc32559 external/bsd/mdocml/dist/mandocdb.c
--- a/external/bsd/mdocml/dist/mandocdb.c       Mon Mar 11 17:50:19 2019 +0000
+++ b/external/bsd/mdocml/dist/mandocdb.c       Mon Mar 11 17:59:28 2019 +0000
@@ -584,8 +584,8 @@
        argv[0] = ".";
        argv[1] = NULL;
 
-       f = fts_open((char * const *)argv, FTS_PHYSICAL | FTS_NOCHDIR,
-           fts_compare);
+       f = fts_open((char * const *)__UNCONST(*argv),
+           FTS_PHYSICAL | FTS_NOCHDIR, fts_compare);
        if (f == NULL) {
                exitcode = (int)MANDOCLEVEL_SYSERR;
                say("", "&fts_open");
diff -r d41435395763 -r b017ffc32559 external/bsd/mdocml/dist/mdoc.c
--- a/external/bsd/mdocml/dist/mdoc.c   Mon Mar 11 17:50:19 2019 +0000
+++ b/external/bsd/mdocml/dist/mdoc.c   Mon Mar 11 17:59:28 2019 +0000
@@ -30,9 +30,9 @@
 #include "mandoc_aux.h"
 #include "mandoc.h"
 #include "roff.h"
+#include "roff_int.h"
 #include "mdoc.h"
 #include "libmandoc.h"
-#include "roff_int.h"
 #include "libmdoc.h"
 
 const  char *const __mdoc_argnames[MDOC_ARG_MAX] = {
diff -r d41435395763 -r b017ffc32559 external/bsd/mdocml/dist/read.c
--- a/external/bsd/mdocml/dist/read.c   Mon Mar 11 17:50:19 2019 +0000
+++ b/external/bsd/mdocml/dist/read.c   Mon Mar 11 17:59:28 2019 +0000
@@ -62,7 +62,6 @@
 static void      free_buf_list(struct buf *);
 static void      resize_buf(struct buf *, size_t);
 static int       mparse_buf_r(struct mparse *, const struct buf, size_t, int);
-static int       mparse_buf_r(struct mparse *, struct buf, size_t, int);
 static int       read_whole_file(struct mparse *, int, struct buf *, int *);
 static void      mparse_end(struct mparse *);
 



Home | Main Index | Thread Index | Old Index