random_seed(time() + (getpid() * 0x11111111));
}
/*
* This function is called whenever a inherit is called for.
* It is supposed to return the program to inherit.
* The first argument is the argument given to inherit, and the second
* is the file name of the program currently compiling. Note that the
* file name can be changed with #line, or set by compile_string, so
* it can not be 100% trusted to be a filename.
* previous_object(), can be virtually anything in this function, as it
* is called from the compiler.
*/
program handle_inherit(string pname, string current_file)
{
return cast_to_program(pname, current_file);
}
mapping (program:object) objects=([object_program(this_object()):this_object()]);
object low_cast_to_object(string oname, string current_file)
{
program p;
object o;
p=cast_to_program(oname, current_file);
if(!p) return 0;
if(!(o=objects[p])) o=objects[p]=p();
return o;
}
/* This function is called when the drivers wants to cast a string
* to an object because of an implict or explicit cast. This function
* may also receive more arguments in the future.
*/
object cast_to_object(string oname, string current_file)
{
if(object o=low_cast_to_object(oname, current_file))
return o;
error("Cast to object failed\n");
}
class dirnode
{
string dirname;
mixed module;
mapping cache=([]);

/* This function is called when all the driver is done with all setup
* of modules, efuns, tables etc. etc. and is ready to start executing
* _real_ programs. It receives the arguments not meant for the driver
* and an array containing the environment variables on the same form as
* a C program receives them.
*/