X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mono%2Fwrapper%2Fgenwrapper.pl;h=15641aa59dcba3c484c5fd82ace9ffa2155e309c;hb=e2f1b034c7b447e860bafa95d02f20209e6f9598;hp=8dd624acddaf1f014bb155ead3b5178781f5f89a;hpb=647f2358521318b53323e585d2633981d53d9f25;p=mono.git diff --git a/mono/wrapper/genwrapper.pl b/mono/wrapper/genwrapper.pl index 8dd624acdda..15641aa59dc 100755 --- a/mono/wrapper/genwrapper.pl +++ b/mono/wrapper/genwrapper.pl @@ -16,21 +16,24 @@ if ($ENV{"OSTYPE"} eq "cygwin") { "errno.h"); } -$cflags = `glib-config --cflags glib`; +$cflags = `pkg-config --cflags glib-2.0`; $cflags =~ s/\n//; $lib = "monowrapper"; +if ($csmode){ + $res_struct .= "[CLSCompliant(false)]\n"; +} create_struct ("MonoWrapperStat", "stat", - "uint", "st_dev", - "uint", "st_mode", - "uint", "st_nlink", - "uint", "st_uid", - "uint", "st_gid", - "long", "st_size", - "uint", "st_atime", - "uint", "st_mtime", - "uint", "st_ctime", + "uint", "mst_dev", + "uint", "mst_mode", + "uint", "mst_nlink", + "uint", "mst_uid", + "uint", "mst_gid", + "long", "mst_size", + "uint", "mst_atime", + "uint", "mst_mtime", + "uint", "mst_ctime", ); create_func ($lib, "", "seek", "long", @@ -38,6 +41,13 @@ create_func ($lib, "", "seek", "long", "long", "offset", "int", "whence"); +create_func ($lib, "", "mkdir", "int", + "string", "path", + "int", "mode"); + +create_func ($lib, "", "rmdir", "int", + "string", "path"); + create_func ($lib, "", "read", "int", "IntPtr", "fd", "void *", "buf", @@ -85,6 +95,24 @@ create_func ($lib, "", "getenv", "IntPtr", create_func ($lib, "", "environ", "IntPtr"); +create_func ($lib, "", "rename", "int", + "string", "source", + "string", "target"); + +create_func ($lib, "", "utime", "int", + "string", "path", + "int", "atime", + "int", "mtime"); + +create_func ($lib, "mono_glob_compile", "mono_glob_compile", "IntPtr", + "string", "glob"); + +create_func ($lib, "mono_glob_match", "mono_glob_match", "int", + "IntPtr", "handle", + "string", "str"); + +create_func ($lib, "mono_glob_dispose", "mono_glob_dispose", "void", + "IntPtr", "handle"); map_const ("int", "%d", "SEEK_SET", "int", "%d", "SEEK_CUR", @@ -260,7 +288,7 @@ sub init { %tmap = ("void" => "void", - "IntPtr" => "int", + "IntPtr" => "gpointer", "sbyte" => "gint8", "byte" => "guint8", "short" => "gint16", @@ -292,6 +320,14 @@ sub create_func { my (@func) = @_; my ($i) = 0; my ($res) = ""; + my ($cls) = 1; + my ($j) = 4; + while ($j <= $#func){ + if ($func[$j] =~ /\*/){ + $cls = 0; + } + $j+=2; + } if ($func[1] eq "") { $func[1] = "mono_wrapper_$func[2]"; @@ -304,6 +340,9 @@ sub create_func { if ($csmode) { $res = "\t[DllImport(\"$func[0]\", EntryPoint=\"$func[1]\", CharSet=CharSet.Ansi)]\n"; + if ($cls == 0){ + $res .= "\t[CLSCompliant(false)]\n"; + } $res .= "\tpublic unsafe static extern $func[3] $func[2] ("; $i +=4; while ($i <= $#func) {