Compare commits

...

2 Commits

3 changed files with 9 additions and 6 deletions

View File

@ -101,8 +101,10 @@ 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)
if (!so_path) {
fprintf(stderr, "Please specify shared object for external renderer. Will ignore this renderer.\n");
continue;
}
output_renderer = GDS_RENDER_OUTPUT_RENDERER(external_renderer_new_with_so(so_path));
} else {
continue;
@ -148,7 +150,8 @@ 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(gds_cell *toplevel, GList *layer_info_list, const char *output_file_name, double scale)
* int EXTERNAL_LIBRARY_FUNCTION(struct 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) {
g_error("Path to shared object not set!");
fprintf(stderr, "Path to shared object not set!\n");
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) {
g_error("Could not load external library '%s'\nDetailed error is:\n%s", so_path, dlerror());
fprintf(stderr, "Could not load external library '%s'\nDetailed error is:\n%s\n", 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) {
g_error("Rendering function not found in library:\n%s\n", error_msg);
fprintf(stderr, "Rendering function not found in library:\n%s\n", error_msg);
goto ret_close_so_handle;
}