]>
git.saurik.com Git - apple/xnu.git/blob - bsd/miscfs/devfs/reproto.sh
3 # This used to be a shell script, but had to become more sophisticated
4 # to allow for KNF function definitions. So rewrote in perl, but wrapped
7 exec /usr
/bin
/perl
<< *EOF
*
8 open
(PROTO
, ">devfs_proto.h") || die
"Cannot open devfs_proto.h\n";
12 " * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved.\n" .
14 " * \@APPLE_OSREFERENCE_LICENSE_HEADER_START\@\n" .
16 " * The contents of this file constitute Original Code as defined in and\n" .
17 " * are subject to the Apple Public Source License Version 1.1 (the\n" .
18 " * \"License\"). You may not use this file except in compliance with the\n" .
19 " * License. Please obtain a copy of the License at\n" .
20 " * http://www.apple.com/publicsource and read it before using this file.\n" .
22 " * This Original Code and all software distributed under the License are\n" .
23 " * distributed on an \"AS IS\" basis, WITHOUT WARRANTY OF ANY KIND, EITHER\n" .
24 " * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,\n" .
25 " * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,\n" .
26 " * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the\n" .
27 " * License for the specific language governing rights and limitations\n" .
28 " * under the License.\n" .
30 " * \@APPLE_OSREFERENCE_LICENSE_HEADER_END\@\n" .
33 print PROTO
"/* THIS FILE HAS BEEN PRODUCED AUTOMATICALLY */\n";
35 print PROTO
"#ifndef __DEVFS_DEVFS_PROTO_H__\n";
36 print PROTO
"#define __DEVFS_DEVFS_PROTO_H__\n";
37 print PROTO
"\n#include <sys/appleapiopts.h>\n";
38 print PROTO
"\n#ifdef __APPLE_API_PRIVATE\n";
40 while (\
$file = <*.c
>) {
41 if(open
(F
, \
$file) == 0) {
42 warn
"Cannot open \$file.\n";
51 } elsif
(\
$collecting) {
53 \
$text[\
$idx - 1] .
= ';';
54 for (\
$i = 0; \
$i < \
$idx; \
$i++) {
55 print PROTO
"\$text[\$i]";
56 print PROTO \
$i == 0?
"\t": "\n";
61 \
$text[\
$idx++] = \
$_;
67 print PROTO
"\n#endif /* __APPLE_API_PRIVATE */\n";
68 print PROTO
"#endif /* __DEVFS_DEVFS_PROTO_H__ */\n";
70 print PROTO
"/* THIS FILE PRODUCED AUTOMATICALLY */\n" .
71 "/* DO NOT EDIT (see reproto.sh) */\n";