phantasmal_dgd_v1/
phantasmal_dgd_v1/bin/
phantasmal_dgd_v1/doc/
phantasmal_dgd_v1/mud/doc/
phantasmal_dgd_v1/mud/doc/api/
phantasmal_dgd_v1/mud/doc/kernel/
phantasmal_dgd_v1/mud/doc/kernel/hook/
phantasmal_dgd_v1/mud/doc/kernel/lfun/
phantasmal_dgd_v1/mud/include/
phantasmal_dgd_v1/mud/include/kernel/
phantasmal_dgd_v1/mud/kernel/lib/
phantasmal_dgd_v1/mud/kernel/lib/api/
phantasmal_dgd_v1/mud/kernel/obj/
phantasmal_dgd_v1/mud/kernel/sys/
phantasmal_dgd_v1/mud/tmp/
phantasmal_dgd_v1/mud/usr/System/
phantasmal_dgd_v1/mud/usr/System/keys/
phantasmal_dgd_v1/mud/usr/System/obj/
phantasmal_dgd_v1/mud/usr/System/open/lib/
phantasmal_dgd_v1/mud/usr/common/data/
phantasmal_dgd_v1/mud/usr/common/lib/parsed/
phantasmal_dgd_v1/mud/usr/common/obj/telopt/
phantasmal_dgd_v1/mud/usr/common/obj/ustate/
phantasmal_dgd_v1/mud/usr/game/
phantasmal_dgd_v1/mud/usr/game/include/
phantasmal_dgd_v1/mud/usr/game/obj/
phantasmal_dgd_v1/mud/usr/game/object/
phantasmal_dgd_v1/mud/usr/game/object/stuff/
phantasmal_dgd_v1/mud/usr/game/sys/
phantasmal_dgd_v1/mud/usr/game/text/
phantasmal_dgd_v1/mud/usr/game/users/
phantasmal_dgd_v1/src/host/
phantasmal_dgd_v1/src/host/beos/
phantasmal_dgd_v1/src/host/mac/
phantasmal_dgd_v1/src/host/unix/
phantasmal_dgd_v1/src/host/win32/res/
phantasmal_dgd_v1/src/kfun/
phantasmal_dgd_v1/src/lpc/
phantasmal_dgd_v1/src/parser/
# include "lex.h"
# include "macro.h"
# include "token.h"
# include "special.h"

/*
 * Predefined macro handling.
 */

static char datestr[14];
static char timestr[11];

/*
 * NAME:	special_define()
 * DESCRIPTION:	predefine macros
 */
void special_define()
{
    char buf[26];

    mc_define("__LINE__", (char *) NULL, -1);
    mc_define("__FILE__", (char *) NULL, -1);
    mc_define("__DATE__", (char *) NULL, -1);
    mc_define("__TIME__", (char *) NULL, -1);

    P_ctime(buf, P_time());
    sprintf(datestr, "\"%.6s %.4s\"", buf + 4, buf + 20);
    sprintf(timestr, "\"%.8s\"", buf + 11);
}

/*
 * NAME:	special_replace()
 * DESCRIPTION:	return the expandation of a predefined macro
 */
char *special_replace(name)
register char *name;
{
    static char buf[STRINGSZ + 3];

    if (strcmp(name, "__LINE__") == 0) {
	sprintf(buf, " %u ", tk_line());
	return buf;
    } else if (strcmp(name, "__FILE__") == 0) {
	sprintf(buf, "\"/%s\"", tk_filename());
	return buf;
    } else if (strcmp(name, "__DATE__") == 0) {
	return datestr;
    } else if (strcmp(name, "__TIME__") == 0) {
	return timestr;
    }
    return (char *) NULL;
}