7 # ARG 0 is components.txt
8 open(PV,"$ARGV[0]") || die "Can't open components file $ARGV[0]:$!";
24 # Write the file inline by copying everything before a demarcation
25 # line, and putting the generated data after the demarcation
29 open(IN,$opt_i) || die "Can't open input file \"$opt_i\"";
42 print "# Everything below this line is machine generated. Do not edit. \n";
44 print "/* Everything below this line is machine generated. Do not edit. */\n";
49 if ($opt_c or $opt_h and !$opt_i){
53 ======================================================================
54 FILE: icalderivedproperties.{c,h}
55 CREATOR: eric 09 May 1999
59 (C) COPYRIGHT 1999 Eric Busboom
60 http://www.softwarestudio.org
62 The contents of this file are subject to the Mozilla Public License
63 Version 1.0 (the "License"); you may not use this file except in
64 compliance with the License. You may obtain a copy of the License at
65 http://www.mozilla.org/MPL/
67 Software distributed under the License is distributed on an "AS IS"
68 basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
69 the License for the specific language governing rights and
70 limitations under the License.
73 ======================================================================*/
76 * THIS FILE IS MACHINE GENERATED DO NOT EDIT
79 #include <stdarg.h> /* for va_arg functions */
85 if ($opt_p and !$opt_i){
94 foreach $comp (@components) {
98 my $ucf = join("",map {ucfirst(lc($_));} split(/-/,$comp));
102 if($opt_c) { # Make C source
107 icalcomponent* icalcomponent_new_${lc}()
109 return (icalcomponent*)icalcomponent_new_impl(ICAL_${uc}_COMPONENT);
112 icalcomponent* icalcomponent_vanew_${lc}(...)
115 struct icalcomponent_impl *impl = icalcomponent_new_impl(ICAL_${uc}_component);
118 icalcomponent_add_properties(impl, args);
121 return (icalcomponent*)impl;
127 } elsif ($opt_h) { # Make a C header
131 icalcomponent* icalcomponent_new_${lc}();
132 icalcomponent* icalcomponent_vanew_${lc}(...);
135 } elsif ($opt_s) { # Make something for a switch statement
138 case ICAL_${uc}_PROPERTY:
141 } elsif ($opt_p) { # make perl source
146 package Net::ICal::Component::${ucf};
147 \@ISA=qw(Net::ICal::Component);
151 my \$package = shift;
152 my \$c = Net::ICal::icalcomponent_new(\$Net::ICal::ICAL_${uc}_COMPONENT);
154 my \$self = Net::ICal::Component::new_from_ref(\$c);
155 Net::ICal::Component::_add_elements(\$self,\\\@_);
157 # Self is blessed in new_from_ref