diff options
author | David Robillard <d@drobilla.net> | 2022-08-10 18:33:27 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2022-08-17 13:51:18 -0400 |
commit | 07441cc2e624ff5d0b81fba102fee648110e16a4 (patch) | |
tree | 17c27eafe5870d3fdd81d0073ab74d65348f1064 | |
parent | b85553a3f608ee60f8ad39f1f6ea1a96fbab88e6 (diff) | |
download | jalv-07441cc2e624ff5d0b81fba102fee648110e16a4.tar.gz jalv-07441cc2e624ff5d0b81fba102fee648110e16a4.tar.bz2 jalv-07441cc2e624ff5d0b81fba102fee648110e16a4.zip |
Factor jalv_init_env() out of jalv_open()
-rw-r--r-- | src/jalv.c | 21 |
1 files changed, 13 insertions, 8 deletions
@@ -966,6 +966,17 @@ jalv_init_nodes(LilvWorld* const world, JalvNodes* const nodes) #undef MAP_NODE } +static void +jalv_init_env(SerdEnv* const env) +{ + serd_env_set_prefix_from_strings( + env, (const uint8_t*)"patch", (const uint8_t*)LV2_PATCH_PREFIX); + serd_env_set_prefix_from_strings( + env, (const uint8_t*)"time", (const uint8_t*)LV2_TIME_PREFIX); + serd_env_set_prefix_from_strings( + env, (const uint8_t*)"xsd", (const uint8_t*)NS_XSD); +} + int jalv_open(Jalv* const jalv, int* argc, char*** argv) { @@ -986,6 +997,7 @@ jalv_open(Jalv* const jalv, int* argc, char*** argv) return ret; } + jalv->env = serd_env_new(NULL); jalv->symap = symap_new(); jalv_init_urids(jalv->symap, &jalv->urids); @@ -1007,14 +1019,7 @@ jalv_open(Jalv* const jalv, int* argc, char*** argv) init_feature(&jalv->features.unmap_feature, LV2_URID__unmap, &jalv->unmap); lv2_atom_forge_init(&jalv->forge, &jalv->map); - - jalv->env = serd_env_new(NULL); - serd_env_set_prefix_from_strings( - jalv->env, (const uint8_t*)"patch", (const uint8_t*)LV2_PATCH_PREFIX); - serd_env_set_prefix_from_strings( - jalv->env, (const uint8_t*)"time", (const uint8_t*)LV2_TIME_PREFIX); - serd_env_set_prefix_from_strings( - jalv->env, (const uint8_t*)"xsd", (const uint8_t*)NS_XSD); + jalv_init_env(jalv->env); jalv->sratom = sratom_new(&jalv->map); jalv->ui_sratom = sratom_new(&jalv->map); |