Merge gstvideotemplate.h into gstvideotemplate.c
[platform/upstream/gst-plugins-good.git] / gst / videofilter / make_filter
1 #!/usr/bin/perl
2 #
3
4 if(scalar(@ARGV) < 1){
5         print "$0 Objectname\n";
6         print "  creates gstobjectname.{c,h} implementing GstObjectname,\n";
7         print "  subclassing GstVideofilter.\n";
8         exit(0);
9 }
10
11 $Template = $ARGV[0];
12 ($TEMPLATE = $Template) =~ tr/a-z/A-Z/;
13 ($template = $Template) =~ tr/A-Z/a-z/;
14
15 open IN, "gstvideotemplate.c";
16 open OUT, ">gst$template.c";
17
18 @lines = <IN>;
19 map { 
20         s/gstvideotemplate\.c/SOURCEFILE/g;
21         s/Videotemplate/$Template/g;
22         s/videotemplate/$template/g;
23         s/VIDEOTEMPLATE/$TEMPLATE/g;
24         # remember to break up the Id: in the line below
25         s/\$I[d]: (.*)\$/$1/g;
26         s/SOURCEFILE/gstvideotemplate\.c/g;
27 } @lines;
28
29 print OUT @lines;
30
31 close IN;
32 close OUT;
33