ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/W11/wrap/mkproxy.pl
Revision: 1.1
Committed: Mon Nov 24 17:28:08 2003 UTC (20 years, 7 months ago) by pcg
Content type: text/plain
Branch: MAIN
CVS Tags: rel-7_0, post_menubar_removal, rel-6_2, rel-6_3, rel-6_0, rel-6_1, rel-2_1_0, rel-5_5, rel-5_4, rel-5_7, rel-5_1, rel-5_0, rel-5_3, rel-5_2, rel-4_4, rel-4_6, rel-4_7, rel-5_9, rel-5_8, rel-4_2, rel-4_3, rel-3_7, rel-3_8, rel-3_5, rel-3_4, rel-3_3, rel-3_2, rel-2_8, rel-3_0, rel-4_0, rel-2_4, rel-2_5, rel-2_2, rel-2_3, rel-2_0, rel-4_1, rel-1-9, rel-1-3, rel-1-2, rxvt-2-0, rel-1_9, rel-3_6, rel-2_7, rel-4_8, rel-4_9
Log Message:
*** empty log message ***

File Contents

# Content
1 #! perl
2
3 $file = join("",<>);
4 $file=~s/[^\000]+\/\* functions \*\///;
5 $file=~s/#endif\s+$//;
6 foreach my $def (split(/\s*;\s*/,$file))
7 {
8 $def =~ s/\s+/ /g;
9 my $paren = ($def=~s/\(([^\(\)]*)\)\s*//)?$1:'';
10 my $type = ($def=~s/^([^\000]*\s+\*?)//)?$1:'';
11 $type=~s/^\s+//;
12 $type=~s/\s+$//;
13 push(@list,{def=>$def,type=>$type,paren=>$paren});
14 }
15 foreach my $s (sort {$a->{def} cmp $b->{def}} @list)
16 {
17 my $def = $s->{def};
18 my $type = $s->{type};
19 my $paren=$s->{paren};
20 my $params = $paren;
21 $params=~s/[\[\]\*]//g;
22 $params=~s/\s+,/,/g;
23 $params=~s/[^,\s]+\s+//g;
24 next if ($params =~ /\.\.\./);
25 next if ($def eq 'XOpenDisplay');
26 my $return = $type eq 'void' ? '':'return ';
27 print "
28 typedef $type (proto_$def)($paren);
29 static proto_$def *func_$def = NULL;
30 $type $def($paren) {
31 if (!func_$def) func_$def=(proto_$def *)_loadfunc(\"$def\");
32 $return(func_$def)($params);
33 }
34 ";
35
36 }