sbsv1_os/e32toolp/genutil/conv_khronos_openvg_hdr_to_cpp.pl
branchRCL_3
changeset 73 22bdd8a90cc4
parent 18 99082257a271
child 76 2b4ec55c802e
equal deleted inserted replaced
62:7416fe50a180 73:22bdd8a90cc4
    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