Example #1
0
///////////////////////////////////////////////////
// i_end(i_name) (+)
//	pop current DB (interface became instantiable)
//
BtFImpl(i_end, a, p)
{
	Term t;
	if (!(t = p->eval_term(a.getarg(0))).type(f_ATOM)) {
		p->BtErr(BTERR_INVALID_ARG_TYPE);
		return 0;
	}

	DbIntlog *db = p->get_db();
	kstring dbid = db->GetId(), idi = t.kstr();
	if (dbid != idi || (db = db->EndInterface()) == 0) {
		CCP sdb = MemStoreRef(dbid) != MSR_NULL ? dbid : "";
		p->BtErr(BTERR_CANT_ENDINTERF, CCP(idi), sdb);
		return 0;
	}

	p->set_db(db);
	return 1;
}
Example #2
0
///////////////////////////////
// enable to change identifier
//
void DbIntlog::SetId(kstring id)
{
    if (MemStoreRef(m_name) == MSR_NULL)
        m_name = id;
}