lw.h - the linewrap includefile.

Written by Ethereal Cashimor.

Introduction.

When a line is too long to be displayed on the screen, usually it will
be broken off somewhere (in the middle of a word) and the second part
will be printed on the next line. Some terminals do not support this:
the rest of the line is lost. Both things are very ugly. Sometimes the
programmer does not know the length of the line he/she'll be printing.
Because of the inclusion of a string with an unknown length. In this
case a small function that automagically inserted \n's in a way that
the line can be displayed correctly would be handy. This function is
provided by lw.h.

Normal usage.

To use lw.h all you have to do is include it in your file (preferably
AFTER an inherit instruction, though at the moment it could be placed
before them). Some inheritfiles (room/room.c for example) already
include lw.h, in that case it should not be included by the programmer.
example to include lw.h:

inherit "obj/thing";
#include "/obj/lw.h"

reset(arg) {
...

The usage is very simple, lw.h provides a function lw(str) which needs
the string as argument, without \n's, unless to end a paragraph.
lw(str) returns the string with \n's inserted preventing the text to
grow above 78 characters long. lw(str) will NOT insert a \n at the end
of the string str. Example:

write(lw("This is a example of a text that will be line-wrapped by "
       + "the great lw(str) routine. Just to make sure I have more "
       + "than 80 characters, I'll make three lines of text here..."
       + " (*grin*)\n"));

Special usages:

If one wants to change the number of characters on which it
works, one can do an #undef SCREEN_WIDTH followed by a new #define to
specify the desired width for the text. Please make this only larger
than 78 for private purposes! Example:

#undef SCREEN_WIDTH
#define SCREEN_WIDTH 40

I hope this explains everything there is to know about this little two
line includefile.

Greetings,

Ethereal Cashimor
**
