Changeset 2103
- Timestamp:
- 06/14/09 10:18:12 (15 months ago)
- Files:
-
- 1 modified
-
trunk/slv2/src/world.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/slv2/src/world.c
r2090 r2103 209 209 210 210 #ifdef SLV2_DYN_MANIFEST 211 LV2_Dyn_Manifest_Handle handle = NULL; 212 const LV2_Dyn_Manifest_Feature* const features = { NULL }; 213 211 214 const unsigned char* const query_str = (const unsigned char* const) 212 215 "PREFIX : <http://lv2plug.in/ns/lv2core#>\n" 213 "PREFIX dynman: <http:// naspro.atheme.org/rdf/dman#>\n"216 "PREFIX dynman: <http://lv2plug.in/ns/ext/dynmanifest#>\n" 214 217 "SELECT DISTINCT ?dynman ?binary WHERE {\n" 215 218 "?dynman a dynman:DynManifest ;\n" … … 229 232 if (lib_path) { 230 233 void* lib = dlopen(lib_path, RTLD_NOW); 231 typedef int (*DynManifestGetFunc)(FILE*); 232 DynManifestGetFunc func = (DynManifestGetFunc)dlsym(lib, "lv2_dyn_manifest_write"); 233 if (func) { 234 235 // Open dynamic manifest 236 typedef int (*OpenFunc)(LV2_Dyn_Manifest_Handle*, 237 const LV2_Dyn_Manifest_Feature *const *); 238 OpenFunc open_func = (OpenFunc)dlsym(lib, "lv2_dyn_manifest_open"); 239 open_func(&handle, &features); 240 241 // Get subjects (what would be in the manifest) 242 typedef int (*GetSubjectsFunc)(LV2_Dyn_Manifest_Handle, FILE*); 243 GetSubjectsFunc get_subjects_func = (GetSubjectsFunc)dlsym(lib, 244 "lv2_dyn_manifest_get_subjects"); 245 if (get_subjects_func) { 234 246 printf("DYNAMIC MANIFEST <%s> @ <%s> {\n", 235 247 librdf_uri_as_string(librdf_node_get_uri(dynman_node)), 236 248 librdf_uri_as_string(librdf_node_get_uri(binary_node))); 237 FILE* dyn_manifest = tmpfile(); 238 func(dyn_manifest); 249 //FILE* dyn_manifest = tmpfile(); 250 FILE* dyn_manifest = fopen("/tmp/naspro.ttl", "w+"); 251 get_subjects_func(handle, dyn_manifest); 239 252 rewind(dyn_manifest); 240 253 librdf_parser_parse_file_handle_into_model(world->parser, … … 250 263 librdf_free_query_results(query_results); 251 264 librdf_free_query(query); 252 #endif 265 #endif // SLV2_DYN_MANIFEST 253 266 254 267 /* ?plugin a lv2:Plugin */
