From 3af8d34f0f0fdfba8fefb5201dee604d201192dd Mon Sep 17 00:00:00 2001 From: manus Date: Thu, 13 Jan 2011 23:53:42 +0000 Subject: [PATCH] * Use READABLE_STRING_GENERAL instead of STRING_GENERAL for routines expecting a string. This enables us to use IMMUTABLE_STRINGs as argument without conversion. * As a consequence we are also now using `same_string' instead of `is_equal' to compare strings which will handle any type of strings. * Enforced the rule that arguments are READABLE_STRING_GENERAL and queries are STRING_32 when unicode is expected. * The most delicate part of the change was the update of the encoding library. Now we have two queries:last_converted_string_32 and last_converted_string_8 in addition of the typeless last_converted_string. The idea is that if you know that you are converting to something where characters are at least 2 bytes wide, you know that you have to use STRING_32, otherwise it will be STRING_8. * Unlike STRING_GENERAL, READABLE_STRING_GENERAL does not have a conversion to STRING_32 and thus in a few places we had to use `as_string_32' for explicit conversion which I found better. git-svn-id: https://svn.origo.ethz.ch/eiffelstudio/trunk/Src/library/cURL@85350 8089f293-4706-0410-a29e-feb5c42a2edf --- curl_easy_externals.e | 4 ++-- curl_externals.e | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/curl_easy_externals.e b/curl_easy_externals.e index 4ba6c0ee..7ed81eb1 100644 --- a/curl_easy_externals.e +++ b/curl_easy_externals.e @@ -29,7 +29,7 @@ feature -- Command exists: Result /= default_pointer end - setopt_string (a_curl_handle: POINTER; a_opt: INTEGER; a_string: STRING_GENERAL) + setopt_string (a_curl_handle: POINTER; a_opt: INTEGER; a_string: READABLE_STRING_GENERAL) -- Declared as curl_easy_setopt(). require exists: a_curl_handle /= default_pointer @@ -396,7 +396,7 @@ feature {NONE} -- C externals note library: "cURL: Library of reusable components for Eiffel." - copyright: "Copyright (c) 1984-2009, Eiffel Software and others" + copyright: "Copyright (c) 1984-2010, Eiffel Software and others" license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" source: "[ Eiffel Software diff --git a/curl_externals.e b/curl_externals.e index 2474a36c..36a18d0b 100644 --- a/curl_externals.e +++ b/curl_externals.e @@ -38,7 +38,7 @@ feature -- Command end end - formadd_string_string (a_form: CURL_FORM; a_last_pointer: CURL_FORM; a_arg_1: INTEGER; a_arg_1_value: STRING_GENERAL; a_arg_2: INTEGER; a_arg_2_value: STRING_GENERAL; a_arg_3: INTEGER) + formadd_string_string (a_form: CURL_FORM; a_last_pointer: CURL_FORM; a_arg_1: INTEGER; a_arg_1_value: READABLE_STRING_GENERAL; a_arg_2: INTEGER; a_arg_2_value: READABLE_STRING_GENERAL; a_arg_3: INTEGER) -- Declared as curl_formadd (). require not_void: a_form /= Void @@ -65,7 +65,7 @@ feature -- Command end end - slist_append (a_list: POINTER; a_string: STRING_GENERAL): POINTER + slist_append (a_list: POINTER; a_string: READABLE_STRING_GENERAL): POINTER -- Declared as curl_slist_append (). -- note: call with a null `a_list' to get initialized pointer as Result require @@ -118,7 +118,7 @@ feature {NONE} -- Implementation Result := l_utility.api_loader end - internal_formadd_string_string (a_form: TYPED_POINTER [POINTER]; a_last_pointer: TYPED_POINTER [POINTER]; a_arg_1: INTEGER; a_arg_1_value: STRING_GENERAL; a_arg_2: INTEGER; a_arg_2_value: STRING_GENERAL; a_arg_3: INTEGER) + internal_formadd_string_string (a_form: TYPED_POINTER [POINTER]; a_last_pointer: TYPED_POINTER [POINTER]; a_arg_1: INTEGER; a_arg_1_value: READABLE_STRING_GENERAL; a_arg_2: INTEGER; a_arg_2_value: READABLE_STRING_GENERAL; a_arg_3: INTEGER) -- Declared as curl_formadd (). local l_c_string_1, l_c_string_2: C_STRING @@ -212,11 +212,11 @@ feature {NONE} -- C externals note library: "cURL: Library of reusable components for Eiffel." - copyright: "Copyright (c) 1984-2006, Eiffel Software and others" + copyright: "Copyright (c) 1984-2010, Eiffel Software and others" license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" source: "[ Eiffel Software - 356 Storke Road, Goleta, CA 93117 USA + 5949 Hollister Ave., Goleta, CA 93117 USA Telephone 805-685-1006, Fax 805-685-6869 Website http://www.eiffel.com Customer support http://support.eiffel.com