gstreamer/gstreamer-sharp/GError.cs
Sebastian Dröge aa7bb8fa1c Use internal glib-sharp copy everywhere and make it work side-by-side with real glib-sharp
glib-sharp will only get a new release with the new API that we need for
3.0 in a year or something. Instead of waiting a year before we can release
something we now have our own internal copy of glib-sharp trunk that will
be dropped once glib-sharp 3.0 is released.

Everything is now compilable and working without any additional patches.
2009-08-05 16:57:20 +02:00

56 lines
1.1 KiB
C#

//
// Copyright (c) 2009 Sebastian Dröge <sebastian.droege@collabora.co.uk>
//
// This class implements some helper functions to handle GError
//
using System;
using System.Runtime.InteropServices;
namespace Gst {
[StructLayout (LayoutKind.Sequential) ]
internal struct GError {
uint domain_quark;
int code;
IntPtr message;
public uint Domain {
get {
return domain_quark;
}
set {
domain_quark = value;
}
}
public int Code {
get {
return code;
}
set {
code = value;
}
}
public string Message {
get {
if (message == IntPtr.Zero)
return null;
return Gst.GLib.Marshaller.Utf8PtrToString (message);
}
set {
if (message != IntPtr.Zero)
Gst.GLib.Marshaller.Free (message);
message = Gst.GLib.Marshaller.StringToPtrGStrdup (value);
}
}
public void Unset () {
Gst.GLib.Marshaller.Free (message);
message = IntPtr.Zero;
code = 0;
domain_quark = 0;
}
}
}