On Thu, Mar 06, 2003 at 02:59:26PM +0000, Steve Harris wrote:
> 0.2.4 http://plugin.org.uk/lrdf/
> 
> liblrdf is a library for handling RDF files describing LADSPA plugins,
> plus it can also do lightweight general RDF tasks.
> 
> Changes:
>    Added a pkgconfig file suppllied by Taybin
>    Fixed a buffer overrun triggered by rebuilding the caches
>    Fixed a bunch of memory leaks
> 
> PS Someone had some code that generated string to build GTK (I think)
>    menus from, if you could mail me the code again then I'l provide it as
>    a function or at least put it in the documentation. Sorry, I lost the
>    mail and forgot your name :(
> 
> - Steve
> 

It only sets up a relation UniqueID -> paths
i just took some code from jack-rack and showtaxonomy.c

This is essentially what has to be done:
i can send the complete file if this is not sufficient for
you....



PRIVATE void setup_lrdf( void ) {


 lrdf_init( );
 plugin_mgr_load_path_uris();

 PathIndex = g_relation_new(2);
 g_relation_index(PathIndex, 0, g_int_hash, g_int_equal);
 decend(LADSPA_BASE "Plugin", "LADSPA");
}

void decend(char *uri, char *base)
{
        lrdf_uris *uris;
        unsigned int i;
        char *newbase;
        char *label;

        uris = lrdf_get_instances(uri);

        if (uris != NULL) {
                for (i = 0; i < uris->count; i++) {
                        guint *uid = safe_malloc( sizeof( guint ) );
                        char *basedup = safe_string_dup( base );

                        *uid = lrdf_get_uid( uris->items[i] );
                        

                        //printf("%s/[%d]\n", base, *uid );
                        
                        g_relation_insert( PathIndex, uid, basedup ); 
                        //printf( "selct: %d\n", g_relation_count( PathIndex, uid, 0 ) 
);
                }
                lrdf_free_uris(uris);
        }

        uris = lrdf_get_subclasses(uri);

        if (uris != NULL) {
                for (i = 0; i < uris->count; i++) {
                        label = lrdf_get_label(uris->items[i]);
                        newbase = malloc(strlen(base) + strlen(label) + 2);
                        sprintf(newbase, "%s/%s", base, label);
                        //printf("%s\n", newbase);
                        decend(uris->items[i], newbase);
                        free(newbase);
                }
                lrdf_free_uris(uris);
        }
}

-- 
torben Hohn
http://galan.sourceforge.net -- The graphical Audio language

Reply via email to