head	1.28;
access;
symbols
	netbsd-11-0-RC4:1.28
	netbsd-11-0-RC3:1.28
	netbsd-11-0-RC2:1.28
	netbsd-11-0-RC1:1.28
	perseant-exfatfs-base-20250801:1.28
	netbsd-11:1.28.0.4
	netbsd-11-base:1.28
	netbsd-10-1-RELEASE:1.27
	perseant-exfatfs-base-20240630:1.28
	perseant-exfatfs:1.28.0.2
	perseant-exfatfs-base:1.28
	netbsd-8-3-RELEASE:1.26
	netbsd-9-4-RELEASE:1.26
	netbsd-10-0-RELEASE:1.27
	netbsd-10-0-RC6:1.27
	netbsd-10-0-RC5:1.27
	netbsd-10-0-RC4:1.27
	netbsd-10-0-RC3:1.27
	netbsd-10-0-RC2:1.27
	netbsd-10-0-RC1:1.27
	netbsd-10:1.27.0.6
	netbsd-10-base:1.27
	netbsd-9-3-RELEASE:1.26
	cjep_sun2x-base1:1.27
	cjep_sun2x:1.27.0.4
	cjep_sun2x-base:1.27
	cjep_staticlib_x-base1:1.27
	netbsd-9-2-RELEASE:1.26
	cjep_staticlib_x:1.27.0.2
	cjep_staticlib_x-base:1.27
	netbsd-9-1-RELEASE:1.26
	phil-wifi-20200421:1.26
	phil-wifi-20200411:1.26
	is-mlppp:1.26.0.20
	is-mlppp-base:1.26
	phil-wifi-20200406:1.26
	netbsd-8-2-RELEASE:1.26
	netbsd-9-0-RELEASE:1.26
	netbsd-9-0-RC2:1.26
	netbsd-9-0-RC1:1.26
	phil-wifi-20191119:1.26
	netbsd-9:1.26.0.18
	netbsd-9-base:1.26
	phil-wifi-20190609:1.26
	netbsd-8-1-RELEASE:1.26
	netbsd-8-1-RC1:1.26
	pgoyette-compat-merge-20190127:1.26
	pgoyette-compat-20190127:1.26
	pgoyette-compat-20190118:1.26
	pgoyette-compat-1226:1.26
	pgoyette-compat-1126:1.26
	pgoyette-compat-1020:1.26
	pgoyette-compat-0930:1.26
	pgoyette-compat-0906:1.26
	netbsd-7-2-RELEASE:1.25
	pgoyette-compat-0728:1.26
	netbsd-8-0-RELEASE:1.26
	phil-wifi:1.26.0.16
	phil-wifi-base:1.26
	pgoyette-compat-0625:1.26
	netbsd-8-0-RC2:1.26
	pgoyette-compat-0521:1.26
	pgoyette-compat-0502:1.26
	pgoyette-compat-0422:1.26
	netbsd-8-0-RC1:1.26
	pgoyette-compat-0415:1.26
	pgoyette-compat-0407:1.26
	pgoyette-compat-0330:1.26
	pgoyette-compat-0322:1.26
	pgoyette-compat-0315:1.26
	netbsd-7-1-2-RELEASE:1.25
	pgoyette-compat:1.26.0.14
	pgoyette-compat-base:1.26
	netbsd-7-1-1-RELEASE:1.25
	matt-nb8-mediatek:1.26.0.12
	matt-nb8-mediatek-base:1.26
	perseant-stdc-iso10646:1.26.0.10
	perseant-stdc-iso10646-base:1.26
	netbsd-8:1.26.0.8
	netbsd-8-base:1.26
	prg-localcount2-base3:1.26
	prg-localcount2-base2:1.26
	prg-localcount2-base1:1.26
	prg-localcount2:1.26.0.6
	prg-localcount2-base:1.26
	pgoyette-localcount-20170426:1.26
	bouyer-socketcan-base1:1.26
	pgoyette-localcount-20170320:1.26
	netbsd-7-1:1.25.0.24
	netbsd-7-1-RELEASE:1.25
	netbsd-7-1-RC2:1.25
	netbsd-7-nhusb-base-20170116:1.25
	bouyer-socketcan:1.26.0.4
	bouyer-socketcan-base:1.26
	pgoyette-localcount-20170107:1.26
	netbsd-7-1-RC1:1.25
	pgoyette-localcount-20161104:1.26
	netbsd-7-0-2-RELEASE:1.25
	localcount-20160914:1.26
	netbsd-7-nhusb:1.25.0.22
	netbsd-7-nhusb-base:1.25
	pgoyette-localcount-20160806:1.26
	pgoyette-localcount-20160726:1.26
	pgoyette-localcount:1.26.0.2
	pgoyette-localcount-base:1.26
	netbsd-7-0-1-RELEASE:1.25
	netbsd-7-0:1.25.0.20
	netbsd-7-0-RELEASE:1.25
	netbsd-7-0-RC3:1.25
	netbsd-7-0-RC2:1.25
	netbsd-7-0-RC1:1.25
	netbsd-5-2-3-RELEASE:1.23
	netbsd-5-1-5-RELEASE:1.23
	netbsd-6-0-6-RELEASE:1.25
	netbsd-6-1-5-RELEASE:1.25
	netbsd-7:1.25.0.18
	netbsd-7-base:1.25
	yamt-pagecache-base9:1.25
	yamt-pagecache-tag8:1.23.2.1
	netbsd-6-1-4-RELEASE:1.25
	netbsd-6-0-5-RELEASE:1.25
	tls-earlyentropy:1.25.0.16
	tls-earlyentropy-base:1.25
	riastradh-xf86-video-intel-2-7-1-pre-2-21-15:1.25
	riastradh-drm2-base3:1.25
	netbsd-6-1-3-RELEASE:1.25
	netbsd-6-0-4-RELEASE:1.25
	netbsd-5-2-2-RELEASE:1.23
	netbsd-5-1-4-RELEASE:1.23
	netbsd-6-1-2-RELEASE:1.25
	netbsd-6-0-3-RELEASE:1.25
	netbsd-5-2-1-RELEASE:1.23
	netbsd-5-1-3-RELEASE:1.23
	netbsd-6-1-1-RELEASE:1.25
	riastradh-drm2-base2:1.25
	riastradh-drm2-base1:1.25
	riastradh-drm2:1.25.0.10
	riastradh-drm2-base:1.25
	netbsd-6-1:1.25.0.14
	netbsd-6-0-2-RELEASE:1.25
	netbsd-6-1-RELEASE:1.25
	netbsd-6-1-RC4:1.25
	netbsd-6-1-RC3:1.25
	agc-symver:1.25.0.12
	agc-symver-base:1.25
	netbsd-6-1-RC2:1.25
	netbsd-6-1-RC1:1.25
	yamt-pagecache-base8:1.25
	netbsd-5-2:1.23.0.22
	netbsd-6-0-1-RELEASE:1.25
	yamt-pagecache-base7:1.25
	netbsd-5-2-RELEASE:1.23
	netbsd-5-2-RC1:1.23
	matt-nb6-plus-nbase:1.25
	yamt-pagecache-base6:1.25
	netbsd-6-0:1.25.0.8
	netbsd-6-0-RELEASE:1.25
	netbsd-6-0-RC2:1.25
	tls-maxphys:1.25.0.6
	tls-maxphys-base:1.25
	matt-nb6-plus:1.25.0.4
	matt-nb6-plus-base:1.25
	netbsd-6-0-RC1:1.25
	yamt-pagecache-base5:1.25
	yamt-pagecache-base4:1.25
	netbsd-6:1.25.0.2
	netbsd-6-base:1.25
	netbsd-5-1-2-RELEASE:1.23
	netbsd-5-1-1-RELEASE:1.23
	yamt-pagecache-base3:1.23
	yamt-pagecache-base2:1.23
	yamt-pagecache:1.23.0.2
	yamt-pagecache-base:1.23
	cherry-xenmp:1.23.0.20
	cherry-xenmp-base:1.23
	bouyer-quota2-nbase:1.23
	bouyer-quota2:1.23.0.18
	bouyer-quota2-base:1.23
	matt-mips64-premerge-20101231:1.23
	matt-nb5-mips64-premerge-20101231:1.23
	matt-nb5-pq3:1.23.0.16
	matt-nb5-pq3-base:1.23
	netbsd-5-1:1.23.0.14
	netbsd-5-1-RELEASE:1.23
	netbsd-5-1-RC4:1.23
	matt-nb5-mips64-k15:1.23
	netbsd-5-1-RC3:1.23
	netbsd-5-1-RC2:1.23
	netbsd-5-1-RC1:1.23
	netbsd-5-0-2-RELEASE:1.23
	matt-nb5-mips64-premerge-20091211:1.23
	matt-premerge-20091211:1.23
	matt-nb5-mips64-u2-k2-k4-k7-k8-k9:1.23
	matt-nb4-mips64-k7-u2a-k9b:1.23
	matt-nb5-mips64-u1-k1-k5:1.23
	matt-nb5-mips64:1.23.0.12
	netbsd-5-0-1-RELEASE:1.23
	jym-xensuspend-nbase:1.23
	netbsd-5-0:1.23.0.10
	netbsd-5-0-RELEASE:1.23
	netbsd-5-0-RC4:1.23
	netbsd-5-0-RC3:1.23
	netbsd-5-0-RC2:1.23
	jym-xensuspend:1.23.0.8
	jym-xensuspend-base:1.23
	netbsd-5-0-RC1:1.23
	christos-time_t-nbase:1.23
	christos-time_t:1.23.0.6
	christos-time_t-base:1.23
	netbsd-5:1.23.0.4
	netbsd-5-base:1.23
	matt-mips64-base2:1.23
	matt-mips64:1.18.0.6
	netbsd-4-0-1-RELEASE:1.17
	wrstuden-revivesa-base-3:1.23
	wrstuden-revivesa-base-2:1.23
	wrstuden-fixsa-newbase:1.17
	wrstuden-revivesa-base-1:1.21
	yamt-pf42-base4:1.21
	yamt-pf42-base3:1.21
	hpcarm-cleanup-nbase:1.21
	yamt-pf42-baseX:1.21
	yamt-pf42-base2:1.21
	wrstuden-revivesa:1.21.0.6
	wrstuden-revivesa-base:1.21
	yamt-pf42:1.21.0.4
	yamt-pf42-base:1.21
	keiichi-mipv6:1.21.0.2
	keiichi-mipv6-base:1.21
	matt-armv6-nbase:1.21
	matt-armv6-prevmlocking:1.18.4.1
	wrstuden-fixsa-base-1:1.17
	netbsd-4-0:1.17.0.8
	netbsd-4-0-RELEASE:1.17
	cube-autoconf:1.20.0.2
	cube-autoconf-base:1.20
	netbsd-4-0-RC5:1.17
	netbsd-4-0-RC4:1.17
	netbsd-4-0-RC3:1.17
	netbsd-4-0-RC2:1.17
	netbsd-4-0-RC1:1.17
	matt-armv6:1.18.0.4
	matt-armv6-base:1.20
	matt-mips64-base:1.18
	hpcarm-cleanup:1.18.0.2
	hpcarm-cleanup-base:1.21
	netbsd-3-1-1-RELEASE:1.16
	netbsd-3-0-3-RELEASE:1.16
	wrstuden-fixsa:1.17.0.6
	wrstuden-fixsa-base:1.17
	abandoned-netbsd-4-base:1.17
	abandoned-netbsd-4:1.17.0.2
	netbsd-3-1:1.16.0.12
	netbsd-3-1-RELEASE:1.16
	netbsd-3-0-2-RELEASE:1.16
	netbsd-3-1-RC4:1.16
	netbsd-3-1-RC3:1.16
	netbsd-3-1-RC2:1.16
	netbsd-3-1-RC1:1.16
	netbsd-4:1.17.0.4
	netbsd-4-base:1.17
	netbsd-3-0-1-RELEASE:1.16
	netbsd-3-0:1.16.0.10
	netbsd-3-0-RELEASE:1.16
	netbsd-3-0-RC6:1.16
	netbsd-3-0-RC5:1.16
	netbsd-3-0-RC4:1.16
	netbsd-3-0-RC3:1.16
	netbsd-3-0-RC2:1.16
	netbsd-3-0-RC1:1.16
	netbsd-2-0-3-RELEASE:1.16
	netbsd-2-1:1.16.0.8
	netbsd-2-1-RELEASE:1.16
	netbsd-2-1-RC6:1.16
	netbsd-2-1-RC5:1.16
	netbsd-2-1-RC4:1.16
	netbsd-2-1-RC3:1.16
	netbsd-2-1-RC2:1.16
	netbsd-2-1-RC1:1.16
	netbsd-2-0-2-RELEASE:1.16
	netbsd-3:1.16.0.6
	netbsd-3-base:1.16
	netbsd-2-0-1-RELEASE:1.16
	netbsd-2:1.16.0.4
	netbsd-2-base:1.16
	netbsd-2-0-RELEASE:1.16
	netbsd-2-0-RC5:1.16
	netbsd-2-0-RC4:1.16
	netbsd-2-0-RC3:1.16
	netbsd-2-0-RC2:1.16
	netbsd-2-0-RC1:1.16
	netbsd-2-0:1.16.0.2
	netbsd-2-0-base:1.16
	netbsd-1-6-PATCH002-RELEASE:1.8.2.1
	netbsd-1-6-PATCH002:1.8.2.1
	netbsd-1-6-PATCH002-RC4:1.8.2.1
	netbsd-1-6-PATCH002-RC3:1.8.2.1
	netbsd-1-6-PATCH002-RC2:1.8.2.1
	netbsd-1-6-PATCH002-RC1:1.8.2.1
	netbsd-1-6-PATCH001:1.8.2.1
	netbsd-1-6-PATCH001-RELEASE:1.8.2.1
	netbsd-1-6-PATCH001-RC3:1.8.2.1
	netbsd-1-6-PATCH001-RC2:1.8.2.1
	netbsd-1-6-PATCH001-RC1:1.8.2.1
	nathanw_sa_end:1.7.4.5
	nathanw_sa_before_merge:1.12
	fvdl_fs64_base:1.12
	nathanw_sa_base:1.12
	netbsd-1-6-RELEASE:1.8
	netbsd-1-6-RC3:1.8
	netbsd-1-6-RC2:1.8
	netbsd-1-6-RC1:1.8
	netbsd-1-6:1.8.0.2
	netbsd-1-6-base:1.8
	netbsd-1-5-PATCH003:1.7
	netbsd-1-5-PATCH002:1.7
	kqueue:1.7.0.6
	kqueue-base:1.7
	netbsd-1-5-PATCH001:1.7
	nathanw_sa:1.7.0.4
	netbsd-1-5-RELEASE:1.7
	netbsd-1-5-BETA2:1.7
	netbsd-1-5-BETA:1.7
	netbsd-1-4-PATCH003:1.5
	netbsd-1-5-ALPHA2:1.7
	netbsd-1-5:1.7.0.2
	netbsd-1-5-base:1.7
	minoura-xpg4dl:1.5.0.8
	minoura-xpg4dl-base:1.5
	netbsd-1-4-PATCH002:1.5
	wrstuden-devbsize-19991221:1.5
	wrstuden-devbsize:1.5.0.6
	wrstuden-devbsize-base:1.5
	comdex-fall-1999:1.5.0.4
	comdex-fall-1999-base:1.5
	netbsd-1-4-PATCH001:1.5
	netbsd-1-4-RELEASE:1.5
	netbsd-1-4:1.5.0.2
	netbsd-1-4-base:1.5
	netbsd-1-3-PATCH003:1.1.2.1
	netbsd-1-3-PATCH003-CANDIDATE2:1.1.2.1
	netbsd-1-3-PATCH003-CANDIDATE1:1.1.2.1
	netbsd-1-3-PATCH003-CANDIDATE0:1.1.2.1
	netbsd-1-3-PATCH002:1.1.2.1
	netbsd-1-3-PATCH001:1.1.2.1
	netbsd-1-3-RELEASE:1.1.2.1
	netbsd-1-3-BETA:1.1.2.1
	netbsd-1-3:1.1.0.2
	netbsd-1-3-base:1.1;
locks; strict;
comment	@# @;


1.28
date	2024.01.20.14.52.49;	author christos;	state Exp;
branches;
next	1.27;
commitid	dyDTCmv3zWWUlcVE;

1.27
date	2020.05.16.18.31.47;	author christos;	state Exp;
branches;
next	1.26;
commitid	AayHkepHy6nSLu8C;

1.26
date	2016.04.03.00.48.29;	author christos;	state Exp;
branches;
next	1.25;
commitid	j7gcj7enCsDve71z;

1.25
date	2012.02.12.01.46.05;	author martin;	state Exp;
branches;
next	1.24;

1.24
date	2012.02.01.05.34.40;	author dholland;	state Exp;
branches;
next	1.23;

1.23
date	2008.08.05.02.08.13;	author lukem;	state Exp;
branches
	1.23.2.1
	1.23.6.1;
next	1.22;

1.22
date	2008.08.05.01.54.47;	author lukem;	state Exp;
branches;
next	1.21;

1.21
date	2008.01.15.03.37.14;	author rmind;	state Exp;
branches
	1.21.6.1;
next	1.20;

1.20
date	2007.11.13.09.07.33;	author he;	state Exp;
branches;
next	1.19;

1.19
date	2007.10.09.18.18.33;	author rmind;	state Exp;
branches;
next	1.18;

1.18
date	2007.02.09.22.08.48;	author ad;	state Exp;
branches
	1.18.4.1;
next	1.17;

1.17
date	2006.06.18.14.28.12;	author christos;	state Exp;
branches;
next	1.16;

1.16
date	2004.01.29.02.00.02;	author tsarna;	state Exp;
branches;
next	1.15;

1.15
date	2003.09.30.22.30.16;	author christos;	state Exp;
branches;
next	1.14;

1.14
date	2003.07.26.19.24.54;	author salo;	state Exp;
branches;
next	1.13;

1.13
date	2003.01.18.11.33.07;	author thorpej;	state Exp;
branches;
next	1.12;

1.12
date	2002.11.11.00.54.57;	author thorpej;	state Exp;
branches;
next	1.11;

1.11
date	2002.10.23.09.25.49;	author jdolecek;	state Exp;
branches;
next	1.10;

1.10
date	2002.10.12.17.41.20;	author jdolecek;	state Exp;
branches;
next	1.9;

1.9
date	2002.09.14.03.14.15;	author thorpej;	state Exp;
branches;
next	1.8;

1.8
date	2001.11.13.18.39.10;	author tv;	state Exp;
branches
	1.8.2.1;
next	1.7;

1.7
date	2000.06.14.17.25.07;	author cgd;	state Exp;
branches
	1.7.4.1
	1.7.6.1;
next	1.6;

1.6
date	2000.06.14.06.49.10;	author cgd;	state Exp;
branches;
next	1.5;

1.5
date	98.07.03.18.09.25;	author mycroft;	state Exp;
branches
	1.5.8.1;
next	1.4;

1.4
date	98.07.03.17.50.10;	author mycroft;	state Exp;
branches;
next	1.3;

1.3
date	98.03.01.10.20.06;	author fvdl;	state Exp;
branches;
next	1.2;

1.2
date	97.11.05.05.46.18;	author thorpej;	state Exp;
branches;
next	1.1;

1.1
date	96.12.22.11.38.34;	author cgd;	state Exp;
branches
	1.1.2.1;
next	;

1.23.2.1
date	2012.04.17.00.05.26;	author yamt;	state Exp;
branches;
next	;

1.23.6.1
date	2008.08.05.02.08.13;	author lukem;	state dead;
branches;
next	1.23.6.2;

1.23.6.2
date	2008.08.05.02.08.14;	author lukem;	state Exp;
branches;
next	;

1.21.6.1
date	2008.09.18.04.39.23;	author wrstuden;	state Exp;
branches;
next	;

1.18.4.1
date	2007.11.06.23.11.21;	author matt;	state Exp;
branches;
next	1.18.4.2;

1.18.4.2
date	2008.01.09.01.34.22;	author matt;	state Exp;
branches;
next	1.18.4.3;

1.18.4.3
date	2008.03.23.00.40.26;	author matt;	state Exp;
branches;
next	;

1.8.2.1
date	2002.11.11.21.47.58;	author he;	state Exp;
branches;
next	;

1.7.4.1
date	2001.11.14.19.32.05;	author nathanw;	state Exp;
branches;
next	1.7.4.2;

1.7.4.2
date	2002.05.04.16.39.21;	author thorpej;	state Exp;
branches;
next	1.7.4.3;

1.7.4.3
date	2002.09.17.21.32.54;	author nathanw;	state Exp;
branches;
next	1.7.4.4;

1.7.4.4
date	2002.10.18.02.17.01;	author nathanw;	state Exp;
branches;
next	1.7.4.5;

1.7.4.5
date	2002.11.11.22.23.01;	author nathanw;	state Exp;
branches;
next	;

1.7.6.1
date	2001.07.10.12.19.37;	author lukem;	state Exp;
branches;
next	;

1.5.8.1
date	2000.06.23.16.18.09;	author minoura;	state Exp;
branches;
next	;

1.1.2.1
date	97.11.05.05.52.08;	author thorpej;	state Exp;
branches;
next	;


desc
@@


1.28
log
@Catch up with all the lint warnings since exit on warning was disabled.
Disable 'missing header declaration' and 'nested extern' warnings for now.
@
text
@#!/bin/sh -
# $NetBSD: makelintstub,v 1.27 2020/05/16 18:31:47 christos Exp $
#
# Copyright (c) 1996, 1997 Christopher G. Demetriou
# All rights reserved.
# 
# 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 for the
#          NetBSD Project.  See http://www.NetBSD.org/ for
#          information about NetBSD.
# 4. The name of the author may not be used to endorse or promote products
#    derived from this software without specific prior written permission.
# 
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
# 
# <<Id: LICENSE,v 1.2 2000/06/14 15:57:33 cgd Exp>>

usage()
{

cat << _EOF 1>&2
Usage: $PROG [-n|-p] [-o filename] [-s syscall.h] object ...
	-n		Create SYSCALL_NOERROR.
	-p		Create PSEUDO_NOERROR.
			(also removes leading "_" on syscall name).
	-o filename	Output to filename.
	-s syscall.h	Header to #include instead of <sys/syscall.h>.

	The CPP environment variable must be set
	to the path to the C preprocessor.
_EOF
	exit 1
}

header()
{

	cat <<- __EOF__
	/*
	 * THIS IS AN AUTOMATICALLY GENERATED FILE.  DO NOT EDIT.
	 * It is generated by $PROG
	 */

	#include <sys/param.h>
	#include <sys/acl.h>
	#include <sys/aio.h>
	#include <sys/time.h>
	#include <sys/mount.h>
	#include <sys/stat.h>
	#include <ufs/ufs/dinode.h>
	#include <ufs/lfs/lfs.h>
	#include <sys/resource.h>
	#include <sys/poll.h>
	#include <sys/uio.h>
	#include <sys/ipc.h>
	#include <sys/idtype.h>
	#include <sys/lwpctl.h>
	#include <sys/mqueue.h>
	#include <sys/msg.h>
	#include <sys/sem.h>
	#include <sys/shm.h>
	#include <sys/spawn.h>
	#include <sys/sched.h>
	#include <sys/timex.h>
	#include <sys/socket.h>
	#include <sys/event.h>
	#include <sys/uuid.h>
	#include <sys/quotactl.h>
	#include <stdarg.h>
	#include <unistd.h>
	#include <stdlib.h>
	#include <spawn.h>
	#include <fcntl.h>

	#include "extern.h"

	__EOF__
}

syscall_stub()
{

	syscalldump="$1"
	syscallname="$2"
	funcname="$3"

    	arglist="$(
    	sed -e 'ta
		:a
		s,^/\* syscall: \"'"$syscallname"'\" ,,
	        tb
		d
		:b
		s, \*/$,,' $syscalldump
	)"

	eval set -f -- "$arglist"

	if [ $# -lt 3 ]; then
		echo syscall $syscallname not found! 1>&2
		exit 1
	fi

	shift			# kill "ret:"
	returntype=$1; shift
	shift			# kill "args:"

	cat <<- __EOF__
	/*ARGSUSED*/
	$returntype
	__EOF__

	# do ANSI C function header
	echo	"#ifdef __STDC__"

	echo "$funcname("
	first=true; i=1
	for arg; do
		if $first; then
			first=false
		else
			echo ", "
		fi
		case "$arg" in
		"...") echo "...";;
		*) echo "$arg arg$i"; i=$(($i + 1));;
		esac
	done
	if $first; then
		echo "void"
	fi
	echo	")"

	# do K&R C function header
	echo	"#else"

	echo "$funcname("
	first=true; i=1
	for arg; do
		if $first; then
			first=false
		else
			echo ", "
		fi
		case "$arg" in
		"...") echo "va_alist";;
		*) echo "arg$i"; i=$(($i + 1));;
		esac
	done
	echo	")"
	i=1
	for arg; do
		case "$arg" in
		"...") echo "	va_dcl";;
		*) echo "	$arg arg$i;"; i=$(($i + 1));;
		esac
	done

	# do function body
	echo	"#endif"

	echo	"{"
	if [ "$returntype" != "void" ]; then
		echo "        return (($returntype)0);"
	fi
	echo	"}"
}

trailer()
{

	cat <<- __EOF__
	/* END */
	__EOF__
}


pflag=false
nflag=false
oarg=""
syscallhdr=/usr/include/sys/syscall.h
syscalldump=/tmp/makelintstub.$$
PROG="$(basename "$0")"

if [ -z "${CPP}" ]; then
	usage
fi

while getopts no:ps: i
do
	case "$i" in
	n)	nflag=true;;
	o)	oarg=$OPTARG;;
	p)	pflag=true;;
	s)	syscallhdr=$OPTARG;;
	*)	usage;;
	esac
done

shift $(expr $OPTIND - 1)

if $pflag && $nflag
then
	echo "$PROG: -n flag and -p flag may not be used together" 1>&2
	usage
fi

if [ -n "$oarg" ]; then
	exec > $oarg
fi

trap "rm -f $syscalldump" 0 1 2 3 15

header

echo "#include \"$syscallhdr\"" | ${CPP} -D_LIBC -C > $syscalldump

for syscall; do
	fnname=${syscall%.S}
	if $pflag; then
		scname=${fnname#_}
	else
		scname=$fnname
	fi
	syscall_stub $syscalldump $scname $fnname
	echo ""
done

trailer

exit 0
@


1.27
log
@Add ACL support for FFS. From FreeBSD.
@
text
@d2 1
a2 1
# $NetBSD: makelintstub,v 1.26 2016/04/03 00:48:29 christos Exp $
a86 1
	#ifdef __STDC__
d88 6
a93 3
	#else
	#include <varargs.h>
	#endif
@


1.26
log
@add idtype.h to mklintstub and say who generates it.
@
text
@d2 1
a2 1
# $NetBSD: makelintstub,v 1.25 2012/02/12 01:46:05 martin Exp $
d63 1
@


1.25
log
@Add missing <sys/spawn.h> include
@
text
@d2 1
a2 1
# $NetBSD: makelintstub,v 1.24 2012/02/01 05:34:40 dholland Exp $
d59 1
d73 1
@


1.24
log
@Change the syscall API for quotas over to the new non-proplib one.

   - struct vfs_quotactl_args -> struct quotactl_args
   - add sys/stdint.h to sys/quotactl.h for clean userland build
   - install sys/quotactl.h in /usr/include
   - update set lists for same
   - add new marshalling code in libquota
   - add new unmarshalling code in vfs_syscalls.c
   - discard proplib interpreter code in vfs_quotactl.c
   - add dispatching code for the 14 quotactl ops in vfs_quotactl.c
   - mark the proplib quotactl syscall obsolete
   - add a new syscall number for the new quotactl syscall
   - change the name of the syscall to __quotactl()
   - remove the decl of the old quotactl from quota/quotaprop.h
   - add a decl of the new quotactl to sys/quotactl.h
   - update the libc build
   - update ktruss
   - remove proplib marshalling code from libquota
   - update copy of syscall table in gdb ppc sources
   - hack rumphijack to accomodate new quotactl name (as I recall,
     pooka wanted such a name change to simplify something, but I
     don't really see what/how)

This change appears to require a kernel version bump for rumpish
reasons.
@
text
@d2 1
a2 1
# $NetBSD: makelintstub,v 1.23 2008/08/05 02:08:13 lukem Exp $
d77 1
@


1.23
log
@Revert previous addition of '-e sedcmd'.  Still retain the usage improvements.
@
text
@d2 1
a2 1
# $NetBSD: makelintstub,v 1.22 2008/08/05 01:54:47 lukem Exp $
d82 1
@


1.23.2.1
log
@sync with head
@
text
@d2 1
a2 1
# $NetBSD$
a76 1
	#include <sys/spawn.h>
a81 1
	#include <sys/quotactl.h>
@


1.23.6.1
log
@file makelintstub was added on branch christos-time_t on 2008-08-05 02:08:14 +0000
@
text
@d1 242
@


1.23.6.2
log
@Revert previous addition of '-e sedcmd'.  Still retain the usage improvements.
@
text
@a0 242
#!/bin/sh -
# $NetBSD: makelintstub,v 1.23 2008/08/05 02:08:13 lukem Exp $
#
# Copyright (c) 1996, 1997 Christopher G. Demetriou
# All rights reserved.
# 
# 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 for the
#          NetBSD Project.  See http://www.NetBSD.org/ for
#          information about NetBSD.
# 4. The name of the author may not be used to endorse or promote products
#    derived from this software without specific prior written permission.
# 
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
# 
# <<Id: LICENSE,v 1.2 2000/06/14 15:57:33 cgd Exp>>

usage()
{

cat << _EOF 1>&2
Usage: $PROG [-n|-p] [-o filename] [-s syscall.h] object ...
	-n		Create SYSCALL_NOERROR.
	-p		Create PSEUDO_NOERROR.
			(also removes leading "_" on syscall name).
	-o filename	Output to filename.
	-s syscall.h	Header to #include instead of <sys/syscall.h>.

	The CPP environment variable must be set
	to the path to the C preprocessor.
_EOF
	exit 1
}

header()
{

	cat <<- __EOF__
	/*
	 * THIS IS AN AUTOMATICALLY GENERATED FILE.  DO NOT EDIT.
	 */

	#include <sys/param.h>
	#include <sys/aio.h>
	#include <sys/time.h>
	#include <sys/mount.h>
	#include <sys/stat.h>
	#include <ufs/ufs/dinode.h>
	#include <ufs/lfs/lfs.h>
	#include <sys/resource.h>
	#include <sys/poll.h>
	#include <sys/uio.h>
	#include <sys/ipc.h>
	#include <sys/lwpctl.h>
	#include <sys/mqueue.h>
	#include <sys/msg.h>
	#include <sys/sem.h>
	#include <sys/shm.h>
	#include <sys/sched.h>
	#include <sys/timex.h>
	#include <sys/socket.h>
	#include <sys/event.h>
	#include <sys/uuid.h>
	#ifdef __STDC__
	#include <stdarg.h>
	#else
	#include <varargs.h>
	#endif

	__EOF__
}

syscall_stub()
{

	syscalldump="$1"
	syscallname="$2"
	funcname="$3"

    	arglist="$(
    	sed -e 'ta
		:a
		s,^/\* syscall: \"'"$syscallname"'\" ,,
	        tb
		d
		:b
		s, \*/$,,' $syscalldump
	)"

	eval set -f -- "$arglist"

	if [ $# -lt 3 ]; then
		echo syscall $syscallname not found! 1>&2
		exit 1
	fi

	shift			# kill "ret:"
	returntype=$1; shift
	shift			# kill "args:"

	cat <<- __EOF__
	/*ARGSUSED*/
	$returntype
	__EOF__

	# do ANSI C function header
	echo	"#ifdef __STDC__"

	echo "$funcname("
	first=true; i=1
	for arg; do
		if $first; then
			first=false
		else
			echo ", "
		fi
		case "$arg" in
		"...") echo "...";;
		*) echo "$arg arg$i"; i=$(($i + 1));;
		esac
	done
	if $first; then
		echo "void"
	fi
	echo	")"

	# do K&R C function header
	echo	"#else"

	echo "$funcname("
	first=true; i=1
	for arg; do
		if $first; then
			first=false
		else
			echo ", "
		fi
		case "$arg" in
		"...") echo "va_alist";;
		*) echo "arg$i"; i=$(($i + 1));;
		esac
	done
	echo	")"
	i=1
	for arg; do
		case "$arg" in
		"...") echo "	va_dcl";;
		*) echo "	$arg arg$i;"; i=$(($i + 1));;
		esac
	done

	# do function body
	echo	"#endif"

	echo	"{"
	if [ "$returntype" != "void" ]; then
		echo "        return (($returntype)0);"
	fi
	echo	"}"
}

trailer()
{

	cat <<- __EOF__
	/* END */
	__EOF__
}


pflag=false
nflag=false
oarg=""
syscallhdr=/usr/include/sys/syscall.h
syscalldump=/tmp/makelintstub.$$
PROG="$(basename "$0")"

if [ -z "${CPP}" ]; then
	usage
fi

while getopts no:ps: i
do
	case "$i" in
	n)	nflag=true;;
	o)	oarg=$OPTARG;;
	p)	pflag=true;;
	s)	syscallhdr=$OPTARG;;
	*)	usage;;
	esac
done

shift $(expr $OPTIND - 1)

if $pflag && $nflag
then
	echo "$PROG: -n flag and -p flag may not be used together" 1>&2
	usage
fi

if [ -n "$oarg" ]; then
	exec > $oarg
fi

trap "rm -f $syscalldump" 0 1 2 3 15

header

echo "#include \"$syscallhdr\"" | ${CPP} -D_LIBC -C > $syscalldump

for syscall; do
	fnname=${syscall%.S}
	if $pflag; then
		scname=${fnname#_}
	else
		scname=$fnname
	fi
	syscall_stub $syscalldump $scname $fnname
	echo ""
done

trailer

exit 0
@


1.22
log
@Add '-e sedcmd' to makelintstub, to translate filename to syscall name.
Improve usage, etc.

Invoke makelintstub with -e 's/^tmp_//' when building LintSysNormal.c

Fixes build problem that matt@@ highlighted to me.
@
text
@d2 1
a2 1
# $NetBSD: makelintstub,v 1.21 2008/01/15 03:37:14 rmind Exp $
d40 1
a40 4
Usage: $PROG [-n|-p] [-e sedcmd] [-o filename] [-s syscall.h] object ...
	-e sedcmd	sed(1) command to translate filename to syscall name.
			The ".S" suffix is always removed.
			Multiple sed commands may be supplied.
a191 1
fnsedcmd=""
d200 1
a200 1
while getopts e:no:ps: i
a202 1
	e)	fnsedcmd="$fnsedcmd -e $OPTARG";;
a230 3
	if [ -n "$fnsedcmd" ]; then
		fnname=$(echo "$fnname" | sed $fnsedcmd)
	fi
@


1.21
log
@Implementation of processor-sets, affinity and POSIX real-time extensions.
Add schedctl(8) - a program to control scheduling of processes and threads.

Notes:
- This is supported only by SCHED_M2;
- Migration of LWP mechanism will be revisited;

Proposed on: <tech-kern>. Reviewed by: <ad>.
@
text
@d2 1
a2 1
# $NetBSD: makelintstub,v 1.20 2007/11/13 09:07:33 he Exp $
d40 10
a49 1
Usage: $PROG [-n|-p] [-o filename] object ...
d195 1
d204 1
a204 1
while getopts no:ps: i
d207 1
d236 3
@


1.21.6.1
log
@Sync with wrstuden-revivesa-base-2.
@
text
@d2 1
a2 1
# $NetBSD: makelintstub,v 1.21 2008/01/15 03:37:14 rmind Exp $
d40 1
a40 7
Usage: $PROG [-n|-p] [-o filename] [-s syscall.h] object ...
	-n		Create SYSCALL_NOERROR.
	-p		Create PSEUDO_NOERROR.
			(also removes leading "_" on syscall name).
	-o filename	Output to filename.
	-s syscall.h	Header to #include instead of <sys/syscall.h>.

@


1.20
log
@We now need <sys/lwpctl.h> included in order to lint LintSysNormal.c.
@
text
@d2 1
a2 1
# $NetBSD: makelintstub,v 1.19 2007/10/09 18:18:33 rmind Exp $
d71 1
@


1.19
log
@Add cancellation stubs in libpthread for POSIX messages queues and
asynchronous I/O.

OK by <ad>.
@
text
@d2 1
a2 1
# $NetBSD: makelintstub,v 1.18 2007/02/09 22:08:48 ad Exp $
d66 1
@


1.18
log
@Sync with kernel changes introduced by merging the newlock2 branch.
@
text
@d2 1
a2 1
# $NetBSD: makelintstub,v 1.17 2006/06/18 14:28:12 christos Exp $
d56 1
d66 1
@


1.18.4.1
log
@sync with HEAD
@
text
@d2 1
a2 1
# $NetBSD: makelintstub,v 1.19 2007/10/09 18:18:33 rmind Exp $
a55 1
	#include <sys/aio.h>
a64 1
	#include <sys/mqueue.h>
@


1.18.4.2
log
@sync with HEAD
@
text
@d2 1
a2 1
# $NetBSD$
a65 1
	#include <sys/lwpctl.h>
@


1.18.4.3
log
@sync with HEAD
@
text
@d2 1
a2 1
# makelintstub,v 1.18.4.2 2008/01/09 01:34:22 matt Exp
a70 1
	#include <sys/sched.h>
@


1.17
log
@Modernize:
	getopt -> getopts
	`` -> $()
	YES/NO -> true/false
	[ x$f = x ] -> [ -z $f ]
	test -> [
	errors to stderr
@
text
@d2 1
a2 1
# $NetBSD: makelintstub,v 1.16 2004/01/29 02:00:02 tsarna Exp $
a58 1
	#include <sys/sa.h>
@


1.16
log
@uuidgen(2) syscall.  Originally from FreeBSD, ported by John Franklin in
PR#23470, with minor updates by me. This is only the syscall support
from that PR, for now.

Changes: port over fix from FreeBSD for multicast address generation.
Changed bcopy to memcpy.  For now, #ifdef notyet the portions of
kern_uuid.c that are meant to be used by (currently nonexistent) other
things in the kernel.  Added syscall to COMPAT_FREEBSD as well, though
that's currently not useful, as any program new enough to use this call
also uses other syscalls we don't (yet) emulate.
@
text
@d2 1
a2 1
# $NetBSD: makelintstub,v 1.15 2003/09/30 22:30:16 christos Exp $
d39 5
a43 3
	echo "usage: $0 [-n|-p] [-o filename] object ..."
	echo "       The CPP environment variable must be set"
	echo "       to the path to the C preprocessor."
d89 1
a89 1
    	arglist="`
d97 1
a97 1
	`"
d119 1
a119 1
	first=yes; i=1
d121 2
a122 2
		if [ $first = yes ]; then
			first=no
d131 1
a131 1
	if [ $first = yes ]; then
d140 1
a140 1
	first=yes; i=1
d142 2
a143 2
		if [ $first = yes ]; then
			first=no
a178 1
set -- `getopt no:ps: $*`
d180 2
a181 2
pflag=NO
nflag=NO
d185 1
d187 1
a187 1
if test "x${CPP}" = "x"; then
d191 2
a192 4
if test $? -ne 0; then
	usage
fi
for i; do
d194 5
a198 5
	-n)	nflag=YES; shift;;
	-o)	oarg=$2; shift; shift;;
	-p)	pflag=YES; shift;;
	-s)	syscallhdr=$2; shift; shift;;
	--)	shift; break;;
d202 5
a206 3
if [ $pflag = YES ] && [ $nflag = YES ]; then
	echo "$0: -n flag and -p flag may not be used together"
	echo ""
d210 1
a210 1
if [ "X$oarg" != "X" ]; then
d214 1
a214 1
trap "rm -f $syscalldump" 0 1 2 15
d217 3
a219 1
echo "#include \"$syscallhdr\"" | ${CPP} -D_LIBC -C >$syscalldump
d222 1
a222 1
	if [ $pflag = YES ]; then
d230 1
@


1.15
log
@Pass -D_LIBC
@
text
@d2 1
a2 1
# $NetBSD: makelintstub,v 1.14 2003/07/26 19:24:54 salo Exp $
d70 1
@


1.14
log
@netbsd.org->NetBSD.org
@
text
@d2 1
a2 1
# $NetBSD: makelintstub,v 1.13 2003/01/18 11:33:07 thorpej Exp $
d214 1
a214 1
echo "#include \"$syscallhdr\"" | ${CPP} -C >$syscalldump
@


1.13
log
@Merge the nathanw_sa branch.
@
text
@d2 1
a2 1
# $NetBSD: makelintstub,v 1.12 2002/11/11 00:54:57 thorpej Exp $
d18 1
a18 1
#          NetBSD Project.  See http://www.netbsd.org/ for
@


1.12
log
@Make sure there is a newline at the end of CPP input.
@
text
@d2 1
a2 1
# $NetBSD: makelintstub,v 1.11 2002/10/23 09:25:49 jdolecek Exp $
d57 1
@


1.11
log
@make support for kqueue(2) and kevent(2) unconditional, the kqueue branch
was merged
@
text
@d2 1
a2 1
# $NetBSD: makelintstub,v 1.10 2002/10/12 17:41:20 jdolecek Exp $
d213 1
a213 1
printf '#include "'"$syscallhdr"'"' | ${CPP} -C >$syscalldump
@


1.10
log
@if WITH_KQUEUE is defined and <sys/event.h> exists in DESTDIR, compile
  support for kqueue(2) and kevent(2) in

this is temporary measure to ease testing of kqueue branch; the support
  will be made unconditional once kqueue branch would be merged
@
text
@d2 1
a2 1
# $NetBSD: makelintstub,v 1.9 2002/09/14 03:14:15 thorpej Exp $
a67 1
	#ifdef WITH_KQUEUE
a68 1
	#endif
@


1.9
log
@Fix some problems using makelintstub as a cross-tool:
* Require that the path to the C preprocessor be passed in the CPP
  environemnt variable, and use it rather than hard-coding "cpp".
  Provide the target's preprocessor when invoking makelintstub.
* Fix some quoting issues that turned up with Solaris 8's XPG4 sh and sed.
* Don't use echo -n.  Instead, don't bother making the output pretty; the
  whitespace isn't supposed to be syntactically significant anyhow.
@
text
@d2 1
a2 1
# $NetBSD: makelintstub,v 1.8 2001/11/13 18:39:10 tv Exp $
d68 3
@


1.8
log
@Make this match the new .S extension of syscalls.
@
text
@d2 1
a2 1
# $NetBSD: makelintstub,v 1.7 2000/06/14 17:25:07 cgd Exp $
d40 2
d87 1
a87 1
		s,^/\* syscall: "'"$syscallname"'" ,,
d113 1
a113 1
	echo -n	"$funcname("
d119 1
a119 1
			echo -n	", "
d122 2
a123 2
		"...") echo -n "...";;
		*) echo -n "$arg arg$i"; i=$(($i + 1));;
d126 3
d134 1
a134 1
	echo -n	"$funcname("
d140 1
a140 1
			echo -n	", "
d143 2
a144 2
		"...") echo -n "va_alist";;
		*) echo -n "arg$i"; i=$(($i + 1));;
d182 4
d212 1
a212 1
printf '#include "'"$syscallhdr"'"' | cpp -C >$syscalldump
@


1.8.2.1
log
@Pull up revision 1.9 (requested by thorpej in ticket #803):
  Fix some problems using makelintstub as a cross-tool:
   o Require that the path to the C preprocessor be passed
     in the CPP environment variable, and use it rather than
     hard-coding "cpp".  Provide the target's preprocessor
     when invoking makelintstub.
   o Fix some quoting issues found with Solaris 8's XPG4 sh
     and sed.
   o Do not use "echo -n".  The resulting whitespace is not
     supposed to be syntactically significant anyway.
@
text
@d2 1
a2 1
# $NetBSD: makelintstub,v 1.8 2001/11/13 18:39:10 tv Exp $
a39 2
	echo "       The CPP environment variable must be set"
	echo "       to the path to the C preprocessor."
d85 1
a85 1
		s,^/\* syscall: \"'"$syscallname"'\" ,,
d111 1
a111 1
	echo "$funcname("
d117 1
a117 1
			echo ", "
d120 2
a121 2
		"...") echo "...";;
		*) echo "$arg arg$i"; i=$(($i + 1));;
a123 3
	if [ $first = yes ]; then
		echo "void"
	fi
d129 1
a129 1
	echo "$funcname("
d135 1
a135 1
			echo ", "
d138 2
a139 2
		"...") echo "va_alist";;
		*) echo "arg$i"; i=$(($i + 1));;
a176 4
if test "x${CPP}" = "x"; then
	usage
fi

d203 1
a203 1
printf '#include "'"$syscallhdr"'"' | ${CPP} -C >$syscalldump
@


1.7
log
@sweep of my licenses (userland files w/o only my copyright) for
consistency.  (no functional changes)
@
text
@d2 1
a2 1
# $NetBSD: makelintstub,v 1.6 2000/06/14 06:49:10 cgd Exp $
d205 1
a205 1
	fnname=${syscall%.o}
@


1.7.4.1
log
@Catch up to -current.
@
text
@d2 1
a2 1
# $NetBSD: makelintstub,v 1.7 2000/06/14 17:25:07 cgd Exp $
d205 1
a205 1
	fnname=${syscall%.S}
@


1.7.4.2
log
@Pull in <sys/sa.h>.
@
text
@d2 1
a2 1
# $NetBSD: makelintstub,v 1.7.4.1 2001/11/14 19:32:05 nathanw Exp $
a54 1
	#include <sys/sa.h>
@


1.7.4.3
log
@Catch up to -current.
@
text
@d2 1
a2 1
# $NetBSD$
a39 2
	echo "       The CPP environment variable must be set"
	echo "       to the path to the C preprocessor."
d86 1
a86 1
		s,^/\* syscall: \"'"$syscallname"'\" ,,
d112 1
a112 1
	echo "$funcname("
d118 1
a118 1
			echo ", "
d121 2
a122 2
		"...") echo "...";;
		*) echo "$arg arg$i"; i=$(($i + 1));;
a124 3
	if [ $first = yes ]; then
		echo "void"
	fi
d130 1
a130 1
	echo "$funcname("
d136 1
a136 1
			echo ", "
d139 2
a140 2
		"...") echo "va_alist";;
		*) echo "arg$i"; i=$(($i + 1));;
a177 4
if test "x${CPP}" = "x"; then
	usage
fi

d204 1
a204 1
printf '#include "'"$syscallhdr"'"' | ${CPP} -C >$syscalldump
@


1.7.4.4
log
@Catch up to -current.
@
text
@a68 3
	#ifdef WITH_KQUEUE
	#include <sys/event.h>
	#endif
@


1.7.4.5
log
@Catch up to -current
@
text
@d69 1
d71 1
d216 1
a216 1
echo "#include \"$syscallhdr\"" | ${CPP} -C >$syscalldump
@


1.7.6.1
log
@pull in <sys/event.h>
@
text
@d2 1
a2 1
# $NetBSD: makelintstub,v 1.7 2000/06/14 17:25:07 cgd Exp $
a59 1
	#include <sys/event.h>
@


1.6
log
@fix up NetBSD RCS Ids to match the standard, and the leading comment as
to match as well.  No functional changes.
@
text
@d2 1
a2 3
# $NetBSD: makelintstub,v 1.5 1998/07/03 18:09:25 mycroft Exp $
#
# Copyright (c) 1996, 1997 Christopher G. Demetriou.  All rights reserved.
d4 3
d17 3
a19 2
#      This product includes software developed for the NetBSD Project
#      by Christopher G. Demetriou.
d21 2
a22 2
#    derived from this software without specific prior written permission
#
d33 2
@


1.5
log
@Further redux.
@
text
@d2 1
a2 1
#	$NetBSD: makelintstub,v 1.3 1998/03/01 10:20:06 fvdl Exp $
@


1.5.8.1
log
@Sync w/ netbsd-1-5-base.
@
text
@d2 3
a4 1
# $NetBSD: makelintstub,v 1.7 2000/06/14 17:25:07 cgd Exp $
a5 3
# Copyright (c) 1996, 1997 Christopher G. Demetriou
# All rights reserved.
# 
d16 2
a17 3
#          This product includes software developed for the
#          NetBSD Project.  See http://www.netbsd.org/ for
#          information about NetBSD.
d19 2
a20 2
#    derived from this software without specific prior written permission.
# 
a30 2
# 
# <<Id: LICENSE,v 1.2 2000/06/14 15:57:33 cgd Exp>>
@


1.4
log
@Make this a bit less fork-happy.
@
text
@a103 9
	if [ "`eval echo -n \\$$#`" = "..." ]; then
		varargs=YES
		nargs=$(($# - 1))
	else
		varargs=NO
		nargs=$#
	fi
	nargswithva=$#

d105 1
a105 2
	if [ $varargs = YES ]; then
		echo	"#ifdef __STDC__"
d107 7
a113 12
		echo -n	"$funcname("
		i=1
		while [ $i -le $nargs ]; do
			eval echo -n \""\$$i"\"
			echo -n	" arg$i"
			if [ $i -lt $nargswithva ]; then
				echo -n	", "
			fi
			i=$(($i + 1))
		done
		if [ $varargs = YES ]; then
			echo -n "..."
d115 6
a120 1
		echo	")"
d122 2
a123 3
		# do K&R C function header
		echo	"#else"
	fi
d126 5
a130 4
	i=1
	while [ $i -le $nargs ]; do
		echo -n	"arg$i"
		if [ $i -lt $nargswithva ]; then
d133 4
a136 1
		i=$(($i + 1))
a137 3
	if [ $varargs = YES ]; then
		echo -n "va_alist"
	fi
d140 5
a144 4
	while [ $i -le $nargs ]; do
		eval echo -n \""        \$$i"\"
		echo	" arg$i;"
		i=$(($i + 1))
a145 3
	if [ $varargs = YES ]; then
		echo	"        va_dcl"
	fi
d148 2
a149 3
	if [ $varargs = YES ]; then
		echo	"#endif"
	fi
@


1.3
log
@Make this output one more include file, needed after the Lite2 changes.
@
text
@d2 1
a2 1
#	$NetBSD: makelintstub,v 1.2 1997/11/05 05:46:18 thorpej Exp $
d74 1
a74 1
	syscallhdr="$1"
d78 9
a86 3
	arglist="`printf '#include "'"$syscallhdr"'"' | cpp -C | \
    	grep '^/\* syscall: "'"$syscallname"'" ' | \
    	sed -e 's,^/\* syscall: ,,;s, \*/$,,'`"
d90 1
a90 1
	if [ $# -lt 4 ]; then
d95 3
a97 4
	syscallname=$1
	shift 2			# kill name and "ret:"
	returntype=$1
	shift 2			# kill return type and "args:"
d184 1
d209 2
d212 1
d214 1
a214 1
	fnname=`echo $syscall | sed -e 's,\.o$,,'`
d216 1
a216 1
		scname=`echo $fnname | sed -e 's,^_,,'`
d220 1
a220 1
	syscall_stub $syscallhdr $scname $fnname
@


1.2
log
@Instead of creating a .ln for each syscall stub, create one (big) .ln
per class of syscall stubs.  This is much more efficient (though it's still
pretty inefficient).

This also fixes a problem with syscall.h and DESTDIR which was pretty
well buried in the old implementation.

From Chris Demetriou <cgd@@pa.dec.com>.
@
text
@d2 1
a2 1
#	$NetBSD: makelintstub,v 1.1 1996/12/22 11:38:34 cgd Exp $
d51 1
@


1.1
log
@a script to build C source code stubs to be fed to lint(1) from the data
in <sys/syscall.h>.
@
text
@d2 1
a2 1
#	$NetBSD$
d4 1
a4 1
# Copyright (c) 1996 Christopher G. Demetriou.  All rights reserved.
d32 4
a35 2
if [ $# -lt 1 ] || [ $# -gt 2 ]; then
	echo "usage: $0 syscallname [funcname]"
d37 1
a37 1
fi
d39 2
a40 6
syscallname="$1"
if [ $# -eq 1 ]; then
	funcname="$syscallname"
else
	funcname="$2"
fi
d42 45
a86 3
arglist="`printf '#include <sys/syscall.h>' | cpp -C | \
    grep '^/\* syscall: "'"$syscallname"'" ' | \
    sed -e 's,^/\* syscall: ,,;s, \*/$,,'`"
d88 18
a105 1
eval set -f -- "$arglist"
d107 18
a124 4
if [ $# -lt 4 ]; then
	echo syscall $syscallname not found! 1>&2
	exit 1
fi
d126 3
a128 38
syscallname=$1
shift 2			# kill name and "ret:"
returntype=$1
shift 2			# kill return type and "args:"

cat << __EOF__
#include <sys/param.h>
#include <sys/time.h>
#include <sys/mount.h>
#include <sys/stat.h>
#include <ufs/lfs/lfs.h>
#include <sys/resource.h>
#include <sys/poll.h>
#include <sys/uio.h>
#include <sys/ipc.h>
#include <sys/msg.h>
#include <sys/sem.h>
#include <sys/shm.h>
#include <sys/timex.h>
#include <sys/socket.h>
#ifdef __STDC__
#include <stdarg.h>
#else
#include <varargs.h>
#endif

/*ARGSUSED*/
$returntype
__EOF__

if [ "`eval echo -n \\$$#`" = "..." ]; then
	varargs=YES
	nargs=$(($# - 1))
else
	varargs=NO
	nargs=$#
fi
nargswithva=$#
d130 22
a151 2
# do ANSI C function header
echo	"#ifdef __STDC__"
d153 3
a155 7
echo -n	"$funcname("
i=1
while [ $i -le $nargs ]; do
	eval echo -n \""\$$i"\"
	echo -n	" arg$i"
	if [ $i -lt $nargswithva ]; then
		echo -n	", "
d157 33
a189 1
	i=$(($i + 1))
a190 7
if [ $varargs = YES ]; then
	echo -n "..."
fi
echo	")"

# do K&R C function header
echo	"#else"
d192 17
a208 6
echo -n	"$funcname("
i=1
while [ $i -le $nargs ]; do
	echo -n	"arg$i"
	if [ $i -lt $nargswithva ]; then
		echo -n	", "
d210 2
a211 1
	i=$(($i + 1))
d213 1
a213 21
if [ $varargs = YES ]; then
	echo -n "va_alist"
fi
echo	")"
i=1
while [ $i -le $nargs ]; do
	eval echo -n \""        \$$i"\"
	echo	" arg$i;"
	i=$(($i + 1))
done
if [ $varargs = YES ]; then
	echo	"        va_dcl"
fi

# do function body
echo	"#endif"
echo	"{"
if [ "$returntype" != "void" ]; then
	echo "        return (($returntype)0);"
fi
echo	"}"
@


1.1.2.1
log
@Update from trunk: fix lint syscall stub generation.
@
text
@d2 1
a2 1
#	$NetBSD: makelintstub,v 1.2 1997/11/05 05:46:18 thorpej Exp $
d4 1
a4 1
# Copyright (c) 1996, 1997 Christopher G. Demetriou.  All rights reserved.
d32 2
a33 4
usage()
{

	echo "usage: $0 [-n|-p] [-o filename] object ..."
d35 1
a35 1
}
d37 6
a42 2
header()
{
d44 3
a46 45
	cat <<- __EOF__
	/*
	 * THIS IS AN AUTOMATICALLY GENERATED FILE.  DO NOT EDIT.
	 */

	#include <sys/param.h>
	#include <sys/time.h>
	#include <sys/mount.h>
	#include <sys/stat.h>
	#include <ufs/lfs/lfs.h>
	#include <sys/resource.h>
	#include <sys/poll.h>
	#include <sys/uio.h>
	#include <sys/ipc.h>
	#include <sys/msg.h>
	#include <sys/sem.h>
	#include <sys/shm.h>
	#include <sys/timex.h>
	#include <sys/socket.h>
	#ifdef __STDC__
	#include <stdarg.h>
	#else
	#include <varargs.h>
	#endif

	__EOF__
}

syscall_stub()
{

	syscallhdr="$1"
	syscallname="$2"
	funcname="$3"

	arglist="`printf '#include "'"$syscallhdr"'"' | cpp -C | \
    	grep '^/\* syscall: "'"$syscallname"'" ' | \
    	sed -e 's,^/\* syscall: ,,;s, \*/$,,'`"

	eval set -f -- "$arglist"

	if [ $# -lt 4 ]; then
		echo syscall $syscallname not found! 1>&2
		exit 1
	fi
d48 1
a48 18
	syscallname=$1
	shift 2			# kill name and "ret:"
	returntype=$1
	shift 2			# kill return type and "args:"

	cat <<- __EOF__
	/*ARGSUSED*/
	$returntype
	__EOF__

	if [ "`eval echo -n \\$$#`" = "..." ]; then
		varargs=YES
		nargs=$(($# - 1))
	else
		varargs=NO
		nargs=$#
	fi
	nargswithva=$#
d50 4
a53 18
	# do ANSI C function header
	if [ $varargs = YES ]; then
		echo	"#ifdef __STDC__"

		echo -n	"$funcname("
		i=1
		while [ $i -le $nargs ]; do
			eval echo -n \""\$$i"\"
			echo -n	" arg$i"
			if [ $i -lt $nargswithva ]; then
				echo -n	", "
			fi
			i=$(($i + 1))
		done
		if [ $varargs = YES ]; then
			echo -n "..."
		fi
		echo	")"
d55 38
a92 3
		# do K&R C function header
		echo	"#else"
	fi
d94 2
a95 22
	echo -n	"$funcname("
	i=1
	while [ $i -le $nargs ]; do
		echo -n	"arg$i"
		if [ $i -lt $nargswithva ]; then
			echo -n	", "
		fi
		i=$(($i + 1))
	done
	if [ $varargs = YES ]; then
		echo -n "va_alist"
	fi
	echo	")"
	i=1
	while [ $i -le $nargs ]; do
		eval echo -n \""        \$$i"\"
		echo	" arg$i;"
		i=$(($i + 1))
	done
	if [ $varargs = YES ]; then
		echo	"        va_dcl"
	fi
d97 7
a103 3
	# do function body
	if [ $varargs = YES ]; then
		echo	"#endif"
d105 6
a110 6
	echo	"{"
	if [ "$returntype" != "void" ]; then
		echo "        return (($returntype)0);"
	fi
	echo	"}"
}
d112 2
a113 2
trailer()
{
d115 18
a132 23
	cat <<- __EOF__
	/* END */
	__EOF__
}

set -- `getopt no:ps: $*`

pflag=NO
nflag=NO
oarg=""
syscallhdr=/usr/include/sys/syscall.h

if test $? -ne 0; then
	usage
fi
for i; do
	case "$i" in
	-n)	nflag=YES; shift;;
	-o)	oarg=$2; shift; shift;;
	-p)	pflag=YES; shift;;
	-s)	syscallhdr=$2; shift; shift;;
	--)	shift; break;;
	esac
d134 3
d138 7
a144 22
if [ $pflag = YES ] && [ $nflag = YES ]; then
	echo "$0: -n flag and -p flag may not be used together"
	echo ""
	usage
fi

if [ "X$oarg" != "X" ]; then
	exec > $oarg
fi

header
for syscall; do
	fnname=`echo $syscall | sed -e 's,\.o$,,'`
	if [ $pflag = YES ]; then
		scname=`echo $fnname | sed -e 's,^_,,'`
	else
		scname=$fnname
	fi
	syscall_stub $syscallhdr $scname $fnname
	echo ""
done
trailer
@
