Mon Jan 14 18:01:59 2013 UTC ()
Since mdocml decided to name headers that conflict with system ones (term.h)
move the header inclusion one up.


(christos)
diff -r1.3 -r1.4 src/usr.sbin/makemandb/Makefile
diff -r1.7 -r1.8 src/usr.sbin/makemandb/apropos-utils.c
diff -r1.16 -r1.17 src/usr.sbin/makemandb/makemandb.c

cvs diff -r1.3 -r1.4 src/usr.sbin/makemandb/Makefile (expand / switch to unified diff)

--- src/usr.sbin/makemandb/Makefile 2012/10/06 15:33:59 1.3
+++ src/usr.sbin/makemandb/Makefile 2013/01/14 18:01:59 1.4
@@ -1,36 +1,35 @@ @@ -1,36 +1,35 @@
1# $NetBSD: Makefile,v 1.3 2012/10/06 15:33:59 wiz Exp $ 1# $NetBSD: Makefile,v 1.4 2013/01/14 18:01:59 christos Exp $
2 2
3.include <bsd.own.mk> 3.include <bsd.own.mk>
4 4
5MDIST= ${NETBSDSRCDIR}/external/bsd/mdocml/dist 
6MDOCDIR=${NETBSDSRCDIR}/external/bsd/mdocml 5MDOCDIR=${NETBSDSRCDIR}/external/bsd/mdocml
7MANCONFDIR=${NETBSDSRCDIR}/usr.bin/man 6MANCONFDIR=${NETBSDSRCDIR}/usr.bin/man
8 7
9PROGS= makemandb apropos whatis 8PROGS= makemandb apropos whatis
10SRCS.makemandb= makemandb.c apropos-utils.c manconf.c 9SRCS.makemandb= makemandb.c apropos-utils.c manconf.c
11SRCS.apropos= apropos.c apropos-utils.c manconf.c 10SRCS.apropos= apropos.c apropos-utils.c manconf.c
12SRCS.whatis= whatis.c apropos-utils.c manconf.c 11SRCS.whatis= whatis.c apropos-utils.c manconf.c
13MAN.makemandb= makemandb.8 12MAN.makemandb= makemandb.8
14MAN.apropos= apropos.1 13MAN.apropos= apropos.1
15MAN.whatis= whatis.1 14MAN.whatis= whatis.1
16 15
17BINDIR.apropos= /usr/bin 16BINDIR.apropos= /usr/bin
18BINDIR.makemandb= /usr/sbin 17BINDIR.makemandb= /usr/sbin
19BINDIR.whatis= /usr/bin 18BINDIR.whatis= /usr/bin
20 19
21.PATH: ${MANCONFDIR} 20.PATH: ${MANCONFDIR}
22 21
23CPPFLAGS+=-I${MDIST} -I${MANCONFDIR} -I${.OBJDIR} 22CPPFLAGS+= -I${MDOCDIR} -I${MANCONFDIR} -I${.OBJDIR}
24 23
25MDOCMLOBJDIR!= cd ${MDOCDIR}/lib/libmandoc && ${PRINTOBJDIR} 24MDOCMLOBJDIR!= cd ${MDOCDIR}/lib/libmandoc && ${PRINTOBJDIR}
26MDOCMLLIB= ${MDOCMLOBJDIR}/libmandoc.a 25MDOCMLLIB= ${MDOCMLOBJDIR}/libmandoc.a
27 26
28DPADD.makemandb+= ${MDOCMLLIB} ${LIBARCHIVE} ${LIBBZ2} ${LIBLZMA} 27DPADD.makemandb+= ${MDOCMLLIB} ${LIBARCHIVE} ${LIBBZ2} ${LIBLZMA}
29LDADD.makemandb+= -L${MDOCMLOBJDIR} -lmandoc -larchive -lbz2 -llzma 28LDADD.makemandb+= -L${MDOCMLOBJDIR} -lmandoc -larchive -lbz2 -llzma
30DPADD+= ${LIBSQLITE3} ${LIBM} ${LIBZ} ${LIBUTIL} 29DPADD+= ${LIBSQLITE3} ${LIBM} ${LIBZ} ${LIBUTIL}
31LDADD+= -lsqlite3 -lm -lz -lutil 30LDADD+= -lsqlite3 -lm -lz -lutil
32 31
33stopwords.c: stopwords.txt 32stopwords.c: stopwords.txt
34 ( set -e; ${TOOL_NBPERF} -n stopwords_hash -s -p ${.ALLSRC}; \ 33 ( set -e; ${TOOL_NBPERF} -n stopwords_hash -s -p ${.ALLSRC}; \
35 echo 'static const char *stopwords[] = {'; \ 34 echo 'static const char *stopwords[] = {'; \
36 ${TOOL_SED} -e 's|^\(.*\)$$| "\1",|' ${.ALLSRC}; \ 35 ${TOOL_SED} -e 's|^\(.*\)$$| "\1",|' ${.ALLSRC}; \

cvs diff -r1.7 -r1.8 src/usr.sbin/makemandb/apropos-utils.c (expand / switch to unified diff)

--- src/usr.sbin/makemandb/apropos-utils.c 2012/10/06 15:33:59 1.7
+++ src/usr.sbin/makemandb/apropos-utils.c 2013/01/14 18:01:59 1.8
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: apropos-utils.c,v 1.7 2012/10/06 15:33:59 wiz Exp $ */ 1/* $NetBSD: apropos-utils.c,v 1.8 2013/01/14 18:01:59 christos Exp $ */
2/*- 2/*-
3 * Copyright (c) 2011 Abhinav Upadhyay <er.abhinav.upadhyay@gmail.com> 3 * Copyright (c) 2011 Abhinav Upadhyay <er.abhinav.upadhyay@gmail.com>
4 * All rights reserved. 4 * All rights reserved.
5 * 5 *
6 * This code was developed as part of Google's Summer of Code 2011 program. 6 * This code was developed as part of Google's Summer of Code 2011 program.
7 * 7 *
8 * Redistribution and use in source and binary forms, with or without 8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions 9 * modification, are permitted provided that the following conditions
10 * are met: 10 * are met:
11 * 11 *
12 * 1. Redistributions of source code must retain the above copyright 12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer. 13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright 14 * 2. Redistributions in binary form must reproduce the above copyright
@@ -21,44 +21,44 @@ @@ -21,44 +21,44 @@
21 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 21 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
22 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 22 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
23 * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 23 * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
24 * INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING, 24 * INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
25 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 25 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
26 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 26 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
27 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 27 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 28 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
29 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 29 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE. 30 * SUCH DAMAGE.
31 */ 31 */
32 32
33#include <sys/cdefs.h> 33#include <sys/cdefs.h>
34__RCSID("$NetBSD: apropos-utils.c,v 1.7 2012/10/06 15:33:59 wiz Exp $"); 34__RCSID("$NetBSD: apropos-utils.c,v 1.8 2013/01/14 18:01:59 christos Exp $");
35 35
36#include <sys/queue.h> 36#include <sys/queue.h>
37#include <sys/stat.h> 37#include <sys/stat.h>
38 38
39#include <assert.h> 39#include <assert.h>
40#include <ctype.h> 40#include <ctype.h>
41#include <err.h> 41#include <err.h>
42#include <math.h> 42#include <math.h>
43#include <stdio.h> 43#include <stdio.h>
44#include <stdlib.h> 44#include <stdlib.h>
45#include <string.h> 45#include <string.h>
46#include <util.h> 46#include <util.h>
47#include <zlib.h> 47#include <zlib.h>
48 48
49#include "apropos-utils.h" 49#include "apropos-utils.h"
50#include "manconf.h" 50#include "manconf.h"
51#include "mandoc.h" 51#include "dist/mandoc.h"
52#include "sqlite3.h" 52#include "sqlite3.h"
53 53
54typedef struct orig_callback_data { 54typedef struct orig_callback_data {
55 void *data; 55 void *data;
56 int (*callback) (void *, const char *, const char *, const char *, 56 int (*callback) (void *, const char *, const char *, const char *,
57 const char *, size_t); 57 const char *, size_t);
58} orig_callback_data; 58} orig_callback_data;
59 59
60typedef struct inverse_document_frequency { 60typedef struct inverse_document_frequency {
61 double value; 61 double value;
62 int status; 62 int status;
63} inverse_document_frequency; 63} inverse_document_frequency;
64 64

cvs diff -r1.16 -r1.17 src/usr.sbin/makemandb/makemandb.c (expand / switch to unified diff)

--- src/usr.sbin/makemandb/makemandb.c 2012/11/08 19:17:54 1.16
+++ src/usr.sbin/makemandb/makemandb.c 2013/01/14 18:01:59 1.17
@@ -1,54 +1,54 @@ @@ -1,54 +1,54 @@
1/* $NetBSD: makemandb.c,v 1.16 2012/11/08 19:17:54 christos Exp $ */ 1/* $NetBSD: makemandb.c,v 1.17 2013/01/14 18:01:59 christos Exp $ */
2/* 2/*
3 * Copyright (c) 2011 Abhinav Upadhyay <er.abhinav.upadhyay@gmail.com> 3 * Copyright (c) 2011 Abhinav Upadhyay <er.abhinav.upadhyay@gmail.com>
4 * Copyright (c) 2011 Kristaps Dzonsons <kristaps@bsd.lv> 4 * Copyright (c) 2011 Kristaps Dzonsons <kristaps@bsd.lv>
5 * 5 *
6 * Permission to use, copy, modify, and distribute this software for any 6 * Permission to use, copy, modify, and distribute this software for any
7 * purpose with or without fee is hereby granted, provided that the above 7 * purpose with or without fee is hereby granted, provided that the above
8 * copyright notice and this permission notice appear in all copies. 8 * copyright notice and this permission notice appear in all copies.
9 * 9 *
10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 */ 17 */
18 18
19#include <sys/cdefs.h> 19#include <sys/cdefs.h>
20__RCSID("$NetBSD: makemandb.c,v 1.16 2012/11/08 19:17:54 christos Exp $"); 20__RCSID("$NetBSD: makemandb.c,v 1.17 2013/01/14 18:01:59 christos Exp $");
21 21
22#include <sys/stat.h> 22#include <sys/stat.h>
23#include <sys/types.h> 23#include <sys/types.h>
24 24
25#include <assert.h> 25#include <assert.h>
26#include <ctype.h> 26#include <ctype.h>
27#include <dirent.h> 27#include <dirent.h>
28#include <err.h> 28#include <err.h>
29#include <archive.h> 29#include <archive.h>
30#include <libgen.h> 30#include <libgen.h>
31#include <md5.h> 31#include <md5.h>
32#include <stdio.h> 32#include <stdio.h>
33#include <stdlib.h> 33#include <stdlib.h>
34#include <string.h> 34#include <string.h>
35#include <unistd.h> 35#include <unistd.h>
36#include <util.h> 36#include <util.h>
37 37
38#include "apropos-utils.h" 38#include "apropos-utils.h"
39#include "man.h" 39#include "dist/man.h"
40#include "mandoc.h" 40#include "dist/mandoc.h"
41#include "mdoc.h" 41#include "dist/mdoc.h"
42#include "sqlite3.h" 42#include "sqlite3.h"
43 43
44#define BUFLEN 1024 44#define BUFLEN 1024
45#define MDOC 0 //If the page is of mdoc(7) type 45#define MDOC 0 //If the page is of mdoc(7) type
46#define MAN 1 //If the page is of man(7) type 46#define MAN 1 //If the page is of man(7) type
47 47
48/* 48/*
49 * A data structure for holding section specific data. 49 * A data structure for holding section specific data.
50 */ 50 */
51typedef struct secbuff { 51typedef struct secbuff {
52 char *data; 52 char *data;
53 size_t buflen; //Total length of buffer allocated initially 53 size_t buflen; //Total length of buffer allocated initially
54 size_t offset; // Current offset in the buffer. 54 size_t offset; // Current offset in the buffer.