-/* $Id: mandocdb.c,v 1.52 2012/06/08 15:06:28 kristaps Exp $ */
+/* $Id: mandocdb.c,v 1.55 2012/06/09 14:11:16 kristaps Exp $ */
/*
* Copyright (c) 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2011, 2012 Ingo Schwarze <schwarze@openbsd.org>
#include <string.h>
#include <unistd.h>
+#ifdef HAVE_OHASH
#include <ohash.h>
+#else
+#include "compat_ohash.h"
+#endif
#include <sqlite3.h>
#include "mdoc.h"
#include "man.h"
#include "mandoc.h"
-#include "mandocdb.h"
#include "manpath.h"
+#include "mansearch.h"
/* Post a warning to stderr. */
#define WARNING(_f, _b, _fmt, _args...) \
{
char cwd[MAXPATHLEN];
int ch, rc, fd, i;
+ unsigned int index;
size_t j, sz;
const char *dir;
struct str *s;
* turn off synchronous mode for much better
* performance.
*/
+#ifndef __APPLE__
SQL_EXEC("PRAGMA synchronous = OFF");
+#endif
if (0 == ofmerge(mc, mp, dirs.paths[j]))
goto out;
manpath_free(&dirs);
mchars_free(mc);
mparse_free(mp);
- for (s = ohash_first(&strings, &ch);
- NULL != s; s = ohash_next(&strings, &ch)) {
+ for (s = ohash_first(&strings, &index);
+ NULL != s; s = ohash_next(&strings, &index)) {
if (s->utf8 != s->key)
free(s->utf8);
free(s);