Use regular T_PTROBJ and typedefs instead of a complex typemap
[audio-opusfile.git] / typemap
diff --git a/typemap b/typemap
index c780241374648cc7c32c81972a485c01a2858840..12c4fdd0d0b606a3ef8b76916b91a3738689c655 100644 (file)
--- a/typemap
+++ b/typemap
@@ -1,65 +1,4 @@
-const OggOpusFile*    T_OGG_OPUS_FILE
-      OggOpusFile*    T_OGG_OPUS_FILE
-const OpusHead*       T_OPUS_HEAD
-      OpusHead*       T_OPUS_HEAD
-const OpusTags*       T_OPUS_TAGS
-      OpusTags*       T_OPUS_TAGS
-const OpusPictureTag* T_OPUS_PICTURE_TAG
-      OpusPictureTag* T_OPUS_PICTURE_TAG
-
-INPUT
-# All three types are copies of T_PTROBJ, only difference being the class name
-
-T_OGG_OPUS_FILE
-       if (SvROK($arg) && sv_derived_from($arg, \"Audio::Opusfile\")) {
-               IV tmp = SvIV((SV*)SvRV($arg));
-               $var = INT2PTR($type,tmp);
-       }
-       else
-               Perl_croak_nocontext(\"%s: %s is not of type %s\",
-                       ${$ALIAS?\q[GvNAME(CvGV(cv))]:\qq[\"$pname\"]},
-                       \"$var\", \"Audio::Opusfile\")
-
-T_OPUS_HEAD
-       if (SvROK($arg) && sv_derived_from($arg, \"Audio::Opusfile::Head\")) {
-               IV tmp = SvIV((SV*)SvRV($arg));
-               $var = INT2PTR($type,tmp);
-       }
-       else
-               Perl_croak_nocontext(\"%s: %s is not of type %s\",
-                       ${$ALIAS?\q[GvNAME(CvGV(cv))]:\qq[\"$pname\"]},
-                       \"$var\", \"Audio::Opusfile::Head\")
-
-T_OPUS_TAGS
-       if (SvROK($arg) && sv_derived_from($arg, \"Audio::Opusfile::Tags\")) {
-               IV tmp = SvIV((SV*)SvRV($arg));
-               $var = INT2PTR($type,tmp);
-       }
-       else
-               Perl_croak_nocontext(\"%s: %s is not of type %s\",
-                       ${$ALIAS?\q[GvNAME(CvGV(cv))]:\qq[\"$pname\"]},
-                       \"$var\", \"Audio::Opusfile::Tags\")
-
-T_OPUS_PICTURE_TAG
-       if (SvROK($arg) && sv_derived_from($arg, \"Audio::Opusfile::PictureTag\")) {
-               IV tmp = SvIV((SV*)SvRV($arg));
-               $var = INT2PTR($type,tmp);
-       }
-       else
-               Perl_croak_nocontext(\"%s: %s is not of type %s\",
-                       ${$ALIAS?\q[GvNAME(CvGV(cv))]:\qq[\"$pname\"]},
-                       \"$var\", \"Audio::Opusfile::Tags\")
-
-OUTPUT
-
-T_OGG_OPUS_FILE
-       sv_setref_pv($arg, \"Audio::Opusfile\", (void*)$var);
-
-T_OPUS_HEAD
-       sv_setref_pv($arg, \"Audio::Opusfile::Head\", (void*)$var);
-
-T_OPUS_TAGS
-       sv_setref_pv($arg, \"Audio::Opusfile::Tags\", (void*)$var);
-
-T_OPUS_PICTURE_TAG
-       sv_setref_pv($arg, \"Audio::Opusfile::PictureTag\", (void*)$var);
+Audio::Opusfile             T_PTROBJ
+Audio::Opusfile::Head       T_PTROBJ
+Audio::Opusfile::Tags       T_PTROBJ
+Audio::Opusfile::PictureTag T_PTROBJ
This page took 0.010198 seconds and 4 git commands to generate.