Esempio n. 1
0
ATerm TS_getValue(const char* name, ATerm key)
{
  Table table = TS_getTable(name);

  if (table != NULL) {
    return T_getValue(table, key);
  }

  return NULL;
}
Esempio n. 2
0
ATermList T_getAllKeyValuePairs(Table table)
{
  ATermList keys = T_getAllKeys(table);
  ATermList pairs;

  for (pairs = ATempty; !ATisEmpty(keys); keys = ATgetNext(keys)) {
    ATerm key = ATgetFirst(keys);
    ATerm value = T_getValue(table, key);
    ATermList pair = ATmakeList2(key, value);

    pairs = ATinsert(pairs, (ATerm) pair);
  }

  return pairs;
}
Esempio n. 3
0
ATermList T_getValues(Table table, ATermList keys)
{
  ATermList values = ATempty;

  for ( ;!ATisEmpty(keys); keys = ATgetNext(keys)) {
    ATerm key = ATgetFirst(keys);
    ATerm value = T_getValue(table, key);
    
    if (value != NULL) {
      values = ATinsert(values, value);
    }
    else {
      return NULL;
    }
  }

  return values;
}
Esempio n. 4
0
ATbool T_containsKey(Table table, ATerm key)
{
  return (T_getValue(table, key) != NULL);
}