X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=php_http_message_api.h;h=8e9084135792c197b393228cbc7bbf9ebf0a5070;hp=cf942567d371411cabcb44aef8781ae4611ccdd1;hb=f8bdf6572e8b44f93cf3fbad8846419145b782b7;hpb=d5930114b227ce9c9ce71d3930291f333750c192 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)