source@mandoc.bsd.lv
 help / color / mirror / Atom feed
* mdocml: * remove FreeBSDisms * purge and sort headers * add build and
@ 2015-05-20 22:23 schwarze
  0 siblings, 0 replies; only message in thread
From: schwarze @ 2015-05-20 22:23 UTC (permalink / raw)
  To: source

Log Message:
-----------
* remove FreeBSDisms
* purge and sort headers
* add build and compat glue
* and LICENSE information
for soelim(1)

Modified Files:
--------------
    mdocml:
        LICENSE
        Makefile
        compat_stringlist.c
        compat_stringlist.h
        configure
        configure.local.example
        soelim.1
        soelim.c

Added Files:
-----------
    mdocml:
        test-stringlist.c

Revision Data
-------------
Index: LICENSE
===================================================================
RCS file: /home/cvs/mdocml/mdocml/LICENSE,v
retrieving revision 1.7
retrieving revision 1.8
diff -LLICENSE -LLICENSE -u -p -r1.7 -r1.8
--- LICENSE
+++ LICENSE
@@ -8,10 +8,12 @@ Copyright (c) 2008-2012, 2014 Kristaps D
 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 PERFORM
 
 
 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 Re
 
 compat_fgetln.c:
 Copyright (c) 1998 The NetBSD Foundation, Inc.
+
+compat_stringlist.c, compat_stringlist.h:
+Copyright (c) 1994 Christos Zoulas <christos@netbsd.org>
Index: soelim.c
===================================================================
RCS file: /home/cvs/mdocml/mdocml/soelim.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -Lsoelim.c -Lsoelim.c -u -p -r1.1.1.1 -r1.2
--- soelim.c
+++ soelim.c
@@ -1,4 +1,5 @@
-/*-
+/*	$Id$	*/
+/*
  * 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
 
Index: Makefile
===================================================================
RCS file: /home/cvs/mdocml/mdocml/Makefile,v
retrieving revision 1.461
retrieving revision 1.462
diff -LMakefile -LMakefile -u -p -r1.461 -r1.462
--- Makefile
+++ Makefile
@@ -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 ma
 
 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
@@ -392,6 +401,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 ---
 
--- /dev/null
+++ 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);
+}
Index: configure
===================================================================
RCS file: /home/cvs/mdocml/mdocml/configure,v
retrieving revision 1.25
retrieving revision 1.26
diff -Lconfigure -Lconfigure -u -p -r1.25 -r1.26
--- configure
+++ 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}
Index: compat_stringlist.c
===================================================================
RCS file: /home/cvs/mdocml/mdocml/compat_stringlist.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -Lcompat_stringlist.c -Lcompat_stringlist.c -u -p -r1.1.1.1 -r1.2
--- compat_stringlist.c
+++ compat_stringlist.c
@@ -1,5 +1,6 @@
+/*	$Id$	*/
 /*
- * 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;
 }
 
Index: compat_stringlist.h
===================================================================
RCS file: /home/cvs/mdocml/mdocml/compat_stringlist.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -Lcompat_stringlist.h -Lcompat_stringlist.h -u -p -r1.1.1.1 -r1.2
--- compat_stringlist.h
+++ compat_stringlist.h
@@ -1,7 +1,8 @@
+/*	$Id$	*/
 /*	$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 */
Index: soelim.1
===================================================================
RCS file: /home/cvs/mdocml/mdocml/soelim.1,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -Lsoelim.1 -Lsoelim.1 -u -p -r1.1.1.1 -r1.2
--- soelim.1
+++ soelim.1
@@ -1,3 +1,5 @@
+.\"	$Id$
+.\"
 .\" 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$
 .Dt SOELIM 1
 .Os
 .Sh NAME
Index: configure.local.example
===================================================================
RCS file: /home/cvs/mdocml/mdocml/configure.local.example,v
retrieving revision 1.8
retrieving revision 1.9
diff -Lconfigure.local.example -Lconfigure.local.example -u -p -r1.8 -r1.9
--- configure.local.example
+++ configure.local.example
@@ -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:
--
 To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-05-20 22:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-20 22:23 mdocml: * remove FreeBSDisms * purge and sort headers * add build and schwarze

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).