#!/usr/bin/perl

while (<STDIN>) {
    my $line = $_;

    $line =~ s/<\?xml.*//;
    $line =~ s/,\s*\);/\);/g;
    $line =~ s/#TYPE#GObject.ObjectClass#TYPE#/ctypes.voidptr_t/g;
    $line =~ s/#TYPE#Gen[^#]+#TYPE#/ctypes.voidptr_t/g;
    $line =~ s/#TYPE#[^#]+Context#TYPE#/ctypes.voidptr_t \/\* UnityWebappsContext \*\//g;
    $line =~ s/#TYPE#IntegrationScriptDescription#TYPE#/ctypes.voidptr_t/g;
    $line =~ s/#TYPE#Context#TYPE#/ctypes.voidptr_t \/\* UnityWebappsContext \*\//g;
    $line =~ s/#TYPE#Service#TYPE#/ctypes.voidptr_t \/\* UnityWebappsService \*\//g;
    $line =~ s/#TYPE#GLib\.Variant#TYPE#/ctypes.voidptr_t \/\* GVariant \*\//g;
    $line =~ s/#TYPE#Gio.*#TYPE#/ctypes.voidptr_t \/\* GIO type \*\//g;
    $line =~ s/#TYPE#MusicPlayerPlaybackState#TYPE#/ctypes.int32_t/g;
    $line =~ s/#TYPE#gboolean#TYPE#/ctypes.int32_t/g;
    $line =~ s/#TYPE#gint#TYPE#/ctypes.int32_t/g;
    $line =~ s/#TYPE#GType#TYPE#/ctypes.int32_t/g;
    $line =~ s/#TYPE#guint#TYPE#/ctypes.uint32_t/g;
    $line =~ s/#TYPE#gsize#TYPE#/ctypes.int32_t/g;
    $line =~ s/#TYPE#guint64#TYPE#/ctypes.uint64_t/g;
    $line =~ s/#TYPE#gint64#TYPE#/ctypes.int64_t/g;
    $line =~ s/#TYPE#gdouble#TYPE#/ctypes.double/g;
    $line =~ s/#TYPE#utf8#TYPE#/ctypes.char.ptr/g;
    $line =~ s/#TYPE#none#TYPE#/ctypes.void_t/g;
    $line =~ s/#TYPE#gpointer#TYPE#/ctypes.voidptr_t/g;
    $line =~ s/#TYPE#(.+Callback)#TYPE#/this.\1Type.ptr/g;
    $line =~ s/#TYPE#(.+Desc)#TYPE#/this.\1.array()/g;
    $line =~ s/#TYPE#GLib.List#TYPE#/ctypes.voidptr_t/g;

    $line =~ s/#TYPE#MetaRepo#TYPE#/ctypes.voidptr_t/g;
    $line =~ s/#TYPE#ScriptDir#TYPE#/ctypes.voidptr_t/g;
    $line =~ s/#TYPE#Script#TYPE#/ctypes.voidptr_t/g;

    print $line;


}
