/* $Id: manpath.c,v 1.30 2016/05/28 13:44:13 schwarze Exp $ */
/*
* Copyright (c) 2011, 2014, 2015 Ingo Schwarze <schwarze@openbsd.org>
* Copyright (c) 2011 Kristaps Dzonsons <kristaps@bsd.lv>
*
* Permission to use, copy, modify, and distribute this software for any
* 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 AUTHORS DISCLAIM ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* 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
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include "config.h"
#include <ctype.h>
#if HAVE_ERR
#include <err.h>
#endif
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "mandoc_aux.h"
#include "manconf.h"
#if !HAVE_MANPATH
static void manconf_file(struct manconf *, const char *);
#endif
static void manpath_add(struct manpaths *, const char *, int);
static void manpath_parseline(struct manpaths *, char *, int);
void
{
#if HAVE_MANPATH
char *buf;
if (file) {
}
if (auxp) {
}
if (defp) {
}
/* Open manpath(1). Ignore errors. */
return;
bsz = 0;
/* Read in as much output as we can. */
do {
} while (sz > 0);
}
#else
char *insert;
/* Always prepend -m. */
/* If -M is given, it overrides everything else. */
return;
}
/* MANPATH and man.conf(5) cooperate. */
/* No MANPATH; use man.conf(5) only. */
return;
}
/* Prepend man.conf(5) to MANPATH. */
if (':' == defp[0]) {
return;
}
/* Append man.conf(5) to MANPATH. */
return;
}
/* Insert man.conf(5) into MANPATH. */
*insert++ = '\0';
return;
}
/* MANPATH overrides man.conf(5) completely. */
#endif
}
/*
* Parse a FULL pathname from a colon-separated list of arrays.
*/
static void
{
char *dir;
return;
}
/*
* Add a directory to the array, ignoring bad directories.
* Grow the array one-by-one for simplicity's sake.
*/
static void
{
char *cp;
size_t i;
if (complain)
return;
}
return;
if (complain)
return;
}
}
void
{
size_t i;
}
#if !HAVE_MANPATH
static void
{
goto out;
linesz = 0;
*ep-- = '\0';
cp++;
continue;
cp++;
break;
}
}
switch (tok) {
case 2: /* _whatdb */
ep--;
continue;
*ep = '\0';
/* FALLTHROUGH */
case 0: /* manpath */
*manpath_default = '\0';
break;
case 1: /* output */
break;
default:
break;
}
}
out:
if (*manpath_default != '\0')
}
#endif
void
{
const char *const toks[] = {
"includes", "man", "paper", "style",
"indent", "width", "fragment", "mdoc"
};
if (*cp == '=')
cp++;
cp++;
break;
}
}
return;
switch (tok) {
case 0:
break;
case 1:
break;
case 2:
break;
case 3:
break;
case 4:
break;
case 5:
break;
case 6:
break;
case 7:
break;
default:
break;
}
}