sbsv1_os/e32toolp/genutil/conv_khronos_openvg_hdr_to_cpp.pl
changeset 3 3c318bb9d9cf
parent 0 83f4b4db085c
child 17 849005a0b183
equal deleted inserted replaced
2:fee529991771 3:3c318bb9d9cf
    60 
    60 
    61 sub generateStubImplementation()
    61 sub generateStubImplementation()
    62   {
    62   {
    63     @lines = <INFILE>;
    63     @lines = <INFILE>;
    64     my $s = "";
    64     my $s = "";
    65     foreach (@lines) {
    65     foreach my $line (@lines) {
    66       # Find function prototype lines
    66       # Find function prototype lines
    67       if (/^VG[U]?_API_CALL/ || length($s) != 0) {
    67       if ($line =~ /^VG[U]?_API_CALL/ || length($s) != 0) {
    68 	    $s = $s.$_;
    68       $line =~ s/^VG[U]?_API_CALL/EXPORT_C/;
    69 		if (/;/) {
    69 	    $s = $s.$line;
       
    70 		if ($line =~ /;/) {
    70 		  # Convert the function prototype into a stub function definition
    71 		  # Convert the function prototype into a stub function definition
    71 		  $s =~ s/\;$/ { }/;
    72 		  $s =~ s/\;$/ { }/;
    72 		  # Record the stub functions.  There will be a stub implementation
    73 		  # Record the stub functions.  There will be a stub implementation
    73 		  # file which includes these stub functions.  This ensures we never
    74 		  # file which includes these stub functions.  This ensures we never
    74 		  # accidentally miss a new function added to the header file supplied
    75 		  # accidentally miss a new function added to the header file supplied