diff options
Diffstat (limited to 'bindings/csharp')
-rw-r--r-- | bindings/csharp/AssemblyInfo.cs | 33 | ||||
-rw-r--r-- | bindings/csharp/CMakeLists.txt | 14 | ||||
-rw-r--r-- | bindings/csharp/libproxy-sharp-1.0.pc.cmake | 5 | ||||
-rw-r--r-- | bindings/csharp/libproxy.cs | 81 | ||||
-rw-r--r-- | bindings/csharp/libproxy.snk | bin | 596 -> 0 bytes |
5 files changed, 0 insertions, 133 deletions
diff --git a/bindings/csharp/AssemblyInfo.cs b/bindings/csharp/AssemblyInfo.cs deleted file mode 100644 index 2baa161..0000000 --- a/bindings/csharp/AssemblyInfo.cs +++ /dev/null @@ -1,33 +0,0 @@ -/******************************************************************************* - * libproxy - A library for proxy configuration - * Copyright (C) 2008-2010 Dominique Leuenberger <dominique@leuenberger.net> - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - ******************************************************************************/ - -using System; -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -[assembly:AssemblyVersion("0.4.6")] -[assembly:AssemblyTitle ("LibProxy#")] -[assembly:AssemblyDescription ("A library that provides automatic proxy configuration management.")] -[assembly:AssemblyCopyright ("Copyright (c) 2006-2009 Nathaniel McCallum")] -[assembly:AssemblyCompany ("")] -[assembly:AssemblyDelaySign(false)] -[assembly:AssemblyKeyFile("libproxy.snk")] -[assembly:CLSCompliant(false)] - diff --git a/bindings/csharp/CMakeLists.txt b/bindings/csharp/CMakeLists.txt deleted file mode 100644 index d433fc6..0000000 --- a/bindings/csharp/CMakeLists.txt +++ /dev/null @@ -1,14 +0,0 @@ -PROJECT(libproxy-sharp) - -enable_language(CSharp) - -SET(KEYFILE ${CMAKE_CURRENT_SOURCE_DIR}/libproxy.snk) - -CSHARP_ADD_LIBRARY(libproxy-sharp libproxy.cs AssemblyInfo.cs COMPILE_FLAGS /warn:0 "/keyfile:${KEYFILE}") -SET_PROPERTY(TARGET libproxy-sharp PROPERTY pkg-config_template_basename libproxy-sharp-1.0) - -GET_LIBRARY_OUTPUT_DIR(library_target_dir) -FILE(WRITE ${library_target_dir}/libproxy-sharp.dll.config "<configuration><dllmap dll=\"proxy\" target=\"libproxy.so.1\"/></configuration>") - -INSTALL_ASSEMBLY(libproxy-sharp DESTINATION lib PACKAGE libproxy-sharp) - diff --git a/bindings/csharp/libproxy-sharp-1.0.pc.cmake b/bindings/csharp/libproxy-sharp-1.0.pc.cmake deleted file mode 100644 index 5e2f4a4..0000000 --- a/bindings/csharp/libproxy-sharp-1.0.pc.cmake +++ /dev/null @@ -1,5 +0,0 @@ - -Name: Libproxy# -Description: Libproxy# - .NET Binding to libproxy -Version: 0.4.6 -Libs: -r:@assembly@ diff --git a/bindings/csharp/libproxy.cs b/bindings/csharp/libproxy.cs deleted file mode 100644 index 4002e2a..0000000 --- a/bindings/csharp/libproxy.cs +++ /dev/null @@ -1,81 +0,0 @@ -/******************************************************************************* - * libproxy - A library for proxy configuration - * Copyright (C) 2006 Nathaniel McCallum <nathaniel@natemccallum.com> - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - ******************************************************************************/ - -namespace libproxy { - using System; - using System.Runtime.InteropServices; - - public class ProxyFactory { - private HandleRef self; - - [DllImport ("proxy")] - private static extern - IntPtr px_proxy_factory_new(); - - [DllImport ("proxy")] - private static extern - IntPtr px_proxy_factory_get_proxies(HandleRef self, string url); - - [DllImport ("proxy")] - private static extern - void px_proxy_factory_free_proxies(IntPtr proxies); - - [DllImport ("proxy")] - private static extern - void px_proxy_factory_free(HandleRef self); - - public ProxyFactory() - { - this.self = new HandleRef(this, px_proxy_factory_new()); - } - - public string[] GetProxies(string url) - { - int count = 0; - - // Get the results - // TODO: If we call both this function and px_proxy_factory_free() - // this crashes, figure out why... - IntPtr array = px_proxy_factory_get_proxies(this.self, url); - - // Count the number of returned strings - while (Marshal.ReadIntPtr(array, count * IntPtr.Size) != IntPtr.Zero) count++; - - // Allocate a correctly sized array - string[] proxies = new string[count]; - - // Fill the response array - for (int i=0 ; i < count ; i++) - { - IntPtr p = Marshal.ReadIntPtr(array, i * IntPtr.Size); - proxies[i] = Marshal.PtrToStringAnsi(p); - } - - px_proxy_factory_free_proxies(array); - - return proxies; - } - - ~ProxyFactory() - { - // TODO: See note above... - px_proxy_factory_free(this.self); - } - } -} diff --git a/bindings/csharp/libproxy.snk b/bindings/csharp/libproxy.snk Binary files differdeleted file mode 100644 index 3dc1731..0000000 --- a/bindings/csharp/libproxy.snk +++ /dev/null |