Use EIF_REFERENCE instead of EIF_OBJECT.

git-svn-id: https://svn.origo.ethz.ch/eiffelstudio/trunk/Src/library/cURL@71086 8089f293-4706-0410-a29e-feb5c42a2edf
This commit is contained in:
larryl
2007-11-08 08:55:00 +00:00
parent 65559b8b82
commit 7e024b589a

View File

@@ -19,7 +19,7 @@
#define eiffel_curl #define eiffel_curl
typedef EIF_INTEGER (* EIF_CURL_PROGRESS_PROC) ( typedef EIF_INTEGER (* EIF_CURL_PROGRESS_PROC) (
EIF_OBJECT, /* CURL_FUNCTION Eiffel object */ EIF_REFERENCE, /* CURL_FUNCTION Eiffel object */
EIF_POINTER, /* a_user_pointer */ EIF_POINTER, /* a_user_pointer */
EIF_REAL_64, /* a_dltotal */ EIF_REAL_64, /* a_dltotal */
EIF_REAL_64, /* a_dlnow */ EIF_REAL_64, /* a_dlnow */
@@ -28,7 +28,7 @@ typedef EIF_INTEGER (* EIF_CURL_PROGRESS_PROC) (
); );
typedef EIF_INTEGER (* EIF_CURL_WRITE_PROC) ( typedef EIF_INTEGER (* EIF_CURL_WRITE_PROC) (
EIF_OBJECT, /* CURL_FUNCTION Eiffel object */ EIF_REFERENCE, /* CURL_FUNCTION Eiffel object */
EIF_POINTER, /* a_data_pointer */ EIF_POINTER, /* a_data_pointer */
EIF_INTEGER, /* a_size */ EIF_INTEGER, /* a_size */
EIF_INTEGER, /* a_nmemb */ EIF_INTEGER, /* a_nmemb */
@@ -36,7 +36,7 @@ typedef EIF_INTEGER (* EIF_CURL_WRITE_PROC) (
); );
typedef EIF_INTEGER (* EIF_CURL_DEBUG_PROC) ( typedef EIF_INTEGER (* EIF_CURL_DEBUG_PROC) (
EIF_OBJECT, /* CURL_FUNCTION Eiffel object */ EIF_REFERENCE, /* CURL_FUNCTION Eiffel object */
EIF_POINTER, /* a_curl_handle */ EIF_POINTER, /* a_curl_handle */
EIF_INTEGER, /* a_curl_infotype */ EIF_INTEGER, /* a_curl_infotype */
EIF_POINTER, /* a_char_pointer */ EIF_POINTER, /* a_char_pointer */
@@ -44,7 +44,7 @@ typedef EIF_INTEGER (* EIF_CURL_DEBUG_PROC) (
EIF_POINTER /* a_user_pointer */ EIF_POINTER /* a_user_pointer */
); );
EIF_OBJECT eiffel_function_object = NULL; EIF_REFERENCE eiffel_function_object = NULL;
/* Address of Eiffel object CURL_FUNCTION */ /* Address of Eiffel object CURL_FUNCTION */
EIF_CURL_PROGRESS_PROC eiffel_progress_function = NULL; EIF_CURL_PROGRESS_PROC eiffel_progress_function = NULL;
@@ -57,9 +57,9 @@ EIF_CURL_DEBUG_PROC eiffel_debug_function = NULL;
/* Address of Eiffel CURL_FUNCTION.debug_function */ /* Address of Eiffel CURL_FUNCTION.debug_function */
/* Set Eiffel CURL_FUNCTION object address */ /* Set Eiffel CURL_FUNCTION object address */
void c_set_object(EIF_OBJECT a_address) void c_set_object(EIF_REFERENCE a_address)
{ {
eiffel_function_object = (EIF_OBJECT) eif_adopt (a_address); eiffel_function_object = (EIF_REFERENCE) eif_adopt (a_address);
} }
/* Release Eiffel CURL_FUNCTION object address */ /* Release Eiffel CURL_FUNCTION object address */
@@ -87,12 +87,12 @@ void c_set_debug_function_address (EIF_POINTER a_address)
} }
/* Eiffel adapter function for CURLOPT_WRITEFUNCTION /* Eiffel adapter function for CURLOPT_WRITEFUNCTION
We need this function since Eiffel function call need first parameter is EIF_OBJECT. */ We need this function since Eiffel function call need first parameter is EIF_REFERENCE. */
size_t curl_write_function (void *ptr, size_t size, size_t nmemb, void *data) size_t curl_write_function (void *ptr, size_t size, size_t nmemb, void *data)
{ {
if (eiffel_function_object) { if (eiffel_function_object) {
return (size_t) ((eiffel_write_function) ( return (size_t) ((eiffel_write_function) (
(EIF_OBJECT) eif_access (eiffel_function_object), (EIF_REFERENCE) eif_access (eiffel_function_object),
(EIF_POINTER) ptr, (EIF_POINTER) ptr,
(EIF_INTEGER) size, (EIF_INTEGER) size,
(EIF_INTEGER) nmemb, (EIF_INTEGER) nmemb,
@@ -102,12 +102,12 @@ size_t curl_write_function (void *ptr, size_t size, size_t nmemb, void *data)
} }
/* Eiffel adapter function for CURLOPT_PROGRESSFUNCTION /* Eiffel adapter function for CURLOPT_PROGRESSFUNCTION
We need this function since Eiffel function call need first parameter is EIF_OBJECT. */ We need this function since Eiffel function call need first parameter is EIF_REFERENCE. */
size_t curl_progress_function (void * a_object_id, double a_dltotal, double a_dlnow, double a_ultotal, double a_ulnow) size_t curl_progress_function (void * a_object_id, double a_dltotal, double a_dlnow, double a_ultotal, double a_ulnow)
{ {
if (eiffel_function_object) { if (eiffel_function_object) {
return (size_t) ((eiffel_progress_function) ( return (size_t) ((eiffel_progress_function) (
(EIF_OBJECT) eif_access (eiffel_function_object), (EIF_REFERENCE) eif_access (eiffel_function_object),
(EIF_POINTER) a_object_id, (EIF_POINTER) a_object_id,
(EIF_REAL_64) a_dltotal, (EIF_REAL_64) a_dltotal,
(EIF_REAL_64) a_dlnow, (EIF_REAL_64) a_dlnow,
@@ -118,12 +118,12 @@ size_t curl_progress_function (void * a_object_id, double a_dltotal, double a_dl
} }
/* Eiffel adapter function for CURLOPT_DEBUGFUNCTION /* Eiffel adapter function for CURLOPT_DEBUGFUNCTION
We need this function since Eiffel function call need first parameter is EIF_OBJECT. */ We need this function since Eiffel function call need first parameter is EIF_REFERENCE. */
size_t curl_debug_function (CURL * a_curl_handle, curl_infotype a_curl_infotype, unsigned char * a_char_pointer, size_t a_size, void * a_object_id) size_t curl_debug_function (CURL * a_curl_handle, curl_infotype a_curl_infotype, unsigned char * a_char_pointer, size_t a_size, void * a_object_id)
{ {
if (eiffel_function_object) { if (eiffel_function_object) {
return (size_t) ((eiffel_debug_function) ( return (size_t) ((eiffel_debug_function) (
(EIF_OBJECT) eif_access (eiffel_function_object), (EIF_REFERENCE) eif_access (eiffel_function_object),
(EIF_POINTER) a_curl_handle, (EIF_POINTER) a_curl_handle,
(EIF_INTEGER) a_curl_infotype, (EIF_INTEGER) a_curl_infotype,
(EIF_POINTER) a_char_pointer, (EIF_POINTER) a_char_pointer,