| version 1.3, 2003/02/23 17:38:24 |
version 1.4, 2003/03/09 10:32:38 |
|
|
| |
|
| my %def_meth = ( |
my %def_meth = ( |
| "has_method" => "co_has_method", |
"has_method" => "co_has_method", |
| "clone" => "co_clone" |
"sclone" => "co_clone_shallow", |
| |
"dclone" => "co_clone_deep", |
| |
"fclone" => "co_clone_full", |
| |
"dclone_c" => "co_clone_clean", |
| |
"fclone_c" => "co_clone_clean_full" |
| ); |
); |
| |
|
| sub meth { |
sub meth { |
|
|
| # ." ap);\n"; |
# ." ap);\n"; |
| $tab{$o} .= "\tco_meth_add (o -> __co_meth_ar, COM ($m)," |
$tab{$o} .= "\tco_meth_add (o -> __co_meth_ar, COM ($m)," |
| ." (co_msg_h) ${o}_$m);\n"; |
." (co_msg_h) ${o}_$m);\n"; |
| $fwd{$o} .= "co_v ${o}_$m ($o this, co self, co_id_t message, va_list" |
$fwd{$o} .= "static co_v ${o}_$m ($o this, co self" |
| ." ap)\n{\n\tCO_RETURN (${t}_p, &(this -> $m));\n}\n"; |
. " CO_POSSIBLY_UNUSED, co_id_t message CO_POSSIBLY_UNUSED," |
| |
. " va_list ap CO_POSSIBLY_UNUSED)\n" |
| |
. "{\n\tCO_RETURN (${t}_p, &(this -> $m));\n}\n"; |
| } |
} |
| } |
} |
| for (@objs) { |
for (@objs) { |
| $o = $_; |
$o = $_; |
| for (keys %def_meth) { |
for (keys %def_meth) { |
| $fwd{$o} .= "co_v $def_meth{$_} (co this, co self, " |
#$fwd{$o} .= "co_v $def_meth{$_} (co this, co self, " |
| ."co_id_t message, va_list ap);\n"; |
# ."co_id_t message, va_list ap);\n"; |
| $tab{$o} .= "\tco_meth_add (o -> __co_meth_ar," |
$tab{$o} .= "\tco_meth_add (o -> __co_meth_ar," |
| ." COM ($_), $def_meth{$_});\n"; |
." COM ($_), $def_meth{$_});\n"; |
| } |
} |
|
|
| &append ($in, qr/\bE$ws*\(.*?,(.*?)[,)]/, \@list, "E"); |
&append ($in, qr/\bE$ws*\(.*?,(.*?)[,)]/, \@list, "E"); |
| } |
} |
| #if ($in =~ /CO_OBJECT/) { # FIXME |
#if ($in =~ /CO_OBJECT/) { # FIXME |
| &addid (\@list, "Mhas_method"); |
#&addid (\@list, "Mhas_method"); |
| &addid (\@list, "Mclone"); |
# &addid (\@list, "Mclone"); |
| #} |
#} |
| |
foreach (keys %def_meth) { |
| |
&addid (\@list, "M$_"); |
| |
} |
| |
|
| print OUT "#include <co_object.h>\n"; |
print OUT "#include <co_object.h>\n"; |
| print OUT "#include <co_super.h>\n"; |
print OUT "#include <co_super.h>\n"; |
|
|
| for (keys %ifcs) { |
for (keys %ifcs) { |
| print OUT "void __co_file_init_${_}_$ifcs{$_} (co);\n"; |
print OUT "void __co_file_init_${_}_$ifcs{$_} (co);\n"; |
| } |
} |
| |
print OUT "void __co_mod_autoinit (co_super super);\n"; |
| print OUT "void __co_mod_autoinit (co_super super) {\n"; |
print OUT "void __co_mod_autoinit (co_super super) {\n"; |
| for (keys %ifcs) { |
for (keys %ifcs) { |
| print OUT "__co_file_init_${_}_$ifcs{$_} (super);\n"; |
print OUT "__co_file_init_${_}_$ifcs{$_} (super);\n"; |