69 lines
1.3 KiB
C
69 lines
1.3 KiB
C
|
//you are butifull, you are butifull
|
||
|
dword ShowSource()
|
||
|
{
|
||
|
dword new_buf, new_buf_start, i;
|
||
|
byte ww, param, comment;
|
||
|
|
||
|
if (souce_mode) return;
|
||
|
souce_mode = true;
|
||
|
new_buf_start = new_buf = malloc(bufsize*5);
|
||
|
strcat(new_buf, "<pre>");
|
||
|
for (i=bufpointer; i<bufpointer+bufsize; i++)
|
||
|
{
|
||
|
ww = ESBYTE[i];
|
||
|
new_buf++;
|
||
|
switch (ww)
|
||
|
{
|
||
|
case '<':
|
||
|
if (ESBYTE[i+1]=='!') && (ESBYTE[i+2]=='-') && (ESBYTE[i+3]=='-')
|
||
|
{
|
||
|
strcat(new_buf, "<font color=#ccc><");
|
||
|
new_buf+=20;
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
strcat(new_buf, "<font color=#00f><");
|
||
|
new_buf+=20;
|
||
|
}
|
||
|
break;
|
||
|
case '>':
|
||
|
if (!param) //fix non-closed quote
|
||
|
{
|
||
|
param = 1;
|
||
|
strcat(new_buf, ""</font>");
|
||
|
new_buf+=12;
|
||
|
}
|
||
|
if (ESBYTE[i-1]=='-') && (ESBYTE[i-2]=='-')
|
||
|
{
|
||
|
strcat(new_buf, "></font>");
|
||
|
new_buf+=10;
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
strcat(new_buf, "></font>");
|
||
|
new_buf+=10;
|
||
|
}
|
||
|
break;
|
||
|
case '\"':
|
||
|
case '\'':
|
||
|
if (param)
|
||
|
{
|
||
|
param = 0;
|
||
|
strcat(new_buf, "<font color=#f0f>"");
|
||
|
new_buf+=22;
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
param = 1;
|
||
|
strcat(new_buf, ""</font>");
|
||
|
new_buf+=12;
|
||
|
}
|
||
|
break;
|
||
|
default:
|
||
|
chrcat(new_buf, ww);
|
||
|
}
|
||
|
}
|
||
|
bufsize = new_buf;
|
||
|
free(bufpointer);
|
||
|
bufpointer = new_buf_start;
|
||
|
}
|