Exemplo n.º 1
0
void 
set_living_name(struct object *ob, char *str)
{
    struct object **hl;

    if (ob->flags & O_DESTRUCTED)
	return;
    if (ob->living_name) {
	remove_living_name(ob);
#ifdef SUPER_SNOOP
	if (ob->interactive && ob->interactive->snoop_fd >= 0) {
	    (void) close(ob->interactive->snoop_fd);
	    ob->interactive->snoop_fd = -1;
	}
#endif
    }
    if (!*str)
	return;
    num_living_names++;
    hl = &hashed_living[LivHash(str)];
    ob->next_hashed_living = *hl;
    *hl = ob;
    ob->living_name = make_sstring(str);
#ifdef SUPER_SNOOP
    check_supersnoop(ob);
#endif
    return;
}
Exemplo n.º 2
0
static void set_living_name (object_t * ob, const char *str)
{
    int flags = ob->flags & O_ENABLE_COMMANDS;
    object_t **hl;

    if (ob->flags & O_DESTRUCTED)
	return;
    remove_living_name(ob);
    num_living_names++;
    hl = &hashed_living[hash_living_name(str)];
    ob->next_hashed_living = *hl;
    *hl = ob;
    ob->living_name = make_shared_string(str);
    ob->flags |= flags;
}