=================================================================== RCS file: /cvs/mandoc/main.c,v retrieving revision 1.228 retrieving revision 1.229 diff -u -p -r1.228 -r1.229 --- mandoc/main.c 2015/03/27 16:36:31 1.228 +++ mandoc/main.c 2015/03/27 17:37:25 1.229 @@ -1,4 +1,4 @@ -/* $Id: main.c,v 1.228 2015/03/27 16:36:31 schwarze Exp $ */ +/* $Id: main.c,v 1.229 2015/03/27 17:37:25 schwarze Exp $ */ /* * Copyright (c) 2008-2012 Kristaps Dzonsons * Copyright (c) 2010-2012, 2014, 2015 Ingo Schwarze @@ -8,9 +8,9 @@ * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF @@ -39,7 +39,7 @@ #include "main.h" #include "mdoc.h" #include "man.h" -#include "manpath.h" +#include "manconf.h" #include "mansearch.h" #if !defined(__GNUC__) || (__GNUC__ < 2) @@ -118,9 +118,9 @@ static enum mandoclevel rc; int main(int argc, char *argv[]) { + struct manconf conf; struct curparse curp; struct mansearch search; - struct manpaths paths; char *auxpaths; char *defos; unsigned char *uc; @@ -151,7 +151,7 @@ main(int argc, char *argv[]) /* Search options. */ - memset(&paths, 0, sizeof(struct manpaths)); + memset(&conf, 0, sizeof(conf)); conf_file = defpaths = NULL; auxpaths = NULL; @@ -336,10 +336,11 @@ main(int argc, char *argv[]) /* Access the mandoc database. */ - manpath_parse(&paths, conf_file, defpaths, auxpaths); + manconf_parse(&conf, conf_file, defpaths, auxpaths); #if HAVE_SQLITE3 mansearch_setup(1); - if( ! mansearch(&search, &paths, argc, argv, &res, &sz)) + if ( ! mansearch(&search, &conf.manpath, + argc, argv, &res, &sz)) usage(search.argmode); #else if (search.argmode != ARG_NAME) { @@ -351,7 +352,8 @@ main(int argc, char *argv[]) #endif if (sz == 0 && search.argmode == ARG_NAME) - fs_search(&search, &paths, argc, argv, &res, &sz); + fs_search(&search, &conf.manpath, + argc, argv, &res, &sz); if (sz == 0) { rc = MANDOCLEVEL_BADARG; @@ -439,7 +441,7 @@ main(int argc, char *argv[]) parse(&curp, fd, *argv); else if (resp->form & FORM_SRC) { /* For .so only; ignore failure. */ - chdir(paths.paths[resp->ipath]); + chdir(conf.manpath.paths[resp->ipath]); parse(&curp, fd, resp->file); } else passthrough(resp->file, fd, synopsis_only); @@ -470,7 +472,7 @@ main(int argc, char *argv[]) out: if (search.argmode != ARG_FILE) { - manpath_free(&paths); + manconf_free(&conf); #if HAVE_SQLITE3 mansearch_free(res, sz); mansearch_setup(0);