X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=php_http_message_api.h;fp=php_http_message_api.h;h=8e9084135792c197b393228cbc7bbf9ebf0a5070;hb=120b03d9b12c4946391584e910d11713006f7018;hp=cf942567d371411cabcb44aef8781ae4611ccdd1;hpb=bf34f97f799dde077889f667a8432b83bc0acb5c;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)