I know I'm like 20 years late to this party, but here I am none the less.
I've recently started dabbling with SWR FUSS through Cygwin. Nick's guides were immensely helpful for getting it all running.
Now I've begun the journey to learn how this archaic code base works. I have a reasonable amount of programming experience, but I've been pampered by loosely typed scripting languages and never dealt with this level of complexity. I always intended to get experience coding in C, but it just never happened.
What I'm trying to accomplish is prevent the buffer from counting color/background/formatting tokens towards the buffer limit. Currently if you write something with &W, &B, or any other token character, it uses them in the calculation. This can stunt the available size of output and cause lines to be misplaced if one line uses a significant amount of color. These tokens are not actually displayed to the screen either.
I've been exploring code files and I believe I am on the right track. I have been digging into "editor.c" and "comm.c" for awhile now. However, I'm having trouble isolating where the buffer operation is occurring.
I think it is somewhere around this function:
I have been toying with some ideas for how to approach this programming wise.
This is my initial idea in what I think is mostly C syntax, but mgith be off:
This is my initial brain storm. I'm really inexperienced with C and tampering with SMAUG. I appreciate any advice, wisdom, or insights you wonderful people in the community can offer.
[EDIT] Forum codes fixed up.
I've recently started dabbling with SWR FUSS through Cygwin. Nick's guides were immensely helpful for getting it all running.
Now I've begun the journey to learn how this archaic code base works. I have a reasonable amount of programming experience, but I've been pampered by loosely typed scripting languages and never dealt with this level of complexity. I always intended to get experience coding in C, but it just never happened.
What I'm trying to accomplish is prevent the buffer from counting color/background/formatting tokens towards the buffer limit. Currently if you write something with &W, &B, or any other token character, it uses them in the calculation. This can stunt the available size of output and cause lines to be misplaced if one line uses a significant amount of color. These tokens are not actually displayed to the screen either.
I've been exploring code files and I believe I am on the right track. I have been digging into "editor.c" and "comm.c" for awhile now. However, I'm having trouble isolating where the buffer operation is occurring.
I think it is somewhere around this function:
for( i = 0, k = 0; d->inbuf[i] != '\n' && d->inbuf[i] != '\r'; i++ )
{
if( k >= 254 )
{
write_to_descriptor( d, "Line too long.\n\r", 0 );
/*
* skip the rest of the line
*/
d->inbuf[i] = '\n';
d->inbuf[i + 1] = '\0';
break;
}
I have been toying with some ideas for how to approach this programming wise.
This is my initial idea in what I think is mostly C syntax, but mgith be off:
for(i = 0; i < strlen(string);i++)
{
if(string[i\] == "&")
{
if!(string[i + 1] == "W" || string[i + 1] == "B")
{
//Letter does not match color tokens, add to buffer
//This if would have a bunch of ORs for each letter, but is condensed for example
cur_buffer_size++;
}
else{
//Letter matches a token, increment to skip the next letter
i++;
}
}
}
This is my initial brain storm. I'm really inexperienced with C and tampering with SMAUG. I appreciate any advice, wisdom, or insights you wonderful people in the community can offer.
[EDIT] Forum codes fixed up.