CONCORD_INDEX
concord_genre_open_index (CONCORD_Genre genre, const unsigned char* index);
+CONCORD_Feature
+concord_genre_get_feature_0 (CONCORD_Genre genre, const unsigned char* name);
+
int concord_close_index (CONCORD_INDEX table);
}
int
-CONCORD_DS_close (CONCORD_DS ds)
+concord_close_ds (CONCORD_DS ds)
{
if (ds->location != NULL)
free (ds->location);
}
int
-concord_ds_set_object_nil (CONCORD_DS ds, CONCORD_Object object_nil)
+concord_ds_set_object_failure (CONCORD_DS ds, CONCORD_Object object_nil)
{
ds->object_nil = object_nil;
return 0;
return status;
}
+unsigned char*
+concord_genre_get_name (CONCORD_Genre genre)
+{
+ return genre->name;
+}
+
CONCORD_DS
concord_genre_get_data_source (CONCORD_Genre genre)
{
}
CONCORD_Feature
-concord_genre_get_feature (CONCORD_Genre genre, const unsigned char* name)
+concord_genre_get_feature_0 (CONCORD_Genre genre, const unsigned char* name)
{
CONCORD_Feature feature;
return feature;
}
+CONCORD_Feature
+concord_genre_get_feature (CONCORD_Genre genre, const unsigned char* name)
+{
+ CONCORD_Genre g_feature
+ = concord_ds_get_genre (genre->ds, "feature");
+
+ if (g_feature != NULL)
+ {
+ CONCORD_Feature p_true_name
+ = concord_genre_get_feature_0 (g_feature, "true-name");
+
+ if (g_feature != NULL)
+ {
+ CONCORD_String_Tank s_true_name;
+ int status
+ = concord_obj_get_feature_value_string (name,
+ p_true_name,
+ &s_true_name);
+ if (status == 0)
+ {
+ unsigned char* t_name = alloca (s_true_name.size + 1);
+
+ strncpy (t_name, s_true_name.data, s_true_name.size);
+ t_name[s_true_name.size] = '\0';
+ return concord_genre_get_feature_0 (genre, t_name);
+ }
+ }
+ }
+ return concord_genre_get_feature_0 (genre, name);
+}
+
CONCORD_INDEX
concord_genre_get_index (CONCORD_Genre genre, const unsigned char* name)
{
return feature->name;
}
+CONCORD_Genre
+concord_feature_get_genre (CONCORD_Feature feature)
+{
+ return feature->genre;
+}
+
int
concord_feature_setup_db (CONCORD_Feature feature, int writable)
{
}
int
-concord_stroid_set_feature_str (const unsigned char* object_id,
- CONCORD_Feature feature,
- unsigned char* value)
+concord_obj_put_feature_value_str (const unsigned char* object_id,
+ CONCORD_Feature feature,
+ unsigned char* value)
{
if (feature == NULL)
return -1;
}
int
-concord_stroid_get_feature_string (const unsigned char* object_id,
- CONCORD_Feature feature,
- CONCORD_String value)
+concord_obj_get_feature_value_string (const unsigned char* object_id,
+ CONCORD_Feature feature,
+ CONCORD_String value)
{
int status;
}
CONCORD_Object
-concord_stroid_get_feature_object (const unsigned char* object_id,
- CONCORD_Feature feature)
+concord_obj_get_feature_value (const unsigned char* object_id,
+ CONCORD_Feature feature)
{
DBT valdatum;
int status;
}
unsigned char*
-concord_stroid_gets_feature (const unsigned char* object_id,
- CONCORD_Feature feature,
- unsigned char* dst, size_t size)
+concord_obj_gets_feature_value (const unsigned char* object_id,
+ CONCORD_Feature feature,
+ unsigned char* dst, size_t size)
{
DBT valdatum;
int status;
}
int
-concord_feature_foreach_object_string (CONCORD_Feature feature,
- int (*func)(CONCORD_String object_id,
- CONCORD_Feature feature,
- CONCORD_String value))
+concord_feature_foreach_obj_string (CONCORD_Feature feature,
+ int (*func)(CONCORD_String object_id,
+ CONCORD_Feature feature,
+ CONCORD_String value))
{
CONCORD_String_Tank key, value;
DBC *dbcp;
}
int
-concord_index_strid_get_object_string (CONCORD_INDEX index,
- const unsigned char* strid,
- CONCORD_String object_id)
+concord_index_strid_put_obj (CONCORD_INDEX index,
+ const unsigned char* strid,
+ unsigned char* object_id)
{
if (index == NULL)
return -1;
- if (concord_index_setup_db (index, 0))
+ if (concord_index_setup_db (index, 1))
return -1;
- return CONCORD_BDB_get (index->db, strid, object_id);
+ return CONCORD_BDB_put (index->db, strid, object_id);
}
int
-concord_index_strid_set_object_str (CONCORD_INDEX index,
+concord_index_strid_get_obj_string (CONCORD_INDEX index,
const unsigned char* strid,
- unsigned char* object_id)
+ CONCORD_String object_id)
{
if (index == NULL)
return -1;
- if (concord_index_setup_db (index, 1))
+ if (concord_index_setup_db (index, 0))
return -1;
- return CONCORD_BDB_put (index->db, strid, object_id);
+ return CONCORD_BDB_get (index->db, strid, object_id);
}