4 # Script last updated: 30May1999 GMD
8 # usually open restrictions.csv
9 open(F,"$ARGV[0]") || die "Can't open restriction file $ARGV[0]:$!";
13 ======================================================================
14 File: restrictionrecords.c
16 (C) COPYRIGHT 1999 Graham Davison
17 mailto:g.m.davison\@computer.org
19 The contents of this file are subject to the Mozilla Public License
20 Version 1.0 (the "License"); you may not use this file except in
21 compliance with the License. You may obtain a copy of the License at
22 http://www.mozilla.org/MPL/
24 Software distributed under the License is distributed on an "AS IS"
25 basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
26 the License for the specific language governing rights and
27 limitations under the License.
30 ======================================================================*/
34 * THIS FILE IS MACHINE GENERATED DO NOT EDIT
38 typedef struct icalrestriction_record {
39 icalproperty_method method;
40 icalcomponent_kind component;
41 icalproperty_kind property;
42 icalcomponent_kind subcomponent;
43 icalrestriction_kind restriction;
44 } icalrestriction_record;
47 icalrestriction_record icalrestriction_records[] =
52 my $last_component = "";
53 my $last_property = "";
60 # split line at commas
61 my ($method,$component,$property,$subcomponent,$restriction)=split(/\,/,$_);
64 #put in code to generate comments here!
66 if ($method ne $last_method)
69 $last_method = $method;
71 if ($component ne $last_component)
74 $last_component = $component;
79 print "\n\t/* METHOD: ${method}, COMPONENT: ${component} */\n";
83 foreach $item ($component,$property,$subcomponent,$restriction)
85 # handle special cases.
88 else { if (substr($item,0,1) eq "X")
92 $item = join("",split(/-/,$item));
94 # strip leading V from component names
95 $component =~ s/^(V?)(\w+?)((SAVINGS)?)((TIME)?)$/$2/;
96 $subcomponent =~ s/^V(\w+)/$1/;
98 print "\t\{ICAL_METHOD_${method},ICAL_${component}_COMPONENT,";
99 print "ICAL_${property}_PROPERTY,ICAL_${subcomponent}_COMPONENT,";
100 print "ICAL_RESTRICTION_${restriction}\},\n";
107 {ICAL_METHOD_NONE,ICAL_NO_COMPONENT,ICAL_NO_PROPERTY,ICAL_NO_COMPONENT,ICAL_RESTRICTION_NONE}