*** Functions ***

This is a list and short description of some of the main functions available
from the server (main.c). This is by no means a comprehensive list but these
functions are the ones you will use most in creating your "mudlib".

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

write_sock(int socket,char *text)
    Write the text to the given socket.

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.

OBJECT reclone(char *object_name,int room,int interval)
    This function will set up a structure element with a room structure that
    allows you to define whether and object will be recloned in a given room
    if it is not currently there. Because of this this facility is really only
    of use for items or npcs that do not move. On a moving npc the server will
    reclone it if it is not in its start room after the given interval. See
    objects.c for an example.


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_has(OBJECT object, char *item_name)
    Returns position in inventory of item else returns -1.

OBJECT 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.

OBJECT 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.

OBJECT 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,OBJECT killer)
    Puts the object on the regeneration list. killer is the object which 
    killed it if there was one.

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.


Memory lists
------------

int add_memlist(OBJECT obj,char *elem)
   This adds an element to the objects memory list (obj->memlist).

int del_memlist_elem(OBJECT obj,char *elem)
   This deletes the first occurance of the given element from the objects 
   memory list.

int del_memlist_elem(OBJECT obj,int pos);
   This delete the element at position pos.

int alter_memlist(OBJECT obj,char *elem,int pos)
   Replaces the element at position pos with the new element supplied.

char *get_memlist_elem(OBJECT obj,int pos)
   This returns the element at position pos.

get_memlist_pos(OBJECT obj,char *elem)
   This returns the position the element is found at in the list.

get_memlist_pos2(OBJECT obj,char *elem,int pos)
   This returns the position the element is found at in the list with the
   search starting at position pos.


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.

exits_contents(OBJECT user,int links[],char *extra_exits)
     This function is used in every room to show the user what is in the
     room and where the exits are. Extra_exits is a string that will be 
     displayed after the hard coded exits (defined by links) and this allows
     the room to have exits that are different to the standard north, south
     etc. Eg you could have an exit called "pub". The code to parse this
     exit has to be in the room code however.

char *get_indef_art(char *word)
     Returns the appropriate indefinite article ('a' or 'an') for the given
     word.
