]>
git.saurik.com Git - apple/xnu.git/blob - bsd/miscfs/devfs/reproto.sh
facf5f8ab21174da578273f35302a9e098ffdb30
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_LICENSE_OSREFERENCE_HEADER_START\@\n" .
16 " * This file contains Original Code and/or Modifications of Original Code\n" .
17 " * as defined in and that are subject to the Apple Public Source License\n" .
18 " * Version 2.0 (the \"License\"). You may not use this file except in\n" .
19 " * compliance with the License. The rights granted to you under the\n" .
20 " * License may not be used to create, or enable the creation or\n" .
21 " * redistribution of, unlawful or unlicensed copies of an Apple operating\n" .
22 " * system, or to circumvent, violate, or enable the circumvention or\n" .
23 " * violation of, any terms of an Apple operating system software license\n" .
26 " * Please obtain a copy of the License at\n" .
27 " * http://www.opensource.apple.com/apsl/ and read it before using this\n" .
30 " * The Original Code and all software distributed under the License are\n" .
31 " * distributed on an \"AS IS\" basis, WITHOUT WARRANTY OF ANY KIND, EITHER\n" .
32 " * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,\n" .
33 " * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,\n" .
34 " * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.\n" .
35 " * Please see the License for the specific language governing rights and\n" .
36 " * limitations under the License.\n" .
38 " * \@APPLE_LICENSE_OSREFERENCE_HEADER_END\@\n" .
41 print PROTO
"/* THIS FILE HAS BEEN PRODUCED AUTOMATICALLY */\n";
43 print PROTO
"#ifndef __DEVFS_DEVFS_PROTO_H__\n";
44 print PROTO
"#define __DEVFS_DEVFS_PROTO_H__\n";
45 print PROTO
"\n#include <sys/appleapiopts.h>\n";
46 print PROTO
"\n#ifdef __APPLE_API_PRIVATE\n";
48 while (\
$file = <*.c
>) {
49 if(open
(F
, \
$file) == 0) {
50 warn
"Cannot open \$file.\n";
59 } elsif
(\
$collecting) {
61 \
$text[\
$idx - 1] .
= ';';
62 for (\
$i = 0; \
$i < \
$idx; \
$i++) {
63 print PROTO
"\$text[\$i]";
64 print PROTO \
$i == 0?
"\t": "\n";
69 \
$text[\
$idx++] = \
$_;
75 print PROTO
"\n#endif /* __APPLE_API_PRIVATE */\n";
76 print PROTO
"#endif /* __DEVFS_DEVFS_PROTO_H__ */\n";
78 print PROTO
"/* THIS FILE PRODUCED AUTOMATICALLY */\n" .
79 "/* DO NOT EDIT (see reproto.sh) */\n";