-/* $Id$ */
-
/***
This file is part of avahi.
using Mono.Unix;
using Mono.Unix.Native;
+using Stdlib = Mono.Unix.Native.Stdlib;
+
namespace Avahi
{
internal class Utility
{
if (ptr == IntPtr.Zero)
return null;
-
+
int len = strlen (ptr);
byte[] bytes = new byte[len];
Marshal.Copy (ptr, bytes, 0, len);
{
if (ptr == IntPtr.Zero)
return null;
-
+
string ret = PtrToString (ptr);
Free (ptr);
return ret;
public static IPAddress PtrToAddress (IntPtr ptr)
{
IPAddress address = null;
-
+
if (ptr != IntPtr.Zero) {
IntPtr buf = Stdlib.malloc (256);
IntPtr addrPtr = avahi_address_snprint (buf, 256, ptr);