31
|
1 |
#
|
|
2 |
# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
# All rights reserved.
|
|
4 |
# This component and the accompanying materials are made available
|
|
5 |
# under the terms of "Eclipse Public License v1.0"
|
|
6 |
# which accompanies this distribution, and is available
|
|
7 |
# at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
8 |
#
|
|
9 |
# Initial Contributors:
|
|
10 |
# Nokia Corporation - initial contribution.
|
|
11 |
#
|
|
12 |
# Contributors:
|
|
13 |
#
|
|
14 |
# Description:
|
|
15 |
#
|
|
16 |
#!C:\Perl\bin
|
|
17 |
|
|
18 |
&do_c_header;
|
|
19 |
#&do_cpp_header;
|
|
20 |
|
|
21 |
|
|
22 |
|
|
23 |
#end of sub calls
|
|
24 |
|
|
25 |
|
|
26 |
sub do_c_header
|
|
27 |
{
|
|
28 |
$l1="/** \
|
|
29 |
\@file FILENAME \
|
|
30 |
\@internalComponent \
|
|
31 |
*/";
|
|
32 |
|
|
33 |
$infile = "ls.txt";
|
|
34 |
#$logfile = "sample.dosc";
|
|
35 |
$cmd = "ls *.h > ls.txt";
|
|
36 |
$cmd2 = "rm ls.txt";
|
|
37 |
|
|
38 |
#open(LOGFILE, ">$logfile");
|
|
39 |
|
|
40 |
# take dir list
|
|
41 |
system $cmd;
|
|
42 |
|
|
43 |
#open ls.txt and read lines
|
|
44 |
open(INFILE, $infile);
|
|
45 |
@lines=<INFILE>;
|
|
46 |
|
|
47 |
foreach $filename (@lines) #$filename = @lines[1];
|
|
48 |
{
|
|
49 |
#print LOGFILE "$filename\n";
|
|
50 |
$l2 = "$l1";
|
|
51 |
#print LOGFILE "-----------\n";
|
|
52 |
#print LOGFILE "$l2\n";
|
|
53 |
#print LOGFILE "----\n";
|
|
54 |
$l2 =~ s/FILENAME/$filename/; #replace FILENAME with header file name
|
|
55 |
#print LOGFILE "$l2\n";
|
|
56 |
#print LOGFILE "-----------\n";
|
|
57 |
$filename =~ s/\.h/.dosc/; #rename .h to .dosc
|
|
58 |
#print LOGFILE $filename;
|
|
59 |
|
|
60 |
open (OUTFILE, ">$filename");
|
|
61 |
print OUTFILE $l2;
|
|
62 |
close (OUTFILE);
|
|
63 |
}
|
|
64 |
|
|
65 |
|
|
66 |
#clean the ls.txt file
|
|
67 |
close (INFILE);
|
|
68 |
system $cmd2;
|
|
69 |
|
|
70 |
#print LOGFILE "$l1";
|
|
71 |
#print LOGFILE @lines;
|
|
72 |
#close (LOGFILE);
|
|
73 |
}
|
|
74 |
|
|
75 |
sub do_cpp_header
|
|
76 |
{
|
|
77 |
$l1="/** \
|
|
78 |
\@file FILENAME \
|
|
79 |
\@internalComponent \
|
|
80 |
*/";
|
|
81 |
|
|
82 |
$infile = "ls.txt";
|
|
83 |
#$logfile = "sample.dosc";
|
|
84 |
$cmd = "ls | grep -v \\. > ls.txt";
|
|
85 |
$cmd2 = "rm ls.txt";
|
|
86 |
|
|
87 |
#open(LOGFILE, ">$logfile");
|
|
88 |
|
|
89 |
# take dir list
|
|
90 |
system $cmd;
|
|
91 |
|
|
92 |
#open ls.txt and read lines
|
|
93 |
open(INFILE, $infile);
|
|
94 |
@lines=<INFILE>;
|
|
95 |
|
|
96 |
foreach $filename (@lines) #$filename = @lines[1];
|
|
97 |
{
|
|
98 |
#print "$filename\n";
|
|
99 |
$l2 = "$l1";
|
|
100 |
$l2 =~ s/FILENAME/$filename/; #replace FILENAME with header file name
|
|
101 |
#print LOGFILE "-----------\n";
|
|
102 |
#print "$l2\n";
|
|
103 |
#print LOGFILE "----\n";
|
|
104 |
|
|
105 |
#print LOGFILE "$l2\n";
|
|
106 |
#print LOGFILE "-----------\n";
|
|
107 |
#print LOGFILE $filename;
|
|
108 |
$filename =~ s/\n/\.dosc/;
|
|
109 |
#print "$filename\n";
|
|
110 |
|
|
111 |
open (OUTFILE, ">$filename");
|
|
112 |
print OUTFILE $l2;
|
|
113 |
close (OUTFILE);
|
|
114 |
}
|
|
115 |
|
|
116 |
#clean the ls.txt file
|
|
117 |
close (INFILE);
|
|
118 |
# system $cmd2;
|
|
119 |
|
|
120 |
#print LOGFILE "$l1";
|
|
121 |
#print LOGFILE @lines;
|
|
122 |
#close (LOGFILE);
|
|
123 |
}
|
|
124 |
|
|
125 |
|
|
126 |
|
|
127 |
|
|
128 |
|
|
129 |
|
|
130 |
|