Update Logfile Function

This function is useful for copyovers, after a copyover recovery completes you can initiate this to 
redirect your log output. If your MUD soley uses copyover to handle reboots, logfiles get very 
large, this helps break them up making them easier to find. It requires the timestamp function to 
work.

Timestamp Function

This useful function returns a timestamp for usage wherever you might require one to be added. 
It is particularly nifty for logging and log related commands where you would need a timestamp, 
and can be used to replace existing timestamps to conserve resources.


Time Functions

Presently only includes friendly_ctime, a user friendly version of ctime that breaks from the
unpleasant military time into a more simplistic standard 12/12 time. It mimics the loog and
feel of ctime, with the exception of the AM/PM, and the lack of the annoying newline at the
end of the string, so you don't have to waste time/space removing one you don't need.

Wordwrap Functions

This function wraps the input text into the formatting specified, cutting off with a /n/r
whenever the specified length is reached.

Sendmail Function

This function allows your mud to send email. This is just the core essentials. All you have to do
is pass the required information, and it sends it. You can use this for anything from having your
MUD email you when crash, to creating and email command to send mail to players from within the
MUD, in fact, its versatile enough to do all of that and still be used for anything else you
might want to do with it. This function does no error checking on its own, and will try to do
what it is told to, no matter what. For this reason you should be careful to ensure that whatever
other functions and commands it is called from, do their own validation, or you add your own.

Printf Functions

This is a collection of buffer reduction commands, to save space and time, and make things 
generally more clean and efficient. Rather than creating extra variables all over the place, these 
allow a coder to do in one line what may have taken 2 to 5.

	buffer_printf(DESCRIPTOR_DATA *d, char *fmt, ...)

	This sends to a descriptor the formatted information specified. 
	Example: 
	buffer_printf( d, "%s made this command for you %s.\n\r", "Eos", d->character->name);

	log_printf( sh_int log_type, char *fmt, ...)

	This will send to the log channel specified in log_type the information specified.
	Example: 
	log_printf( log_comm, "%s tried to kill %s.\n\r", ch->name, victim->name);


	command( CHAR_DATA *ch, DO_FUN *command, char *fmt, ...)

	This invokes the command specified, on behalf of ch, doing the information as specified.
	Example: 
	command( mob, do_say, "Sorry %s, you can't afford %s", ch->name, obj->short_descr);


	stralloc_printf( char **pointer, char *fmt, ...)

	Better than having to use a buffer, strfree, then stralloc, this does it all in one. 
	Example: 
	stralloc_printf( obj->short_descr, "A ball created by %s", ch->name);

	strdup_printf( char **pointer, char *fmt, ...)

	Better than disposing, and then strduping a buffer, does it all in one.
	Example: 
	strdup_printf( ch->pcdata->password, "%s", crypt(argument));

	format( char *fmt, ...)

	Rather than declare a local variable (like buf) and use sprintf on it, this can be used anywhere.
	Example: 
	do_say( ch, format( "Hi %s my name is %s I'm a %s %s.", victim->name, ch->name, race_table[ch->race]->race_name, class_table[ch->class]->who_name ) );

Math Functions

Some basic mathmatical functions to help with various things you never know if you'll need.

	what_percent( float x, float y)

	This function returns the % of x that y is.
	Example: 
	what_percent( victim->hit, victim->max_hit) will tell you what percentage of a 
	persons hitpoints they are. (5, 20) for example would return 25%.

	num_in_range(int x, int n, int y)

	This returns TRUE if n is higher than x, and lower than y. Just a nice shortcut to those 
	ifchecks that say the same thing in twice as much space.
	Example: 
	if (num_in_range(minalign, ch->align, maxalign))

	big_number_fuzzy( int number )

	This odd command fuzzies EACH digit of a number.
	Example: 
	111 may come out as: 001, to 222, as each digit is fuzzied.

Common Sense Functions Noone Ever Made

These are things SMAUG somehow doesn't have, that it really should. Sometimes the simplest most 
sensible things don't get thought of though. Redundancy is sin! 

	get_race_by_name( char *argument)
	get_class_by_name( char *argument)

	Both of these quite obviously return the # of the corresponding race/class based on name.
	
	get_mob(int vnum)
	obj_by_vnum(int vnum)

	These two find an instance of a mobile/object in existance, based on its vnum and return a 
	pointer to it.

	CHAR_DATA *get_player_world( char *argument)

	This function returns a pointer to the first matching character named, period
	As long as the character exists, and is loaded, and is not a mob, this will
        point to them, without needing a second character to base whether or not they
        can be seen. The primary usage for this, is for letting your mud quickly find and
        send messages to individuals who are logged on, such us when using a notice system,
        or tells, etc. Because it returns a pointer to the character, any required checks to
        specially validate the character can still be performed, without actually requiring them
        to be done within the search.