aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2015-05-20 22:22:59 +0000
committerIngo Schwarze <schwarze@openbsd.org>2015-05-20 22:22:59 +0000
commitea3a546595c994f7d63049af16eecab1660ef4fa (patch)
tree878fffc5e32865bc50e1b26525056762d1b60e44
parent7578dcc6592a42a9ad7fbebacd5fcdfba0238f9e (diff)
downloadmandoc-ea3a546595c994f7d63049af16eecab1660ef4fa.tar.gz
mandoc-ea3a546595c994f7d63049af16eecab1660ef4fa.tar.zst
mandoc-ea3a546595c994f7d63049af16eecab1660ef4fa.zip
* remove FreeBSDisms
* purge and sort headers * add build and compat glue * and LICENSE information for soelim(1)
-rw-r--r--LICENSE15
-rw-r--r--Makefile20
-rw-r--r--compat_stringlist.c20
-rw-r--r--compat_stringlist.h10
-rwxr-xr-xconfigure12
-rw-r--r--configure.local.example13
-rw-r--r--soelim.16
-rw-r--r--soelim.c19
-rw-r--r--test-stringlist.c37
9 files changed, 102 insertions, 50 deletions
diff --git a/LICENSE b/LICENSE
index 080c04fa..5745fa3e 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,4 +1,4 @@
-$Id: LICENSE,v 1.7 2015/02/16 14:56:22 schwarze Exp $
+$Id: LICENSE,v 1.8 2015/05/20 22:22:59 schwarze Exp $
With the exceptions noted below, all code and documentation
contained in the mdocml toolkit is protected by the Copyright
@@ -8,10 +8,12 @@ Copyright (c) 2008-2012, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
Copyright (c) 2010-2015 Ingo Schwarze <schwarze@openbsd.org>
Copyright (c) 2009, 2010, 2011, 2012 Joerg Sonnenberger <joerg@netbsd.org>
Copyright (c) 2013 Franco Fichtner <franco@lastsummer.de>
+Copyright (c) 2014 Baptiste Daroussin <bapt@FreeBSD.org>
Copyright (c) 1999, 2004 Marc Espie <espie@openbsd.org>
Copyright (c) 1998, 2004, 2010 Todd C. Miller <Todd.Miller@courtesan.com>
Copyright (c) 2008 Otto Moerbeek <otto@drijf.net>
Copyright (c) 2004 Ted Unangst <tedu@openbsd.org>
+Copyright (c) 1994 Christos Zoulas <christos@netbsd.org>
Copyright (c) 2003, 2007, 2008, 2014 Jason McIntyre <jmc@openbsd.org>
See the individual source files for information about who contributed
@@ -35,8 +37,12 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
The following files included from outside sources are protected by
-other people's Copyright and are distributed under a 3-clause BSD
-license; see these individual files for details.
+other people's Copyright and are distributed under various 2-clause,
+3-clause, and 4-clause BSD licenses; see these individual files for
+details.
+
+soelim.c, soelim.1:
+Copyright (c) 2014 Baptiste Daroussin <bapt@FreeBSD.org>
compat_fts.c, compat_fts.h,
compat_getsubopt.c, compat_strcasestr.c, compat_strsep.c,
@@ -45,3 +51,6 @@ Copyright (c) 1989,1990,1993,1994 The Regents of the University of California
compat_fgetln.c:
Copyright (c) 1998 The NetBSD Foundation, Inc.
+
+compat_stringlist.c, compat_stringlist.h:
+Copyright (c) 1994 Christos Zoulas <christos@netbsd.org>
diff --git a/Makefile b/Makefile
index cb120f3e..71652254 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.461 2015/04/02 21:36:49 schwarze Exp $
+# $Id: Makefile,v 1.462 2015/05/20 22:22:59 schwarze Exp $
#
# Copyright (c) 2010, 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv>
# Copyright (c) 2011, 2013, 2014, 2015 Ingo Schwarze <schwarze@openbsd.org>
@@ -31,6 +31,7 @@ TESTSRCS = test-dirent-namlen.c \
test-sqlite3.c \
test-sqlite3_errstr.c \
test-strcasestr.c \
+ test-stringlist.c \
test-strlcat.c \
test-strlcpy.c \
test-strptime.c \
@@ -51,6 +52,7 @@ SRCS = att.c \
compat_reallocarray.c \
compat_sqlite3_errstr.c \
compat_strcasestr.c \
+ compat_stringlist.c \
compat_strlcat.c \
compat_strlcpy.c \
compat_strsep.c \
@@ -89,6 +91,7 @@ SRCS = att.c \
preconv.c \
read.c \
roff.c \
+ soelim.c \
st.c \
tbl.c \
tbl_data.c \
@@ -113,6 +116,7 @@ DISTFILES = INSTALL \
chars.in \
compat_fts.h \
compat_ohash.h \
+ compat_stringlist.h \
configure \
configure.local.example \
demandoc.1 \
@@ -154,6 +158,7 @@ DISTFILES = INSTALL \
predefs.in \
roff.7 \
roff.h \
+ soelim.1 \
st.in \
style.css \
tbl.3 \
@@ -247,10 +252,13 @@ MANPAGE_OBJS = manpage.o mansearch.o mansearch_const.o manpath.o
DEMANDOC_OBJS = demandoc.o
+SOELIM_OBJS = soelim.o compat_stringlist.o
+
WWW_MANS = apropos.1.html \
demandoc.1.html \
man.1.html \
mandoc.1.html \
+ soelim.1.html \
mandoc.3.html \
mandoc_escape.3.html \
mandoc_headers.3.html \
@@ -288,7 +296,7 @@ include Makefile.local
all: base-build $(BUILD_TARGETS) Makefile.local
-base-build: mandoc demandoc
+base-build: mandoc demandoc soelim
cgi-build: man.cgi
@@ -314,6 +322,7 @@ clean:
rm -f man.cgi $(CGI_OBJS)
rm -f manpage $(MANPAGE_OBJS)
rm -f demandoc $(DEMANDOC_OBJS)
+ rm -f soelim $(SOELIM_OBJS)
rm -f $(WWW_MANS) $(WWW_OBJS)
rm -rf *.dSYM
@@ -326,12 +335,12 @@ base-install: base-build
mkdir -p $(DESTDIR)$(MANDIR)/man3
mkdir -p $(DESTDIR)$(MANDIR)/man5
mkdir -p $(DESTDIR)$(MANDIR)/man7
- $(INSTALL_PROGRAM) mandoc demandoc $(DESTDIR)$(BINDIR)
+ $(INSTALL_PROGRAM) mandoc demandoc soelim $(DESTDIR)$(BINDIR)
ln -f $(DESTDIR)$(BINDIR)/mandoc $(DESTDIR)$(BINDIR)/$(BINM_MAN)
$(INSTALL_LIB) libmandoc.a $(DESTDIR)$(LIBDIR)
$(INSTALL_LIB) man.h mandoc.h mandoc_aux.h mdoc.h roff.h \
$(DESTDIR)$(INCLUDEDIR)
- $(INSTALL_MAN) mandoc.1 demandoc.1 $(DESTDIR)$(MANDIR)/man1
+ $(INSTALL_MAN) mandoc.1 demandoc.1 soelim.1 $(DESTDIR)$(MANDIR)/man1
$(INSTALL_MAN) man.1 $(DESTDIR)$(MANDIR)/man1/$(BINM_MAN).1
$(INSTALL_MAN) mandoc.3 mandoc_escape.3 mandoc_malloc.3 \
mchars_alloc.3 tbl.3 $(DESTDIR)$(MANDIR)/man3
@@ -393,6 +402,9 @@ man.cgi: $(CGI_OBJS) libmandoc.a
demandoc: $(DEMANDOC_OBJS) libmandoc.a
$(CC) $(LDFLAGS) -o $@ $(DEMANDOC_OBJS) libmandoc.a
+soelim: $(SOELIM_OBJS)
+ $(CC) $(LDFLAGS) -o $@ $(SOELIM_OBJS)
+
# --- maintainer targets ---
www-install: www
diff --git a/compat_stringlist.c b/compat_stringlist.c
index a09a8e70..2b26e200 100644
--- a/compat_stringlist.c
+++ b/compat_stringlist.c
@@ -1,5 +1,6 @@
+/* $Id: compat_stringlist.c,v 1.2 2015/05/20 22:22:59 schwarze Exp $ */
/*
- * Copyright (c) 1994 Christos Zoulas
+ * Copyright (c) 1994 Christos Zoulas <christos@netbsd.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -26,19 +27,10 @@
* SUCH DAMAGE.
*/
-#if defined(LIBC_SCCS) && !defined(lint)
-static char *rcsid = "$NetBSD: stringlist.c,v 1.2 1997/01/17 07:26:20 lukem Exp $";
-#endif /* LIBC_SCCS and not lint */
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include "namespace.h"
-#include <stdio.h>
-#include <string.h>
#include <err.h>
#include <stdlib.h>
-#include <stringlist.h>
-#include "un-namespace.h"
+#include <string.h>
+#include "compat_stringlist.h"
#define _SL_CHUNKSIZE 20
@@ -52,13 +44,13 @@ sl_init(void)
sl = malloc(sizeof(StringList));
if (sl == NULL)
- _err(1, "stringlist: %m");
+ err(1, "stringlist");
sl->sl_cur = 0;
sl->sl_max = _SL_CHUNKSIZE;
sl->sl_str = malloc(sl->sl_max * sizeof(char *));
if (sl->sl_str == NULL)
- _err(1, "stringlist: %m");
+ err(1, "stringlist");
return sl;
}
diff --git a/compat_stringlist.h b/compat_stringlist.h
index d3154b34..5751fb22 100644
--- a/compat_stringlist.h
+++ b/compat_stringlist.h
@@ -1,7 +1,8 @@
+/* $Id: compat_stringlist.h,v 1.2 2015/05/20 22:22:59 schwarze Exp $ */
/* $NetBSD: stringlist.h,v 1.2 1997/01/17 06:11:36 lukem Exp $ */
/*
- * Copyright (c) 1994 Christos Zoulas
+ * Copyright (c) 1994 Christos Zoulas <christos@netbsd.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -29,13 +30,8 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- *
- * $FreeBSD$
*/
-#ifndef _STRINGLIST_H
-#define _STRINGLIST_H
-#include <sys/cdefs.h>
#include <sys/types.h>
/*
@@ -53,5 +49,3 @@ int sl_add(StringList *, char *);
void sl_free(StringList *, int);
char *sl_find(StringList *, const char *);
__END_DECLS
-
-#endif /* _STRINGLIST_H */
diff --git a/configure b/configure
index 87db2897..59a28f92 100755
--- a/configure
+++ b/configure
@@ -51,6 +51,7 @@ HAVE_MKDTEMP=
HAVE_MMAP=
HAVE_REALLOCARRAY=
HAVE_STRCASESTR=
+HAVE_STRINGLIST=
HAVE_STRLCAT=
HAVE_STRLCPY=
HAVE_STRPTIME=
@@ -78,9 +79,10 @@ HTDOCDIR=
CGIBINDIR=
BINM_APROPOS="apropos"
+BINM_MAKEWHATIS="makewhatis"
BINM_MAN="man"
+BINM_SOELIM="soelim"
BINM_WHATIS="whatis"
-BINM_MAKEWHATIS="makewhatis"
MANM_MAN="man"
MANM_MANCONF="man.conf"
MANM_MDOC="mdoc"
@@ -177,6 +179,7 @@ runtest mkdtemp MKDTEMP || true
runtest mmap MMAP || true
runtest reallocarray REALLOCARRAY || true
runtest strcasestr STRCASESTR || true
+runtest stringlist STRINGLIST || true
runtest strlcat STRLCAT || true
runtest strlcpy STRLCPY || true
runtest strptime STRPTIME || true
@@ -295,6 +298,7 @@ cat << __HEREDOC__
#define HAVE_MMAP ${HAVE_MMAP}
#define HAVE_REALLOCARRAY ${HAVE_REALLOCARRAY}
#define HAVE_STRCASESTR ${HAVE_STRCASESTR}
+#define HAVE_STRINGLIST ${HAVE_STRINGLIST}
#define HAVE_STRLCAT ${HAVE_STRLCAT}
#define HAVE_STRLCPY ${HAVE_STRLCPY}
#define HAVE_STRPTIME ${HAVE_STRPTIME}
@@ -308,9 +312,10 @@ cat << __HEREDOC__
#define HAVE_MANPATH ${HAVE_MANPATH}
#define BINM_APROPOS "${BINM_APROPOS}"
+#define BINM_MAKEWHATIS "${BINM_MAKEWHATIS}"
#define BINM_MAN "${BINM_MAN}"
+#define BINM_SOELIM "${BINM_SOELIM}"
#define BINM_WHATIS "${BINM_WHATIS}"
-#define BINM_MAKEWHATIS "${BINM_MAKEWHATIS}"
#if !defined(__BEGIN_DECLS)
# ifdef __cplusplus
@@ -420,9 +425,10 @@ WWWPREFIX = ${WWWPREFIX}
HTDOCDIR = ${HTDOCDIR}
CGIBINDIR = ${CGIBINDIR}
BINM_APROPOS = ${BINM_APROPOS}
+BINM_MAKEWHATIS = ${BINM_MAKEWHATIS}
BINM_MAN = ${BINM_MAN}
+BINM_SOELIM = ${BINM_SOELIM}
BINM_WHATIS = ${BINM_WHATIS}
-BINM_MAKEWHATIS = ${BINM_MAKEWHATIS}
MANM_MAN = ${MANM_MAN}
MANM_MANCONF = ${MANM_MANCONF}
MANM_MDOC = ${MANM_MDOC}
diff --git a/configure.local.example b/configure.local.example
index 3cee71c4..0349a760 100644
--- a/configure.local.example
+++ b/configure.local.example
@@ -1,4 +1,4 @@
-# $Id: configure.local.example,v 1.8 2015/03/27 00:18:14 schwarze Exp $
+# $Id: configure.local.example,v 1.9 2015/05/20 22:22:59 schwarze Exp $
#
# Copyright (c) 2014, 2015 Ingo Schwarze <schwarze@openbsd.org>
#
@@ -115,13 +115,14 @@ MANM_EQN="mandoc_eqn" # default is "eqn"
MANM_TBL="mandoc_tbl" # default is "tbl"
# Some distributions may want to avoid naming conflicts
-# with another man(1) utility.
-# If you want to change the name of the binary program,
-# the following alternative name is suggested.
-# Using a different name is possible as well.
-# This changes the name of the installed section 1 manual page as well.
+# with other man(1) and soelim(1) utilities.
+# If you want to change the names of binary programs,
+# the following alternative names are suggested.
+# Using different names is possible as well.
+# This changes the names of the installed section 1 manual pages as well.
BINM_MAN=mman # default is "man"
+BINM_SOELIM=msoelim # default is "soelim"
# It is possible to change the utility program used for installation
# and the modes files are installed with. The defaults are:
diff --git a/soelim.1 b/soelim.1
index b6ec13c1..b6eca51a 100644
--- a/soelim.1
+++ b/soelim.1
@@ -1,3 +1,5 @@
+.\" $Id: soelim.1,v 1.2 2015/05/20 22:22:59 schwarze Exp $
+.\"
.\" Copyright (c) 2014 Baptiste Daroussin <bapt@FreeBSD.org>
.\" All rights reserved.
.\"
@@ -22,9 +24,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $FreeBSD$
-.\"
-.Dd May 1, 2015
+.Dd $Mdocdate: May 20 2015 $
.Dt SOELIM 1
.Os
.Sh NAME
diff --git a/soelim.c b/soelim.c
index de6911f3..c1fa4adb 100644
--- a/soelim.c
+++ b/soelim.c
@@ -1,4 +1,5 @@
-/*-
+/* $Id: soelim.c,v 1.2 2015/05/20 22:22:59 schwarze Exp $ */
+/*
* Copyright (c) 2014 Baptiste Daroussin <bapt@FreeBSD.org>
* All rights reserved.
*
@@ -24,20 +25,20 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
#include <sys/param.h>
+#include <sys/types.h>
-#define _WITH_GETLINE
+#include <ctype.h>
+#include <err.h>
#include <stdio.h>
-#include <unistd.h>
#include <stdlib.h>
-#include <stdbool.h>
#include <string.h>
+#if HAVE_STRINGLIST
#include <stringlist.h>
-#include <err.h>
-#include <ctype.h>
+#else
+#include "compat_stringlist.h"
+#endif
+#include <unistd.h>
#define C_OPTION 0x1
diff --git a/test-stringlist.c b/test-stringlist.c
new file mode 100644
index 00000000..790ba095
--- /dev/null
+++ b/test-stringlist.c
@@ -0,0 +1,37 @@
+/* $Id: test-stringlist.c,v 1.1 2015/05/20 22:22:59 schwarze Exp $ */
+/*
+ * Copyright (c) 2015 Ingo Schwarze <schwarze@openbsd.org>
+ *
+ * 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 AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR 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 <stringlist.h>
+
+int
+main(void)
+{
+ StringList *sl;
+ char teststr[] = "test";
+
+ if ((sl = sl_init()) == NULL)
+ return(1);
+ if (sl_add(sl, teststr))
+ return(2);
+ if (sl->sl_cur != 1)
+ return(3);
+ if (sl->sl_str[0] != teststr)
+ return(4);
+
+ sl_free(sl, 0);
+ return(0);
+}