aboutsummaryrefslogtreecommitdiffstats
path: root/libical/scripts
diff options
context:
space:
mode:
authorJP Rosevear <jpr@src.gnome.org>2003-11-19 00:33:30 +0800
committerJP Rosevear <jpr@src.gnome.org>2003-11-19 00:33:30 +0800
commit58f1b46675ef29528f51e5c44fe0e087bda5d82d (patch)
tree725648cf84182762d9dc2ac5846b233203411d59 /libical/scripts
parentb47685534d7e5738d712962334537bb329831b9e (diff)
downloadgsoc2013-evolution-58f1b46675ef29528f51e5c44fe0e087bda5d82d.tar
gsoc2013-evolution-58f1b46675ef29528f51e5c44fe0e087bda5d82d.tar.gz
gsoc2013-evolution-58f1b46675ef29528f51e5c44fe0e087bda5d82d.tar.bz2
gsoc2013-evolution-58f1b46675ef29528f51e5c44fe0e087bda5d82d.tar.lz
gsoc2013-evolution-58f1b46675ef29528f51e5c44fe0e087bda5d82d.tar.xz
gsoc2013-evolution-58f1b46675ef29528f51e5c44fe0e087bda5d82d.tar.zst
gsoc2013-evolution-58f1b46675ef29528f51e5c44fe0e087bda5d82d.zip
Remove libical from this tree, it resides in e-d-s now.
svn path=/trunk/; revision=23417
Diffstat (limited to 'libical/scripts')
-rw-r--r--libical/scripts/.cvsignore6
-rw-r--r--libical/scripts/Makefile.am9
-rwxr-xr-xlibical/scripts/mkderivedcomponents.pl170
-rwxr-xr-xlibical/scripts/mkderivedparameters.pl332
-rwxr-xr-xlibical/scripts/mkderivedproperties.pl258
-rwxr-xr-xlibical/scripts/mkderivedvalues.pl232
-rw-r--r--libical/scripts/mkinclude.sh39
-rwxr-xr-xlibical/scripts/mkneticali.pl99
-rwxr-xr-xlibical/scripts/mkparameterrestrictions.pl85
-rwxr-xr-xlibical/scripts/mkrestrictionrecords.pl109
-rwxr-xr-xlibical/scripts/mkrestrictiontable.pl98
-rw-r--r--libical/scripts/readvaluesfile.pl133
12 files changed, 0 insertions, 1570 deletions
diff --git a/libical/scripts/.cvsignore b/libical/scripts/.cvsignore
deleted file mode 100644
index dc4caac801..0000000000
--- a/libical/scripts/.cvsignore
+++ /dev/null
@@ -1,6 +0,0 @@
-Makefile.in
-Makefile
-.deps
-.libs
-*.lo
-*.la
diff --git a/libical/scripts/Makefile.am b/libical/scripts/Makefile.am
deleted file mode 100644
index c61eaefdce..0000000000
--- a/libical/scripts/Makefile.am
+++ /dev/null
@@ -1,9 +0,0 @@
-EXTRA_DIST = \
-mkderivedcomponents.pl \
-mkderivedparameters.pl \
-mkderivedproperties.pl \
-mkderivedvalues.pl \
-mkparameterrestrictions.pl \
-mkrestrictionrecords.pl \
-mkrestrictiontable.pl \
-readvaluesfile.pl
diff --git a/libical/scripts/mkderivedcomponents.pl b/libical/scripts/mkderivedcomponents.pl
deleted file mode 100755
index 31743c3ba3..0000000000
--- a/libical/scripts/mkderivedcomponents.pl
+++ /dev/null
@@ -1,170 +0,0 @@
-#!/usr/bin/env perl
-
-use Getopt::Std;
-getopts('chspi:');
-
-
-# ARG 0 is components.txt
-open(PV,"$ARGV[0]") || die "Can't open components file $ARGV[0]:$!";
-
-my @components;
-
-while (<PV>){
-
- s/#.*//;
-
- chop;
-
- push(@components,$_);
-
-}
-
-close PV;
-
-# 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(<IN>){
-
- if (/Do not edit/){
- last;
- }
-
- print;
-
- }
-
- if($opt_i){
- print "# Everything below this line is machine generated. Do not edit. \n";
- } else {
- print "/* Everything below this line is machine generated. Do not edit. */\n";
- }
-
-}
-
-if ($opt_c or $opt_h and !$opt_i){
-
-print <<EOM;
-/* -*- Mode: C -*-
- ======================================================================
- FILE: icalderivedproperties.{c,h}
- CREATOR: eric 09 May 1999
-
- \044Id:\044
-
- (C) COPYRIGHT 1999 Eric Busboom
- http://www.softwarestudio.org
-
- The contents of this file are subject to the Mozilla Public License
- Version 1.0 (the "License"); you may not use this file except in
- compliance with the License. You may obtain a copy of the License at
- http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS IS"
- basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- the License for the specific language governing rights and
- limitations under the License.
-
-
- ======================================================================*/
-
-/*
- * THIS FILE IS MACHINE GENERATED DO NOT EDIT
- */
-
-#include <stdarg.h> /* for va_arg functions */
-
-EOM
-
-}
-
-if ($opt_p and !$opt_i){
-
-print <<EOM;
-
-EOM
-
-}
-
-
-foreach $comp (@components) {
-
- next if !$comp;
-
- my $ucf = join("",map {ucfirst(lc($_));} split(/-/,$comp));
- my $lc = lc($ucf);
- my $uc = uc($lc);
-
- if($opt_c) { # Make C source
- print<<EOM;
-
-/* $comp */
-
-icalcomponent* icalcomponent_new_${lc}()
-{
- return (icalcomponent*)icalcomponent_new_impl(ICAL_${uc}_COMPONENT);
-}
-
-icalcomponent* icalcomponent_vanew_${lc}(...)
-{
- va_list args;
- struct icalcomponent_impl *impl = icalcomponent_new_impl(ICAL_${uc}_component);
-
- va_start(args,v);
- icalcomponent_add_properties(impl, args);
- va_end(args);
-
- return (icalcomponent*)impl;
-}
-
-EOM
-
-
- } elsif ($opt_h) { # Make a C header
- print<<EOM;
-
-/* $comp */
-icalcomponent* icalcomponent_new_${lc}();
-icalcomponent* icalcomponent_vanew_${lc}(...);
-EOM
-
-} elsif ($opt_s) { # Make something for a switch statement
-
-print <<EOM;
-case ICAL_${uc}_PROPERTY:
-EOM
-
-} elsif ($opt_p) { # make perl source
-
-print <<EOM;
-
-# $comp
-package Net::ICal::Component::${ucf};
-\@ISA=qw(Net::ICal::Component);
-
-sub new
-{
- my \$package = shift;
- my \$c = Net::ICal::icalcomponent_new(\$Net::ICal::ICAL_${uc}_COMPONENT);
-
- my \$self = Net::ICal::Component::new_from_ref(\$c);
- Net::ICal::Component::_add_elements(\$self,\\\@_);
-
- # Self is blessed in new_from_ref
-
- return \$self;
-
-}
-EOM
-
-}
-
-
-
-}
-
-
diff --git a/libical/scripts/mkderivedparameters.pl b/libical/scripts/mkderivedparameters.pl
deleted file mode 100755
index 5439509aa8..0000000000
--- a/libical/scripts/mkderivedparameters.pl
+++ /dev/null
@@ -1,332 +0,0 @@
-#!/usr/bin/env perl
-
-require "readvaluesfile.pl";
-
-use Getopt::Std;
-getopts('chspi:');
-
-%no_xname = (RELATED=>1,RANGE=>1,RSVP=>1,XLICERRORTYPE=>1,XLICCOMPARETYPE=>1);
-
-%params = read_parameters_file($ARGV[0]);
-
-
-# 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(<IN>){
- if (/<insert_code_here>/){
- insert_code();
- } else {
- print;
- }
-
- }
-
- if($opt_p){
- print "# Everything below this line is machine generated. Do not edit. \n";
- } else {
- print "/* Everything below this line is machine generated. Do not edit. */\n";
- }
-
-}
-
-sub insert_code
-{
-
-# Write parameter enumerations and datatypes
-
-if($opt_h){
- print "typedef enum icalparameter_kind {\n ICAL_ANY_PARAMETER = 0,\n";
- foreach $param (sort keys %params) {
-
- next if !$param;
-
- next if $param eq 'NO' or $param eq 'ANY';
-
- my $uc = join("",map {uc($_);} split(/-/,$param));
-
- my @enums = @{$params{$param}->{'enums'}};
-
- print " ICAL_${uc}_PARAMETER, \n";
-
- }
- print " ICAL_NO_PARAMETER\n} icalparameter_kind;\n\n";
-
- # Now create enumerations for parameter values
- $idx = 20000;
-
- print "#define ICALPARAMETER_FIRST_ENUM $idx\n\n";
-
- foreach $param (sort keys %params) {
-
- next if !$param;
-
- next if $param eq 'NO' or $prop eq 'ANY';
-
- my $type = $params{$param}->{"C"};
- my $ucv = join("",map {uc(lc($_));} split(/-/,$param));
- my @enums = @{$params{$param}->{'enums'}};
-
- if(@enums){
-
- print "typedef enum $type {\n";
- my $first = 1;
-
- unshift(@enums,"X");
-
- push(@enums,"NONE");
-
- foreach $e (@enums) {
- if (!$first){
- print ",\n";
- } else {
- $first = 0;
- }
-
- my $uce = join("",map {uc(lc($_));} split(/-/,$e));
-
- print " ICAL_${ucv}_${uce} = $idx";
-
- $idx++;
- }
- $c_type =~ s/enum //;
-
- print "\n} $type;\n\n";
- }
- }
-
- print "#define ICALPARAMETER_LAST_ENUM $idx\n\n";
-
-}
-
-if ($opt_c){
-
-
- # Create the icalparameter_value to icalvalue_kind conversion table
- my $count = 0;
- my $out;
-
- foreach $enum (@{$params{'VALUE'}->{'enums'}}){
- next if $enum eq 'NO' or $enum eq 'ERROR';
- $uc = join("",map {uc(lc($_));} split(/-/,$enum));
- $out.=" {ICAL_VALUE_${uc},ICAL_${uc}_VALUE},\n";
- $count++;
- }
-
- $count+=2;
- print "static struct icalparameter_value_kind_map value_kind_map[$count] = {\n";
- print $out;
- print " {ICAL_VALUE_X,ICAL_X_VALUE},\n";
- print " {ICAL_VALUE_NONE,ICAL_NO_VALUE}\n};\n\n";
-
- #Create the parameter Name map
-
- $out="";
- $count=0;
- foreach $param (sort keys %params) {
-
- next if !$param;
-
- next if $param eq 'NO' or $prop eq 'ANY';
-
- my $lc = join("",map {lc($_);} split(/-/,$param));
- my $uc = join("",map {uc(lc($_));} split(/-/,$param));
-
- $count++;
- $out.=" {ICAL_${uc}_PARAMETER,\"$param\"},\n";
-
- }
- $count+=1;
- print "static struct icalparameter_kind_map parameter_map[$count] = { \n";
- print $out;
- print " { ICAL_NO_PARAMETER, \"\"}\n};\n\n";
-
- # Create the parameter value map
- $out ="";
- $count=0;
- foreach $param (sort keys %params) {
-
- next if !$param;
-
- next if $param eq 'NO' or $prop eq 'ANY';
-
- my $type = $params{$param}->{"C"};
- my $uc = join("",map {uc(lc($_));} split(/-/,$param));
- my @enums = @{$params{$param}->{'enums'}};
-
- if(@enums){
-
- foreach $e (@enums){
- my $uce = join("",map {uc(lc($_));} split(/-/,$e));
-
- $count++;
- $out.=" {ICAL_${uc}_PARAMETER,ICAL_${uc}_${uce},\"$e\"},\n";
- }
-
- }
- }
-
- $count+=3;
- print "static struct icalparameter_map icalparameter_map[] = {\n";
- print "{ICAL_ANY_PARAMETER,0,\"\"},\n";
- print $out;
- print " {ICAL_NO_PARAMETER,0,\"\"}};\n\n";
-
-}
-
-foreach $param (keys %params){
-
- my $type = $params{$param}->{'C'};
-
- my $ucf = join("",map {ucfirst(lc($_));} split(/-/,$param));
-
- my $lc = lc($ucf);
- my $uc = uc($lc);
-
- my $charorenum;
- my $set_code;
- my $pointer_check;
- my $pointer_check_v;
- my $xrange;
-
- if ($type=~/char/ ) {
-
- $charorenum = " icalerror_check_arg_rz( (param!=0), \"param\");\n return param->string;";
-
- $set_code = "((struct icalparameter_impl*)param)->string = icalmemory_strdup(v);";
-
- $pointer_check = "icalerror_check_arg_rz( (v!=0),\"v\");";
- $pointer_check_v = "icalerror_check_arg_rv( (v!=0),\"v\");";
-
- } else {
-
- $xrange =" if (param->string != 0){\n return ICAL_${uc}_X;\n }\n" if !exists $no_xname{$uc};
-
- $charorenum= "icalerror_check_arg( (param!=0), \"param\");\n$xrange\nreturn ($type)(param->data);";
-
- $pointer_check = "icalerror_check_arg_rz(v >= ICAL_${uc}_X,\"v\");\n icalerror_check_arg_rz(v < ICAL_${uc}_NONE,\"v\");";
-
- $pointer_check_v = "icalerror_check_arg_rv(v >= ICAL_${uc}_X,\"v\");\n icalerror_check_arg_rv(v < ICAL_${uc}_NONE,\"v\");";
-
- $set_code = "((struct icalparameter_impl*)param)->data = (int)v;";
-
- }
-
-
-
- if ($opt_c) {
-
- print <<EOM;
-/* $param */
-icalparameter* icalparameter_new_${lc}($type v)
-{
- struct icalparameter_impl *impl;
- icalerror_clear_errno();
- $pointer_check
- impl = icalparameter_new_impl(ICAL_${uc}_PARAMETER);
- if (impl == 0) {
- return 0;
- }
-
- icalparameter_set_${lc}((icalparameter*) impl,v);
- if (icalerrno != ICAL_NO_ERROR) {
- icalparameter_free((icalparameter*) impl);
- return 0;
- }
-
- return (icalparameter*) impl;
-}
-
-${type} icalparameter_get_${lc}(const icalparameter* param)
-{
- icalerror_clear_errno();
-$charorenum
-}
-
-void icalparameter_set_${lc}(icalparameter* param, ${type} v)
-{
- $pointer_check_v
- icalerror_check_arg_rv( (param!=0), "param");
- icalerror_clear_errno();
-
- $set_code
-}
-
-EOM
-
- } elsif( $opt_h) {
-
- print <<EOM;
-/* $param */
-icalparameter* icalparameter_new_${lc}($type v);
-${type} icalparameter_get_${lc}(const icalparameter* value);
-void icalparameter_set_${lc}(icalparameter* value, ${type} v);
-
-EOM
-
-}
-
-if ($opt_p) {
-
- print <<EOM;
-
-# $param
-
-package Net::ICal::Parameter::${ucf};
-\@ISA=qw(Net::ICal::Parameter);
-
-sub new
-{
- my \$self = [];
- my \$package = shift;
- my \$value = shift;
-
- bless \$self, \$package;
-
- my \$p;
-
- if (\$value) {
- \$p = Net::ICal::icalparameter_new_from_string(\$Net::ICal::ICAL_${uc}_PARAMETER,\$value);
- } else {
- \$p = Net::ICal::icalparameter_new(\$Net::ICal::ICAL_${uc}_PARAMETER);
- }
-
- \$self->[0] = \$p;
-
- return \$self;
-}
-
-sub get
-{
- my \$self = shift;
- my \$impl = \$self->_impl();
-
- return Net::ICal::icalparameter_as_ical_string(\$impl);
-
-}
-
-sub set
-{
- # This is hard to implement, so I've punted for now.
- die "Set is not implemented";
-}
-
-EOM
-
-}
-
-}
-
-if ($opt_h){
-
-print <<EOM;
-#endif /*ICALPARAMETER_H*/
-
-EOM
-}
-
-}
diff --git a/libical/scripts/mkderivedproperties.pl b/libical/scripts/mkderivedproperties.pl
deleted file mode 100755
index 59ec4b6430..0000000000
--- a/libical/scripts/mkderivedproperties.pl
+++ /dev/null
@@ -1,258 +0,0 @@
-#!/usr/bin/env 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]);
-
-
-$include_vanew = 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(<IN>){
-
- if (/<insert_code_here>/){
- insert_code();
- } else {
- print;
- }
-
- }
-
-}
-
-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);
-
-}
-
-sub insert_code {
-
-# Create the property map data
-if($opt_c){
-
-
- my @props = sort keys %propmap;
- my $count = scalar(@props);
-
-
- print "static struct icalproperty_map property_map[$count] = {\n";
-
- foreach $prop (@props) {
-
- 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";
-
- $idx = 10000;
- $count = 1;
- my $out = "";
-
- 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 = "";
- }
-
- $out.=" {ICAL_${ucv}_PROPERTY,ICAL_${ucv}_${uce},\"$str\" }, /*$idx*/\n";
-
- $idx++;
- $count++;
- }
-
- }
- }
-
- $count++;
- print "static struct icalproperty_enum_map enum_map[$count] = {\n";
- print $out;
- 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
-
- if ($include_vanew) {
- print<<EOM;
-icalproperty* icalproperty_vanew_${lc}($type v, ...){
- va_list args;
- struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_${uc}_PROPERTY); $pointer_check
- icalproperty_set_${lc}((icalproperty*)impl,v);
- va_start(args,v);
- icalproperty_add_parameters(impl, args);
- va_end(args);
- return (icalproperty*)impl;
-}
-EOM
-}
- print<<EOM;
-
-/* $prop */
-icalproperty* icalproperty_new_${lc}($type v) {
- struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_${uc}_PROPERTY); $pointer_check
- icalproperty_set_${lc}((icalproperty*)impl,v);
- return (icalproperty*)impl;
-}
-
-EOM
- # Allow DTSTART, DTEND, DUE, EXDATE and RECURRENCE-ID to take DATE values.
- if ($lc eq "dtstart" || $lc eq "dtend" || $lc eq "due" || $lc eq "exdate"
- || $lc eq "recurrenceid") {
- print<<EOM;
-void icalproperty_set_${lc}(icalproperty* prop, $type v){
- icalvalue *value;
- $set_pointer_check
- icalerror_check_arg_rv( (prop!=0),"prop");
- if (v.is_date)
- value = icalvalue_new_date(v);
- else
- value = icalvalue_new_datetime(v);
- icalproperty_set_value(prop,value);
-}
-EOM
- } else {
-
- print<<EOM;
-void icalproperty_set_${lc}(icalproperty* prop, $type v){
- $set_pointer_check
- icalerror_check_arg_rv( (prop!=0),"prop");
- icalproperty_set_value(prop,icalvalue_new_${lcvalue}(v));
-}
-EOM
- }
- print<<EOM;
-$type icalproperty_get_${lc}(const icalproperty* prop){
- icalerror_check_arg( (prop!=0),"prop");
- return icalvalue_get_${lcvalue}(icalproperty_get_value(prop));
-}
-EOM
- } elsif ($opt_h) { # Generate C Header file
-
-
- print "\
-/* $prop */\
-icalproperty* icalproperty_new_${lc}($type v);\
-void icalproperty_set_${lc}(icalproperty* prop, $type v);\
-$type icalproperty_get_${lc}(const icalproperty* prop);";
-
-
-if ($include_vanew){
- print "icalproperty* icalproperty_vanew_${lc}($type v, ...);\n";
-}
-
-}
-
-
-} # This brace terminates the main loop
-
-
-
-if ($opt_h){
-
-print "\n\n#endif /*ICALPROPERTY_H*/\n"
-}
-
-}
diff --git a/libical/scripts/mkderivedvalues.pl b/libical/scripts/mkderivedvalues.pl
deleted file mode 100755
index 308a2c8ac0..0000000000
--- a/libical/scripts/mkderivedvalues.pl
+++ /dev/null
@@ -1,232 +0,0 @@
-#!/usr/bin/perl
-
-use lib '.';
-
-require 'readvaluesfile.pl';
-
-use Getopt::Std;
-getopts('chi:');
-
- #Options
- # c -> generate c code file
- # h-> generate header file
-
- # Open with value-types.txt
-
-my %h = read_values_file($ARGV[0]);
-
-
- # 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(<IN>){
- if (/<insert_code_here>/){
- insert_code();
- } else {
- print;
- }
-
-
- }
-}
-
-sub insert_code
-{
- # Map type names to the value in the icalvalue_impl data union */
-
-%union_map = (
- BOOLEAN => 'int',
- CALADDRESS=>'string',
- DATE=>'time',
- DATETIME=>'time',
- DATETIMEDATE=>'time',
- DATETIMEPERIOD=>'period',
- DURATION=>'duration',
- INTEGER=>'int',
- TEXT=>'string',
- URI=>'string',
- UTCOFFSET=>'int',
- QUERY=>'string',
- BINARY=>'string',
- X=>'string'
- );
-
-
-if($opt_h){
-
- # First print out the value enumerations
- $idx = 5000;
- print "typedef enum icalvalue_kind {\n";
- print " ICAL_ANY_VALUE=$idx,\n";
-
- foreach $value (keys %h) {
-
- $idx++;
- my $ucv = join("",map {uc(lc($_));} split(/-/,$value));
-
- next if $value eq "NO";
-
- print " ICAL_${ucv}_VALUE=$idx,\n";
- }
-
- $idx++;
- print " ICAL_NO_VALUE=$idx\n} icalvalue_kind ;\n\n";
-
- # Now create enumerations for property values
- $idx = 10000;
-
- print "#define ICALPROPERTY_FIRST_ENUM $idx\n\n";
-
- foreach $value (sort keys %h) {
-
- next if !$value;
-
- next if $value eq 'NO' or $prop eq 'ANY';
-
- my $ucv = join("",map {uc(lc($_));} split(/-/,$value));
- my @enums = @{$h{$value}->{'enums'}};
-
- if(@enums){
-
- my ($c_autogen,$c_type) = @{$h{$value}->{'C'}};
- print "typedef $c_type {\n";
- my $first = 1;
-
- unshift(@enums,"X");
-
- push(@enums,"NONE");
-
- foreach $e (@enums) {
- if (!$first){
- print ",\n";
- } else {
- $first = 0;
- }
-
- my $uce = join("",map {uc(lc($_));} split(/-/,$e));
-
- print " ICAL_${ucv}_${uce} = $idx";
-
- $idx++;
- }
-
- $c_type =~ s/enum //;
-
- print "\n} $c_type;\n\n";
- }
- }
-
- print "#define ICALPROPERTY_LAST_ENUM $idx\n\n";
-
-}
-
-
-if($opt_c){
-
- # print out the value to string map
-
- my $count = scalar(keys %h) + 1;
- print "static struct icalvalue_kind_map value_map[$count]={\n";
-
- foreach $value (keys %h) {
-
- $idx++;
- my $ucv = join("",map {uc(lc($_));} split(/-/,$value));
-
- next if $value eq "NO";
-
- print " {ICAL_${ucv}_VALUE,\"$value\"},\n";
- }
-
-
- print " {ICAL_NO_VALUE,\"\"}\n};";
-
-}
-
-
-foreach $value (keys %h) {
-
- my $autogen = $h{$value}->{C}->[0];
- my $type = $h{$value}->{C}->[1];
-
- my $ucf = join("",map {ucfirst(lc($_));} split(/-/,$value));
-
- my $lc = lc($ucf);
- my $uc = uc($lc);
-
- my $pointer_check = "icalerror_check_arg_rz( (v!=0),\"v\");\n" if $type =~ /\*/;
- my $pointer_check_rv = "icalerror_check_arg_rv( (v!=0),\"v\");\n" if $type =~ /\*/;
-
- my $assign;
-
- if ($type =~ /char/){
- $assign = "icalmemory_strdup(v);\n\n if (impl->data.v_string == 0){\n errno = ENOMEM;\n }\n";
- } else {
- $assign = "v;";
- }
-
- my $union_data;
-
- if(@{$h{$value}->{'enums'}}){
- $union_data = 'enum';
-
- } elsif (exists $union_map{$uc} ){
- $union_data=$union_map{$uc};
- } else {
- $union_data = $lc;
- }
-
- if ($opt_c && $autogen) {
-
- print "\n\n\
-icalvalue* icalvalue_new_${lc} ($type v){\
- struct icalvalue_impl* impl = icalvalue_new_impl(ICAL_${uc}_VALUE);\
- $pointer_check\
- icalvalue_set_${lc}((icalvalue*)impl,v);\
- return (icalvalue*)impl;\
-}\
-void icalvalue_set_${lc}(icalvalue* value, $type v) {\
- struct icalvalue_impl* impl; \
- icalerror_check_arg_rv( (value!=0),\"value\");\
- $pointer_check_rv\
- icalerror_check_value_type(value, ICAL_${uc}_VALUE);\
- impl = (struct icalvalue_impl*)value;\n";
-
- if( $union_data eq 'string') {
-
- print " if(impl->data.v_${union_data}!=0) {free((void*)impl->data.v_${union_data});}\n";
- }
-
-
- print "\n\
- impl->data.v_$union_data = $assign \n\
- icalvalue_reset_kind(impl);\n}\n";
-
- print "$type\ icalvalue_get_${lc}(const icalvalue* value)\ {\n\
- icalerror_check_arg( (value!=0),\"value\");\
- icalerror_check_value_type(value, ICAL_${uc}_VALUE);\
- return ((struct icalvalue_impl*)value)->data.v_${union_data};\n}\n";
-
-
- } elsif($opt_h && $autogen) {
-
- print "\n /* $value */ \
-icalvalue* icalvalue_new_${lc}($type v); \
-$type icalvalue_get_${lc}(const icalvalue* value); \
-void icalvalue_set_${lc}(icalvalue* value, ${type} v);\n\n";
-
- }
-
-}
-
-
-if ($opt_h){
- print "#endif /*ICALVALUE_H*/\n";
- }
-
-
-}
diff --git a/libical/scripts/mkinclude.sh b/libical/scripts/mkinclude.sh
deleted file mode 100644
index a77c8d74a8..0000000000
--- a/libical/scripts/mkinclude.sh
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/bin/sh
-
-#
-# Given a list of headers, combine them into one, excluding certain lines
-#
-OUTFILE="/dev/stdout"
-COMBINEDHEADERS=""
-EXCLUDES=""
-
-while [ $# -gt 0 ]
-do
- case $1 in
- -o) OUTFILE=$2; shift;;
- -e) EXCLUDES="$EXCLUDES $2"; shift;;
- *) COMBINEDHEADERS="$COMBINEDHEADERS $1";
- esac
- shift
-done
-
-echo '#ifdef __cplusplus' > $OUTFILE
-echo 'extern "C" {' >> $OUTFILE
-echo '#endif' >> $OUTFILE
-echo '/*' >> $OUTFILE
-echo " \$Id\$" >> $OUTFILE
-echo '*/' >> $OUTFILE
-cat $COMBINEDHEADERS >> file.temp1
-for exclude in $EXCLUDES
-do
- cp file.temp1 file.temp2
- egrep -v "$exclude" file.temp2 > file.temp1
-done
-cat file.temp1 >> $OUTFILE
-rm -f file.temp1
-rm -f file.temp2
-echo '#ifdef __cplusplus' >> $OUTFILE
-echo '};' >> $OUTFILE
-echo '#endif' >> $OUTFILE
-
-
diff --git a/libical/scripts/mkneticali.pl b/libical/scripts/mkneticali.pl
deleted file mode 100755
index 937de49908..0000000000
--- a/libical/scripts/mkneticali.pl
+++ /dev/null
@@ -1,99 +0,0 @@
-#!/usr/local/bin/perl
-
-$pr = 1;
-$ignore = 0;
-
-
-print<<EOM;
-/* -*- Mode: C -*-*/
-/*======================================================================
- FILE: ical.i
-
- (C) COPYRIGHT 1999 Eric Busboom
- http://www.softwarestudio.org
-
- The contents of this file are subject to the Mozilla Public License
- Version 1.0 (the "License"); you may not use this file except in
- compliance with the License. You may obtain a copy of the License at
- http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS IS"
- basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- the License for the specific language governing rights and
- limitations under the License.
-
- The original author is Eric Busboom
-
- Contributions from:
- Graham Davison (g.m.davison\@computer.org)
-
- ======================================================================*/
-
-%module Net__ICal
-
-%{
-#include "ical.h"
-
-#include <sys/types.h> /* for size_t */
-#include <time.h>
-
-%}
-
-EOM
-
-foreach $f (@ARGV)
-{
- @f = split(/\//,$f);
- $fn = pop(@f);
-
- $fn=~/pvl/ && next;
- $fn=~/sspm/ && next;
- $fn=~/cstp/ && next;
- $fn=~/csdb/ && next;
- $fn=~/vcal/ && next;
- $fn=~/yacc/ && next;
- $fn=~/lex/ && next;
-
- print "\n/**********************************************************************\n";
-
- print "\t$fn\n";
- print "**********************************************************************/\n\n";
-
-
- open F, $f;
-
- while(<F>){
-
- s/^#.*//;
-
- s/\/\*.*\*\///;
-
- /^\/\// && next;
-
- next if /^$/;
-
- if(/\/\*/){ $pr = 0;}
-
- /icalparser_parse\(/ and $ignore = 1;
- /vanew/ and $ignore = 1;
- /_stub/ and $ignore = 1;
- /_response/ and $ignore = 1;
- /line_gen_func/ and $ignore = 1;
- /extern/ and $ignore = 1;
- /sspm/ and $ignore = 1;
- /icalrecur/ and $ignore = 1;
-
- if ($pr == 1 && $ignore == 0){
- print ;
- }
-
-
- if(/\*\//){ $pr = 1;}
-
- if (/\;/){ $ignore = 0; }
-
- }
-
-}
-
-
diff --git a/libical/scripts/mkparameterrestrictions.pl b/libical/scripts/mkparameterrestrictions.pl
deleted file mode 100755
index 2c57eb4ca5..0000000000
--- a/libical/scripts/mkparameterrestrictions.pl
+++ /dev/null
@@ -1,85 +0,0 @@
-#!/usr/bin/perl
-
-# Version: 1.0
-# Script last updated: 30May1999 GMD
-# Change log:
-# <none>
-
-
-# usually open params-in-prop.txt
-open(F,"$ARGV[0]") || die "Can't open restriction file $ARGV[0]:$!";
-
-print <<EOM;
-/*
- ======================================================================
- File: parameterrestrictions.c
-
- (C) COPYRIGHT 1999 Graham Davison
- mailto:g.m.davison\@computer.org
-
- The contents of this file are subject to the Mozilla Public License
- Version 1.0 (the "License"); you may not use this file except in
- compliance with the License. You may obtain a copy of the License at
- http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS IS"
- basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- the License for the specific language governing rights and
- limitations under the License.
-
-
- ======================================================================*/
-
-/*
- * THIS FILE IS MACHINE GENERATED DO NOT EDIT
- */
-
-
-int icalrestriction_is_parameter_allowed(icalproperty_kind prop,icalparameter_kind param)
-{
- switch (prop)
- {
-EOM
-
-while(<F>)
-{
- chop;
-
- # split line by whitespace
- my @v = split(/\s+/,$_);
- # property is first item on line
- my $prop = shift @v;
- my $prop_name = $prop;
- if (substr($prop,0,1) eq "X") { $prop = "X"; }
- $prop = join("",split(/-/,$prop));
-
-print <<EOM;
-
- /* ${prop_name} */
- case ICAL_${prop}_PROPERTY:
- switch (param)
- {
-EOM
-
- foreach $param (@v)
- {
- $param = join("",split(/-/,$param));
- print "\t\t\t\tcase ICAL_${param}_PARAMETER:\n";
- }
-
-print <<EOM;
- return 1;
- default:
- return 0;
- }
-
-EOM
-
-}
-
-print <<EOM;
- }
-
- return 0;
-}
-EOM
diff --git a/libical/scripts/mkrestrictionrecords.pl b/libical/scripts/mkrestrictionrecords.pl
deleted file mode 100755
index dd28d77708..0000000000
--- a/libical/scripts/mkrestrictionrecords.pl
+++ /dev/null
@@ -1,109 +0,0 @@
-#!/usr/bin/env perl
-
-# Version: 1.0
-# Script last updated: 30May1999 GMD
-# Change log:
-# <none>
-
-# usually open restrictions.csv
-open(F,"$ARGV[0]") || die "Can't open restriction file $ARGV[0]:$!";
-
-print <<EOM;
-/*
- ======================================================================
- File: restrictionrecords.c
-
- (C) COPYRIGHT 1999 Graham Davison
- mailto:g.m.davison\@computer.org
-
- The contents of this file are subject to the Mozilla Public License
- Version 1.0 (the "License"); you may not use this file except in
- compliance with the License. You may obtain a copy of the License at
- http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS IS"
- basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- the License for the specific language governing rights and
- limitations under the License.
-
-
- ======================================================================*/
-
-
-/*
- * THIS FILE IS MACHINE GENERATED DO NOT EDIT
- */
-
-
-typedef struct icalrestriction_record {
- icalproperty_method method;
- icalcomponent_kind component;
- icalproperty_kind property;
- icalcomponent_kind subcomponent;
- icalrestriction_kind restriction;
-} icalrestriction_record;
-
-
-icalrestriction_record icalrestriction_records[] =
-{
-EOM
-
-my $last_method = "";
-my $last_component = "";
-my $last_property = "";
-my $need_header = 0;
-
-while(<F>)
-{
- chop;
-
- # split line at commas
- my ($method,$component,$property,$subcomponent,$restriction)=split(/\,/,$_);
-
- #
- #put in code to generate comments here!
- #
- if ($method ne $last_method)
- {
- $need_header = 1;
- $last_method = $method;
- }
- if ($component ne $last_component)
- {
- $need_header = 1;
- $last_component = $component;
- }
-
- if ($need_header)
- {
- print "\n\t/* METHOD: ${method}, COMPONENT: ${component} */\n";
- $need_header = 0;
- }
-
- foreach $item ($component,$property,$subcomponent,$restriction)
- {
- # handle special cases.
- if ($item eq "NONE")
- { $item = "NO"; }
- else { if (substr($item,0,1) eq "X")
- { $item = "X"; }}
-
- # strip out dashes
- $item = join("",split(/-/,$item));
- }
- # strip leading V from component names
- $component =~ s/^(V?)(\w+?)((SAVINGS)?)((TIME)?)$/$2/;
- $subcomponent =~ s/^V(\w+)/$1/;
-
- print "\t\{ICAL_METHOD_${method},ICAL_${component}_COMPONENT,";
- print "ICAL_${property}_PROPERTY,ICAL_${subcomponent}_COMPONENT,";
- print "ICAL_RESTRICTION_${restriction}\},\n";
-
-}
-
-print <<EOM;
-
- /* END */
- {ICAL_METHOD_NONE,ICAL_NO_COMPONENT,ICAL_NO_PROPERTY,ICAL_NO_COMPONENT,ICAL_RESTRICTION_NONE}
-};
-EOM
diff --git a/libical/scripts/mkrestrictiontable.pl b/libical/scripts/mkrestrictiontable.pl
deleted file mode 100755
index e02c55b2f9..0000000000
--- a/libical/scripts/mkrestrictiontable.pl
+++ /dev/null
@@ -1,98 +0,0 @@
-#!/usr/bin/env perl
-
-use Getopt::Std;
-getopts('i:');
-
-# the argument should be the path to the restriction datafile, usually
-# design-data/restrictions.csv
-open(F,"$ARGV[0]") || die "Can't open restriction data file $ARGV[0]:$!";
-
-# 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(<IN>){
-
- if (/Do not edit/){
- last;
- }
-
- print;
-
- }
-
- print "/* Everything below this line is machine generated. Do not edit. */\n";
-
-
- close IN;
-}
-
-# First build the property restriction table
-print "icalrestriction_property_record icalrestriction_property_records[] = {\n";
-
-while(<F>)
-{
-
- chop;
-
- s/\#.*$//;
-
- my($method,$targetcomp,$prop,$subcomp,$restr,$sub) = split(/,/,$_);
-
- next if !$method;
-
- if(!$sub) {
- $sub = "0";
- } else {
- $sub = "icalrestriction_".$sub;
- }
-
- if($prop ne "NONE"){
- print(" \{ICAL_METHOD_${method},ICAL_${targetcomp}_COMPONENT,ICAL_${prop}_PROPERTY,ICAL_RESTRICTION_${restr},$sub},\n");
- }
-
-}
-
-
-# Print the terminating line
-print " {ICAL_METHOD_NONE,ICAL_NO_COMPONENT,ICAL_NO_PROPERTY,ICAL_RESTRICTION_NONE}\n";
-
-print "};\n";
-
-print "icalrestriction_component_record icalrestriction_component_records[] = {\n";
-
-
-# Go back through the entire file and build the component restriction table
-close(F);
-open(F,"$ARGV[0]") || die "Can't open restriction data file $ARGV[0]:$!";
-
-while(<F>)
-{
-
- chop;
-
- s/\#.*$//;
-
- my($method,$targetcomp,$prop,$subcomp,$restr,$sub) = split(/,/,$_);
-
- next if !$method;
-
- if(!$sub) {
- $sub = "0";
- } else {
- $sub = "icalrestriction_".$sub;
- }
-
-
- if($subcomp ne "NONE"){
- print(" \{ICAL_METHOD_${method},ICAL_${targetcomp}_COMPONENT,ICAL_${subcomp}_COMPONENT,ICAL_RESTRICTION_${restr},$sub\},\n");
- }
-
-}
-
-# print the terminating line
-print " {ICAL_METHOD_NONE,ICAL_NO_COMPONENT,ICAL_NO_COMPONENT,ICAL_RESTRICTION_NONE}\n";
-print "};\n";
diff --git a/libical/scripts/readvaluesfile.pl b/libical/scripts/readvaluesfile.pl
deleted file mode 100644
index cb40db84ff..0000000000
--- a/libical/scripts/readvaluesfile.pl
+++ /dev/null
@@ -1,133 +0,0 @@
-
-
-sub read_values_file {
-
- my $path = shift;
- my %h;
-
- open(F,$path) || die "Can't open values file $path";
-
- while(<F>){
-
- chop;
-
- s/#.*$//g;
- s/\"//g;
- s/\r//g;
-
- next if ! $_;
-
- @column = split(/,/,$_);
-
- my $value_name = $column[0];
-
- my $c_type_str = $column[1];
- my $c_autogen = ($c_type_str =~ /\(a\)/);
-
- my $c_type = $c_type_str;
- $c_type =~ s/\(.\)//;
-
- my $python_type = $column[2];
- my $components = $column[3];
- my $enum_values = $column[4];
-
- my @components;
- if($components ne "unitary"){
- @components = split(/;/,$components);
- } else {
- @components = ();
- }
-
- my @enums;
- if($enum_values) {
- @enums = split(/;/,$enum_values);
-
- } else {
- @enums = ();
- }
-
- $h{$value_name} = { C => [$c_autogen,$c_type],
- perl => $perl_type,
- python => $python_type,
- components=>[@components],
- enums=>[@enums]
- };
- }
-
- return %h;
-}
-
-sub read_properties_file {
-
- my $path = shift;
- my %h;
-
- open(F,$path) || die "Can't open properties file $path";
-
- while(<F>){
-
- chop;
-
- s/#.*$//g;
- s/\"//g;
- s/\r//g;
-
- next if ! $_;
-
- @column = split(/,/,$_);
-
- my $property_name = $column[0];
-
- my $lic_value = $column[1];
- my $default_value = $column[2];
-
- $h{$property_name} = { lic_value => $lic_value,
- default_value => $default_value
- };
- }
-
- return %h;
-}
-
-sub read_parameters_file {
-
- my $path = shift;
- my %h;
-
- open(F,$path) || die "Can't open parameters file $path";
-
- while(<F>){
-
- chop;
-
- s/#.*$//g;
- s/\"//g;
- s/\r//g;
-
- next if ! $_;
-
- @column = split(/\,/,$_);
-
- my $parameter_name = $column[0];
-
- my $data_type = $column[1];
- my $enum_string = $column[2];
-
- my @enums;
- if($enum_string){
- @enums = split(/;/,$enum_string);
- }
-
- $h{$parameter_name} = { C => $data_type,
- enums => [@enums]
- };
- }
-
- close(F);
-
- return %h;
-}
-
-
-
-1;