예제 #1
0
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);
  }
}
예제 #2
0
void *_destroy_table(void)
{
  int i;
  lookup_table(i, Ttop());
  ATtableDestroy(ST_tables[i]);
  ATtableRemove(ST_table_table, Ttop());
  return NULL;
}
예제 #3
0
ATbool _destroy_table(void)
{
  int i;
  lookup_table(i, Ttop);
  ATtableDestroy(ST_tables[i]);
  ATtableRemove(ST_table_table, Ttop);
  return ATtrue;
}
예제 #4
0
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;
}
예제 #5
0
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;
}
예제 #6
0
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);
  }
}
예제 #7
0
void T_removeValue(Table table, ATerm key)
{
  ATtableRemove((ATermTable) table, key);
}