generator: fixed string[] return types

This commit is contained in:
Stephan Sundermann 2013-10-08 17:54:29 +02:00 committed by Andrés G. Aragoneses
parent 8d4ec22ef2
commit b5806d2a1b
2 changed files with 7 additions and 2 deletions

View file

@ -160,7 +160,7 @@ namespace GtkSharp.Generation {
string args = ", typeof (" + ElementType + "), " + (owned ? "true" : "false") + ", " + (elements_owned ? "true" : "false");
var = "new " + IGen.QualifiedName + "(" + var + args + ")";
} else if (is_null_term)
return String.Format ("GLib.Marshaller.StringArrayToNullTermPointer ({0})", var);
return String.Format ("GLib.Marshaller.StringArrayToNullTermStrvPointer ({0})", var);
else if (is_array)
return String.Format ("GLib.Marshaller.ArrayToArrayPtr ({0})", var);

View file

@ -170,7 +170,7 @@ namespace GLib {
return ret.Replace ("%", "%%");
}
internal static IntPtr StringArrayToStrvPtr (string[] strs)
public static IntPtr StringArrayToStrvPtr (string[] strs)
{
IntPtr[] ptrs = StringArrayToNullTermPointer (strs);
IntPtr ret = g_malloc (new UIntPtr ((ulong) (ptrs.Length * IntPtr.Size)));
@ -178,6 +178,11 @@ namespace GLib {
return ret;
}
public static IntPtr StringArrayToNullTermStrvPointer (string[] strs)
{
return StringArrayToStrvPtr (strs);
}
public static IntPtr[] StringArrayToNullTermPointer (string[] strs)
{
if (strs == null)