* proper cpp indention
authorMichael Wallner <mike@php.net>
Fri, 11 Feb 2005 09:30:17 +0000 (09:30 +0000)
committerMichael Wallner <mike@php.net>
Fri, 11 Feb 2005 09:30:17 +0000 (09:30 +0000)
http.c
http_api.c
php_http.h
php_http_api.h

diff --git a/http.c b/http.c
index afa95b789c593459b2b5b794f2dea3584bdc8633..795a3a54d32387ff1c306a9f587e89dd58035100 100644 (file)
--- a/http.c
+++ b/http.c
@@ -18,7 +18,7 @@
 #define ZEND_INCLUDE_FULL_WINDOWS_HEADERS
 
 #ifdef HAVE_CONFIG_H
-#include "config.h"
+#      include "config.h"
 #endif
 
 #include "php.h"
 #include "php_http_api.h"
 
 #ifdef ZEND_ENGINE_2
-#include "ext/standard/php_http.h"
+#      include "ext/standard/php_http.h"
 #endif
 
 #ifdef HTTP_HAVE_CURL
 
-#ifdef PHP_WIN32
-#include <winsock2.h>
-#include <sys/types.h>
-#endif
+#      ifdef PHP_WIN32
+#              include <winsock2.h>
+#              include <sys/types.h>
+#      endif
 
-#include <curl/curl.h>
-#endif
-
-ZEND_DECLARE_MODULE_GLOBALS(http)
-
-#ifdef COMPILE_DL_HTTP
-ZEND_GET_MODULE(http)
-#endif
+#      include <curl/curl.h>
 
 /* {{{ ARG_INFO */
-#ifdef ZEND_BEGIN_ARG_INFO
+#      ifdef ZEND_BEGIN_ARG_INFO
 ZEND_BEGIN_ARG_INFO(http_request_info_ref_3, 0)
        ZEND_ARG_PASS_INFO(0)
        ZEND_ARG_PASS_INFO(0)
@@ -65,11 +58,20 @@ ZEND_BEGIN_ARG_INFO(http_request_info_ref_4, 0)
        ZEND_ARG_PASS_INFO(0)
        ZEND_ARG_PASS_INFO(1)
 ZEND_END_ARG_INFO();
-#else
+#      else
 static unsigned char http_request_info_ref_3[] = {3, BYREF_NONE, BYREF_NONE, BYREF_FORCE};
 static unsigned char http_request_info_ref_4[] = {4, BYREF_NONE, BYREF_NONE, BYREF_NONE, BYREF_FORCE};
+#      endif
+/* }}} ARG_INFO */
+
+#endif /* HTTP_HAVE_CURL */
+
+ZEND_DECLARE_MODULE_GLOBALS(http)
+
+#ifdef COMPILE_DL_HTTP
+ZEND_GET_MODULE(http)
 #endif
-/* }}}*/
+
 
 /* {{{ http_functions[] */
 function_entry http_functions[] = {
index d8a0828df32ca2bd4f57645bffdbb0e9e2b99648..f9091ee4791694d68aefcea20b564770907b75de 100644 (file)
@@ -18,7 +18,7 @@
 #define ZEND_INCLUDE_FULL_WINDOWS_HEADERS
 
 #ifdef HAVE_CONFIG_H
-#include "config.h"
+#      include "config.h"
 #endif
 
 #include <ctype.h>
@@ -37,9 +37,9 @@
 #include "SAPI.h"
 
 #ifdef ZEND_ENGINE_2
-#include "ext/standard/php_http.h"
+#      include "ext/standard/php_http.h"
 #else
-#include "http_build_query.c"
+       #include "http_build_query.c"
 #endif
 
 #include "php_http.h"
 
 #ifdef HTTP_HAVE_CURL
 
-#ifdef PHP_WIN32
-#include <winsock2.h>
-#include <sys/types.h>
-#endif
+#      ifdef PHP_WIN32
+#              include <winsock2.h>
+#              include <sys/types.h>
+#      endif
+
+#      include <curl/curl.h>
+#      include <curl/easy.h>
 
-#include <curl/curl.h>
-#include <curl/easy.h>
 #endif
 
 
@@ -1428,7 +1429,7 @@ PHP_HTTP_API STATUS _http_send_ranges(zval *zranges, const void *data, const siz
        /* single range */
        if ((c = zend_hash_num_elements(Z_ARRVAL_P(zranges))) == 1) {
                char range_header[256] = {0};
-               
+
                zend_hash_index_find(Z_ARRVAL_P(zranges), 0, (void **) &zrange);
                zend_hash_index_find(Z_ARRVAL_PP(zrange), 0, (void **) &begin);
                zend_hash_index_find(Z_ARRVAL_PP(zrange), 1, (void **) &end);
@@ -1444,9 +1445,9 @@ PHP_HTTP_API STATUS _http_send_ranges(zval *zranges, const void *data, const siz
        /* multi range */
        else {
                int i;
-               char bound[23] = {0}, preface[1024] = {0}, 
+               char bound[23] = {0}, preface[1024] = {0},
                        multi_header[68] = "Content-Type: multipart/byteranges; boundary=";
-               
+
                snprintf(bound, 22, "--%d%0.9f", time(NULL), php_combined_lcg(TSRMLS_C));
                strncat(multi_header, bound + 2, 21);
                http_send_header(multi_header);
@@ -1462,22 +1463,22 @@ PHP_HTTP_API STATUS _http_send_ranges(zval *zranges, const void *data, const siz
                                        SUCCESS != zend_hash_index_find(
                                                Z_ARRVAL_PP(zrange), 1, (void **) &end)) {
                                break;
-                       }       
+                       }
 
                        snprintf(preface, 1023,
-                               HTTP_CRLF "%s" 
+                               HTTP_CRLF "%s"
                                HTTP_CRLF "Content-Type: %s"
                                HTTP_CRLF "Content-Range: bytes %ld-%ld/%ld"
-                               HTTP_CRLF 
+                               HTTP_CRLF
                                HTTP_CRLF,
-                               
-                               bound, 
-                               HTTP_G(ctype) ? HTTP_G(ctype) : "application/x-octetstream", 
-                               **begin, 
-                               **end, 
+
+                               bound,
+                               HTTP_G(ctype) ? HTTP_G(ctype) : "application/x-octetstream",
+                               **begin,
+                               **end,
                                size
                        );
-                       
+
                        php_body_write(preface, strlen(preface) TSRMLS_CC);
                        http_send_chunk(data, **begin, **end + 1, mode);
                }
index 5f96f524014a70e427a0356e85b7254fe14cc7f7..0b65451b49b2d234e097d060601b34409ed1f21e 100644 (file)
@@ -28,14 +28,14 @@ extern zend_module_entry http_module_entry;
 #define phpext_http_ptr &http_module_entry
 
 #ifdef ZTS
-#include "TSRM.h"
-#define HTTP_G(v) TSRMG(http_globals_id, zend_http_globals *, v)
+#      include "TSRM.h"
+#      define HTTP_G(v) TSRMG(http_globals_id, zend_http_globals *, v)
 #else
-#define HTTP_G(v) (http_globals.v)
+#      define HTTP_G(v) (http_globals.v)
 #endif
 
 #ifndef ZEND_ENGINE_2
-#include "php_http_build_query.h"
+#      include "php_http_build_query.h"
 #endif
 
 PHP_FUNCTION(http_date);
index 101857e004b5ab5b2e409780508c7032aba85b71..8ca390d12a2d21ac668da5764b680138dae98a9e 100644 (file)
 #define PHP_HTTP_API_H
 
 #ifdef PHP_WIN32
-#define PHP_HTTP_API __declspec(dllexport)
+#      define PHP_HTTP_API __declspec(dllexport)
 #else
-#define PHP_HTTP_API
+#      define PHP_HTTP_API
 #endif
 
 #ifndef ZEND_ENGINE_2
-#include "php_http_build_query.h"
+#      include "php_http_build_query.h"
 #endif
 
 /* make functions that return SUCCESS|FAILURE more obvious */