Skip to content

Commit

Permalink
Updated implementation of dlite_meta_is_metameta() to match its docum…
Browse files Browse the repository at this point in the history
…entation.
  • Loading branch information
jesper-friis committed Feb 2, 2020
1 parent a7b8998 commit 171553a
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/dlite-entity.c
Original file line number Diff line number Diff line change
Expand Up @@ -1461,17 +1461,17 @@ const DLiteProperty *dlite_meta_get_property(const DLiteMeta *meta,
*/
int dlite_meta_is_metameta(const DLiteMeta *meta)
{
int has_dimensions=0, has_properties=0;
int has_dimensions=0, has_properties=0, has_relations=0;
size_t i;
for (i=0; i<meta->nproperties; i++) {
DLiteProperty *p = meta->properties + i;
if (p->type == dliteDimension &&
(strcmp(p->name, "schema_dimensions") == 0 ||
strcmp(p->name, "dimensions") == 0)) has_dimensions = 1;
if (p->type == dliteProperty &&
(strcmp(p->name, "schema_properties") == 0 ||
strcmp(p->name, "properties") == 0)) has_properties = 1;
if (p->type == dliteDimension && strcmp(p->name, "dimensions") == 0)
has_dimensions = 1;
if (p->type == dliteProperty && strcmp(p->name, "properties") == 0)
has_properties = 1;
if (p->type == dliteRelation && strcmp(p->name, "relations") == 0)
has_relations = 1;
}
if (has_dimensions && has_properties) return 1;
if (has_dimensions && (has_properties || has_relations)) return 1;
return 0;
}

0 comments on commit 171553a

Please sign in to comment.