summaryrefslogtreecommitdiffstats
path: root/usr.bin/m4
diff options
context:
space:
mode:
authorjkim <jkim@FreeBSD.org>2013-05-03 23:29:38 +0000
committerjkim <jkim@FreeBSD.org>2013-05-03 23:29:38 +0000
commit0ceb3c977351928509aac9580e4929caa3985909 (patch)
tree21bf6d42e447dfc0510b33c649cbd9c5962dbaf4 /usr.bin/m4
parent679fa5ed4e91b1d9e2002d8da43d9c31056fe7a4 (diff)
downloadFreeBSD-src-0ceb3c977351928509aac9580e4929caa3985909.zip
FreeBSD-src-0ceb3c977351928509aac9580e4929caa3985909.tar.gz
Reduce diff with upstream.
Diffstat (limited to 'usr.bin/m4')
-rw-r--r--usr.bin/m4/TEST/ack.m44
-rw-r--r--usr.bin/m4/TEST/hanoi.m44
-rw-r--r--usr.bin/m4/TEST/hash.m44
-rw-r--r--usr.bin/m4/TEST/sqroot.m44
-rw-r--r--usr.bin/m4/TEST/string.m44
-rw-r--r--usr.bin/m4/TEST/test.m44
-rw-r--r--usr.bin/m4/eval.c2
-rw-r--r--usr.bin/m4/extern.h2
-rw-r--r--usr.bin/m4/m4.143
-rw-r--r--usr.bin/m4/main.c2
-rw-r--r--usr.bin/m4/parser.y2
-rw-r--r--usr.bin/m4/tokenizer.l2
12 files changed, 45 insertions, 32 deletions
diff --git a/usr.bin/m4/TEST/ack.m4 b/usr.bin/m4/TEST/ack.m4
index c4bc39d..bf2a995 100644
--- a/usr.bin/m4/TEST/ack.m4
+++ b/usr.bin/m4/TEST/ack.m4
@@ -1,4 +1,4 @@
-# $OpenBSD: ack.m4,v 1.2 1996/06/26 05:36:18 deraadt Exp $
+# $OpenBSD: ack.m4,v 1.3 2003/06/03 02:56:11 millert Exp $
# $NetBSD: ack.m4,v 1.4 1995/09/28 05:37:54 tls Exp $
#
# Copyright (c) 1989, 1993
@@ -15,7 +15,7 @@
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
-# 4. Neither the name of the University nor the names of its contributors
+# 3. Neither the name of the University nor the names of its contributors
# may be used to endorse or promote products derived from this software
# without specific prior written permission.
#
diff --git a/usr.bin/m4/TEST/hanoi.m4 b/usr.bin/m4/TEST/hanoi.m4
index b26ec6b..5be47d1 100644
--- a/usr.bin/m4/TEST/hanoi.m4
+++ b/usr.bin/m4/TEST/hanoi.m4
@@ -1,4 +1,4 @@
-# $OpenBSD: hanoi.m4,v 1.2 1996/06/26 05:36:19 deraadt Exp $
+# $OpenBSD: hanoi.m4,v 1.3 2003/06/03 02:56:11 millert Exp $
# $NetBSD: hanoi.m4,v 1.4 1995/09/28 05:37:56 tls Exp $
#
# Copyright (c) 1989, 1993
@@ -15,7 +15,7 @@
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
-# 4. Neither the name of the University nor the names of its contributors
+# 3. Neither the name of the University nor the names of its contributors
# may be used to endorse or promote products derived from this software
# without specific prior written permission.
#
diff --git a/usr.bin/m4/TEST/hash.m4 b/usr.bin/m4/TEST/hash.m4
index 7aa2038..06357df 100644
--- a/usr.bin/m4/TEST/hash.m4
+++ b/usr.bin/m4/TEST/hash.m4
@@ -1,4 +1,4 @@
-# $OpenBSD: hash.m4,v 1.2 1996/06/26 05:36:19 deraadt Exp $
+# $OpenBSD: hash.m4,v 1.3 2003/06/03 02:56:11 millert Exp $
# $NetBSD: hash.m4,v 1.4 1995/09/28 05:37:58 tls Exp $
#
# Copyright (c) 1989, 1993
@@ -15,7 +15,7 @@
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
-# 4. Neither the name of the University nor the names of its contributors
+# 3. Neither the name of the University nor the names of its contributors
# may be used to endorse or promote products derived from this software
# without specific prior written permission.
#
diff --git a/usr.bin/m4/TEST/sqroot.m4 b/usr.bin/m4/TEST/sqroot.m4
index 9b80109..1442ecf6 100644
--- a/usr.bin/m4/TEST/sqroot.m4
+++ b/usr.bin/m4/TEST/sqroot.m4
@@ -1,4 +1,4 @@
-# $OpenBSD: sqroot.m4,v 1.2 1996/06/26 05:36:20 deraadt Exp $
+# $OpenBSD: sqroot.m4,v 1.3 2003/06/03 02:56:11 millert Exp $
# $NetBSD: sqroot.m4,v 1.4 1995/09/28 05:38:01 tls Exp $
#
# Copyright (c) 1989, 1993
@@ -15,7 +15,7 @@
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
-# 4. Neither the name of the University nor the names of its contributors
+# 3. Neither the name of the University nor the names of its contributors
# may be used to endorse or promote products derived from this software
# without specific prior written permission.
#
diff --git a/usr.bin/m4/TEST/string.m4 b/usr.bin/m4/TEST/string.m4
index ce12396..61fc28e 100644
--- a/usr.bin/m4/TEST/string.m4
+++ b/usr.bin/m4/TEST/string.m4
@@ -1,4 +1,4 @@
-# $OpenBSD: string.m4,v 1.2 1996/06/26 05:36:20 deraadt Exp $
+# $OpenBSD: string.m4,v 1.3 2003/06/03 02:56:11 millert Exp $
# $NetBSD: string.m4,v 1.4 1995/09/28 05:38:03 tls Exp $
#
# Copyright (c) 1989, 1993
@@ -15,7 +15,7 @@
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
-# 4. Neither the name of the University nor the names of its contributors
+# 3. Neither the name of the University nor the names of its contributors
# may be used to endorse or promote products derived from this software
# without specific prior written permission.
#
diff --git a/usr.bin/m4/TEST/test.m4 b/usr.bin/m4/TEST/test.m4
index 61b8de6..25b01b8 100644
--- a/usr.bin/m4/TEST/test.m4
+++ b/usr.bin/m4/TEST/test.m4
@@ -1,4 +1,4 @@
-# $OpenBSD: test.m4,v 1.2 1996/06/26 05:36:21 deraadt Exp $
+# $OpenBSD: test.m4,v 1.3 2003/06/03 02:56:11 millert Exp $
# $NetBSD: test.m4,v 1.4 1995/09/28 05:38:05 tls Exp $
#
# Copyright (c) 1989, 1993
@@ -15,7 +15,7 @@
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
-# 4. Neither the name of the University nor the names of its contributors
+# 3. Neither the name of the University nor the names of its contributors
# may be used to endorse or promote products derived from this software
# without specific prior written permission.
#
diff --git a/usr.bin/m4/eval.c b/usr.bin/m4/eval.c
index 729cf18..fbd42aa 100644
--- a/usr.bin/m4/eval.c
+++ b/usr.bin/m4/eval.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: eval.c,v 1.69 2011/03/24 11:23:08 espie Exp $ */
+/* $OpenBSD: eval.c,v 1.70 2012/04/12 17:00:11 espie Exp $ */
/* $NetBSD: eval.c,v 1.7 1996/11/10 21:21:29 pk Exp $ */
/*
diff --git a/usr.bin/m4/extern.h b/usr.bin/m4/extern.h
index ccb2e77..7753c32 100644
--- a/usr.bin/m4/extern.h
+++ b/usr.bin/m4/extern.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: extern.h,v 1.51 2011/09/27 07:24:02 espie Exp $ */
+/* $OpenBSD: extern.h,v 1.52 2012/04/12 17:00:11 espie Exp $ */
/* $NetBSD: extern.h,v 1.3 1996/01/13 23:25:24 pk Exp $ */
/*-
diff --git a/usr.bin/m4/m4.1 b/usr.bin/m4/m4.1
index 6d26111..d0669c1 100644
--- a/usr.bin/m4/m4.1
+++ b/usr.bin/m4/m4.1
@@ -1,5 +1,5 @@
-.\" $NetBSD: m4.1,v 1.22 2010/05/14 17:14:28 joerg Exp $
-.\" @(#) $OpenBSD: m4.1,v 1.56 2009/10/14 17:19:47 sthen Exp $
+.\" $NetBSD: m4.1,v 1.23 2012/04/08 22:00:39 wiz Exp $
+.\" @(#) $OpenBSD: m4.1,v 1.59 2010/10/21 13:20:51 jmc Exp $
.\"
.\" Copyright (c) 1989, 1993
.\" The Regents of the University of California. All rights reserved.
@@ -33,14 +33,14 @@
.\"
.\" $FreeBSD$
.\"
-.Dd October 14, 2009
+.Dd October 21, 2010
.Dt M4 1
.Os
.Sh NAME
.Nm m4
.Nd macro language processor
.Sh SYNOPSIS
-.Nm m4
+.Nm
.Op Fl gPs
.Oo
.Sm off
@@ -50,18 +50,16 @@
.Op Fl d Ar flags
.Op Fl I Ar dirname
.Op Fl o Ar filename
-.Bk -words
.Op Fl t Ar macro
.Op Fl U Ns Ar name
.Op Ar
-.Ek
.Sh DESCRIPTION
The
-.Nm m4
+.Nm
utility is a macro processor that can be used as a front end to any
language (e.g., C, ratfor, fortran, lex, and yacc).
If no input files are given,
-.Nm m4
+.Nm
reads from the standard input,
otherwise files specified on the command line are
processed in the given order.
@@ -69,7 +67,7 @@ Input files can be regular files, files in the m4 include paths, or a
single dash
.Pq Sq - ,
denoting standard input.
-.Nm m4
+.Nm
writes
the processed text to the standard output, unless told otherwise.
.Pp
@@ -77,7 +75,7 @@ Macro calls have the form name(argument1[, argument2, ..., argumentN]).
.Pp
There cannot be any space following the macro name and the open
parenthesis
-.Sq \&( .
+.Pq Sq \&( .
If the macro name is not followed by an open
parenthesis it is processed with no arguments.
.Pp
@@ -169,7 +167,7 @@ Undefine the symbol
.Ar name .
.El
.Sh SYNTAX
-.Nm m4
+.Nm
provides the following built-in macros.
They may be redefined, losing their original meaning.
Return values are null unless otherwise stated.
@@ -240,7 +238,7 @@ macro definitions (even for built-in macros).
.It Fn divert num
There are 10 output queues (numbered 0-9).
At the end of processing
-.Nm m4
+.Nm
concatenates all the queues in numerical order to produce the
final output.
Initially the output queue is 0.
@@ -259,7 +257,7 @@ Prints the first argument on the standard error output stream.
.It Fn esyscmd cmd
Passes its first argument to a shell and returns the shell's standard output.
Note that the shell shares its standard input and standard error with
-.Nm m4 .
+.Nm .
.It Fn eval expr
Computes the first argument as an arithmetic expression using 32-bit
arithmetic.
@@ -348,6 +346,9 @@ Multiple calls to
get inserted in sequence at the final
.Dv EOF .
.It Fn maketemp template
+Like
+.Ic mkstemp .
+.It Fn mkstemp template
Invokes
.Xr mkstemp 3
on the first argument, and returns the modified string.
@@ -431,10 +432,16 @@ Returns the current file's line number.
.It Ic __file__
Returns the current file's name.
.El
+.Sh EXIT STATUS
+.Ex -std m4
+.Pp
+But note that the
+.Ic m4exit
+macro can modify the exit status.
.Sh STANDARDS
The
.Nm
-utility is compliant with the
+utility is mostly compliant with the
.St -p1003.1-2008
specification.
.Pp
@@ -456,6 +463,12 @@ and
.Ic __file__
are extensions to that specification.
.Pp
+.Ic maketemp
+is not supposed to be a synonym for
+.Ic mkstemp ,
+but instead to be an insecure temporary file name creation function.
+The change causes no known compatibility issues.
+.Pp
The output format of tracing and of
.Ic dumpdef
are not specified in any standard,
@@ -480,7 +493,7 @@ replaces the top-most definition only.
Other implementations may erase all definitions on the stack instead.
.Pp
All built-ins do expand without arguments in many other
-.Nm m4 .
+.Nm .
.Pp
Many other
.Nm
diff --git a/usr.bin/m4/main.c b/usr.bin/m4/main.c
index c8de97c..1cb0340 100644
--- a/usr.bin/m4/main.c
+++ b/usr.bin/m4/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.80 2011/09/27 07:24:02 espie Exp $ */
+/* $OpenBSD: main.c,v 1.81 2012/04/12 17:00:11 espie Exp $ */
/* $NetBSD: main.c,v 1.12 1997/02/08 23:54:49 cgd Exp $ */
/*-
diff --git a/usr.bin/m4/parser.y b/usr.bin/m4/parser.y
index 2239cf3..8e8ad8c 100644
--- a/usr.bin/m4/parser.y
+++ b/usr.bin/m4/parser.y
@@ -1,5 +1,5 @@
%{
-/* $OpenBSD: parser.y,v 1.6 2008/08/21 21:00:14 espie Exp $ */
+/* $OpenBSD: parser.y,v 1.7 2012/04/12 17:00:11 espie Exp $ */
/*
* Copyright (c) 2004 Marc Espie <espie@cvs.openbsd.org>
*
diff --git a/usr.bin/m4/tokenizer.l b/usr.bin/m4/tokenizer.l
index ca3612e..da362b4 100644
--- a/usr.bin/m4/tokenizer.l
+++ b/usr.bin/m4/tokenizer.l
@@ -1,6 +1,6 @@
%option nounput noinput
%{
-/* $OpenBSD: tokenizer.l,v 1.7 2010/03/22 20:40:44 espie Exp $ */
+/* $OpenBSD: tokenizer.l,v 1.8 2012/04/12 17:00:11 espie Exp $ */
/*
* Copyright (c) 2004 Marc Espie <espie@cvs.openbsd.org>
*
OpenPOWER on IntegriCloud