Compare commits

..

No commits in common. "d4f14c52edc9f760eb711931c62a9c4013cd2e64" and "02a59c4cc51ae0e6bf4aedf6805d283bc9bd5296" have entirely different histories.

3 changed files with 6 additions and 9 deletions

View File

@ -101,10 +101,8 @@ static int create_renderers(char **renderers,
} else if (!strcmp(current_renderer, "svg")) {
output_renderer = GDS_RENDER_OUTPUT_RENDERER(cairo_renderer_new_svg());
} else if (!strcmp(current_renderer, "ext")) {
if (!so_path) {
fprintf(stderr, "Please specify shared object for external renderer. Will ignore this renderer.\n");
if (!so_path)
continue;
}
output_renderer = GDS_RENDER_OUTPUT_RENDERER(external_renderer_new_with_so(so_path));
} else {
continue;
@ -150,8 +148,7 @@ int command_line_convert_gds(const char *gds_name,
layer_settings_load_from_csv(layer_sett, layer_file);
/* Create renderers */
if (create_renderers(renderers, output_file_names, tex_layers, tex_standalone,
so_path, &renderer_list, layer_sett))
if (create_renderers(renderers, output_file_names, tex_layers, tex_standalone, so_path, &renderer_list, layer_sett))
goto ret_destroy_layer_mapping;

View File

@ -45,7 +45,7 @@ G_DECLARE_FINAL_TYPE(ExternalRenderer, external_renderer, GDS_RENDER, EXTERNAL_R
*
* The function has to be defined as follows:
* @code
* int EXTERNAL_LIBRARY_FUNCTION(struct gds_cell *toplevel, GList *layer_info_list, const char *output_file_name, double scale)
* int EXTERNAL_LIBRARY_FUNCTION(gds_cell *toplevel, GList *layer_info_list, const char *output_file_name, double scale)
* @endcode
*/
#define EXTERNAL_LIBRARY_FUNCTION "render_cell_to_file"

View File

@ -62,7 +62,7 @@ static int external_renderer_render_cell(struct gds_cell *toplevel_cell, GList *
int ret = 0;
if (!so_path) {
fprintf(stderr, "Path to shared object not set!\n");
g_error("Path to shared object not set!");
return -3000;
}
@ -73,7 +73,7 @@ static int external_renderer_render_cell(struct gds_cell *toplevel_cell, GList *
/* Load shared object */
so_handle = dlopen(so_path, RTLD_LAZY);
if (!so_handle) {
fprintf(stderr, "Could not load external library '%s'\nDetailed error is:\n%s\n", so_path, dlerror());
g_error("Could not load external library '%s'\nDetailed error is:\n%s", so_path, dlerror());
return -2000;
}
@ -81,7 +81,7 @@ static int external_renderer_render_cell(struct gds_cell *toplevel_cell, GList *
so_render_func = (int (*)(struct gds_cell *, GList *, const char *, double))dlsym(so_handle, EXTERNAL_LIBRARY_FUNCTION);
error_msg = dlerror();
if (error_msg != NULL) {
fprintf(stderr, "Rendering function not found in library:\n%s\n", error_msg);
g_error("Rendering function not found in library:\n%s\n", error_msg);
goto ret_close_so_handle;
}