void delete_session(int cid, ATerm sid) { EM_Session session = getSession(sid); if (session != NULL) { int referenceCount = EM_getSessionReferenceCount(session); if (referenceCount == 0) { ATtableRemove(sessions, sid); ATtableRemove(bindings, sid); } else { putSession(EM_setSessionStatus(session, EM_makeSessionStatusZombie())); } } else { ATabort("delete_session: no such session: %t\n", sid); } }
void *_destroy_table(void) { int i; lookup_table(i, Ttop()); ATtableDestroy(ST_tables[i]); ATtableRemove(ST_table_table, Ttop()); return NULL; }
ATbool _destroy_table(void) { int i; lookup_table(i, Ttop); ATtableDestroy(ST_tables[i]); ATtableRemove(ST_table_table, Ttop); return ATtrue; }
void *_table_remove(void) { ATerm table, key; int i; if(MatchPair(Ttop(), &table, &key)) { lookup_table(i, table); ATtableRemove(ST_tables[i], key); return NULL; } return fail_address; }
ATbool _table_remove(void) { ATerm table, key; int i; if(MatchPair(Ttop, &table, &key)) { lookup_table(i, table); ATtableRemove(ST_tables[i], key); return ATtrue; } return ATfalse; }
void end_transaction(int cid, ATerm sid) { EM_Session session = getSession(sid); if (session != NULL) { int referenceCount = EM_getSessionReferenceCount(session); assert(referenceCount > 0); referenceCount--; session = EM_setSessionReferenceCount(session, referenceCount); putSession(session); if (referenceCount == 0) { EM_SessionStatus status = EM_getSessionStatus(session); if (EM_isSessionStatusZombie(status)) { ATtableRemove(sessions, sid); } } } else { ATabort("editor-manager.c:end_transaction: no such session %t\n", sid); } }
void T_removeValue(Table table, ATerm key) { ATtableRemove((ATermTable) table, key); }