version 1.39, 2014/07/24 20:30:45 |
version 1.44, 2014/08/16 19:00:01 |
|
|
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
*/ |
*/ |
#ifdef HAVE_CONFIG_H |
|
#include "config.h" |
#include "config.h" |
#endif |
|
|
|
#include <sys/mman.h> |
#include <sys/mman.h> |
|
#include <sys/types.h> |
|
|
#include <assert.h> |
#include <assert.h> |
#include <fcntl.h> |
#include <fcntl.h> |
#include <getopt.h> |
#include <getopt.h> |
|
|
#include <string.h> |
#include <string.h> |
#include <unistd.h> |
#include <unistd.h> |
|
|
#ifdef HAVE_OHASH |
#if HAVE_OHASH |
#include <ohash.h> |
#include <ohash.h> |
#else |
#else |
#include "compat_ohash.h" |
#include "compat_ohash.h" |
#endif |
#endif |
#include <sqlite3.h> |
#include <sqlite3.h> |
|
#ifndef SQLITE_DETERMINISTIC |
|
#define SQLITE_DETERMINISTIC 0 |
|
#endif |
|
|
#include "mandoc.h" |
#include "mandoc.h" |
#include "mandoc_aux.h" |
#include "mandoc_aux.h" |
Line 120 mansearch_setup(int start) |
|
Line 123 mansearch_setup(int start) |
|
} |
} |
|
|
pagecache = mmap(NULL, PC_PAGESIZE * PC_NUMPAGES, |
pagecache = mmap(NULL, PC_PAGESIZE * PC_NUMPAGES, |
PROT_READ | PROT_WRITE, MAP_ANON, -1, 0); |
PROT_READ | PROT_WRITE, |
|
MAP_SHARED | MAP_ANON, -1, 0); |
|
|
if (MAP_FAILED == pagecache) { |
if (MAP_FAILED == pagecache) { |
perror("mmap"); |
perror("mmap"); |
Line 299 mansearch(const struct mansearch *search, |
|
Line 303 mansearch(const struct mansearch *search, |
|
mp->pageid = pageid; |
mp->pageid = pageid; |
mp->form = sqlite3_column_int(s, 1); |
mp->form = sqlite3_column_int(s, 1); |
if (TYPE_Nd == outbit) |
if (TYPE_Nd == outbit) |
mp->desc = mandoc_strdup( |
mp->desc = mandoc_strdup((const char *) |
sqlite3_column_text(s, 0)); |
sqlite3_column_text(s, 0)); |
ohash_insert(&htab, idx, mp); |
ohash_insert(&htab, idx, mp); |
} |
} |
Line 403 buildnames(struct manpage *mpage, sqlite3 *db, sqlite3 |
|
Line 407 buildnames(struct manpage *mpage, sqlite3 *db, sqlite3 |
|
|
|
/* Fetch the next name. */ |
/* Fetch the next name. */ |
|
|
sec = sqlite3_column_text(s, 0); |
sec = (const char *)sqlite3_column_text(s, 0); |
arch = sqlite3_column_text(s, 1); |
arch = (const char *)sqlite3_column_text(s, 1); |
name = sqlite3_column_text(s, 2); |
name = (const char *)sqlite3_column_text(s, 2); |
|
|
/* Remember the first section found. */ |
/* Remember the first section found. */ |
|
|
Line 494 buildoutput(sqlite3 *db, sqlite3_stmt *s, uint64_t pag |
|
Line 498 buildoutput(sqlite3 *db, sqlite3_stmt *s, uint64_t pag |
|
oldoutput = output; |
oldoutput = output; |
sep1 = " # "; |
sep1 = " # "; |
} |
} |
data = sqlite3_column_text(s, 1); |
data = (const char *)sqlite3_column_text(s, 1); |
mandoc_asprintf(&newoutput, "%s%s%s", |
mandoc_asprintf(&newoutput, "%s%s%s", |
oldoutput, sep1, data); |
oldoutput, sep1, data); |
free(output); |
free(output); |