X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;ds=sidebyside;f=php_http_message_api.h;h=8e9084135792c197b393228cbc7bbf9ebf0a5070;hb=96c0ae82ca8cda98d70b87597d765a9d050129de;hp=cf942567d371411cabcb44aef8781ae4611ccdd1;hpb=d5930114b227ce9c9ce71d3930291f333750c192;p=m6w6%2Fext-http diff --git a/php_http_message_api.h b/php_http_message_api.h index cf94256..8e90841 100644 --- a/php_http_message_api.h +++ b/php_http_message_api.h @@ -62,6 +62,12 @@ static inline zval *_http_message_header_ex(http_message *msg, char *key_str, si return NULL; } +#define http_message_count(c, m) \ +{ \ + http_message *__tmp_msg = (m); \ + for (c = 0; __tmp_msg; __tmp_msg = __tmp_msg->parent, ++(c)); \ +} + #define http_message_parse(m, l) http_message_parse_ex(NULL, (m), (l)) #define http_message_parse_ex(h, m, l) _http_message_parse_ex((h), (m), (l) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC TSRMLS_CC) #define http_message_parse_rel(h, m, l) _http_message_parse_ex((h), (m), (l) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC TSRMLS_CC)