Index: exp_fmt_amf.c =================================================================== --- exp_fmt_amf.c (revision 35977) +++ exp_fmt_amf.c (revision 35978) @@ -133,7 +133,10 @@ verthash_uninit(&verthash); } +static stl_facet_t *amf_solid_fload(rnd_hidlib_t *hl, FILE *f, const char *fn); + static const stl_fmt_t fmt_amf = { + /* output */ ".amf", amf_print_horiz_tri, amf_print_vert_tri, @@ -140,5 +143,8 @@ amf_print_facet, amf_new_obj, amf_print_header, - amf_print_footer + amf_print_footer, + + /* model load */ + amf_solid_fload }; Index: exp_fmt_stl.c =================================================================== --- exp_fmt_stl.c (revision 35977) +++ exp_fmt_stl.c (revision 35978) @@ -102,7 +102,10 @@ fprintf(f, "endsolid\n"); } +static stl_facet_t *stl_solid_fload(rnd_hidlib_t *hl, FILE *f, const char *fn); + static const stl_fmt_t fmt_stl = { + /* output */ ".stl", stl_print_horiz_tri, stl_print_vert_tri, @@ -109,5 +112,8 @@ stl_print_facet, stl_new_obj, stl_print_header, - stl_print_footer + stl_print_footer, + + /* model load */ + stl_solid_fload }; Index: export_stl.c =================================================================== --- export_stl.c (revision 35977) +++ export_stl.c (revision 35978) @@ -323,6 +323,7 @@ static verthash_t verthash; typedef struct { + /* output */ const char *suffix; void (*print_horiz_tri)(FILE *f, fp2t_triangle_t *t, int up, rnd_coord_t z); void (*print_vert_tri)(FILE *f, rnd_coord_t x1, rnd_coord_t y1, rnd_coord_t x2, rnd_coord_t y2, rnd_coord_t z0, rnd_coord_t z1); @@ -330,6 +331,9 @@ void (*new_obj)(float r, float g, float b); void (*print_header)(FILE *f); void (*print_footer)(FILE *f); + + /* model load */ + stl_facet_t *(*model_load)(rnd_hidlib_t *hl, FILE *f, const char *fn); } stl_fmt_t; static const rnd_export_opt_t *stl_get_export_options_(rnd_hid_t *hid, int *n, const stl_fmt_t *fmt) Index: model_load_amf.c =================================================================== --- model_load_amf.c (revision 35977) +++ model_load_amf.c (revision 35978) @@ -40,7 +40,7 @@ rnd_trace("amf mesh\n"); } -stl_facet_t *amf_solid_fload(rnd_hidlib_t *hl, FILE *f, const char *fn) +static stl_facet_t *amf_solid_fload(rnd_hidlib_t *hl, FILE *f, const char *fn) { xmlDoc *doc; xmlNode *root, *n, *m; @@ -79,7 +79,7 @@ #else /* Fallback: still provide a dummy if libxml is not available */ -stl_facet_t *amf_solid_fload(rnd_hidlib_t *hl, FILE *f, const char *fn) +static stl_facet_t *amf_solid_fload(rnd_hidlib_t *hl, FILE *f, const char *fn) { return &stl_format_not_supported; } Index: model_load_stl.c =================================================================== --- model_load_stl.c (revision 35977) +++ model_load_stl.c (revision 35978) @@ -24,7 +24,7 @@ * mailing list: pcb-rnd (at) list.repo.hu (send "subscribe") */ -stl_facet_t *stl_solid_fload(rnd_hidlib_t *hl, FILE *f, const char *fn) +static stl_facet_t *stl_solid_fload(rnd_hidlib_t *hl, FILE *f, const char *fn) { stl_facet_t *head = NULL, *tail = NULL, *t; char *cmd, line[512]; Index: stl_models.c =================================================================== --- stl_models.c (revision 35977) +++ stl_models.c (revision 35978) @@ -169,7 +169,7 @@ char *full_path; FILE *f = rnd_fopen_first(&PCB->hidlib, &conf_core.rc.library_search_paths, name, "r", &full_path, rnd_true); if (f != NULL) { - head = stl_solid_fload(hl, f, full_path); + head = fmt->model_load(hl, f, full_path); if (head == NULL) rnd_message(RND_MSG_ERROR, "STL model failed to load: %s\n", full_path); else if (head == &stl_format_not_supported)