xref: /xnu-10002.1.13/bsd/vfs/vnode_if.sh (revision 1031c584a5e37aff177559b9f69dbd3c8c3fd30a)
1*1031c584SApple OSS Distributions#!/bin/sh -
2*1031c584SApple OSS Distributionscopyright='
3*1031c584SApple OSS Distributions/*
4*1031c584SApple OSS Distributions * Copyright (c) 2000-2019 Apple Inc. All rights reserved.
5*1031c584SApple OSS Distributions *
6*1031c584SApple OSS Distributions * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
7*1031c584SApple OSS Distributions *
8*1031c584SApple OSS Distributions * The contents of this file constitute Original Code as defined in and
9*1031c584SApple OSS Distributions * are subject to the Apple Public Source License Version 1.1 (the
10*1031c584SApple OSS Distributions * "License").  You may not use this file except in compliance with the
11*1031c584SApple OSS Distributions * License.  Please obtain a copy of the License at
12*1031c584SApple OSS Distributions * http://www.apple.com/publicsource and read it before using this file.
13*1031c584SApple OSS Distributions *
14*1031c584SApple OSS Distributions * This Original Code and all software distributed under the License are
15*1031c584SApple OSS Distributions * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
16*1031c584SApple OSS Distributions * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
17*1031c584SApple OSS Distributions * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
18*1031c584SApple OSS Distributions * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT.  Please see the
19*1031c584SApple OSS Distributions * License for the specific language governing rights and limitations
20*1031c584SApple OSS Distributions * under the License.
21*1031c584SApple OSS Distributions *
22*1031c584SApple OSS Distributions * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
23*1031c584SApple OSS Distributions */
24*1031c584SApple OSS Distributions/*
25*1031c584SApple OSS Distributions * Copyright (c) 1995 NeXT Computer, Inc. All Rights Reserved
26*1031c584SApple OSS Distributions * Copyright (c) 1992, 1993, 1994, 1995
27*1031c584SApple OSS Distributions *	The Regents of the University of California.  All rights reserved.
28*1031c584SApple OSS Distributions *
29*1031c584SApple OSS Distributions * Redistribution and use in source and binary forms, with or without
30*1031c584SApple OSS Distributions * modification, are permitted provided that the following conditions
31*1031c584SApple OSS Distributions * are met:
32*1031c584SApple OSS Distributions * 1. Redistributions of source code must retain the above copyright
33*1031c584SApple OSS Distributions *    notice, this list of conditions and the following disclaimer.
34*1031c584SApple OSS Distributions * 2. Redistributions in binary form must reproduce the above copyright
35*1031c584SApple OSS Distributions *    notice, this list of conditions and the following disclaimer in the
36*1031c584SApple OSS Distributions *    documentation and/or other materials provided with the distribution.
37*1031c584SApple OSS Distributions * 3. All advertising materials mentioning features or use of this software
38*1031c584SApple OSS Distributions *    must display the following acknowledgement:
39*1031c584SApple OSS Distributions *      This product includes software developed by the University of
40*1031c584SApple OSS Distributions *      California, Berkeley and its contributors.
41*1031c584SApple OSS Distributions * 4. Neither the name of the University nor the names of its contributors
42*1031c584SApple OSS Distributions *    may be used to endorse or promote products derived from this software
43*1031c584SApple OSS Distributions *    without specific prior written permission.
44*1031c584SApple OSS Distributions *
45*1031c584SApple OSS Distributions * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
46*1031c584SApple OSS Distributions * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
47*1031c584SApple OSS Distributions * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
48*1031c584SApple OSS Distributions * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
49*1031c584SApple OSS Distributions * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
50*1031c584SApple OSS Distributions * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
51*1031c584SApple OSS Distributions * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
52*1031c584SApple OSS Distributions * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
53*1031c584SApple OSS Distributions * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
54*1031c584SApple OSS Distributions * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
55*1031c584SApple OSS Distributions * SUCH DAMAGE.
56*1031c584SApple OSS Distributions */
57*1031c584SApple OSS Distributions'
58*1031c584SApple OSS DistributionsSCRIPT_ID='@(#)vnode_if.sh	8.7 (Berkeley) 5/11/95'
59*1031c584SApple OSS Distributions
60*1031c584SApple OSS Distributions# Script to produce VFS front-end sugar.
61*1031c584SApple OSS Distributions#
62*1031c584SApple OSS Distributions# usage: vnode_if.sh srcfile
63*1031c584SApple OSS Distributions#	(where srcfile is currently bsd/vfs/vnode_if.src)
64*1031c584SApple OSS Distributions#
65*1031c584SApple OSS Distributions
66*1031c584SApple OSS Distributionsif [ $# -ne 1 ] ; then
67*1031c584SApple OSS Distributions	echo 'usage: vnode_if.sh srcfile'
68*1031c584SApple OSS Distributions	exit 1
69*1031c584SApple OSS Distributionsfi
70*1031c584SApple OSS Distributions
71*1031c584SApple OSS Distributions# Name of the source file.
72*1031c584SApple OSS Distributionssrc=$1
73*1031c584SApple OSS Distributions
74*1031c584SApple OSS Distributions# Names of the created files.
75*1031c584SApple OSS Distributionsout_c=vnode_if.c
76*1031c584SApple OSS Distributionsout_h=vnode_if.h
77*1031c584SApple OSS Distributions
78*1031c584SApple OSS Distributions# Awk program (must support nawk extensions)
79*1031c584SApple OSS Distributions# Use "awk" at Berkeley, "nawk" or "gawk" elsewhere.
80*1031c584SApple OSS Distributionsawk=${AWK:-awk}
81*1031c584SApple OSS Distributions#awk=${AWK:-gawk}
82*1031c584SApple OSS Distributions
83*1031c584SApple OSS Distributions# Does this awk have a "toupper" function? (i.e. is it GNU awk)
84*1031c584SApple OSS Distributionsisgawk=`$awk 'BEGIN { print toupper("true"); exit; }' 2>/dev/null`
85*1031c584SApple OSS Distributions
86*1031c584SApple OSS Distributions# If this awk does not define "toupper" then define our own.
87*1031c584SApple OSS Distributionsif [ "$isgawk" = TRUE ] ; then
88*1031c584SApple OSS Distributions	# GNU awk provides it.
89*1031c584SApple OSS Distributions	toupper=
90*1031c584SApple OSS Distributionselse
91*1031c584SApple OSS Distributions	# Provide our own toupper()
92*1031c584SApple OSS Distributions	toupper='
93*1031c584SApple OSS Distributionsfunction toupper(str) {
94*1031c584SApple OSS Distributions	_toupper_cmd = "echo "str" |tr a-z A-Z"
95*1031c584SApple OSS Distributions	_toupper_cmd | getline _toupper_str;
96*1031c584SApple OSS Distributions	close(_toupper_cmd);
97*1031c584SApple OSS Distributions	return _toupper_str;
98*1031c584SApple OSS Distributions}'
99*1031c584SApple OSS Distributionsfi
100*1031c584SApple OSS Distributions
101*1031c584SApple OSS Distributions#
102*1031c584SApple OSS Distributions# This is the common part of all awk programs that read $src
103*1031c584SApple OSS Distributions# This parses the input for one function into the arrays:
104*1031c584SApple OSS Distributions#	argdir, argtype, argname, willrele
105*1031c584SApple OSS Distributions# and calls "doit()" to generate output for the function.
106*1031c584SApple OSS Distributions#
107*1031c584SApple OSS Distributions# Input to this parser is pre-processed slightly by sed
108*1031c584SApple OSS Distributions# so this awk parser doesn't have to work so hard.  The
109*1031c584SApple OSS Distributions# changes done by the sed pre-processing step are:
110*1031c584SApple OSS Distributions#	insert a space beween * and pointer name
111*1031c584SApple OSS Distributions#	replace semicolons with spaces
112*1031c584SApple OSS Distributions#
113*1031c584SApple OSS Distributionssed_prep='s:\*\([^\*/]\):\* \1:g
114*1031c584SApple OSS Distributionss/;/ /'
115*1031c584SApple OSS Distributionsawk_parser='
116*1031c584SApple OSS Distributions# Comment line
117*1031c584SApple OSS Distributions/^#/	{ next; }
118*1031c584SApple OSS Distributions# First line of description
119*1031c584SApple OSS Distributions/^vop_/	{
120*1031c584SApple OSS Distributions	name=$1;
121*1031c584SApple OSS Distributions	argc=0;
122*1031c584SApple OSS Distributions	ubc=$3;
123*1031c584SApple OSS Distributions	next;
124*1031c584SApple OSS Distributions}
125*1031c584SApple OSS Distributions# Last line of description
126*1031c584SApple OSS Distributions/^}/	{
127*1031c584SApple OSS Distributions	doit();
128*1031c584SApple OSS Distributions	next;
129*1031c584SApple OSS Distributions}
130*1031c584SApple OSS Distributions# Middle lines of description
131*1031c584SApple OSS Distributions{
132*1031c584SApple OSS Distributions	argdir[argc] = $1; i=2;
133*1031c584SApple OSS Distributions	if ($2 == "WILLRELE") {
134*1031c584SApple OSS Distributions		willrele[argc] = 1;
135*1031c584SApple OSS Distributions		i++;
136*1031c584SApple OSS Distributions	} else
137*1031c584SApple OSS Distributions		willrele[argc] = 0;
138*1031c584SApple OSS Distributions	argtype[argc] = $i; i++;
139*1031c584SApple OSS Distributions	while (i < NF) {
140*1031c584SApple OSS Distributions		argtype[argc] = argtype[argc]" "$i;
141*1031c584SApple OSS Distributions		i++;
142*1031c584SApple OSS Distributions	}
143*1031c584SApple OSS Distributions	argname[argc] = $i;
144*1031c584SApple OSS Distributions	argc++;
145*1031c584SApple OSS Distributions	next;
146*1031c584SApple OSS Distributions}
147*1031c584SApple OSS Distributions'
148*1031c584SApple OSS Distributions
149*1031c584SApple OSS Distributions# This is put after the copyright on each generated file.
150*1031c584SApple OSS Distributionswarning="
151*1031c584SApple OSS Distributions/*
152*1031c584SApple OSS Distributions * Warning: This file is generated automatically.
153*1031c584SApple OSS Distributions * (Modifications made here may easily be lost!)
154*1031c584SApple OSS Distributions *
155*1031c584SApple OSS Distributions * Created by the script:
156*1031c584SApple OSS Distributions *	${SCRIPT_ID}
157*1031c584SApple OSS Distributions */
158*1031c584SApple OSS Distributions"
159*1031c584SApple OSS Distributions
160*1031c584SApple OSS Distributions# Get rid of ugly spaces
161*1031c584SApple OSS Distributionsspace_elim='s:\([^/]\*\) :\1:g'
162*1031c584SApple OSS Distributions
163*1031c584SApple OSS Distributions#
164*1031c584SApple OSS Distributions# Redirect stdout to the H file.
165*1031c584SApple OSS Distributions#
166*1031c584SApple OSS Distributionsecho "$0: Creating $out_h" 1>&2
167*1031c584SApple OSS Distributionsexec > $out_h
168*1031c584SApple OSS Distributions
169*1031c584SApple OSS Distributions# Begin stuff
170*1031c584SApple OSS Distributionsecho "$copyright"
171*1031c584SApple OSS Distributionsecho "$warning"
172*1031c584SApple OSS Distributionsecho '
173*1031c584SApple OSS Distributions#ifndef _SYS_VNODE_IF_H_
174*1031c584SApple OSS Distributions#define _SYS_VNODE_IF_H_
175*1031c584SApple OSS Distributions
176*1031c584SApple OSS Distributions#include <sys/appleapiopts.h>
177*1031c584SApple OSS Distributions#include <sys/ubc.h>
178*1031c584SApple OSS Distributions
179*1031c584SApple OSS Distributions#ifdef __APPLE_API_UNSTABLE
180*1031c584SApple OSS Distributionsextern struct vnodeop_desc vop_default_desc;
181*1031c584SApple OSS Distributions'
182*1031c584SApple OSS Distributions
183*1031c584SApple OSS Distributions# Body stuff
184*1031c584SApple OSS Distributions# This awk program needs toupper() so define it if necessary.
185*1031c584SApple OSS Distributionssed -e "$sed_prep" $src | $awk "$toupper"'
186*1031c584SApple OSS Distributionsfunction doit() {
187*1031c584SApple OSS Distributions	# Declare arg struct, descriptor.
188*1031c584SApple OSS Distributions	printf("\nstruct %s_args {\n", name);
189*1031c584SApple OSS Distributions	printf("\tstruct vnodeop_desc * a_desc;\n");
190*1031c584SApple OSS Distributions	for (i=0; i<argc; i++) {
191*1031c584SApple OSS Distributions		printf("\t%s a_%s;\n", argtype[i], argname[i]);
192*1031c584SApple OSS Distributions	}
193*1031c584SApple OSS Distributions	printf("};\n");
194*1031c584SApple OSS Distributions	printf("extern struct vnodeop_desc %s_desc;\n", name);
195*1031c584SApple OSS Distributions	# Define inline function.
196*1031c584SApple OSS Distributions	printf("#define %s(", toupper(name));
197*1031c584SApple OSS Distributions	for (i=0; i<argc; i++) {
198*1031c584SApple OSS Distributions		printf("%s", argname[i]);
199*1031c584SApple OSS Distributions		if (i < (argc-1)) printf(", ");
200*1031c584SApple OSS Distributions	}
201*1031c584SApple OSS Distributions	printf(") _%s(", toupper(name));
202*1031c584SApple OSS Distributions	for (i=0; i<argc; i++) {
203*1031c584SApple OSS Distributions		printf("%s", argname[i]);
204*1031c584SApple OSS Distributions		if (i < (argc-1)) printf(", ");
205*1031c584SApple OSS Distributions	}
206*1031c584SApple OSS Distributions	printf(")\n");
207*1031c584SApple OSS Distributions	printf("static __inline int _%s(", toupper(name));
208*1031c584SApple OSS Distributions	for (i=0; i<argc; i++) {
209*1031c584SApple OSS Distributions		# generate ANSI protoypes now, hurrah!
210*1031c584SApple OSS Distributions		printf("%s _%s", argtype[i], argname[i]);
211*1031c584SApple OSS Distributions		if (i < (argc-1)) printf(", ");
212*1031c584SApple OSS Distributions	}
213*1031c584SApple OSS Distributions	printf(")\n");
214*1031c584SApple OSS Distributions	printf("{\n\tstruct %s_args a;\n", name);
215*1031c584SApple OSS Distributions	printf("\ta.a_desc = VDESC(%s);\n", name);
216*1031c584SApple OSS Distributions	for (i=0; i<argc; i++) {
217*1031c584SApple OSS Distributions		printf("\ta.a_%s = _%s;\n", argname[i], argname[i]);
218*1031c584SApple OSS Distributions	}
219*1031c584SApple OSS Distributions	if (toupper(ubc) == "UBC") {
220*1031c584SApple OSS Distributions		printf("\t{\n\t\t" \
221*1031c584SApple OSS Distributions			"int _err;\n\t\t"   \
222*1031c584SApple OSS Distributions			"_err = VCALL(_%s%s, VOFFSET(%s), &a);\n\t\t"    \
223*1031c584SApple OSS Distributions			"return (_err);\n\t}\n}\n",
224*1031c584SApple OSS Distributions			argname[0], argname[0], arg0special, name, argname[0]);
225*1031c584SApple OSS Distributions	} else {
226*1031c584SApple OSS Distributions		printf("\treturn (VCALL(_%s%s, VOFFSET(%s), &a));\n}\n",
227*1031c584SApple OSS Distributions			argname[0], arg0special, name);
228*1031c584SApple OSS Distributions	}
229*1031c584SApple OSS Distributions}
230*1031c584SApple OSS DistributionsBEGIN	{
231*1031c584SApple OSS Distributions	arg0special="";
232*1031c584SApple OSS Distributions}
233*1031c584SApple OSS DistributionsEND	{
234*1031c584SApple OSS Distributions	printf("\n/* Special cases: */\n#include <sys/buf.h>\n#include <sys/vm.h>\n");
235*1031c584SApple OSS Distributions	argc=1;
236*1031c584SApple OSS Distributions	argtype[0]="struct buf *";
237*1031c584SApple OSS Distributions	argname[0]="bp";
238*1031c584SApple OSS Distributions	arg0special="->b_vp";
239*1031c584SApple OSS Distributions	name="vop_strategy";
240*1031c584SApple OSS Distributions	doit();
241*1031c584SApple OSS Distributions	name="VNOP_BWRITE";
242*1031c584SApple OSS Distributions	doit();
243*1031c584SApple OSS Distributions}
244*1031c584SApple OSS Distributions'"$awk_parser" | sed -e "$space_elim"
245*1031c584SApple OSS Distributions
246*1031c584SApple OSS Distributions# End stuff
247*1031c584SApple OSS Distributionsecho '
248*1031c584SApple OSS Distributions/* End of special cases. */
249*1031c584SApple OSS Distributions
250*1031c584SApple OSS Distributions#endif /* __APPLE_API_UNSTABLE */
251*1031c584SApple OSS Distributions#endif /* !_SYS_VNODE_IF_H_ */'
252*1031c584SApple OSS Distributions
253*1031c584SApple OSS Distributions#
254*1031c584SApple OSS Distributions# Redirect stdout to the C file.
255*1031c584SApple OSS Distributions#
256*1031c584SApple OSS Distributionsecho "$0: Creating $out_c" 1>&2
257*1031c584SApple OSS Distributionsexec > $out_c
258*1031c584SApple OSS Distributions
259*1031c584SApple OSS Distributions# Begin stuff
260*1031c584SApple OSS Distributionsecho "$copyright"
261*1031c584SApple OSS Distributionsecho "$warning"
262*1031c584SApple OSS Distributionsecho '
263*1031c584SApple OSS Distributions#include <sys/param.h>
264*1031c584SApple OSS Distributions#include <sys/mount.h>
265*1031c584SApple OSS Distributions#include <sys/vm.h>
266*1031c584SApple OSS Distributions#include <sys/vnode.h>
267*1031c584SApple OSS Distributions
268*1031c584SApple OSS Distributionsstruct vnodeop_desc vop_default_desc = {
269*1031c584SApple OSS Distributions	.vdesc_offset = 0,
270*1031c584SApple OSS Distributions	.vdesc_name = "default",
271*1031c584SApple OSS Distributions	.vdesc_flags = 0,
272*1031c584SApple OSS Distributions	.vdesc_vp_offsets = NULL,
273*1031c584SApple OSS Distributions	.vdesc_vpp_offset = VDESC_NO_OFFSET,
274*1031c584SApple OSS Distributions	.vdesc_cred_offset = VDESC_NO_OFFSET,
275*1031c584SApple OSS Distributions	.vdesc_proc_offset = VDESC_NO_OFFSET,
276*1031c584SApple OSS Distributions	.vdesc_componentname_offset = VDESC_NO_OFFSET,
277*1031c584SApple OSS Distributions	.vdesc_context_offset = VDESC_NO_OFFSET,
278*1031c584SApple OSS Distributions	.vdesc_transports = NULL,
279*1031c584SApple OSS Distributions};
280*1031c584SApple OSS Distributions'
281*1031c584SApple OSS Distributions
282*1031c584SApple OSS Distributions# Body stuff
283*1031c584SApple OSS Distributionssed -e "$sed_prep" $src | $awk '
284*1031c584SApple OSS Distributionsfunction do_offset(typematch) {
285*1031c584SApple OSS Distributions	for (i=0; i<argc; i++) {
286*1031c584SApple OSS Distributions		if (argtype[i] == typematch) {
287*1031c584SApple OSS Distributions			printf("\tVOPARG_OFFSETOF(struct %s_args, a_%s),\n",
288*1031c584SApple OSS Distributions				name, argname[i]);
289*1031c584SApple OSS Distributions			return i;
290*1031c584SApple OSS Distributions		};
291*1031c584SApple OSS Distributions	};
292*1031c584SApple OSS Distributions	print "\tVDESC_NO_OFFSET,";
293*1031c584SApple OSS Distributions	return -1;
294*1031c584SApple OSS Distributions}
295*1031c584SApple OSS Distributions
296*1031c584SApple OSS Distributionsfunction doit() {
297*1031c584SApple OSS Distributions	# Define offsets array
298*1031c584SApple OSS Distributions	printf("\nint %s_vp_offsets[] = {\n", name);
299*1031c584SApple OSS Distributions	for (i=0; i<argc; i++) {
300*1031c584SApple OSS Distributions		if (argtype[i] == "struct vnode *") {
301*1031c584SApple OSS Distributions			printf ("\tVOPARG_OFFSETOF(struct %s_args,a_%s),\n",
302*1031c584SApple OSS Distributions				name, argname[i]);
303*1031c584SApple OSS Distributions		}
304*1031c584SApple OSS Distributions	}
305*1031c584SApple OSS Distributions	print "\tVDESC_NO_OFFSET";
306*1031c584SApple OSS Distributions	print "};";
307*1031c584SApple OSS Distributions	# Define F_desc
308*1031c584SApple OSS Distributions	printf("struct vnodeop_desc %s_desc = {\n", name);
309*1031c584SApple OSS Distributions	# offset
310*1031c584SApple OSS Distributions	printf ("\t0,\n");
311*1031c584SApple OSS Distributions	# printable name
312*1031c584SApple OSS Distributions	printf ("\t\"%s\",\n", name);
313*1031c584SApple OSS Distributions	# flags
314*1031c584SApple OSS Distributions	printf("\t0");
315*1031c584SApple OSS Distributions	vpnum = 0;
316*1031c584SApple OSS Distributions	for (i=0; i<argc; i++) {
317*1031c584SApple OSS Distributions		if (match(argtype[i], "struct vnode *") == 1) {
318*1031c584SApple OSS Distributions			if (willrele[i]) {
319*1031c584SApple OSS Distributions				if (argdir[i] ~ /OUT/) {
320*1031c584SApple OSS Distributions					printf(" | VDESC_VPP_WILLRELE");
321*1031c584SApple OSS Distributions				} else {
322*1031c584SApple OSS Distributions					printf(" | VDESC_VP%s_WILLRELE", vpnum);
323*1031c584SApple OSS Distributions				};
324*1031c584SApple OSS Distributions			}
325*1031c584SApple OSS Distributions		vpnum++;
326*1031c584SApple OSS Distributions		}
327*1031c584SApple OSS Distributions	}
328*1031c584SApple OSS Distributions	print ",";
329*1031c584SApple OSS Distributions	# vp offsets
330*1031c584SApple OSS Distributions	printf ("\t%s_vp_offsets,\n", name);
331*1031c584SApple OSS Distributions	# vpp (if any)
332*1031c584SApple OSS Distributions	do_offset("struct vnode **");
333*1031c584SApple OSS Distributions	# cred (if any)
334*1031c584SApple OSS Distributions	do_offset("kauth_credential_t");
335*1031c584SApple OSS Distributions	# proc (if any)
336*1031c584SApple OSS Distributions	do_offset("struct proc *");
337*1031c584SApple OSS Distributions	# componentname
338*1031c584SApple OSS Distributions	do_offset("struct componentname *");
339*1031c584SApple OSS Distributions	# transport layer information
340*1031c584SApple OSS Distributions	printf ("\tNULL,\n};\n");
341*1031c584SApple OSS Distributions}
342*1031c584SApple OSS DistributionsEND	{
343*1031c584SApple OSS Distributions	printf("\n/* Special cases: */\n");
344*1031c584SApple OSS Distributions	argc=1;
345*1031c584SApple OSS Distributions	argdir[0]="IN";
346*1031c584SApple OSS Distributions	argtype[0]="struct buf *";
347*1031c584SApple OSS Distributions	argname[0]="bp";
348*1031c584SApple OSS Distributions	willrele[0]=0;
349*1031c584SApple OSS Distributions	name="vop_strategy";
350*1031c584SApple OSS Distributions	doit();
351*1031c584SApple OSS Distributions	name="VNOP_BWRITE";
352*1031c584SApple OSS Distributions	doit();
353*1031c584SApple OSS Distributions}
354*1031c584SApple OSS Distributions'"$awk_parser" | sed -e "$space_elim"
355*1031c584SApple OSS Distributions
356*1031c584SApple OSS Distributions# End stuff
357*1031c584SApple OSS Distributionsecho '
358*1031c584SApple OSS Distributions/* End of special cases. */'
359*1031c584SApple OSS Distributions
360*1031c584SApple OSS Distributions# Add the vfs_op_descs array to the C file.
361*1031c584SApple OSS Distributions# Begin stuff
362*1031c584SApple OSS Distributionsecho '
363*1031c584SApple OSS Distributionsstruct vnodeop_desc *vfs_op_descs[] = {
364*1031c584SApple OSS Distributions	&vop_default_desc,	/* MUST BE FIRST */
365*1031c584SApple OSS Distributions	&vop_strategy_desc,	/* XXX: SPECIAL CASE */
366*1031c584SApple OSS Distributions	&VNOP_BWRITE_desc,	/* XXX: SPECIAL CASE */
367*1031c584SApple OSS Distributions'
368*1031c584SApple OSS Distributions
369*1031c584SApple OSS Distributions# Body stuff
370*1031c584SApple OSS Distributionssed -e "$sed_prep" $src | $awk '
371*1031c584SApple OSS Distributionsfunction doit() {
372*1031c584SApple OSS Distributions	printf("\t&%s_desc,\n", name);
373*1031c584SApple OSS Distributions}
374*1031c584SApple OSS Distributions'"$awk_parser"
375*1031c584SApple OSS Distributions
376*1031c584SApple OSS Distributions# End stuff
377*1031c584SApple OSS Distributionsecho '	NULL
378*1031c584SApple OSS Distributions};
379*1031c584SApple OSS Distributions'
380*1031c584SApple OSS Distributions
381*1031c584SApple OSS Distributionsexit 0
382*1031c584SApple OSS Distributions
383*1031c584SApple OSS Distributions# Local Variables:
384*1031c584SApple OSS Distributions# tab-width: 4
385*1031c584SApple OSS Distributions# End:
386