6 # the argument should be the path to the restriction datafile, usually
7 # design-data/restrictions.csv
8 open(F,"$ARGV[0]") || die "Can't open restriction data file $ARGV[0]:$!";
10 # Write the file inline by copying everything before a demarcation
11 # line, and putting the generated data after the demarcation
15 open(IN,$opt_i) || die "Can't open input file $opt_i";
19 if (/<insert_code_here>/){
35 # First build the property restriction table
36 print "static const icalrestriction_property_record icalrestriction_property_records[] = {\n";
45 my($method,$targetcomp,$prop,$subcomp,$restr,$sub) = split(/,/,$_);
52 $sub = "icalrestriction_".$sub;
56 print(" \{ICAL_METHOD_${method},ICAL_${targetcomp}_COMPONENT,ICAL_${prop}_PROPERTY,ICAL_RESTRICTION_${restr},$sub},\n");
62 # Print the terminating line
63 print " {ICAL_METHOD_NONE,ICAL_NO_COMPONENT,ICAL_NO_PROPERTY,ICAL_RESTRICTION_NONE}\n";
67 print "static const icalrestriction_component_record icalrestriction_component_records[] = {\n";
70 # Go back through the entire file and build the component restriction table
72 open(F,"$ARGV[0]") || die "Can't open restriction data file $ARGV[0]:$!";
81 my($method,$targetcomp,$prop,$subcomp,$restr,$sub) = split(/,/,$_);
88 $sub = "icalrestriction_".$sub;
92 if($subcomp ne "NONE"){
93 print(" \{ICAL_METHOD_${method},ICAL_${targetcomp}_COMPONENT,ICAL_${subcomp}_COMPONENT,ICAL_RESTRICTION_${restr},$sub\},\n");
98 # print the terminating line
99 print " {ICAL_METHOD_NONE,ICAL_NO_COMPONENT,ICAL_NO_COMPONENT,ICAL_RESTRICTION_NONE}\n";