rename info tests
[m6w6/ext-http] / php_http_cookie.h
index 9307358..7cf00fe 100644 (file)
@@ -6,12 +6,10 @@
     | modification, are permitted provided that the conditions mentioned |
     | in the accompanying LICENSE file are met.                          |
     +--------------------------------------------------------------------+
-    | Copyright (c) 2004-2010, Michael Wallner <mike@php.net>            |
+    | Copyright (c) 2004-2014, Michael Wallner <mike@php.net>            |
     +--------------------------------------------------------------------+
 */
 
-/* $Id: php_http_cookie_api.h 292841 2009-12-31 08:48:57Z mike $ */
-
 #ifndef PHP_HTTP_COOKIE_H
 #define PHP_HTTP_COOKIE_H
 
@@ -32,6 +30,7 @@ typedef struct php_http_cookie_list {
        char *path;
        char *domain;
        time_t expires;
+       time_t max_age;
 
 #ifdef ZTS
        void ***ts;
@@ -39,29 +38,30 @@ typedef struct php_http_cookie_list {
 } php_http_cookie_list_t;
 
 PHP_HTTP_API php_http_cookie_list_t *php_http_cookie_list_init(php_http_cookie_list_t *list TSRMLS_DC);
-PHP_HTTP_API php_http_cookie_list_t *php_http_cookie_list_parse(php_http_cookie_list_t *list, const char *string, long flags, char **allowed_extras TSRMLS_DC);
+PHP_HTTP_API php_http_cookie_list_t *php_http_cookie_list_parse(php_http_cookie_list_t *list, const char *str, size_t len, long flags, char **allowed_extras TSRMLS_DC);
 PHP_HTTP_API php_http_cookie_list_t *php_http_cookie_list_copy(php_http_cookie_list_t *from, php_http_cookie_list_t *to);
 PHP_HTTP_API void php_http_cookie_list_dtor(php_http_cookie_list_t *list);
 PHP_HTTP_API void php_http_cookie_list_free(php_http_cookie_list_t **list);
 
-#define php_http_cookie_list_has_cookie(list, name, name_len) zend_hash_exists(&(list)->cookies, (name), (name_len)+1)
+#define php_http_cookie_list_has_cookie(list, name, name_len) zend_symtable_exists(&(list)->cookies, (name), (name_len)+1)
+#define php_http_cookie_list_del_cookie(list, name, name_len) zend_symtable_del(&(list)->cookies, (name), (name_len)+1)
 PHP_HTTP_API void php_http_cookie_list_add_cookie(php_http_cookie_list_t *list, const char *name, size_t name_len, const char *value, size_t value_len);
-PHP_HTTP_API const char *php_http_cookie_list_get_cookie(php_http_cookie_list_t *list, const char *name, size_t name_len);
+PHP_HTTP_API const char *php_http_cookie_list_get_cookie(php_http_cookie_list_t *list, const char *name, size_t name_len, zval **cookie);
 
-#define php_http_cookie_list_has_extra(list, name, name_len) zend_hash_exists(&(list)->extras, (name), (name_len)+1)
+#define php_http_cookie_list_has_extra(list, name, name_len) zend_symtable_exists(&(list)->extras, (name), (name_len)+1)
+#define php_http_cookie_list_del_extra(list, name, name_len) zend_symtable_del(&(list)->extras, (name), (name_len)+1)
 PHP_HTTP_API void php_http_cookie_list_add_extra(php_http_cookie_list_t *list, const char *name, size_t name_len, const char *value, size_t value_len);
-PHP_HTTP_API const char *php_http_cookie_list_get_extra(php_http_cookie_list_t *list, const char *name, size_t name_len);
+PHP_HTTP_API const char *php_http_cookie_list_get_extra(php_http_cookie_list_t *list, const char *name, size_t name_len, zval **extra);
 
 PHP_HTTP_API void php_http_cookie_list_to_string(php_http_cookie_list_t *list, char **str, size_t *len);
 PHP_HTTP_API php_http_cookie_list_t *php_http_cookie_list_from_struct(php_http_cookie_list_t *list, zval *strct TSRMLS_DC);
 PHP_HTTP_API void php_http_cookie_list_to_struct(php_http_cookie_list_t *list, zval *strct);
 
-
-extern zend_class_entry *php_http_cookie_class_entry;
-extern zend_function_entry php_http_cookie_method_entry[];
+PHP_HTTP_API zend_class_entry *php_http_cookie_class_entry;
 
 typedef struct php_http_cookie_object {
-       zend_object o;
+       zend_object zo;
+       zend_object_value zv;
        php_http_cookie_list_t *list;
 } php_http_cookie_object_t;
 
@@ -70,32 +70,7 @@ zend_object_value php_http_cookie_object_new_ex(zend_class_entry *ce, php_http_c
 zend_object_value php_http_cookie_object_clone(zval *this_ptr TSRMLS_DC);
 void php_http_cookie_object_free(void *object TSRMLS_DC);
 
-PHP_METHOD(HttpCookie, __construct);
-PHP_METHOD(HttpCookie, getCookies);
-PHP_METHOD(HttpCookie, setCookies);
-PHP_METHOD(HttpCookie, addCookies);
-PHP_METHOD(HttpCookie, getExtras);
-PHP_METHOD(HttpCookie, setExtras);
-PHP_METHOD(HttpCookie, addExtras);
-PHP_METHOD(HttpCookie, getCookie);
-PHP_METHOD(HttpCookie, setCookie);
-PHP_METHOD(HttpCookie, addCookie);
-PHP_METHOD(HttpCookie, getExtra);
-PHP_METHOD(HttpCookie, setExtra);
-PHP_METHOD(HttpCookie, addExtra);
-PHP_METHOD(HttpCookie, getDomain);
-PHP_METHOD(HttpCookie, setDomain);
-PHP_METHOD(HttpCookie, getPath);
-PHP_METHOD(HttpCookie, setPath);
-PHP_METHOD(HttpCookie, getExpires);
-PHP_METHOD(HttpCookie, setExpires);
-PHP_METHOD(HttpCookie, getFlags);
-PHP_METHOD(HttpCookie, setFlags);
-PHP_METHOD(HttpCookie, toString);
-PHP_METHOD(HttpCookie, toArray);
-
-extern PHP_MINIT_FUNCTION(http_cookie);
-
+PHP_MINIT_FUNCTION(http_cookie);
 
 #endif