#include "cos-hash.h"
#include "concord-bdb.h"
+COS_Feature concord_opened_feature_list = NULL;
+COS_Feature concord_opened_feature_list_last = NULL;
+size_t concord_opened_feature_list_length = 0;
+size_t concord_opened_feature_list_limit = 96;
+
+COS_Feature_INDEX concord_opened_index_list = NULL;
+COS_Feature_INDEX concord_opened_index_list_last = NULL;
+size_t concord_opened_index_list_length = 0;
+size_t concord_opened_index_list_limit = 32;
+
int
CONCORD_String_size (const CONCORD_String s)
}
strcpy (table->name, feature);
table->value_table = NULL;
+ table->next = NULL;
return table;
}
{
CONCORD_Genre genre = feature->genre;
+ if ( concord_opened_feature_list_length
+ >= concord_opened_feature_list_limit )
+ {
+ CONCORD_Feature top_feature = concord_opened_feature_list;
+
+ CONCORD_BDB_close (top_feature->db);
+ top_feature->db = NULL;
+ concord_opened_feature_list = top_feature->next;
+ top_feature->next = NULL;
+ concord_opened_feature_list_length--;
+ }
feature->db
= CONCORD_BDB_open (genre->ds->location, genre->name,
"feature", feature->name,
if (feature->db == NULL)
return -1;
feature->access = access;
+ if ( concord_opened_feature_list == NULL )
+ {
+ concord_opened_feature_list = feature;
+ concord_opened_feature_list_last = feature;
+ }
+ else
+ {
+ concord_opened_feature_list_last->next = feature;
+ concord_opened_feature_list_last = feature;
+ }
+ concord_opened_feature_list_length++;
}
return 0;
}
}
strcpy (table->name, index);
table->decoding_table = NULL;
+ table->next = NULL;
return table;
}
{
CONCORD_Genre genre = index->genre;
+ if ( concord_opened_index_list_length
+ >= concord_opened_index_list_limit )
+ {
+ CONCORD_INDEX top_index = concord_opened_index_list;
+
+ CONCORD_BDB_close (top_index->db);
+ top_index->db = NULL;
+ concord_opened_index_list = top_index->next;
+ top_index->next = NULL;
+ concord_opened_index_list_length--;
+ }
index->db
= CONCORD_BDB_open (genre->ds->location, genre->name,
"index", index->name,
if (index->db == NULL)
return -1;
index->access = access;
+ if ( concord_opened_index_list == NULL )
+ {
+ concord_opened_index_list = index;
+ concord_opened_index_list_last = index;
+ }
+ else
+ {
+ concord_opened_index_list_last->next = index;
+ concord_opened_index_list_last = index;
+ }
+ concord_opened_index_list_length++;
}
return 0;
}