Common(3)                                                            Common(3)



NNAAMMEE
       Common - Commonly used routines (but not common enough to be in
       simul_efun).

SSYYNNOOPPSSIISS
       Inherited by FFiinnggeerr__ddaaeemmoonn, SShhuutt, and WWiizzaarrdd.


   PPuubblliicc MMeetthhooddss
       string ggeett__aarreeaa__ddiirr (string str)
       string iinntt__ttoo__ttiimmee (int x)
       int lleeggaall__ffiilleennaammee (string fname)
       varargs object * ppaarrssee__ssiimmppllee (string idstr, object container, int
           force_plural)
       varargs object * oolldd__aallll__pprreesseenntt (string id, object env)

DDEETTAAIILLEEDD DDEESSCCRRIIPPTTIIOONN
       Commonly used routines (but not common enough to be in simul_efun).

       You should include <common.h> if you intend to use many functions from
       this file. You may also use functions with call_other.

       This file contains common functions which it seemed unjustified to make
       simul_efun's. These may be migrated to simul_efun's later.

       Definition at line 11 of file common.c.

MMEEMMBBEERR FFUUNNCCTTIIOONN DDOOCCUUMMEENNTTAATTIIOONN
   ssttrriinngg ggeett__aarreeaa__ddiirr ((ssttrriinngg ssttrr))
       An accessory function used by area objects to figure out which
       directory an area should be in.

       PPaarraammeetteerrss::

       _s_t_r    The location of the area as a semicolon-delimited object
              reference (i.e. world;reality;island;etc). Use get_location in
              order to build one.

       Definition at line 21 of file common.c.

   ssttrriinngg iinntt__ttoo__ttiimmee ((iinntt xx))
       Converts an integer number of seconds to a string giving the length of
       the time period in days, hours, minutes and seconds.

       Definition at line 53 of file common.c.

       Referenced by Finger_daemon::finger_player().

   iinntt lleeggaall__ffiilleennaammee ((ssttrriinngg ffnnaammee))
       Returns true if _f_n_a_m_e is a legal filename. This does not imply that the
       file exists, only that the filename being requested really is legal.

       Definition at line 80 of file common.c.

       Referenced by Finger_daemon::finger_player().

   vvaarraarrggss oobbjjeecctt** oolldd__aallll__pprreesseenntt ((ssttrriinngg iidd,, oobbjjeecctt eennvv))
       Returns a list of objects identified by the string id. The types of
       descriptors that can be recognized are defined as follows:

       <simple> -- A simple object reference.

       Example: table

       <location> -- A locational object reference. Uses PREP_EXP to get a
       list of valid prepositions for object locations. The format is <simple>
       [<preposition> <location>]. Note that evaluation of environment
       <simple>'s doesn't currently handle plural objects, only singular ones
       (so 'get all the fish from the bags on the table' would only look in
       the first bag on the table).

       Example: the bag on the table

       <numobj> -- [all [of]] [the|The] [<num>] <location>

       Example: the second dog --- third fish --- all five potions

       <objlist> -- <numobj> | <numobj>, <objlist> | <numobj> and <objlist> |
       <numobj>, and <objlist>

       Example: table, dog, and cat --- table and dog, cat --- table, dog and
       cat

       Evaluation:

       <simple> -- Find the first object whose iidd(()) returns true. If the
       qquueerryy__pplluurraall(()) doesn't match the search string, stop looking, otherwise
       keep going and grab all the rest of the objects whose iidd(()) strings
       match. Plural evaluation may be forced.

       <location> -- Search through the word list looking for any
       prepositions. If any are found, search for the surrounding halves as if
       they were simple expressions. Plural evaluation may be forced if a
       qquueerryy__pplluurraall(()) matches.

       <numobj> -- If 'all' or 'all of' occur as a prefix they force a plural
       evaluation of the <location> object reference. Numeric references may
       be of these types:

       #.<location>

       <numword> <location> where numword is any of 'first, second, third...'
       etc.

       <num> <location> where num is any of '1st, 2nd, 3rd, 4th...' etc.

       <count> <location> where num is any of 'one, two, three...' or '1, 2,
       3...'. In this case, you should count off however many objects before
       stopping evaluation. If a direct article occurs before the 'number
       word' it is simply stripped.

       <objlist> -- A list of object references. The <numobj> grammar is used
       for evaluating individual objects in a list. These should be split
       before being passed on, using ',' ', and' and 'and' as delimiters.

       NNoottee::
           This function doesn't solve all your problems, it is just a tool.
           For example, a 'get' function would still need to implement 'from'
           as a keyword for getting objects from inside other objects;
           however, it could parse the remainder of the expression by passing
           the phrases on either side of from to this function. In addition,
           since this function looks for objects that are already present, a
           'put' expression would need to find a preposition and parse to
           either side of it, since the object is not yet present in the place
           specified.

       Definition at line 172 of file common.c.

   vvaarraarrggss oobbjjeecctt** ppaarrssee__ssiimmppllee ((ssttrriinngg iiddssttrr,, oobbjjeecctt ccoonnttaaiinneerr,, iinntt
       ffoorrccee__pplluurraall))
       Auxiliary function for all_present.

       Definition at line 97 of file common.c.


AAUUTTHHOORR
       Generated automatically by Doxygen for Walraven from the source code.



Walraven                          8 Jan 2004                         Common(3)
