*** Functions ***

This is a list and short description of some of the main functions available
from the server (main.c).

Writing functions
-----------------

write_user(OBJECT user,char *text)
    Write the text to the specified user.

write_wiz(OBJECT user,char *text);
    Write the text to all the wizards and higher currently logged on.

write_room(int room,char *text)
    Write text to the room specified , or if room = -1 then to all rooms.

write_room_except(int room,char *text,OBJECT user1,OBJECT user2)
    Write text to all in the room specified except for user1 and user2. These
    can be NULL if required.

write_region(int region,char *text)
    Write text to all in specified region.

write_syslog(char *text,int write_time)
    Write text to system log. If write_time is 1 then prepend time of 
    writing to message.


Object functions
----------------

OBJECT construct(int (*func_ptr)(),int is_corpse)
    Construct an object that has func_ptr as its control function. If 
    is_corpse is 1 then object is given control function of corpse_func.
    Returns the objects pointer.

destruct(OBJECT object,int recurse)
    Destroy an object. If recurse is 1 then destroy all object it is carrying/
    contains else drop them in the objects current room.

OBJECT clone(char *object_name,int room,int is_corpse)
    Clone an object from a master object using the name. The name is used 
    instead of the function pointer so that this command can be used in a
    piece of code without the pointer having to be declared all the time.
    The object is placed in the room passed. Is_corpse simply gets passed
    onto construct(). Returns the objects pointer.

inactivate(OBJECT object)
    Inactivate an object and any objects in its inventory. The object will
    remain for 2 heartbeats (to allow any other objects to remove its pointer
    from their variables) then it is destructed.

int object_inven_add(OBJECT object,OBJECT item)
    Add item to the inventory of object and undate appropriate stats. Various
    error codes are returned if it cannot be done. See code for details.

int object_inven_remove(OBJECT object,OBJECT item)
    Removes items from inventory. Returns 1 or 0 for success/failure.

int object_have(OBJECT object,char *item_name)
    Does the same as object_inven_add except the item name is specified
    and a new item is cloned by this function.

int npc_wield(OBJECT npc,char *weapon_name)
    Allows the npc to wield the weapon. If the name is not that of a weapon
    then an error will result. The npc's stats are updated accordingly.

int npc_wear(OBJECT npc,char *clothing_name)
    Same as above except for clothing. If the clothing is also armour then
    the armour points will be increased.

object_say(OBJECT object,char *text)
    This function is not really necessary but it provides a convenient way
    of an npc or user to say something and store it in the last_say element
    at the same time.

object_shout(OBJECT object,char *text)
    Same as about except it applies to shouting. Gets stored in last_shout.

int move_object(OBJECT object,int direction)
    Move an npc/user in direction dir. This does a lot of stuff including
    resetting room light levels and making any following objects move too.

int randmove(OBJECT npc,int fight_ignore)
    Move an npc randomly. If fight_ignore is 1 then move even if in a fight.

int patrol(OBJECT npc,int fight_ignore)
    Make an npc move to the next patrol room according to the structure
    array pat[MAX_PATROL].

set_patrol(OBJECT object,int *rooms)
    This provides a convenient way to set up a large patrol array without
    initialising each element seperately.

set_barrier(OBJECT object,int *rooms)
    This provides a convenient way to set up a large barrier array 
    (bar[MAX_BARRIER]). The barriers are checked by randmove() and patrol()
    and the npc will not be allowed to move into a barrier room.

int is_barrier(OBJECT npc,int room)
    Checks if the room is a barrier to the npc.

int regenerate_pending(OBJECT obj)
    Puts the object on the regeneration list.

int add_object_event(OBJECT object,int (*func_ptr)())
    Adds the function to the objects event list (event[MAX_OBJ_EVENTS]).

int remove_object_event(OBJECT object,int (*func_ptr)())
    Removes the function from the event list.


User functions
--------------

int add_user_skill(OBJECT user,char *skill_name)
    Adds the skill to the users skill list (skill[MAX_USER_SKILLS]). 
    The skill name and function are stored together in the skills[NUM_SKILLS]
    global array.

int remove_user_skill(OBJECT user,char *skill_name)
    Removes the skill from the users list.


Miscellanious
-------------

find_sent_objects(OBJECT obj,int command,int start)
    Finds the 2 objects in the users input sentence. Output is in inp_obj1
and inp_obj2 which are the structure pointers of the objects and inp_objstr1
and inp_objstr2 which are the object names. join_word is the joining word
found in the sentence. It uses word[] as its input.

int instr(char *searched_in, char *searched_for)
   	Returns position for string is found in the in string else returns -1.

strtolower(char *str), strtoupper(char *str) 
     Converts string str to lower or upper case.

int isnumber(char *str)
     Returns 1 if string is a positive number else 0.

char *remove_first(char *inpstr)
     Returns position of 2nd word in string.

int more(OBJECT user,int socket,char *filename)
     Pages a file out to the user. It uses the structure elements file_posn
     and page_file as controlling variables.

int set_light(int room)
     Sets the light in the room to on or off depending on a number of factors.
     The returned value is the rooms current state of illumination, 1 or 0.
