On Tue, May 30, 2006 at 06:07:15PM +0100, Steve Harris
wrote:
On Tue, May 30, 2006 at 11:43:57AM -0400, Dave
Robillard wrote:
char*
type = lv2_port_get_type(someplug, 0);
if (!strcmp(type, LV2_DATATYPE_FLOAT))
/* ... */
free(type);
Makes sense to me. You could make the API (optionally?) take a char * to
write the result into to avoid a lot of malloc() and free()s, but I doublt
it's a worthwhile saving.
I'd consider any interface that just returns a constant and requires
a malloc() and a free() to do it plain broken. This data doesn't live
in kernel space, or does it ? You could just return a const char *.