ldmud-3.4.1/doc/
ldmud-3.4.1/doc/efun.de/
ldmud-3.4.1/doc/efun/
ldmud-3.4.1/doc/man/
ldmud-3.4.1/doc/other/
ldmud-3.4.1/mud/
ldmud-3.4.1/mud/heaven7/
ldmud-3.4.1/mud/lp-245/
ldmud-3.4.1/mud/lp-245/banish/
ldmud-3.4.1/mud/lp-245/doc/
ldmud-3.4.1/mud/lp-245/doc/examples/
ldmud-3.4.1/mud/lp-245/doc/sefun/
ldmud-3.4.1/mud/lp-245/log/
ldmud-3.4.1/mud/lp-245/obj/Go/
ldmud-3.4.1/mud/lp-245/players/lars/
ldmud-3.4.1/mud/lp-245/room/death/
ldmud-3.4.1/mud/lp-245/room/maze1/
ldmud-3.4.1/mud/lp-245/room/sub/
ldmud-3.4.1/mud/lp-245/secure/
ldmud-3.4.1/mud/morgengrauen/
ldmud-3.4.1/mud/morgengrauen/lib/
ldmud-3.4.1/mud/sticklib/
ldmud-3.4.1/mud/sticklib/src/
ldmud-3.4.1/mudlib/uni-crasher/
ldmud-3.4.1/pkg/
ldmud-3.4.1/pkg/debugger/
ldmud-3.4.1/pkg/diff/
ldmud-3.4.1/pkg/misc/
ldmud-3.4.1/src/autoconf/
ldmud-3.4.1/src/hosts/
ldmud-3.4.1/src/hosts/GnuWin32/
ldmud-3.4.1/src/hosts/amiga/
ldmud-3.4.1/src/hosts/win32/
ldmud-3.4.1/src/ptmalloc/
ldmud-3.4.1/src/util/
ldmud-3.4.1/src/util/erq/
ldmud-3.4.1/src/util/indent/hosts/next/
ldmud-3.4.1/src/util/xerq/
ldmud-3.4.1/src/util/xerq/lpc/
ldmud-3.4.1/src/util/xerq/lpc/www/
ldmud-3.4.1/test/t-030925/
ldmud-3.4.1/test/t-040413/
ldmud-3.4.1/test/t-041124/
SYNOPSIS
        object previous_object()
        object previous_object(int i)

DESCRIPTION
        Returns an object pointer to the object that did a call (call_other(),
        funcall(), etc) to the current object, if any. If that object is
        destructed, the function returns 0.

        If the optional arg is given, the call_other()s are followed
        back i times (i.e. previous_object(1) returns the caller of
        the caller): 0 <= i < caller_stack_depth(). If <i> is less than 0, the
        first previous object is returned.

        There is an important special case: in functions called by
        the gamedriver in reaction to some external event (e.g. commands
        added by add_action), previous_object() will return this_object(),
        but previous_object(0) will return 0.

EXAMPLE
        int security() {
           object prev;
           if(!(prev=previous_object()));
           else if(getuid(prev)!=getuid(this_object()));
           else if(geteuid(prev)!=geteuid(this_object()));
           else return 1;
           return 0;
        }
        void highly_sensible_func() {
           if(!security())
              return;
           ...
        }

        This example shows how we can check if the last call to a
        function of the current object is secure or if we should abort
        execution.

BUGS
        Values of i < 0 are treated as if i == 0 was passed - this is
        historic.

SEE ALSO
        call_other(E), this_object(E), this_player(E),
        caller_stack(E), caller_stack_depth(E), extern_call(E)