/*
* 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_LOG_FILE
INIT_LOG_FILE();
#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 */