-/* Generated by re2c 0.5 on Wed Sep 20 10:58:28 2000 */
+/* Generated by re2c 0.5 on Thu Sep 21 02:33:40 2000 */
#line 1 "/home/sas/src/php4/ext/standard/url_scanner_ex.re"
/*
+----------------------------------------------------------------------+
#define smart_str_0(x) ((x)->c[(x)->len] = '\0')
+#define smart_str_alloc(d,n) {\
+ if (n >= d->a) {\
+ d->c = erealloc(d->c, n + 129); \
+ d->a = n + 128; \
+ }\
+}
+
static inline void smart_str_append(smart_str *dest, smart_str *src)
{
size_t newlen;
dest->len = dest->a = 0;
newlen = dest->len + src->len;
- if (newlen >= dest->a) {
- dest->c = erealloc(dest->c, newlen + 129);
- dest->a = newlen + 128;
- }
+ smart_str_alloc(dest, newlen);
memcpy(dest->c + dest->len, src->c, src->len);
dest->len = newlen;
}
static inline void smart_str_appendc(smart_str *dest, char c)
{
- size_t newlen;
-
- newlen = dest->len + 1;
- if (newlen >= dest->a) {
- dest->c = erealloc(dest->c, newlen + 129);
- dest->a = newlen + 128;
- }
- dest->c[dest->len++] = c;
+ ++dest->len;
+ smart_str_alloc(dest, dest->len);
+ dest->c[dest->len - 1] = c;
}
static inline void smart_str_free(smart_str *s)
static inline void smart_str_copyl(smart_str *dest, const char *src, size_t len)
{
- dest->c = erealloc(dest->c, len + 1);
+ smart_str_alloc(dest, len);
memcpy(dest->c, src, len);
- dest->a = dest->len = len;
+ dest->len = len;
}
static inline void smart_str_appendl(smart_str *dest, const char *src, size_t len)
}
}
- if (bash)
+ if (bash)
smart_str_appendl(dest, url->c, bash - url->c);
else
smart_str_append(dest, url);
YYCURSOR = ctx->buf.c;
YYLIMIT = ctx->buf.c + ctx->buf.len;
-#line 269
+#line 268
while(1) {
if(yych != '<') goto yy4;
yy2: yych = *++YYCURSOR;
yy3:
-#line 278
+#line 277
{ PASSTHRU(); STATE = STATE_TAG; continue; }
yy4: yych = *++YYCURSOR;
yy5:
-#line 279
+#line 278
{ PASSTHRU(); continue; }
}
-#line 280
+#line 279
break;
yy8: yych = *++YYCURSOR;
goto yy13;
yy9:
-#line 285
+#line 284
{ HANDLE_TAG() /* Sets STATE */; PASSTHRU(); continue; }
yy10: yych = *++YYCURSOR;
yy11:
-#line 286
+#line 285
{ PASSTHRU(); continue; }
yy12: ++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
yy13: if(yybm[0+yych] & 128) goto yy12;
goto yy9;
}
-#line 287
+#line 286
break;
}
yy16: yych = *++YYCURSOR;
yy17:
-#line 292
+#line 291
{ PASSTHRU(); HANDLE_FORM(); STATE = STATE_PLAIN; continue; }
yy18: yych = *++YYCURSOR;
yy19:
-#line 293
+#line 292
{ PASSTHRU(); continue; }
yy20: yych = *++YYCURSOR;
yy21:
-#line 294
+#line 293
{ YYCURSOR--; STATE = STATE_ARG; continue; }
yy22: yych = *++YYCURSOR;
yy23:
-#line 295
+#line 294
{ PASSTHRU(); continue; }
}
-#line 296
+#line 295
break;
yy26: yych = *++YYCURSOR;
goto yy31;
yy27:
-#line 301
+#line 300
{ PASSTHRU(); HANDLE_ARG(); STATE = STATE_BEFORE_VAL; continue; }
yy28: yych = *++YYCURSOR;
yy29:
-#line 302
+#line 301
{ PASSTHRU(); STATE = STATE_NEXT_ARG; continue; }
yy30: ++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
yy31: if(yybm[0+yych] & 128) goto yy30;
goto yy27;
}
-#line 303
+#line 302
case STATE_BEFORE_VAL:
if(yych == ' ') goto yy41;
if(yych == '=') goto yy39;
yy35:
-#line 308
+#line 307
{ YYCURSOR--; STATE = STATE_NEXT_ARG; continue; }
yy36: yych = *++YYCURSOR;
goto yy40;
yy37:
-#line 307
+#line 306
{ PASSTHRU(); STATE = STATE_VAL; continue; }
yy38: yych = *++YYCURSOR;
goto yy35;
case 0: goto yy35;
}
}
-#line 309
+#line 308
break;
yych = *(YYMARKER = ++YYCURSOR);
if(yych != '>') goto yy54;
yy47:
-#line 316
+#line 315
{ PASSTHRU(); STATE = STATE_NEXT_ARG; continue; }
yy48: yych = *++YYCURSOR;
goto yy52;
yy49:
-#line 315
+#line 314
{ HANDLE_VAL(0); STATE = STATE_NEXT_ARG; continue; }
yy50: yych = *++YYCURSOR;
goto yy47;
}
yy56: yych = *++YYCURSOR;
yy57:
-#line 314
+#line 313
{ HANDLE_VAL(1); STATE = STATE_NEXT_ARG; continue; }
}
-#line 317
+#line 316
break;
}
#define smart_str_0(x) ((x)->c[(x)->len] = '\0')
+#define smart_str_alloc(d,n) {\
+ if (n >= d->a) {\
+ d->c = erealloc(d->c, n + 129); \
+ d->a = n + 128; \
+ }\
+}
+
static inline void smart_str_append(smart_str *dest, smart_str *src)
{
size_t newlen;
dest->len = dest->a = 0;
newlen = dest->len + src->len;
- if (newlen >= dest->a) {
- dest->c = erealloc(dest->c, newlen + 129);
- dest->a = newlen + 128;
- }
+ smart_str_alloc(dest, newlen);
memcpy(dest->c + dest->len, src->c, src->len);
dest->len = newlen;
}
static inline void smart_str_appendc(smart_str *dest, char c)
{
- size_t newlen;
-
- newlen = dest->len + 1;
- if (newlen >= dest->a) {
- dest->c = erealloc(dest->c, newlen + 129);
- dest->a = newlen + 128;
- }
- dest->c[dest->len++] = c;
+ ++dest->len;
+ smart_str_alloc(dest, dest->len);
+ dest->c[dest->len - 1] = c;
}
static inline void smart_str_free(smart_str *s)
static inline void smart_str_copyl(smart_str *dest, const char *src, size_t len)
{
- dest->c = erealloc(dest->c, len + 1);
+ smart_str_alloc(dest, len);
memcpy(dest->c, src, len);
- dest->a = dest->len = len;
+ dest->len = len;
}
static inline void smart_str_appendl(smart_str *dest, const char *src, size_t len)
}
}
- if (bash)
+ if (bash)
smart_str_appendl(dest, url->c, bash - url->c);
else
smart_str_append(dest, url);