Changeset 273838 in git
- Timestamp:
- Apr 17, 1997, 4:31:30 PM (26 years ago)
- Branches:
- (u'spielwiese', '0d6b7fcd9813a1ca1ed4220cfa2b104b97a0a003')
- Children:
- 8591c5247e9885df77234d8c0f31a9ad77cf7bf9
- Parents:
- 50b2dfd4d9dbd3086efcc841c997bede4fe6b7a7
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
factory/bin/makeheader.pl
r50b2df r273838 1 1 #!/usr/bin/perl 2 # $ Id:$2 # $Id: makeheader.pl,v 1.2 1997-04-17 14:31:30 schmidt Exp $ 3 3 # 4 # makeheader - generate a header file out of several header file (ver 1.2).4 # makeheader.pl - generate a header file out of several header file (ver 1.2). 5 5 # 6 6 … … 27 27 28 28 To include a header file into the generated header file 29 \(= <outfile>) use the command `.INCLUDE <includefile>' on a 30 single line in <templatefile>. 31 This line is replaced by sections marked with /*BEGINPUBLIC*/ 32 and /*ENDPUBLIC*/ from <includefile>. <includefile> is looked up 33 in all <includedir>s, then in the current directory, then in 34 the base directory of <templatefile>.\n"; 29 \(= <outfile>) use the two lines 30 31 /*MAKEHEADER*/ 32 #include \"<includefile>\" 33 34 in <templatefile>. 35 36 If you use the alternate form 37 38 /*MAKEHEADER PUBLIC ONLY*/ 39 #include \"<includefile>\" 40 41 only sections marked with /*BEGINPUBLIC*/ and /*ENDPUBLIC*/ are 42 pasted from <includefile> into <outfile>. 43 44 <includefile> is looked up in all <includedir>s, then in the 45 current directory, then in the base directory of 46 <templatefile>.\n"; 35 47 } 36 48 … … 62 74 63 75 while( <INFILE> ) { 64 if ( /^\.INCLUDE/ ) { 65 s/^\.INCLUDE //; 66 chop; 67 $inclfile = &searchpath( $_, $includes ) || 68 die "makeheader: Can not open included file $_ for reading!\n"; 76 if ( /^\/\*MAKEHEADER(.*)\*\/$/ ) { 77 # check whether we have to read public part only 78 if ( $1 eq " PUBLIC ONLY" ) { 79 $public_only = 1; 80 } else { 81 $public_only = 0; 82 } 83 84 # get name of file to include 85 $_ = <INFILE>; chop; 86 if ( /^\#include \"(.*)\"$/ ) { 87 $inclfile = $1; 88 } else { 89 die "makeheader: $_ is not a valid include directive!\n"; 90 } 91 92 $inclfile = &searchpath( $inclfile, $includes ) || 93 die "makeheader: Can not open included file $inclfile for reading!\n"; 69 94 open( INCLFILE, $inclfile ) || 70 die "makeheader: Can not open included file $ _for reading!\n";95 die "makeheader: Can not open included file $inclfile for reading!\n"; 71 96 72 print OUTFILE "/* Stuff from $_ */"; 73 while ( <INCLFILE> ) { 74 if ( /\/\*BEGINPUBLIC\*\// ) { 75 while ( <INCLFILE> ) { 76 last if ( /\/\*ENDPUBLIC\*\// ); 77 print OUTFILE $_; 97 print OUTFILE "\n/* Stuff included from $inclfile */\n"; 98 if ( $public_only ) { 99 # read public part only 100 while ( <INCLFILE> ) { 101 if ( /^\/\*BEGINPUBLIC\*\/$/ ) { 102 while ( <INCLFILE> ) { 103 last if ( /^\/\*ENDPUBLIC\*\/$/ ); 104 print OUTFILE $_; 105 } 78 106 } 79 107 } 108 } else { 109 # just paste contents into output 110 while ( <INCLFILE> ) { print OUTFILE $_; } 80 111 } 81 112 close INCLFILE;
Note: See TracChangeset
for help on using the changeset viewer.