| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: apropos.c,v 1.17 2015/12/20 19:45:29 christos Exp $ */ | | 1 | /* $NetBSD: apropos.c,v 1.18 2016/03/31 20:13:37 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,38 +21,36 @@ | | | @@ -21,38 +21,36 @@ |
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.c,v 1.17 2015/12/20 19:45:29 christos Exp $"); | | 34 | __RCSID("$NetBSD: apropos.c,v 1.18 2016/03/31 20:13:37 christos Exp $"); |
35 | | | 35 | |
36 | #include <err.h> | | 36 | #include <err.h> |
37 | #include <search.h> | | | |
38 | #include <stdio.h> | | 37 | #include <stdio.h> |
39 | #include <stdlib.h> | | 38 | #include <stdlib.h> |
40 | #include <string.h> | | 39 | #include <string.h> |
41 | #include <unistd.h> | | 40 | #include <unistd.h> |
42 | #include <util.h> | | 41 | #include <util.h> |
43 | | | 42 | |
44 | #include "apropos-utils.h" | | 43 | #include "apropos-utils.h" |
45 | #include "sqlite3.h" | | | |
46 | | | 44 | |
47 | typedef struct apropos_flags { | | 45 | typedef struct apropos_flags { |
48 | int sec_nums[SECMAX]; | | 46 | int sec_nums[SECMAX]; |
49 | int nresults; | | 47 | int nresults; |
50 | int pager; | | 48 | int pager; |
51 | int no_context; | | 49 | int no_context; |
52 | query_format format; | | 50 | query_format format; |
53 | int legacy; | | 51 | int legacy; |
54 | const char *machine; | | 52 | const char *machine; |
55 | } apropos_flags; | | 53 | } apropos_flags; |
56 | | | 54 | |
57 | typedef struct callback_data { | | 55 | typedef struct callback_data { |
58 | int count; | | 56 | int count; |