From 908e491f7d55209acfbb2595ab1ef5b24502d641 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 25 Jun 2010 03:10:32 +0200 Subject: get rid of a lot of old svn cruft --- avahi-sharp/AddressResolver.cs | 10 ++++------ avahi-sharp/AssemblyInfo.cs | 10 ++++------ avahi-sharp/AvahiTest.cs | 14 ++++++-------- avahi-sharp/BrowserBase.cs | 2 -- avahi-sharp/Client.cs | 22 ++++++++++------------ avahi-sharp/ClientException.cs | 8 +++----- avahi-sharp/DomainBrowser.cs | 10 ++++------ avahi-sharp/EntryGroup.cs | 22 ++++++++++------------ avahi-sharp/HostNameResolver.cs | 6 ++---- avahi-sharp/Makefile.am | 2 -- avahi-sharp/RecordBrowser.cs | 14 ++++++-------- avahi-sharp/ResolverBase.cs | 2 -- avahi-sharp/ServiceBrowser.cs | 16 +++++++--------- avahi-sharp/ServiceResolver.cs | 8 +++----- avahi-sharp/ServiceTypeBrowser.cs | 10 ++++------ avahi-sharp/Utility.cs | 8 +++----- 16 files changed, 66 insertions(+), 98 deletions(-) (limited to 'avahi-sharp') diff --git a/avahi-sharp/AddressResolver.cs b/avahi-sharp/AddressResolver.cs index 3025102..c11e97d 100644 --- a/avahi-sharp/AddressResolver.cs +++ b/avahi-sharp/AddressResolver.cs @@ -1,5 +1,3 @@ -/* $Id$ */ - /*** This file is part of avahi. @@ -55,7 +53,7 @@ namespace Avahi this.address = address; } } - + public class AddressResolver : ResolverBase, IDisposable { private IntPtr handle; @@ -71,7 +69,7 @@ namespace Avahi private ArrayList foundListeners = new ArrayList (); private ArrayList timeoutListeners = new ArrayList (); - + [DllImport ("avahi-client")] private static extern IntPtr avahi_address_resolver_new (IntPtr client, int iface, Protocol proto, IntPtr address, LookupFlags flags, @@ -92,7 +90,7 @@ namespace Avahi Stop (false); } } - + public event EventHandler Timeout { add { @@ -155,7 +153,7 @@ namespace Avahi if (handle == IntPtr.Zero) client.ThrowError (); } - + Utility.Free (addrPtr); } diff --git a/avahi-sharp/AssemblyInfo.cs b/avahi-sharp/AssemblyInfo.cs index f8dd4ed..aff09d9 100644 --- a/avahi-sharp/AssemblyInfo.cs +++ b/avahi-sharp/AssemblyInfo.cs @@ -1,5 +1,3 @@ -/* $Id$ */ - /*** This file is part of avahi. @@ -23,7 +21,7 @@ using System.Reflection; using System.Runtime.CompilerServices; // -// General Information about an assembly is controlled through the following +// General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. // @@ -34,17 +32,17 @@ using System.Runtime.CompilerServices; [assembly: AssemblyProduct("")] [assembly: AssemblyCopyright("(C) 2005 James Willcox ")] [assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] +[assembly: AssemblyCulture("")] // // Version information for an assembly consists of the following four values: // // Major Version -// Minor Version +// Minor Version // Build Number // Revision // -// You can specify all the values or you can default the Revision and Build Numbers +// You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: [assembly: AssemblyVersion("1.0.0")] diff --git a/avahi-sharp/AvahiTest.cs b/avahi-sharp/AvahiTest.cs index ba4d59b..6ccfd57 100644 --- a/avahi-sharp/AvahiTest.cs +++ b/avahi-sharp/AvahiTest.cs @@ -1,5 +1,3 @@ -/* $Id$ */ - /*** This file is part of avahi. @@ -51,7 +49,7 @@ public class AvahiTest { if (args.State == EntryGroupState.Established) { DomainBrowser browser = new DomainBrowser (client); objects.Add (browser); - + browser.DomainAdded += OnDomainAdded; } } @@ -66,7 +64,7 @@ public class AvahiTest { { ServiceTypeBrowser stb = new ServiceTypeBrowser (client, domain); objects.Add (stb); - + stb.CacheExhausted += OnCacheExhausted; stb.ServiceTypeAdded += OnServiceTypeAdded; } @@ -81,7 +79,7 @@ public class AvahiTest { Console.WriteLine ("Got service type: " + args.ServiceType.ServiceType); ServiceBrowser sb = new ServiceBrowser (client, args.ServiceType.ServiceType, args.ServiceType.Domain); objects.Add (sb); - + sb.ServiceAdded += OnServiceAdded; } @@ -96,7 +94,7 @@ public class AvahiTest { private static void OnServiceResolved (object o, ServiceInfoArgs args) { objects.Remove (o); - + Console.WriteLine ("Service '{0}' at {1}:{2}", args.Service.Name, args.Service.HostName, args.Service.Port); foreach (byte[] bytes in args.Service.Text) { Console.WriteLine ("Text: " + Encoding.UTF8.GetString (bytes)); @@ -117,11 +115,11 @@ public class AvahiTest { private static void OnAddressResolved (object o, HostAddressArgs args) { objects.Remove (o); - + Console.WriteLine ("Resolved {0} to {1}", args.Address, args.Host); HostNameResolver hr = new HostNameResolver (client, args.Host); objects.Add (hr); - + hr.Found += OnHostNameResolved; } diff --git a/avahi-sharp/BrowserBase.cs b/avahi-sharp/BrowserBase.cs index 0a1e3a7..3af0086 100644 --- a/avahi-sharp/BrowserBase.cs +++ b/avahi-sharp/BrowserBase.cs @@ -1,5 +1,3 @@ -/* $Id$ */ - /*** This file is part of avahi. diff --git a/avahi-sharp/Client.cs b/avahi-sharp/Client.cs index 02763d4..b3815b3 100644 --- a/avahi-sharp/Client.cs +++ b/avahi-sharp/Client.cs @@ -1,5 +1,3 @@ -/* $Id$ */ - /*** This file is part of avahi. @@ -35,7 +33,7 @@ namespace Avahi Found, Failure } - + internal enum BrowserEvent { Added, Removed, @@ -70,7 +68,7 @@ namespace Avahi this.error = error; } } - + public enum Protocol { Unspecified = -1, IPv4 = 0, @@ -83,7 +81,7 @@ namespace Avahi Running, Collision } - + public enum ClientState { Registering = ServerState.Registering, Running = ServerState.Running, @@ -117,7 +115,7 @@ namespace Avahi IgnoreUserConfig = 1, NoFail = 2 } - + public class Client : IDisposable { private IntPtr handle; @@ -151,7 +149,7 @@ namespace Avahi [DllImport ("avahi-client")] private static extern int avahi_client_errno (IntPtr handle); - + [DllImport ("avahi-common")] private static extern IntPtr avahi_simple_poll_new (); @@ -192,7 +190,7 @@ namespace Avahi { get { return handle; } } - + public string Version { get { @@ -292,7 +290,7 @@ namespace Avahi avahi_simple_poll_quit (spoll); Monitor.Wait (this); - + avahi_simple_poll_free (spoll); } } @@ -326,7 +324,7 @@ namespace Avahi IntPtr namePtr = Stdlib.malloc ((ulong) len); IntPtr typePtr = Stdlib.malloc ((ulong) len); IntPtr domainPtr = Stdlib.malloc ((ulong) len); - + int ret = avahi_service_name_split (Utility.StringToBytes (service), namePtr, len, typePtr, len, domainPtr, len); @@ -334,7 +332,7 @@ namespace Avahi Utility.Free (namePtr); Utility.Free (typePtr); Utility.Free (domainPtr); - + name = null; type = null; domain = null; @@ -357,7 +355,7 @@ namespace Avahi if (error != ErrorCode.Ok) throw new ClientException (error); } - + private void OnClientCallback (IntPtr client, ClientState state, IntPtr userData) { if (StateChanged != null) diff --git a/avahi-sharp/ClientException.cs b/avahi-sharp/ClientException.cs index fadcce9..0f511ac 100644 --- a/avahi-sharp/ClientException.cs +++ b/avahi-sharp/ClientException.cs @@ -1,5 +1,3 @@ -/* $Id$ */ - /*** This file is part of avahi. @@ -95,14 +93,14 @@ namespace Avahi this.code = code; } } - + public class ClientException : ApplicationException { private ErrorCode code; [DllImport ("avahi-common")] private static extern IntPtr avahi_strerror (ErrorCode code); - + public ErrorCode ErrorCode { get { return code; } @@ -110,7 +108,7 @@ namespace Avahi internal ClientException (int code) : this ((ErrorCode) code) { } - + internal ClientException (ErrorCode code) : base (GetErrorString (code)) { this.code = code; diff --git a/avahi-sharp/DomainBrowser.cs b/avahi-sharp/DomainBrowser.cs index 50da54e..a1165dc 100644 --- a/avahi-sharp/DomainBrowser.cs +++ b/avahi-sharp/DomainBrowser.cs @@ -1,5 +1,3 @@ -/* $Id$ */ - /*** This file is part of avahi. @@ -61,7 +59,7 @@ namespace Avahi } public delegate void DomainInfoHandler (object o, DomainInfoArgs args); - + public class DomainBrowser : BrowserBase, IDisposable { private IntPtr handle; @@ -76,7 +74,7 @@ namespace Avahi private ArrayList addListeners = new ArrayList (); private ArrayList removeListeners = new ArrayList (); - + [DllImport ("avahi-client")] private static extern IntPtr avahi_domain_browser_new (IntPtr client, int iface, int proto, byte[] domain, int btype, LookupFlags flags, @@ -97,7 +95,7 @@ namespace Avahi Stop (false); } } - + public event DomainInfoHandler DomainRemoved { add { @@ -118,7 +116,7 @@ namespace Avahi public DomainBrowser (Client client) : this (client, -1, Protocol.Unspecified, client.DomainName, DomainBrowserType.Browse, LookupFlags.None) { } - + public DomainBrowser (Client client, int iface, Protocol proto, string domain, DomainBrowserType btype, LookupFlags flags) { diff --git a/avahi-sharp/EntryGroup.cs b/avahi-sharp/EntryGroup.cs index 02be643..24abae4 100644 --- a/avahi-sharp/EntryGroup.cs +++ b/avahi-sharp/EntryGroup.cs @@ -1,5 +1,3 @@ -/* $Id$ */ - /*** This file is part of avahi. @@ -41,7 +39,7 @@ namespace Avahi UseWideArea = 128, UseMulticast = 256 } - + public enum EntryGroupState { Uncommited, Registering, @@ -58,7 +56,7 @@ namespace Avahi { get { return state; } } - + public EntryGroupStateArgs (EntryGroupState state) { this.state = state; @@ -67,13 +65,13 @@ namespace Avahi internal delegate void EntryGroupCallback (IntPtr group, EntryGroupState state, IntPtr userdata); public delegate void EntryGroupStateHandler (object o, EntryGroupStateArgs args); - + public class EntryGroup : IDisposable { private Client client; private IntPtr handle; private EntryGroupCallback cb; - + [DllImport ("avahi-client")] private static extern IntPtr avahi_entry_group_new (IntPtr client, EntryGroupCallback cb, IntPtr userdata); @@ -114,7 +112,7 @@ namespace Avahi private static extern int avahi_entry_group_add_record (IntPtr group, int iface, Protocol proto, PublishFlags flags, byte[] name, RecordClass clazz, RecordType type, uint ttl, byte[] rdata, int size); - + [DllImport ("avahi-client")] private static extern void avahi_entry_group_free (IntPtr group); @@ -131,7 +129,7 @@ namespace Avahi private static extern IntPtr avahi_alternative_service_name (byte[] name); public event EntryGroupStateHandler StateChanged; - + public EntryGroupState State { get { @@ -149,7 +147,7 @@ namespace Avahi } } } - + public EntryGroup (Client client) { this.client = client; @@ -245,9 +243,9 @@ namespace Avahi Utility.StringToBytes (domain), Utility.StringToBytes (host), port, list); } - + avahi_string_list_free (list); - + if (ret < 0) { client.ThrowError (); } @@ -285,7 +283,7 @@ namespace Avahi UpdateService (iface, proto, flags, name, type, domain, list); } - + private void UpdateService (int iface, Protocol proto, PublishFlags flags, string name, string type, string domain, IntPtr list) { diff --git a/avahi-sharp/HostNameResolver.cs b/avahi-sharp/HostNameResolver.cs index 81305fd..b9fe7f4 100644 --- a/avahi-sharp/HostNameResolver.cs +++ b/avahi-sharp/HostNameResolver.cs @@ -1,5 +1,3 @@ -/* $Id$ */ - /*** This file is part of avahi. @@ -49,7 +47,7 @@ namespace Avahi private ArrayList foundListeners = new ArrayList (); private ArrayList timeoutListeners = new ArrayList (); - + [DllImport ("avahi-client")] private static extern IntPtr avahi_host_name_resolver_new (IntPtr client, int iface, Protocol proto, byte[] hostname, Protocol aproto, LookupFlags flags, @@ -69,7 +67,7 @@ namespace Avahi Stop (false); } } - + public event EventHandler Timeout { add { diff --git a/avahi-sharp/Makefile.am b/avahi-sharp/Makefile.am index d8f1fab..3fa10ab 100644 --- a/avahi-sharp/Makefile.am +++ b/avahi-sharp/Makefile.am @@ -1,5 +1,3 @@ -# $Id$ - # This file is part of avahi. # # avahi is free software; you can redistribute it and/or modify it diff --git a/avahi-sharp/RecordBrowser.cs b/avahi-sharp/RecordBrowser.cs index f65f8ac..ba5a983 100644 --- a/avahi-sharp/RecordBrowser.cs +++ b/avahi-sharp/RecordBrowser.cs @@ -1,5 +1,3 @@ -/* $Id: ServiceBrowser.cs 635 2005-09-26 03:57:30Z snorp $ */ - /*** This file is part of avahi. @@ -29,7 +27,7 @@ namespace Avahi { public delegate void RecordInfoHandler (object o, RecordInfoArgs args); - + internal delegate void RecordBrowserCallback (IntPtr browser, int iface, Protocol proto, BrowserEvent bevent, IntPtr name, ushort clazz, ushort type, IntPtr rdata, int size, LookupResultFlags flags, IntPtr userdata); @@ -50,7 +48,7 @@ namespace Avahi Aaa = 28, Srv = 33 } - + public struct RecordInfo { public int NetworkInterface; @@ -91,7 +89,7 @@ namespace Avahi private ArrayList addListeners = new ArrayList (); private ArrayList removeListeners = new ArrayList (); - + [DllImport ("avahi-client")] private static extern IntPtr avahi_record_browser_new (IntPtr client, int iface, Protocol proto, byte[] name, ushort clazz, ushort type, @@ -113,7 +111,7 @@ namespace Avahi Stop (false); } } - + public event RecordInfoHandler RecordRemoved { add { @@ -135,7 +133,7 @@ namespace Avahi this (client, -1, Protocol.Unspecified, name, RecordClass.In, type, LookupFlags.None) { } - + public RecordBrowser (Client client, int iface, Protocol proto, string name, RecordClass clazz, RecordType type, LookupFlags flags) { @@ -178,7 +176,7 @@ namespace Avahi { if (client.Handle != IntPtr.Zero && handle != IntPtr.Zero && (force || (addListeners.Count == 0 && removeListeners.Count == 0))) { - + lock (client) { avahi_record_browser_free (handle); handle = IntPtr.Zero; diff --git a/avahi-sharp/ResolverBase.cs b/avahi-sharp/ResolverBase.cs index 0a5a2a8..d546aba 100644 --- a/avahi-sharp/ResolverBase.cs +++ b/avahi-sharp/ResolverBase.cs @@ -1,5 +1,3 @@ -/* $Id$ */ - /*** This file is part of avahi. diff --git a/avahi-sharp/ServiceBrowser.cs b/avahi-sharp/ServiceBrowser.cs index 520e339..5c39ad4 100644 --- a/avahi-sharp/ServiceBrowser.cs +++ b/avahi-sharp/ServiceBrowser.cs @@ -1,5 +1,3 @@ -/* $Id$ */ - /*** This file is part of avahi. @@ -30,7 +28,7 @@ namespace Avahi internal delegate void ServiceBrowserCallback (IntPtr browser, int iface, Protocol proto, BrowserEvent bevent, IntPtr name, IntPtr type, IntPtr domain, LookupResultFlags flags, IntPtr userdata); - + public struct ServiceInfo { public int NetworkInterface; @@ -63,7 +61,7 @@ namespace Avahi } public delegate void ServiceInfoHandler (object o, ServiceInfoArgs args); - + public class ServiceBrowser : BrowserBase, IDisposable { private IntPtr handle; @@ -78,7 +76,7 @@ namespace Avahi private ArrayList addListeners = new ArrayList (); private ArrayList removeListeners = new ArrayList (); - + [DllImport ("avahi-client")] private static extern IntPtr avahi_service_browser_new (IntPtr client, int iface, int proto, byte[] type, byte[] domain, LookupFlags flags, @@ -99,7 +97,7 @@ namespace Avahi Stop (false); } } - + public event ServiceInfoHandler ServiceRemoved { add { @@ -120,12 +118,12 @@ namespace Avahi public ServiceBrowser (Client client, string type) : this (client, type, client.DomainName) { } - + public ServiceBrowser (Client client, string type, string domain) : this (client, -1, Protocol.Unspecified, type, domain, LookupFlags.None) { } - + public ServiceBrowser (Client client, int iface, Protocol proto, string type, string domain, LookupFlags flags) { this.client = client; @@ -167,7 +165,7 @@ namespace Avahi { if (client.Handle != IntPtr.Zero && handle != IntPtr.Zero && (force || (addListeners.Count == 0 && removeListeners.Count == 0))) { - + lock (client) { avahi_service_browser_free (handle); handle = IntPtr.Zero; diff --git a/avahi-sharp/ServiceResolver.cs b/avahi-sharp/ServiceResolver.cs index a32efca..7f8901a 100644 --- a/avahi-sharp/ServiceResolver.cs +++ b/avahi-sharp/ServiceResolver.cs @@ -1,5 +1,3 @@ -/* $Id$ */ - /*** This file is part of avahi. @@ -51,7 +49,7 @@ namespace Avahi private ArrayList foundListeners = new ArrayList (); private ArrayList timeoutListeners = new ArrayList (); - + [DllImport ("avahi-client")] private static extern IntPtr avahi_service_resolver_new (IntPtr client, int iface, Protocol proto, byte[] name, byte[] type, byte[] domain, @@ -82,7 +80,7 @@ namespace Avahi Stop (false); } } - + public event EventHandler Timeout { add { @@ -115,7 +113,7 @@ namespace Avahi GetLookupFlags (service.Flags)) { } - + public ServiceResolver (Client client, int iface, Protocol proto, string name, string type, string domain, Protocol aproto, LookupFlags flags) { diff --git a/avahi-sharp/ServiceTypeBrowser.cs b/avahi-sharp/ServiceTypeBrowser.cs index 3796d60..e1356d0 100644 --- a/avahi-sharp/ServiceTypeBrowser.cs +++ b/avahi-sharp/ServiceTypeBrowser.cs @@ -1,5 +1,3 @@ -/* $Id$ */ - /*** This file is part of avahi. @@ -29,7 +27,7 @@ namespace Avahi internal delegate void ServiceTypeBrowserCallback (IntPtr browser, int iface, Protocol proto, BrowserEvent bevent, IntPtr type, IntPtr domain, LookupResultFlags flags, IntPtr userdata); - + public struct ServiceTypeInfo { public int NetworkInterface; @@ -55,7 +53,7 @@ namespace Avahi } public delegate void ServiceTypeInfoHandler (object o, ServiceTypeInfoArgs args); - + public class ServiceTypeBrowser : BrowserBase, IDisposable { private IntPtr handle; @@ -69,7 +67,7 @@ namespace Avahi private ArrayList addListeners = new ArrayList (); private ArrayList removeListeners = new ArrayList (); - + [DllImport ("avahi-client")] private static extern IntPtr avahi_service_type_browser_new (IntPtr client, int iface, int proto, byte[] domain, LookupFlags flags, @@ -90,7 +88,7 @@ namespace Avahi Stop (false); } } - + public event ServiceTypeInfoHandler ServiceTypeRemoved { add { diff --git a/avahi-sharp/Utility.cs b/avahi-sharp/Utility.cs index 9081b01..a1d0a66 100644 --- a/avahi-sharp/Utility.cs +++ b/avahi-sharp/Utility.cs @@ -1,5 +1,3 @@ -/* $Id$ */ - /*** This file is part of avahi. @@ -45,7 +43,7 @@ namespace Avahi { if (ptr == IntPtr.Zero) return null; - + int len = strlen (ptr); byte[] bytes = new byte[len]; Marshal.Copy (ptr, bytes, 0, len); @@ -56,7 +54,7 @@ namespace Avahi { if (ptr == IntPtr.Zero) return null; - + string ret = PtrToString (ptr); Free (ptr); return ret; @@ -100,7 +98,7 @@ namespace Avahi 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); -- cgit