diff options
Diffstat (limited to 'taxonomy.c')
-rw-r--r-- | taxonomy.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/taxonomy.c b/taxonomy.c index 40af9fd44..670d85ad0 100644 --- a/taxonomy.c +++ b/taxonomy.c @@ -38,3 +38,11 @@ void free_taxonomy(struct taxonomy_data *t) t->nr = 0; } } + +int taxonomy_index_for_category(struct taxonomy_data *t, enum taxonomy_category cat) +{ + for (int i = 0; i < t->nr; i++) + if (t->category[i].category == cat) + return i; + return -1; +} |