cvs: pecl /mailparse php_mailparse_rfc822.c
| From: | Wez Furlong | Date: | Sat, 20 Dec 2003 02:38:58 +0000 |
| Subject: | cvs: pecl /mailparse php_mailparse_rfc822.c | ||
| Groups: | php.pecl.cvs | ||
| Request: | Send a blank email to pecl-cvs+get-603@lists.php.net to get a copy of this message | ||
wez Fri Dec 19 21:38:58 2003 EDT
Modified files:
/pecl/mailparse php_mailparse_rfc822.c
Log:
commit this after the .re to avoid problems for people without re2c
Index: pecl/mailparse/php_mailparse_rfc822.c
diff -u pecl/mailparse/php_mailparse_rfc822.c:1.9 pecl/mailparse/php_mailparse_rfc822.c:1.10
--- pecl/mailparse/php_mailparse_rfc822.c:1.9 Sat Apr 19 18:59:57 2003
+++ pecl/mailparse/php_mailparse_rfc822.c Fri Dec 19 21:38:58 2003
@@ -1,5 +1,5 @@
-/* Generated by re2c 0.5 on Sat Apr 19 23:58:33 2003 */
-#line 1 "/home/wez/src/php/php4.3-cvs/ext/mailparse/php_mailparse_rfc822.re"
+/* Generated by re2c 0.5 on Sat Dec 20 02:34:54 2003 */
+#line 1 "..\\pecl\\mailparse\\php_mailparse_rfc822.re"
/*
+----------------------------------------------------------------------+
| PHP Version 4 |
@@ -17,15 +17,17 @@
| Author: Wez Furlong <wez@thebrainroom.com> |
+----------------------------------------------------------------------+
*/
-/* $Id: php_mailparse_rfc822.c,v 1.9 2003/04/19 22:59:57 wez Exp $ */
+/* $Id: php_mailparse_rfc822.c,v 1.10 2003/12/20 02:38:58 wez Exp $ */
#include "php.h"
+#include "php_mailparse.h"
#include "php_mailparse_rfc822.h"
+#include "ext/standard/php_string.h"
#include "ext/standard/php_smart_str.h"
-#line 37
+#line 39
-#line 46
+#line 48
#define YYFILL(n) if (YYCURSOR == YYLIMIT) goto stop
@@ -48,7 +50,7 @@
counted, allowing the caller to allocate enough room */
static void tokenize(const char *header, php_rfc822_token_t *tokens, int *ntokens, int
report_errors TSRMLS_DC)
{
- register const char *p, *q, *r, *start;
+ register const char *p, *q, *start;
int in_bracket = 0;
/* NB: parser assumes that the header has two bytes of NUL terminator */
@@ -154,25 +156,25 @@
}
yy2: yych = *++YYCURSOR;
yy3:
-#line 86
+#line 88
{ goto stop; }
yy4: ++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
yy5: if(yybm[0+yych] & 32) goto yy4;
yy6:
-#line 87
+#line 89
{ DBG_STATE("SPACE"); goto state_ground; }
yy7: yych = *++YYCURSOR;
yy8:
-#line 88
+#line 90
{ REPORT_ERR("token not valid in ground state"); goto state_ground; }
yy9: yych = *++YYCURSOR;
if(yybm[0+yych] & 128) goto yy21;
goto yy8;
yy10: yych = *++YYCURSOR;
yy11:
-#line 89
+#line 91
{ DBG_STATE("START COMMENT");
if (tokens) {
tokens->token = '(';
@@ -189,7 +191,7 @@
yy14:yy15: yych = *++YYCURSOR;
if(yych == '>') goto yy24;
yy16:
-#line 121
+#line 123
{ DBG_STATE("LANGLE");
if (in_bracket) {
REPORT_ERR("already in < bracket");
@@ -201,7 +203,7 @@
}
yy17: yych = *++YYCURSOR;
yy18:
-#line 130
+#line 132
{ DBG_STATE("RANGLE");
if (!in_bracket) {
REPORT_ERR("not in < bracket");
@@ -213,14 +215,14 @@
}
yy19: yych = *++YYCURSOR;
yy20:
-#line 139
+#line 141
{ DBG_STATE("ATOM"); ADD_ATOM_TOKEN(); goto state_ground; }
yy21: ++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
yy22: if(yybm[0+yych] & 128) goto yy21;
yy23:
-#line 140
+#line 142
{ DBG_STATE("ANY");
if (tokens) {
tokens->token = 0;
@@ -233,7 +235,7 @@
}
yy24: yych = *++YYCURSOR;
yy25:
-#line 108
+#line 110
{ DBG_STATE("NULL <>");
ADD_ATOM_TOKEN();
if (tokens) {
@@ -249,7 +251,7 @@
}
yy26: yych = *++YYCURSOR;
yy27:
-#line 97
+#line 99
{ DBG_STATE("QUOTE STRING");
if (tokens) {
tokens->token = '"';
@@ -262,7 +264,7 @@
goto state_ground;
}
}
-#line 150
+#line 152
state_comment:
@@ -303,10 +305,12 @@
#if DEBUG_RFC822_SCANNER
printf("STOPing parser ntokens=%d YYCURSOR=%p YYLIMIT=%p start=%p cursor=[%d] %s
start=%s\n", *ntokens,
YYCURSOR, YYLIMIT, start, *YYCURSOR, YYCURSOR, start);
+#else
+ ;
#endif
}
-PHPAPI php_rfc822_tokenized_t *php_mailparse_rfc822_tokenize(const char *header, int report_errors
TSRMLS_DC)
+PHP_MAILPARSE_API php_rfc822_tokenized_t *php_mailparse_rfc822_tokenize(const char *header, int
report_errors TSRMLS_DC)
{
php_rfc822_tokenized_t *toks = ecalloc(1, sizeof(php_rfc822_tokenized_t));
int len = strlen(header);
@@ -322,7 +326,7 @@
return toks;
}
-PHPAPI void php_rfc822_tokenize_free(php_rfc822_tokenized_t *toks)
+PHP_MAILPARSE_API void php_rfc822_tokenize_free(php_rfc822_tokenized_t *toks)
{
if (toks->tokens)
efree(toks->tokens);
@@ -330,7 +334,7 @@
efree(toks);
}
-PHPAPI char *php_rfc822_recombine_tokens(php_rfc822_tokenized_t *toks, int first_token, int
n_tokens, int flags)
+PHP_MAILPARSE_API char *php_rfc822_recombine_tokens(php_rfc822_tokenized_t *toks, int first_token,
int n_tokens, int flags)
{
char *ret = NULL;
int i, upper, last_was_atom = 0, this_is_atom = 0, tok_equiv;
@@ -578,7 +582,7 @@
goto mailbox;
}
-PHPAPI php_rfc822_addresses_t *php_rfc822_parse_address_tokens(php_rfc822_tokenized_t *toks)
+PHP_MAILPARSE_API php_rfc822_addresses_t *php_rfc822_parse_address_tokens(php_rfc822_tokenized_t
*toks)
{
php_rfc822_addresses_t *addrs = ecalloc(1, sizeof(php_rfc822_addresses_t));
@@ -589,7 +593,7 @@
return addrs;
}
-PHPAPI void php_rfc822_free_addresses(php_rfc822_addresses_t *addrs)
+PHP_MAILPARSE_API void php_rfc822_free_addresses(php_rfc822_addresses_t *addrs)
{
int i;
for (i = 0; i < addrs->naddrs; i++) {