From be0db30b9482f915d3bfcc68cdd59bce073581b5 Mon Sep 17 00:00:00 2001 From: nobody Date: Fri, 25 May 2001 19:29:39 +0000 Subject: This commit was manufactured by cvs2svn to create tag 'LIBGLADE_1_BEFORE_AUTOCONF_1_52'. svn path=/tags/LIBGLADE_1_BEFORE_AUTOCONF_1_52/; revision=9995 --- libical/scripts/mkderivedproperties.pl | 217 --------------------------------- 1 file changed, 217 deletions(-) delete mode 100755 libical/scripts/mkderivedproperties.pl (limited to 'libical/scripts/mkderivedproperties.pl') diff --git a/libical/scripts/mkderivedproperties.pl b/libical/scripts/mkderivedproperties.pl deleted file mode 100755 index 4e011e112e..0000000000 --- a/libical/scripts/mkderivedproperties.pl +++ /dev/null @@ -1,217 +0,0 @@ -#!/usr/local/bin/perl - -require "readvaluesfile.pl"; - -use Getopt::Std; -getopts('chspmi:'); - -# ARG 0 is properties.csv -%propmap = read_properties_file($ARGV[0]); - -# ARG 1 is value-types.txt -%valuemap = read_values_file($ARGV[1]); - - -# Write the file inline by copying everything before a demarcation -# line, and putting the generated data after the demarcation - -if ($opt_i) { - - open(IN,$opt_i) || die "Can't open input file $opt_i"; - - while(){ - - if (/Do not edit/){ - last; - } - - print; - - } - - print "/* Everything below this line is machine generated. Do not edit. */\n"; - - -} - -sub fudge_data { - my $prop = shift; - - my $value = $propmap{$prop}->{'lic_value'}; - - if (!$value){ - die "Can't find value for property \"$prop\"\n"; - } - my $ucf = join("",map {ucfirst(lc($_));} split(/-/,$prop)); - my $lc = lc($ucf); - my $uc = uc($lc); - - my $ucfvalue = join("",map {ucfirst(lc($_));} split(/-/,$value)); - my $lcvalue = lc($ucfvalue); - my $ucvalue = uc($lcvalue); - - my $type = $valuemap{$value}->{C}->[1]; - - return ($uc,$lc,$lcvalue,$ucvalue,$type); - -} - -# Create the property map data -if($opt_c){ - - print "static struct icalproperty_map property_map[] = {\n"; - - foreach $prop (sort keys %propmap) { - - next if !$prop; - - next if $prop eq 'NO'; - - my ($uc,$lc,$lcvalue,$ucvalue,$type) = fudge_data($prop); - - print "{ICAL_${uc}_PROPERTY,\"$prop\",ICAL_${ucvalue}_VALUE},\n"; - - } - - $prop = "NO"; - - my ($uc,$lc,$lcvalue,$ucvalue,$type) = fudge_data($prop); - - print "{ICAL_${uc}_PROPERTY,\"\",ICAL_NO_VALUE}};\n\n"; - - - print "static struct icalproperty_enum_map enum_map[] = {\n"; - - $idx = 10000; - - foreach $value (sort keys %valuemap) { - - next if !$value; - next if $value eq 'NO' or $prop eq 'ANY'; - - my $ucv = join("",map {uc(lc($_));} split(/-/,$value)); - my @enums = @{$valuemap{$value}->{'enums'}}; - - if(@enums){ - - my ($c_autogen,$c_type) = @{$valuemap{$value}->{'C'}}; - - unshift(@enums,"X"); - push(@enums,"NONE"); - - foreach $e (@enums) { - - my $uce = join("",map {uc(lc($_));} split(/-/,$e)); - - if($e ne "X" and $e ne "NONE"){ - $str = $e; - } else { - $str = ""; - } - - print " {ICAL_${ucv}_PROPERTY,ICAL_${ucv}_${uce},\"$str\" }, /*$idx*/\n"; - - $idx++; - } - - } - } - print " {ICAL_NO_PROPERTY,0,\"\"}\n};\n\n"; - - -} - - -if($opt_h){ - - # Create the property enumerations list - print "typedef enum icalproperty_kind {\n ICAL_ANY_PROPERTY = 0,\n"; - foreach $prop (sort keys %propmap) { - - next if !$prop; - - next if $prop eq 'NO' or $prop eq 'ANY'; - - my ($uc,$lc,$lcvalue,$ucvalue,$type) = fudge_data($prop); - - print " ICAL_${uc}_PROPERTY, \n"; - - } - print " ICAL_NO_PROPERTY\n} icalproperty_kind;\n\n"; - - -} - - -foreach $prop (sort keys %propmap) { - - next if !$prop; - - next if $prop eq 'NO' or $prop eq 'ANY'; - - my ($uc,$lc,$lcvalue,$ucvalue,$type) = fudge_data($prop); - - - my $pointer_check; - if ($type =~ /\*/){ - $pointer_check = "icalerror_check_arg_rz( (v!=0),\"v\");\n" if $type =~ /\*/; - } elsif ( $type eq "void" ){ - $pointer_check = "icalerror_check_arg_rv( (v!=0),\"v\");\n" if $type =~ /\*/; - - } - - my $set_pointer_check = "icalerror_check_arg_rv( (v!=0),\"v\");\n" if $type =~ /\*/; - - if($opt_c) { # Generate C source - print<