5 %::const = map { $_ => 1 } (
13 open(CONST, shift) or die "failed to open constants list: $!";
17 die "invalid constant name: \"$_\"" unless /^XCB[A-Za-z0-9_]*$/;
28 return "uint$1_t" if /^CARD(8|16|32)$/;
29 return "int$1_t" if /^INT(8|16|32)$/;
30 return "uint8_t" if $_ eq 'BOOL' or $_ eq 'BYTE';
31 return $_ if /_/ or !/^XCB(.+)/;
32 my $const = defined $::const{$_};
41 s/[A-Z](?:[A-Z0-9]*|[a-z0-9]*)(?=[A-Z]|$)/"_" . ($abbr{$&} or lc($&))/eg;
43 return "XCB" . uc($_) if $const;
45 $_ .= "_t" unless $fun or /_id$/;
50 s/([_A-Za-z][_A-Za-z0-9]*)([ \t]*\()?/convert($1, defined $2) . ($2 or "")/eg;