fix build with xcode clang
[m6w6/ext-http] / php_http_message_body.c
index 1b5ecc2397f4ef57054bed67f79f08b8f83ebf92..f48dbd66f7bdb9218a39c0251522b4b389be93a2 100644 (file)
@@ -724,6 +724,21 @@ PHP_METHOD(HttpMessageBody, getResource)
        }
 }
 
+ZEND_BEGIN_ARG_INFO_EX(ai_HttpMessageBody_getBoundary, 0, 0, 0)
+ZEND_END_ARG_INFO();
+PHP_METHOD(HttpMessageBody, getBoundary)
+{
+       if (SUCCESS == zend_parse_parameters_none()) {
+               php_http_message_body_object_t * obj = zend_object_store_get_object(getThis() TSRMLS_CC);
+
+               PHP_HTTP_MESSAGE_BODY_OBJECT_INIT(obj);
+
+               if (obj->body->boundary) {
+                       RETURN_STRING(obj->body->boundary, 1);
+               }
+       }
+}
+
 ZEND_BEGIN_ARG_INFO_EX(ai_HttpMessageBody_append, 0, 0, 1)
        ZEND_ARG_INFO(0, string)
 ZEND_END_ARG_INFO();
@@ -837,10 +852,10 @@ PHP_METHOD(HttpMessageBody, stat)
                                        }
                        } else {
                                object_init(return_value);
-                               add_property_long_ex(return_value, ZEND_STRS("size"), sb->sb.st_size);
-                               add_property_long_ex(return_value, ZEND_STRS("atime"), sb->sb.st_atime);
-                               add_property_long_ex(return_value, ZEND_STRS("mtime"), sb->sb.st_mtime);
-                               add_property_long_ex(return_value, ZEND_STRS("ctime"), sb->sb.st_ctime);
+                               add_property_long_ex(return_value, ZEND_STRS("size"), sb->sb.st_size TSRMLS_CC);
+                               add_property_long_ex(return_value, ZEND_STRS("atime"), sb->sb.st_atime TSRMLS_CC);
+                               add_property_long_ex(return_value, ZEND_STRS("mtime"), sb->sb.st_mtime TSRMLS_CC);
+                               add_property_long_ex(return_value, ZEND_STRS("ctime"), sb->sb.st_ctime TSRMLS_CC);
                        }
                }
        }
@@ -855,6 +870,7 @@ static zend_function_entry php_http_message_body_methods[] = {
        PHP_ME(HttpMessageBody, toStream,     ai_HttpMessageBody_toStream,     ZEND_ACC_PUBLIC)
        PHP_ME(HttpMessageBody, toCallback,   ai_HttpMessageBody_toCallback,   ZEND_ACC_PUBLIC)
        PHP_ME(HttpMessageBody, getResource,  ai_HttpMessageBody_getResource,  ZEND_ACC_PUBLIC)
+       PHP_ME(HttpMessageBody, getBoundary,  ai_HttpMessageBody_getBoundary,  ZEND_ACC_PUBLIC)
        PHP_ME(HttpMessageBody, append,       ai_HttpMessageBody_append,       ZEND_ACC_PUBLIC)
        PHP_ME(HttpMessageBody, addForm,      ai_HttpMessageBody_addForm,      ZEND_ACC_PUBLIC)
        PHP_ME(HttpMessageBody, addPart,      ai_HttpMessageBody_addPart,      ZEND_ACC_PUBLIC)