head	1.17;
access;
symbols
	netbsd-11-0-RC4:1.17
	netbsd-11-0-RC3:1.17
	netbsd-11-0-RC2:1.17
	netbsd-11-0-RC1:1.17
	perseant-exfatfs-base-20250801:1.17
	netbsd-11:1.17.0.30
	netbsd-11-base:1.17
	netbsd-10-1-RELEASE:1.17
	perseant-exfatfs-base-20240630:1.17
	perseant-exfatfs:1.17.0.28
	perseant-exfatfs-base:1.17
	netbsd-8-3-RELEASE:1.17
	netbsd-9-4-RELEASE:1.17
	netbsd-10-0-RELEASE:1.17
	netbsd-10-0-RC6:1.17
	netbsd-10-0-RC5:1.17
	netbsd-10-0-RC4:1.17
	netbsd-10-0-RC3:1.17
	netbsd-10-0-RC2:1.17
	netbsd-10-0-RC1:1.17
	netbsd-10:1.17.0.26
	netbsd-10-base:1.17
	netbsd-9-3-RELEASE:1.17
	cjep_sun2x-base1:1.17
	cjep_sun2x:1.17.0.24
	cjep_sun2x-base:1.17
	cjep_staticlib_x-base1:1.17
	netbsd-9-2-RELEASE:1.17
	cjep_staticlib_x:1.17.0.22
	cjep_staticlib_x-base:1.17
	netbsd-9-1-RELEASE:1.17
	phil-wifi-20200421:1.17
	phil-wifi-20200411:1.17
	is-mlppp:1.17.0.20
	is-mlppp-base:1.17
	phil-wifi-20200406:1.17
	netbsd-8-2-RELEASE:1.17
	netbsd-9-0-RELEASE:1.17
	netbsd-9-0-RC2:1.17
	netbsd-9-0-RC1:1.17
	phil-wifi-20191119:1.17
	netbsd-9:1.17.0.18
	netbsd-9-base:1.17
	phil-wifi-20190609:1.17
	netbsd-8-1-RELEASE:1.17
	netbsd-8-1-RC1:1.17
	pgoyette-compat-merge-20190127:1.17
	pgoyette-compat-20190127:1.17
	pgoyette-compat-20190118:1.17
	pgoyette-compat-1226:1.17
	pgoyette-compat-1126:1.17
	pgoyette-compat-1020:1.17
	pgoyette-compat-0930:1.17
	pgoyette-compat-0906:1.17
	netbsd-7-2-RELEASE:1.15
	pgoyette-compat-0728:1.17
	netbsd-8-0-RELEASE:1.17
	phil-wifi:1.17.0.16
	phil-wifi-base:1.17
	pgoyette-compat-0625:1.17
	netbsd-8-0-RC2:1.17
	pgoyette-compat-0521:1.17
	pgoyette-compat-0502:1.17
	pgoyette-compat-0422:1.17
	netbsd-8-0-RC1:1.17
	pgoyette-compat-0415:1.17
	pgoyette-compat-0407:1.17
	pgoyette-compat-0330:1.17
	pgoyette-compat-0322:1.17
	pgoyette-compat-0315:1.17
	netbsd-7-1-2-RELEASE:1.15
	pgoyette-compat:1.17.0.14
	pgoyette-compat-base:1.17
	netbsd-7-1-1-RELEASE:1.15
	matt-nb8-mediatek:1.17.0.12
	matt-nb8-mediatek-base:1.17
	perseant-stdc-iso10646:1.17.0.10
	perseant-stdc-iso10646-base:1.17
	netbsd-8:1.17.0.8
	netbsd-8-base:1.17
	prg-localcount2-base3:1.17
	prg-localcount2-base2:1.17
	prg-localcount2-base1:1.17
	prg-localcount2:1.17.0.6
	prg-localcount2-base:1.17
	pgoyette-localcount-20170426:1.17
	bouyer-socketcan-base1:1.17
	pgoyette-localcount-20170320:1.17
	netbsd-7-1:1.15.0.10
	netbsd-7-1-RELEASE:1.15
	netbsd-7-1-RC2:1.15
	netbsd-7-nhusb-base-20170116:1.15
	bouyer-socketcan:1.17.0.4
	bouyer-socketcan-base:1.17
	pgoyette-localcount-20170107:1.17
	netbsd-7-1-RC1:1.15
	pgoyette-localcount-20161104:1.17
	netbsd-7-0-2-RELEASE:1.15
	localcount-20160914:1.17
	netbsd-7-nhusb:1.15.0.8
	netbsd-7-nhusb-base:1.15
	pgoyette-localcount-20160806:1.17
	pgoyette-localcount-20160726:1.17
	pgoyette-localcount:1.17.0.2
	pgoyette-localcount-base:1.17
	netbsd-7-0-1-RELEASE:1.15
	netbsd-7-0:1.15.0.6
	netbsd-7-0-RELEASE:1.15
	netbsd-7-0-RC3:1.15
	netbsd-7-0-RC2:1.15
	netbsd-7-0-RC1:1.15
	netbsd-5-2-3-RELEASE:1.12
	netbsd-5-1-5-RELEASE:1.12
	netbsd-6-0-6-RELEASE:1.14
	netbsd-6-1-5-RELEASE:1.14
	netbsd-7:1.15.0.4
	netbsd-7-base:1.15
	yamt-pagecache-base9:1.15
	yamt-pagecache-tag8:1.14
	netbsd-6-1-4-RELEASE:1.14
	netbsd-6-0-5-RELEASE:1.14
	tls-earlyentropy:1.15.0.2
	tls-earlyentropy-base:1.15
	riastradh-xf86-video-intel-2-7-1-pre-2-21-15:1.15
	riastradh-drm2-base3:1.15
	netbsd-6-1-3-RELEASE:1.14
	netbsd-6-0-4-RELEASE:1.14
	netbsd-5-2-2-RELEASE:1.12
	netbsd-5-1-4-RELEASE:1.12
	netbsd-6-1-2-RELEASE:1.14
	netbsd-6-0-3-RELEASE:1.14
	netbsd-5-2-1-RELEASE:1.12
	netbsd-5-1-3-RELEASE:1.12
	netbsd-6-1-1-RELEASE:1.14
	riastradh-drm2-base2:1.14
	riastradh-drm2-base1:1.14
	riastradh-drm2:1.14.0.14
	riastradh-drm2-base:1.14
	netbsd-6-1:1.14.0.18
	netbsd-6-0-2-RELEASE:1.14
	netbsd-6-1-RELEASE:1.14
	netbsd-6-1-RC4:1.14
	netbsd-6-1-RC3:1.14
	agc-symver:1.14.0.16
	agc-symver-base:1.14
	netbsd-6-1-RC2:1.14
	netbsd-6-1-RC1:1.14
	yamt-pagecache-base8:1.14
	netbsd-5-2:1.12.0.52
	netbsd-6-0-1-RELEASE:1.14
	yamt-pagecache-base7:1.14
	netbsd-5-2-RELEASE:1.12
	netbsd-5-2-RC1:1.12
	matt-nb6-plus-nbase:1.14
	yamt-pagecache-base6:1.14
	netbsd-6-0:1.14.0.12
	netbsd-6-0-RELEASE:1.14
	netbsd-6-0-RC2:1.14
	tls-maxphys:1.14.0.10
	tls-maxphys-base:1.15
	matt-nb6-plus:1.14.0.8
	matt-nb6-plus-base:1.14
	netbsd-6-0-RC1:1.14
	yamt-pagecache-base5:1.14
	yamt-pagecache-base4:1.14
	netbsd-6:1.14.0.6
	netbsd-6-base:1.14
	netbsd-5-1-2-RELEASE:1.12
	netbsd-5-1-1-RELEASE:1.12
	yamt-pagecache-base3:1.14
	yamt-pagecache-base2:1.14
	yamt-pagecache:1.14.0.4
	yamt-pagecache-base:1.14
	cherry-xenmp:1.14.0.2
	cherry-xenmp-base:1.14
	bouyer-quota2-nbase:1.13
	bouyer-quota2:1.13.0.2
	bouyer-quota2-base:1.13
	matt-mips64-premerge-20101231:1.13
	matt-nb5-mips64-premerge-20101231:1.12
	matt-nb5-pq3:1.12.0.50
	matt-nb5-pq3-base:1.12
	netbsd-5-1:1.12.0.48
	netbsd-5-1-RELEASE:1.12
	netbsd-5-1-RC4:1.12
	matt-nb5-mips64-k15:1.12
	netbsd-5-1-RC3:1.12
	netbsd-5-1-RC2:1.12
	netbsd-5-1-RC1:1.12
	netbsd-5-0-2-RELEASE:1.12
	matt-nb5-mips64-premerge-20091211:1.12
	matt-premerge-20091211:1.13
	OPENBSD20091026:1.1.1.3
	OPENBSD:1.1.1
	matt-nb5-mips64-u2-k2-k4-k7-k8-k9:1.12
	matt-nb4-mips64-k7-u2a-k9b:1.12
	matt-nb5-mips64-u1-k1-k5:1.12
	matt-nb5-mips64:1.12.0.46
	netbsd-5-0-1-RELEASE:1.12
	jym-xensuspend-nbase:1.12
	netbsd-5-0:1.12.0.44
	netbsd-5-0-RELEASE:1.12
	netbsd-5-0-RC4:1.12
	netbsd-5-0-RC3:1.12
	netbsd-5-0-RC2:1.12
	jym-xensuspend:1.12.0.42
	jym-xensuspend-base:1.12
	netbsd-5-0-RC1:1.12
	netbsd-5:1.12.0.40
	netbsd-5-base:1.12
	matt-mips64-base2:1.12
	matt-mips64:1.12.0.38
	mjf-devfs2:1.12.0.36
	mjf-devfs2-base:1.12
	netbsd-4-0-1-RELEASE:1.12
	wrstuden-revivesa-base-3:1.12
	wrstuden-revivesa-base-2:1.12
	wrstuden-fixsa-newbase:1.12
	wrstuden-revivesa-base-1:1.12
	yamt-pf42-base4:1.12
	yamt-pf42-base3:1.12
	hpcarm-cleanup-nbase:1.12
	yamt-pf42-baseX:1.12
	yamt-pf42-base2:1.12
	wrstuden-revivesa:1.12.0.34
	wrstuden-revivesa-base:1.12
	yamt-pf42:1.12.0.32
	yamt-pf42-base:1.12
	keiichi-mipv6-nbase:1.12
	keiichi-mipv6:1.12.0.30
	keiichi-mipv6-base:1.12
	matt-armv6-nbase:1.12
	matt-armv6-prevmlocking:1.12
	wrstuden-fixsa-base-1:1.12
	netbsd-4-0:1.12.0.28
	netbsd-4-0-RELEASE:1.12
	cube-autoconf:1.12.0.26
	cube-autoconf-base:1.12
	netbsd-4-0-RC5:1.12
	netbsd-4-0-RC4:1.12
	netbsd-4-0-RC3:1.12
	netbsd-4-0-RC2:1.12
	netbsd-4-0-RC1:1.12
	matt-armv6:1.12.0.24
	matt-armv6-base:1.12
	matt-mips64-base:1.12
	hpcarm-cleanup:1.12.0.22
	hpcarm-cleanup-base:1.12
	netbsd-3-1-1-RELEASE:1.12
	netbsd-3-0-3-RELEASE:1.12
	wrstuden-fixsa:1.12.0.20
	wrstuden-fixsa-base:1.12
	abandoned-netbsd-4-base:1.12
	abandoned-netbsd-4:1.12.0.14
	netbsd-3-1:1.12.0.16
	netbsd-3-1-RELEASE:1.12
	netbsd-3-0-2-RELEASE:1.12
	netbsd-3-1-RC4:1.12
	netbsd-3-1-RC3:1.12
	netbsd-3-1-RC2:1.12
	netbsd-3-1-RC1:1.12
	netbsd-4:1.12.0.18
	netbsd-4-base:1.12
	chap-midi-nbase:1.12
	netbsd-3-0-1-RELEASE:1.12
	chap-midi:1.12.0.12
	chap-midi-base:1.12
	netbsd-3-0:1.12.0.10
	netbsd-3-0-RELEASE:1.12
	netbsd-3-0-RC6:1.12
	netbsd-3-0-RC5:1.12
	netbsd-3-0-RC4:1.12
	netbsd-3-0-RC3:1.12
	netbsd-3-0-RC2:1.12
	netbsd-3-0-RC1:1.12
	netbsd-2-0-3-RELEASE:1.12
	netbsd-2-1:1.12.0.8
	netbsd-2-1-RELEASE:1.12
	netbsd-2-1-RC6:1.12
	netbsd-2-1-RC5:1.12
	netbsd-2-1-RC4:1.12
	netbsd-2-1-RC3:1.12
	netbsd-2-1-RC2:1.12
	netbsd-2-1-RC1:1.12
	netbsd-2-0-2-RELEASE:1.12
	netbsd-3:1.12.0.6
	netbsd-3-base:1.12
	netbsd-2-0-1-RELEASE:1.12
	netbsd-2:1.12.0.4
	netbsd-2-base:1.12
	netbsd-2-0-RELEASE:1.12
	netbsd-2-0-RC5:1.12
	netbsd-2-0-RC4:1.12
	netbsd-2-0-RC3:1.12
	netbsd-2-0-RC2:1.12
	netbsd-2-0-RC1:1.12
	netbsd-2-0:1.12.0.2
	netbsd-2-0-base:1.12
	netbsd-1-6-PATCH002-RELEASE:1.11
	netbsd-1-6-PATCH002:1.11
	netbsd-1-6-PATCH002-RC4:1.11
	netbsd-1-6-PATCH002-RC3:1.11
	netbsd-1-6-PATCH002-RC2:1.11
	netbsd-1-6-PATCH002-RC1:1.11
	netbsd-1-6-PATCH001:1.11
	netbsd-1-6-PATCH001-RELEASE:1.11
	netbsd-1-6-PATCH001-RC3:1.11
	netbsd-1-6-PATCH001-RC2:1.11
	netbsd-1-6-PATCH001-RC1:1.11
	fvdl_fs64_base:1.11
	netbsd-1-6-RELEASE:1.11
	netbsd-1-6-RC3:1.11
	netbsd-1-6-RC2:1.11
	netbsd-1-6-RC1:1.11
	netbsd-1-6:1.11.0.2
	netbsd-1-6-base:1.11
	netbsd-1-5-PATCH003:1.8
	netbsd-1-5-PATCH002:1.8
	netbsd-1-5-PATCH001:1.8
	netbsd-1-5-RELEASE:1.8
	netbsd-1-5-BETA2:1.8
	netbsd-1-5-BETA:1.8
	netbsd-1-4-PATCH003:1.8
	netbsd-1-5-ALPHA2:1.8
	netbsd-1-5:1.8.0.10
	netbsd-1-5-base:1.8
	minoura-xpg4dl-base:1.8
	minoura-xpg4dl:1.8.0.8
	netbsd-1-4-PATCH002:1.8
	wrstuden-devbsize-19991221:1.8
	wrstuden-devbsize:1.8.0.6
	wrstuden-devbsize-base:1.8
	comdex-fall-1999:1.8.0.4
	comdex-fall-1999-base:1.8
	netbsd-1-4-PATCH001:1.8
	netbsd-1-4-RELEASE:1.8
	netbsd-1-4:1.8.0.2
	netbsd-1-4-base:1.8
	netbsd-1-3-PATCH003:1.7.2.1
	netbsd-1-3-PATCH003-CANDIDATE2:1.7.2.1
	netbsd-1-3-PATCH003-CANDIDATE1:1.7.2.1
	netbsd-1-3-PATCH003-CANDIDATE0:1.7.2.1
	netbsd-1-3-PATCH002:1.7.2.1
	netbsd-1-3-PATCH001:1.7.2.1
	netbsd-1-3-RELEASE:1.7
	netbsd-1-3-BETA:1.7
	netbsd-1-3:1.7.0.2
	netbsd-1-3-base:1.7
	netbsd-1-2-PATCH001:1.7
	netbsd-1-2-RELEASE:1.7
	netbsd-1-2-BETA:1.7
	netbsd-1-2:1.7.0.4
	netbsd-1-2-base:1.7
	netbsd-1-1-PATCH001:1.6
	netbsd-1-1-RELEASE:1.6
	netbsd-1-1:1.6.0.2
	netbsd-1-1-base:1.6
	lite-2:1.1.1.2
	CSRG:1.1.1
	netbsd-1-0-PATCH06:1.5
	netbsd-1-0-PATCH05:1.5
	netbsd-1-0-PATCH04:1.5
	netbsd-1-0-PATCH03:1.5
	netbsd-1-0-PATCH02:1.5
	netbsd-1-0-PATCH1:1.5
	netbsd-1-0-PATCH0:1.5
	netbsd-1-0-RELEASE:1.5
	netbsd-1-0:1.5.0.2
	netbsd-1-0-base:1.5
	netbsd-0-9-RELEASE:1.2
	netbsd-0-9-BETA:1.2
	netbsd-0-9-ALPHA2:1.2
	netbsd-0-9-ALPHA:1.2
	netbsd-0-9:1.2.0.2
	netbsd-0-9-base:1.2
	netbsd-0-8:1.1.1.1
	netbsd-alpha-1:1.1.1.1
	patchkit-0-2-2:1.1.1.1
	WFJ-386bsd-01:1.1.1.1
	WFJ-920714:1.1.1;
locks; strict;
comment	@ * @;


1.17
date	2016.01.16.18.31.29;	author christos;	state Exp;
branches;
next	1.16;
commitid	Whid9jqQkg4FCbRy;

1.16
date	2016.01.16.17.01.01;	author christos;	state Exp;
branches;
next	1.15;
commitid	By8YOll3sJHB7bRy;

1.15
date	2013.10.18.20.19.36;	author christos;	state Exp;
branches;
next	1.14;
commitid	uQ0Gc0TJiS1WzO9x;

1.14
date	2011.03.05.16.37.50;	author christos;	state Exp;
branches
	1.14.4.1
	1.14.10.1;
next	1.13;

1.13
date	2009.10.26.21.11.28;	author christos;	state Exp;
branches;
next	1.12;

1.12
date	2003.08.07.11.14.33;	author agc;	state Exp;
branches;
next	1.11;

1.11
date	2001.11.14.06.16.09;	author tv;	state Exp;
branches;
next	1.10;

1.10
date	2001.03.05.20.26.18;	author wiz;	state Exp;
branches;
next	1.9;

1.9
date	2000.10.18.17.23.18;	author jdolecek;	state Exp;
branches;
next	1.8;

1.8
date	97.12.02.22.34.04;	author cgd;	state Exp;
branches;
next	1.7;

1.7
date	96.01.13.23.25.27;	author pk;	state Exp;
branches
	1.7.2.1;
next	1.6;

1.6
date	95.09.28.05.37.39;	author tls;	state Exp;
branches;
next	1.5;

1.5
date	94.06.19.03.58.39;	author glass;	state Exp;
branches;
next	1.4;

1.4
date	93.10.30.00.28.49;	author glass;	state Exp;
branches;
next	1.3;

1.3
date	93.08.02.17.54.44;	author mycroft;	state Exp;
branches;
next	1.2;

1.2
date	93.06.18.21.50.34;	author glass;	state Exp;
branches;
next	1.1;

1.1
date	93.03.21.09.45.37;	author cgd;	state Exp;
branches
	1.1.1.1;
next	;

1.14.4.1
date	2014.05.22.11.42.45;	author yamt;	state Exp;
branches;
next	;
commitid	cG7DCbrDdiE9MwBx;

1.14.10.1
date	2014.08.20.00.05.00;	author tls;	state Exp;
branches;
next	;
commitid	jTnpym9Qu0o4R1Nx;

1.7.2.1
date	98.01.29.10.52.54;	author mellon;	state Exp;
branches;
next	;

1.1.1.1
date	93.03.21.09.45.37;	author cgd;	state Exp;
branches;
next	1.1.1.2;

1.1.1.2
date	95.09.28.04.33.42;	author tls;	state Exp;
branches;
next	1.1.1.3;

1.1.1.3
date	2009.10.26.21.08.59;	author christos;	state Exp;
branches;
next	;


desc
@@


1.17
log
@add most gnu m4 long options
@
text
@/*	$OpenBSD: mdef.h,v 1.29 2006/03/20 20:27:45 espie Exp $	*/
/*	$NetBSD: mdef.h,v 1.16 2016/01/16 17:01:01 christos Exp $	*/

/*
 * Copyright (c) 1989, 1993
 *	The Regents of the University of California.  All rights reserved.
 *
 * This code is derived from software contributed to Berkeley by
 * Ozan Yigit at York University.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 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.
 * 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.
 *
 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * 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.
 *
 *	@@(#)mdef.h	8.1 (Berkeley) 6/6/93
 */

#ifdef __GNUC__
# define UNUSED	__attribute__((__unused__))
#else
# define UNUSED
#endif

#define MACRTYPE        1
#define DEFITYPE        2
#define EXPRTYPE        3
#define SUBSTYPE        4
#define IFELTYPE        5
#define LENGTYPE        6
#define CHNQTYPE        7
#define SYSCTYPE        8
#define UNDFTYPE        9
#define INCLTYPE        10
#define SINCTYPE        11
#define PASTTYPE        12
#define SPASTYPE        13
#define INCRTYPE        14
#define IFDFTYPE        15
#define PUSDTYPE        16
#define POPDTYPE        17
#define SHIFTYPE        18
#define DECRTYPE        19
#define DIVRTYPE        20
#define UNDVTYPE        21
#define DIVNTYPE        22
#define MKTMTYPE        23
#define ERRPTYPE        24
#define M4WRTYPE        25
#define TRNLTYPE        26
#define DNLNTYPE        27
#define DUMPTYPE        28
#define CHNCTYPE        29
#define INDXTYPE        30
#define SYSVTYPE        31
#define EXITTYPE        32
#define DEFNTYPE        33
#define SELFTYPE	34
#define INDIRTYPE	35
#define BUILTINTYPE	36
#define PATSTYPE	37
#define FILENAMETYPE	38
#define LINETYPE	39
#define REGEXPTYPE	40
#define ESYSCMDTYPE	41
#define TRACEONTYPE	42
#define TRACEOFFTYPE	43
#define FORMATTYPE	44

#define BUILTIN_MARKER	"__builtin_"
 
#define TYPEMASK	0xff	/* Keep bits really corresponding to a type. */
#define RECDEF		0x100	/* Pure recursive def, don't expand it */
#define NOARGS		0x200	/* builtin needs no args */
#define NEEDARGS	0x400	/* mark builtin that need args with this */

/*
 * m4 special characters
 */
 
#define ARGFLAG         '$'
#define LPAREN          '('
#define RPAREN          ')'
#define LQUOTE          '`'
#define RQUOTE          '\''
#define COMMA           ','
#define SCOMMT          '#'
#define ECOMMT          '\n'

#ifdef msdos
#define system(str)	(-1)
#endif

/*
 * other important constants
 */

#define EOS             '\0'
#define MAXINP          10              /* maximum include files   	    */
#define MAXOUT          10              /* maximum # of diversions 	    */
#define BUFSIZE         4096            /* starting size of pushback buffer */
#define INITSTACKMAX    4096           	/* starting size of call stack      */
#define STRSPMAX        4096            /* starting size of string space    */
#define MAXTOK          512          	/* maximum chars in a tokn 	    */
#define HASHSIZE        199             /* maximum size of hashtab 	    */
#define MAXCCHARS	5		/* max size of comment/quote delim  */
 
#define ALL             1
#define TOP             0
 
#ifndef TRUE
#define TRUE	1
#endif
#ifndef FALSE
#define FALSE	0
#endif
#define cycle           for(;;)

/*
 * m4 data structures
 */
 
typedef struct ndblock *ndptr;
 
struct macro_definition {
	struct macro_definition *next;
	char		*defn;	/* definition..               */
	unsigned int	type;	/* type of the entry..        */
};


struct ndblock {			/* hashtable structure         */
	unsigned int 		builtin_type;
	unsigned int		trace_flags;
	struct macro_definition *d;
	char		name[1];	/* entry name..               */
};
 
typedef union {			/* stack structure */
	int	sfra;		/* frame entry  */
	char 	*sstr;		/* string entry */
} stae;

struct input_file {
	FILE 		*file;
	char 		*name;
	unsigned long 	lineno;
	unsigned long   synch_lineno;	/* used for -s */
	int 		c;
};

#define CURRENT_NAME	(infile[ilevel].name)
#define CURRENT_LINE	(infile[ilevel].lineno)
#define	TOKEN_LINE(f)	(f->lineno - (f->c == '\n' ? 1 : 0))

/*
 * macros for readibility and/or speed
 *
 *      gpbc()  - get a possibly pushed-back character
 *      pushf() - push a call frame entry onto stack
 *      pushs() - push a string pointer onto stack
 */
#define gpbc() 	 (bp > bufbase) ? *--bp : obtain_char(infile+ilevel)
#define pushf(x) 			\
	do {				\
		if ((size_t)++sp == STACKMAX) 	\
			enlarge_stack();\
		mstack[sp].sfra = (x);	\
		sstack[sp] = 0; \
	} while (0)

#define pushs(x) 			\
	do {				\
		if ((size_t)++sp == STACKMAX) 	\
			enlarge_stack();\
		mstack[sp].sstr = (x);	\
		sstack[sp] = 1; \
	} while (0)

#define pushs1(x) 			\
	do {				\
		if ((size_t)++sp == STACKMAX) 	\
			enlarge_stack();\
		mstack[sp].sstr = (x);	\
		sstack[sp] = 0; \
	} while (0)

/*
 *	    .				   .
 *	|   .	|  <-- sp		|  .  |
 *	+-------+			+-----+
 *	| arg 3 ----------------------->| str |
 *	+-------+			|  .  |
 *	| arg 2 ---PREVEP-----+ 	   .
 *	+-------+	      |
 *	    .		      |		|     |
 *	+-------+	      | 	+-----+
 *	| plev	|  PARLEV     +-------->| str |
 *	+-------+			|  .  |
 *	| type	|  CALTYP		   .
 *	+-------+
 *	| prcf	---PREVFP--+
 *	+-------+  	   |
 *	|   .	|  PREVSP  |
 *	    .	   	   |
 *	+-------+	   |
 *	|	<----------+
 *	+-------+
 *
 */
#define PARLEV  (mstack[fp].sfra)
#define CALTYP  (mstack[fp-2].sfra)
#define TRACESTATUS (mstack[fp-1].sfra)
#define PREVEP	(mstack[fp+3].sstr)
#define PREVSP	(fp-4)
#define PREVFP	(mstack[fp-3].sfra)

#define VERSION	20150116
@


1.16
log
@Use hex for masks.
@
text
@d2 1
a2 1
/*	$NetBSD: mdef.h,v 1.15 2013/10/18 20:19:36 christos Exp $	*/
d236 2
@


1.15
log
@avoid redefinitions
@
text
@d2 1
a2 1
/*	$NetBSD: mdef.h,v 1.14 2011/03/05 16:37:50 christos Exp $	*/
d91 4
a94 4
#define TYPEMASK	63	/* Keep bits really corresponding to a type. */
#define RECDEF		256	/* Pure recursive def, don't expand it */
#define NOARGS		512	/* builtin needs no args */
#define NEEDARGS	1024	/* mark builtin that need args with this */
@


1.14
log
@use TOKEN_LINE from MirBSD
@
text
@d2 1
a2 1
/*	$NetBSD: mdef.h,v 1.13 2009/10/26 21:11:28 christos Exp $	*/
d130 6
a135 2
#define TRUE            1
#define FALSE           0
@


1.14.10.1
log
@Rebase to HEAD as of a few days ago.
@
text
@d2 1
a2 1
/*	$NetBSD$	*/
d130 2
a131 6
#ifndef TRUE
#define TRUE	1
#endif
#ifndef FALSE
#define FALSE	0
#endif
@


1.14.4.1
log
@sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs.  ("Protocol error: too many arguments")
@
text
@d2 1
a2 1
/*	$NetBSD: mdef.h,v 1.14 2011/03/05 16:37:50 christos Exp $	*/
d130 2
a131 6
#ifndef TRUE
#define TRUE	1
#endif
#ifndef FALSE
#define FALSE	0
#endif
@


1.13
log
@resolve conflicts.
@
text
@d2 1
a2 1
/*	$NetBSD: mdef.h,v 1.7 1996/01/13 23:25:27 pk Exp $	*/
d169 2
@


1.12
log
@Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22365, verified by myself.
@
text
@d1 2
a2 2
/*	$NetBSD: mdef.h,v 1.11 2001/11/14 06:16:09 tv Exp $	*/
/*	$OpenBSD: mdef.h,v 1.21 2001/09/27 11:40:33 espie Exp $	*/
d38 6
d87 1
d89 1
d140 2
a141 2
struct ndblock {		/* hastable structure         */
	char		*name;	/* entry name..               */
a143 2
	unsigned int 	hv;	/* hash function value..      */
	ndptr		nxtptr;	/* link to next entry..       */
d145 8
a153 7
#define nil     ((ndptr) 0)
 
struct keyblk {
	const char	*knam;	/* keyword name */
	int		ktyp;	/* keyword type */
};

d163 1
d179 1
a179 1
		if (++sp == STACKMAX) 	\
d187 1
a187 1
		if (++sp == STACKMAX) 	\
d195 1
a195 1
		if (++sp == STACKMAX) 	\
d225 2
a226 1
#define CALTYP  (mstack[fp-1].sfra)
d228 2
a229 2
#define PREVSP	(fp-3)
#define PREVFP	(mstack[fp-2].sfra)
@


1.11
log
@Pull in various changes from OpenBSD, most from Marc Espie, including:
* Provide some GNUisms as extensions.
* Provide dynamically growable string space.
* Make define(defn(foo)) work correctly for builtins.
(The current version is supposed to be capable of satisfying autoconf.)

All still relevant NetBSD changes have been preserved in this version, and
formatting and style fixes have been applied in various places.

Thanks to Masao Uebayashi <uebayasi@@soum.co.jp> for pointing this out.
@
text
@d1 1
a1 1
/*	$NetBSD: mdef.h,v 1.10 2001/03/05 20:26:18 wiz Exp $	*/
d19 1
a19 5
 * 3. All advertising materials mentioning features or use of this software
 *    must display the following acknowledgement:
 *	This product includes software developed by the University of
 *	California, Berkeley and its contributors.
 * 4. Neither the name of the University nor the names of its contributors
@


1.10
log
@Sprinkle some const, and rename a shadow-variable.
@
text
@d1 2
a2 1
/*	$NetBSD: mdef.h,v 1.9 2000/10/18 17:23:18 jdolecek Exp $	*/
d75 10
d86 5
a90 1
#define STATIC          128
d95 1
a95 1

d113 9
a121 10
#define EOS             (char) 0
#define MAXINP          10              /* maximum include files   */
#define MAXOUT          10              /* maximum # of diversions */
#define MAXSTR          512             /* maximum size of string  */
#define BUFSIZE         4096            /* size of pushback buffer */
#define STACKMAX        1024            /* size of call stack      */
#define STRSPMAX        4096            /* size of string space    */
#define MAXTOK          MAXSTR          /* maximum chars in a tokn */
#define HASHSIZE        199             /* maximum size of hashtab */
#define MAXCCHARS	5		/* max size of comment/quote delim */
d125 1
a125 1

d133 1
a133 1

d135 7
a141 6

struct ndblock {                /* hastable structure         */
        char    *name;          /* entry name..               */
        char    *defn;          /* definition..               */
        int     type;           /* type of the entry..        */
        ndptr   nxtptr;         /* link to next entry..       */
d143 1
a143 1

d145 1
a145 1

d147 2
a148 2
        const char *knam;       /* keyword name */
        int     ktyp;           /* keyword type */
d156 6
a161 1
typedef short pbent;		/* pushback entry; needs to hold chars + EOF */
d163 2
d172 24
a195 3
#define gpbc()		(bp > bufbase) ? *--bp : getc(infile[ilevel])
#define pushf(x)	if (sp < STACKMAX) mstack[++sp].sfra = (x)
#define pushs(x)	if (sp < STACKMAX) mstack[++sp].sstr = (x)
@


1.9
log
@couple more whitespace fixes, by Nathan Ahlstrom
@
text
@d1 1
a1 1
/*	$NetBSD: mdef.h,v 1.8 1997/12/02 22:34:04 cgd Exp $	*/
d132 1
a132 1
        char    *knam;          /* keyword name */
@


1.8
log
@add a typedef which describes elements in the push-back buffer.  Make
that typedef 'short'.  'char' (which was previously used) because char
may be unsigned and ((char)EOF) != EOF if that is the case.  That was
causing the (char)EOF (0xff) pushed back in main to be interepreted as
a character, and, in some cases, to be written to the output.  'short'
was used rather than 'signed char' because if the latter is used,
0xff characters in the input would confuse m4.  (No point in introducing
(more?) 8-bit lossage.)
@
text
@d1 1
a1 1
/*	$NetBSD: mdef.h,v 1.7 1996/01/13 23:25:27 pk Exp $	*/
d74 1
a74 1
 
d80 1
a80 1
 
d111 1
a111 1
 
d119 1
a119 1
 
d121 1
a121 1
 
d128 1
a128 1
 
d130 1
a130 1
 
d150 3
a152 3
#define gpbc() 	 (bp > bufbase) ? *--bp : getc(infile[ilevel])
#define pushf(x) if (sp < STACKMAX) mstack[++sp].sfra = (x)
#define pushs(x) if (sp < STACKMAX) mstack[++sp].sstr = (x)
@


1.7
log
@Handle multichar comment and quote delimiters (up to 5 characters, per the
manual page). Takes care of PR#485.
@
text
@d1 1
a1 1
/*	$NetBSD: mdef.h,v 1.6 1995/09/28 05:37:39 tls Exp $	*/
d140 2
@


1.7.2.1
log
@Pull up 1.8 (cgd)
@
text
@d1 1
a1 1
/*	$NetBSD: mdef.h,v 1.8 1997/12/02 22:34:04 cgd Exp $	*/
a139 2

typedef short pbent;		/* pushback entry; needs to hold chars + EOF */
@


1.6
log
@Sync with 4.4BSD-Lite2
@
text
@d1 1
a1 1
/*	$NetBSD: $	*/
d107 1
@


1.5
log
@upgrade to 4.4-lite m4.  no local changes of note
@
text
@d1 2
@


1.4
log
@latest m4 from ozan.  now does the right thing w/respect to sendmail
@
text
@d1 37
a37 9
/*  Header : mdef.h
    Author : Ozan Yigit
    Updated: 4 May 1992
*/
#ifndef	MACRTYPE

#ifndef unix
#define unix 0
#endif 
a38 20
#ifndef vms
#define vms 0
#endif

#include <stdio.h>
#include <signal.h>

#ifdef	__STDC__
#include <string.h>
#else
#ifdef	VOID
#define void	int
#endif
extern	int	strlen();
extern	int	strcmp();
extern	void	memcpy();
#endif

/*  m4 constants */
 
d72 1
a72 6
#define LINETYPE	34
#define TRIMTYPE	35
#define TLITTYPE	36
#define	DEFQTYPE	37		/* defquote */
#define QUTRTYPE	38		/* quoter thus defined */

d75 3
a77 1
/* m4 special characters */
a83 1
#define	VQUOTE		('V'&(' '- 1))
d88 4
d99 1
a99 2
#ifdef	SMALL
#define MAXSTR           512            /* maximum size of string  */
a102 8
#define HASHSIZE         199            /* maximum size of hashtab */
#else
#define MAXSTR          1024            /* maximum size of string  */
#define BUFSIZE         8192            /* size of pushback buffer */
#define STACKMAX        2048            /* size of call stack      */
#define STRSPMAX        8192            /* size of string space    */
#define HASHSIZE         509            /* maximum size of hashtab */
#endif
d104 1
d111 1
d113 3
a115 1
/* m4 data structures */
d119 1
a119 2
struct ndblock                  /* hashtable structure        */
    {
d124 1
a124 1
    };
d128 7
a134 2
typedef union			/* stack structure */
    {	int	sfra;		/* frame entry  */
d136 1
a136 1
    } stae;
a141 1
 *      min()   - select the minimum of two elements
d145 1
a145 2
#define gpbc() 	 bp == bb ? getc(infile[ilevel]) : *--bp
#define min(x,y) ((x > y) ? y : x)
a176 2

#endif
@


1.3
log
@Add RCS identifiers, remove some completely useless RCS logs and patchkit
headers, and a few other insignificant changes.
@
text
@a3 2

	$Id: $
@


1.2
log
@baseline of new version of m4 supplied by Ozan Yigit, original author
of the broken m4 we had.  This is his stuff virgin + our Makefile.
@
text
@d4 2
@


1.1
log
@Initial revision
@
text
@d1 27
a27 37
/*
 * Copyright (c) 1989 The Regents of the University of California.
 * All rights reserved.
 *
 * This code is derived from software contributed to Berkeley by
 * Ozan Yigit.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 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.
 * 3. All advertising materials mentioning features or use of this software
 *    must display the following acknowledgement:
 *	This product includes software developed by the University of
 *	California, Berkeley and its contributors.
 * 4. 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.
 *
 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * 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.
 *
 *	@@(#)mdef.h	5.6 (Berkeley) 2/26/91
 */
d29 1
a29 11
/*
 * mdef.h
 * Facility: m4 macro processor
 * by: oz
 */

/*
 *
 * m4 constants..
 *
 */
d64 6
a69 1
 
d72 1
a72 3
/*
 * m4 special characters
 */
d79 1
d91 2
a92 1
#define MAXSTR          512             /* maximum size of string  */
d96 8
a104 1
#define HASHSIZE        199             /* maximum size of hashtab */
a110 1
#define cycle           for(;;)
d112 1
a112 3
/*
 * m4 data structures
 */
d116 2
a117 1
struct ndblock {                /* hastable structure         */
d122 1
a122 1
};
d126 2
a127 7
struct keyblk {
        char    *knam;          /* keyword name */
        int     ktyp;           /* keyword type */
};

typedef union {			/* stack structure */
	int	sfra;		/* frame entry  */
d129 1
a129 1
} stae;
d139 1
a139 1
#define gpbc() 	 (bp > buf) ? *--bp : getc(infile[ilevel])
d172 2
@


1.1.1.1
log
@initial import of 386bsd-0.1 sources
@
text
@@


1.1.1.2
log
@imported from 44lite2
@
text
@d2 2
a3 2
 * Copyright (c) 1989, 1993
 *	The Regents of the University of California.  All rights reserved.
d6 1
a6 1
 * Ozan Yigit at York University.
d36 1
a36 1
 *	@@(#)mdef.h	8.1 (Berkeley) 6/6/93
d39 12
a99 4
#ifdef msdos
#define system(str)	(-1)
#endif

d150 1
d154 2
a155 1
#define gpbc() 	 (bp > bufbase) ? *--bp : getc(infile[ilevel])
@


1.1.1.3
log
@Import new m4 from OpenBSD.
@
text
@a0 3
/*	$OpenBSD: mdef.h,v 1.29 2006/03/20 20:27:45 espie Exp $	*/
/*	$NetBSD: mdef.h,v 1.7 1996/01/13 23:25:27 pk Exp $	*/

d16 5
a20 1
 * 3. Neither the name of the University nor the names of its contributors
a38 6
#ifdef __GNUC__
# define UNUSED	__attribute__((__unused__))
#else
# define UNUSED
#endif

d72 2
a73 18
#define SELFTYPE	34
#define INDIRTYPE	35
#define BUILTINTYPE	36
#define PATSTYPE	37
#define FILENAMETYPE	38
#define LINETYPE	39
#define REGEXPTYPE	40
#define ESYSCMDTYPE	41
#define TRACEONTYPE	42
#define TRACEOFFTYPE	43
#define FORMATTYPE	44

#define BUILTIN_MARKER	"__builtin_"
 
#define TYPEMASK	63	/* Keep bits really corresponding to a type. */
#define RECDEF		256	/* Pure recursive def, don't expand it */
#define NOARGS		512	/* builtin needs no args */
#define NEEDARGS	1024	/* mark builtin that need args with this */
d96 9
a104 9
#define EOS             '\0'
#define MAXINP          10              /* maximum include files   	    */
#define MAXOUT          10              /* maximum # of diversions 	    */
#define BUFSIZE         4096            /* starting size of pushback buffer */
#define INITSTACKMAX    4096           	/* starting size of call stack      */
#define STRSPMAX        4096            /* starting size of string space    */
#define MAXTOK          512          	/* maximum chars in a tokn 	    */
#define HASHSIZE        199             /* maximum size of hashtab 	    */
#define MAXCCHARS	5		/* max size of comment/quote delim  */
d119 12
a130 4
struct macro_definition {
	struct macro_definition *next;
	char		*defn;	/* definition..               */
	unsigned int	type;	/* type of the entry..        */
a132 8

struct ndblock {			/* hashtable structure         */
	unsigned int 		builtin_type;
	unsigned int		trace_flags;
	struct macro_definition *d;
	char		name[1];	/* entry name..               */
};
 
a137 10
struct input_file {
	FILE 		*file;
	char 		*name;
	unsigned long 	lineno;
	unsigned long   synch_lineno;	/* used for -s */
	int 		c;
};

#define CURRENT_NAME	(infile[ilevel].name)
#define CURRENT_LINE	(infile[ilevel].lineno)
d145 3
a147 24
#define gpbc() 	 (bp > bufbase) ? *--bp : obtain_char(infile+ilevel)
#define pushf(x) 			\
	do {				\
		if (++sp == STACKMAX) 	\
			enlarge_stack();\
		mstack[sp].sfra = (x);	\
		sstack[sp] = 0; \
	} while (0)

#define pushs(x) 			\
	do {				\
		if (++sp == STACKMAX) 	\
			enlarge_stack();\
		mstack[sp].sstr = (x);	\
		sstack[sp] = 1; \
	} while (0)

#define pushs1(x) 			\
	do {				\
		if (++sp == STACKMAX) 	\
			enlarge_stack();\
		mstack[sp].sstr = (x);	\
		sstack[sp] = 0; \
	} while (0)
d173 1
a173 2
#define CALTYP  (mstack[fp-2].sfra)
#define TRACESTATUS (mstack[fp-1].sfra)
d175 2
a176 2
#define PREVSP	(fp-4)
#define PREVFP	(mstack[fp-3].sfra)
@

