~pixelherodev/c3lib

ref: tmp c3lib/tags.c -rw-r--r-- 315 bytes
ddd78966Noam Preil tmp 3 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include <stdlib.h>
#include <string.h>
#include <stdio.h>

#include "tags.h"
#include "util.h"

char *
c3tagstr(c3tag tag)
{
	static char *tag_names[C3_END] = {
#define C3_ITEM_(NAME) #NAME
		C3_ENUM_tag(C3_ITEM_)
#undef C3_ITEM_
	};
	if (tag < 0 || tag >= C3_END)
		return "<unknown>";
	return tag_names[tag];
}