* cpp stuff
[m6w6/ext-http] / php_http.h
index 0de3905e957ec065c36b6c15b8d05db9c4bbe8d5..1234f9ba273418c9c5c1ecd699bf4c7ecb464e2c 100644 (file)
@@ -18,7 +18,7 @@
 #ifndef PHP_EXT_HTTP_H
 #define PHP_EXT_HTTP_H
 
-#define PHP_EXT_HTTP_VERSION "0.6.0-dev"
+#define PHP_EXT_HTTP_VERSION "0.7.0-dev"
 
 /* make compile on Win32 */
 #include "php_streams.h"
@@ -34,17 +34,28 @@ extern zend_module_entry http_module_entry;
 #      define HTTP_G(v) (http_globals.v)
 #endif
 
-#ifndef ZEND_ENGINE_2
-#      include "php_http_build_query.h"
-#else
+#ifdef ZEND_ENGINE_2
+
+typedef struct {
+       zend_object     zo;
+} httpi_response_object;
 
 #ifdef HTTP_HAVE_CURL
+
+#include <curl/curl.h>
+
+typedef struct {
+       zend_object zo;
+       CURL *ch;
+} httpi_request_object;
+
 typedef enum {
        HTTP_GET,
        HTTP_HEAD,
        HTTP_POST,
 } http_request_method;
-#endif
+
+#endif /* HTTP_HAVE _CURL */
 
 PHP_METHOD(HTTPi, date);
 PHP_METHOD(HTTPi, absoluteURI);
@@ -68,7 +79,7 @@ PHP_METHOD(HTTPi, get);
 PHP_METHOD(HTTPi, head);
 PHP_METHOD(HTTPi, postData);
 PHP_METHOD(HTTPi, postArray);
-#endif
+#endif /* HTTP_HAVE_CURL */
 PHP_METHOD(HTTPi, authBasic);
 PHP_METHOD(HTTPi, authBasicCallback);
 
@@ -120,7 +131,8 @@ PHP_METHOD(HTTPi_Request, getPostFiles);
 PHP_METHOD(HTTPi_Request, unsetPostFiles);
 PHP_METHOD(HTTPi_Request, send);
 PHP_METHOD(HTTPi_Request, getResponseData);
-PHP_METHOD(HTTPi_Request, getResponseHeaders);
+PHP_METHOD(HTTPi_Request, getResponseHeader);
+PHP_METHOD(HTTPi_Request, getResponseCode);
 PHP_METHOD(HTTPi_Request, getResponseBody);
 PHP_METHOD(HTTPi_Request, getResponseInfo);
 
@@ -154,10 +166,12 @@ PHP_FUNCTION(http_get);
 PHP_FUNCTION(http_head);
 PHP_FUNCTION(http_post_data);
 PHP_FUNCTION(http_post_array);
-#endif
+#endif /* HTTP_HAVE_CURL */
 PHP_FUNCTION(http_auth_basic);
 PHP_FUNCTION(http_auth_basic_cb);
-
+#ifndef ZEND_ENGINE_2
+PHP_FUNCTION(http_build_query);
+#endif /* ZEND_ENGINE_2 */
 PHP_FUNCTION(ob_httpetaghandler);
 
 PHP_MINIT_FUNCTION(http);
@@ -176,18 +190,13 @@ ZEND_BEGIN_MODULE_GLOBALS(http)
        char *allowed_methods;
 #ifdef HTTP_HAVE_CURL
        struct {
-               struct {
-                       char *data;
-                       size_t used;
-                       size_t free;
-               } body;
-               struct {
-                       char *data;
-                       size_t used;
-                       size_t free;
-               } hdrs;
+               char *data;
+               size_t used;
+               size_t free;
+               size_t size;
        } curlbuf;
-#endif
+       zend_llist to_free;
+#endif /* HTTP_HAVE_CURL */
 ZEND_END_MODULE_GLOBALS(http)
 
 #endif /* PHP_HTTP_H */