MudOSa4DGD/
MudOSa4DGD/bin/
MudOSa4DGD/data/
MudOSa4DGD/doc/
MudOSa4DGD/doc/driver/
MudOSa4DGD/doc/efun/bitstrings/
MudOSa4DGD/doc/efun/command/
MudOSa4DGD/doc/efun/communication/
MudOSa4DGD/doc/efun/heart_beat/
MudOSa4DGD/doc/efun/interactive/
MudOSa4DGD/doc/efun/inventory/
MudOSa4DGD/doc/efun/living/
MudOSa4DGD/doc/efun/mappings/
MudOSa4DGD/doc/efun/strings/
MudOSa4DGD/doc/efun/uid/
MudOSa4DGD/doc/funs/
MudOSa4DGD/doc/language/
MudOSa4DGD/mudlib/dgd/doc/
MudOSa4DGD/mudlib/dgd/lib/include/dgd/
MudOSa4DGD/mudlib/dgd/lib/std/
MudOSa4DGD/mudlib/dgd/lib/sys/
MudOSa4DGD/mudlib/dgd/log/
MudOSa4DGD/mudlib/log/
MudOSa4DGD/mudlib/std/include/
MudOSa4DGD/mudlib/std/obj/
/*
 * simul_efun.c
 *
 * The simul_efun object. It defines additional kfuns needed by
 * the mudlib. Some of them is actually needed by the DriverLib
 * too, but their code may be changed, to better make them fit
 * into the structure of the current mudlib. Sfuns are really
 * additional auto object kfuns, and may not overload them.
 *
 * Add new sfuns by adding #include statements, and defining the
 * respective "sfun/<funcname>.c" or by group: "sfun/<filename>".
 * By checking for __AUTO, you may define global code and data
 * in the actual SIMUL_EFUN object, and grant access these through
 * additional sfuns. (mudlib should NEVER have to call SIMUL_EFUN)
 *
 * This object may be freely modified to suit a specific mudlib.
 *
 * Started by: Frank Schmidt, Jesus@NorseMUD
 *
 */

#define __SIMUL_EFUN
#include <driver.h>


/* mudlib includes needed in the sfun modules: */
#include <std.h>



/*===================================================================
 * list over sfun modules. They are defined here because they
 * are closer to the mudlib.
 */

/* Important: used in the DriverLib (Alter only) */
#include "sfun/illegal.c"
#include "sfun/log_file.c"
#include "sfun/termcap.c"
#include "sfun/shutdown.c"

/* Mudlib specific: (Alter/Remove at will) */
#include "sfun/path.c"
#include "sfun/creator_file.c"
#include "sfun/make_punctation.c"
#include "sfun/dirs.c"
#include "sfun/translate.c"
#include "sfun/make.c"
#include "sfun/grammar.c"
#include "sfun/exp_sent.c"
#ifdef MUDOS_INVENTORY
# include "sfun/bottom_room.c"
#endif
#if 0
# include "sfun/coord.c"
#endif


/* regexp kfun package must be patched to driver */
#ifdef MUDOS_REGEXP
# include "sfun/regexp.c"
#endif



/* -------- DONE INCLUDING SFUNS --------- */
#define _INCLUDED_SFUNS



/* are we outside auto object? (in SIMUL_EFUN) */
#ifndef __AUTO


/* create us */
static void __CREATE_DEF() {
  if (object_name(this_object()) != SIMUL_EFUN) {
    illegal();
    return;
  }
  ::__CREATE_DEF();
#ifdef MUDOS_USER_ID
  seteuid(getuid());
#endif

  /* do some internal initialization? */
#ifdef INIT_TERMCAP
  INIT_TERMCAP();
#endif
#ifdef INIT_GRAMMAR
  INIT_GRAMMAR();
#endif
#ifdef INIT_REGEXP
  INIT_REGEXP();
#endif
}


/* unmovable */
varargs int __MOVE_DEF(object dest) {
  illegal();
}


void __DESTROY_DEF() {
  if (!DRIVER_PRIV()) {
    /* prevent illegal destruction */
    illegal();
    return;
  }
  ::__DESTROY_DEF();
}


/* prevent cloning of simul_efun object */
int __QUERY_PREVENT_CLONE_DEF() {
  return 1;
}


#endif /* __AUTO */