#include
", stream);
in_para_p = Ct;
}
}
else if (processp)
writestr_stream ("
", stream);
}
else if (processp)
writec_stream (' ', stream);
}
if (i >= length)
break;
switch (s[i])
{
case '<':
writestr_stream ("<", stream);
break;
case '>':
writestr_stream (">", stream);
break;
case '&':
if ((i + 2) < length)
{
for (j = i + ((s[i + 1] == '#') ? 2 : 1); (j < length) && isalnum (s[j]); ++j);
if ((j < length) && (s[j] == ';'))
{
writec_stream ('&', stream);
break;
}
}
writestr_stream ("&", stream);
break;
case 'h':
case 'f':
if ((flags & LINKIFY_URLS_P)
&& !url_state
&& ((i + 10) < length)
&& (s[i + 5] == '/')
&& ((strncmp (s + i, "http://", 7) == 0)
|| (strncmp (s + i, "ftp://", 6) == 0)))
{
for (j = i + 6;
((j < length) && !isspace (s[j]) && (s[j] != '"') && (s[j] != '\'')
&& (s[j] != '<') && (s[j] != '>') && (s[j] != '[') && (s[j] != ']')
&& (s[j] != '(') && (s[j] != ')') && (s[j] != '{') && (s[j] != '}')
&& !((s[j] == '&') && (strncmp (s + j + 1, "nbsp;", 5) == 0)));
++j);
/* Ensure that the last character is a slash or alphanumeric. */
for (; (s[j - 1] != '/') && !isalnum (s[j - 1]); --j);
/* Only a URL if it satisfies the minimum length. */
if ((j - i) > 10)
{
url_start = i;
url_end = j;
url_state = (((strncmp (s + j - 4, ".gif", 4) == 0)
|| (strncmp (s + j - 4, ".jpg", 4) == 0)
|| (strncmp (s + j - 5, ".jpeg", 5) == 0)
|| (strncmp (s + j - 4, ".png", 4) == 0))
? 3
: 1);
writestr_stream ((url_state == 1)
? "st.st_self;
int length = string->st.st_fillp, i = 0, j;
int width = max_width;
while (i < length)
{
if (isspace (s[i]))
{
writec_stream (s[i], stream);
if (s[i] == '\n')
width = max_width;
else
--width;
++i;
}
else
{
for (j = i; (j < length) && !isspace (s[j]); ++j);
width -= (j - i);
if (width < 0)
{
writec_stream ('\n', stream);
width = max_width - (j - i);
}
for (; i < j; ++i)
writec_stream (s[i], stream);
if (width < 0)
{
writec_stream ('\n', stream);
width = max_width;
}
}
}
}