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";
27 print "/* Everything below this line is machine generated. Do not edit. */\n";
33 # First build the property restriction table
34 print "icalrestriction_property_record icalrestriction_property_records[] = {\n";
43 my($method,$targetcomp,$prop,$subcomp,$restr,$sub) = split(/,/,$_);
50 $sub = "icalrestriction_".$sub;
54 print(" \{ICAL_METHOD_${method},ICAL_${targetcomp}_COMPONENT,ICAL_${prop}_PROPERTY,ICAL_RESTRICTION_${restr},$sub},\n");
60 # Print the terminating line
61 print " {ICAL_METHOD_NONE,ICAL_NO_COMPONENT,ICAL_NO_PROPERTY,ICAL_RESTRICTION_NONE}\n";
65 print "icalrestriction_component_record icalrestriction_component_records[] = {\n";
68 # Go back through the entire file and build the component restriction table
70 open(F,"$ARGV[0]") || die "Can't open restriction data file $ARGV[0]:$!";
79 my($method,$targetcomp,$prop,$subcomp,$restr,$sub) = split(/,/,$_);
86 $sub = "icalrestriction_".$sub;
90 if($subcomp ne "NONE"){
91 print(" \{ICAL_METHOD_${method},ICAL_${targetcomp}_COMPONENT,ICAL_${subcomp}_COMPONENT,ICAL_RESTRICTION_${restr},$sub\},\n");
96 # print the terminating line
97 print " {ICAL_METHOD_NONE,ICAL_NO_COMPONENT,ICAL_NO_COMPONENT,ICAL_RESTRICTION_NONE}\n";