Skip to content

feat: add gerbv_create_excellon_image_from_filename() to public API#302

Merged
spe-ciellt merged 1 commit intodevelopfrom
feat/excellon-image-from-filename
Feb 28, 2026
Merged

feat: add gerbv_create_excellon_image_from_filename() to public API#302
spe-ciellt merged 1 commit intodevelopfrom
feat/excellon-image-from-filename

Conversation

@spe-ciellt
Copy link
Copy Markdown
Contributor

Summary

Files changed

  • src/gerbv.h — public function declaration
  • src/gerbv.c — implementation

Test plan

  • Build with cmake --build build -j$(nproc) — clean, 0 errors
  • Symbol exported: nm -D libgerbv.so | grep excellon_image_from_filename — present as global T
  • Regression tests: 94 pass / 10 fail (all 10 are pre-existing Cairo version mismatches, no new failures)
  • API smoke test: loaded .exc file, netlist + tools present, destroyed cleanly

@spe-ciellt spe-ciellt added the enhancement New feature or request label Feb 28, 2026
@spe-ciellt spe-ciellt self-assigned this Feb 28, 2026
Adds the missing counterpart to gerbv_create_rs274x_image_from_filename()
for loading Excellon drill files directly via libgerbv. Based on
SourceForge patch #73 and GitHub PR #9.

Also bumps library version to 1.10.0 since library was changed
(actually long overdue, but now it happened).
@spe-ciellt spe-ciellt force-pushed the feat/excellon-image-from-filename branch from cc61ceb to 6acbe07 Compare February 28, 2026 20:04
@spe-ciellt spe-ciellt merged commit ae10b5d into develop Feb 28, 2026
2 checks passed
@spe-ciellt spe-ciellt deleted the feat/excellon-image-from-filename branch February 28, 2026 20:20
rampageservices added a commit to SourceParts/gerbv that referenced this pull request Mar 1, 2026
Callers of gerb_fopen() use strerror(errno) to report why a file
failed to open, but the cleanup calls inside gerb_fopen() (fclose,
g_free, munmap) could clobber errno before it was returned to the
caller, producing misleading error messages.

Save errno immediately after the failing call and restore it after
cleanup, before returning NULL.  This affects all six error paths:
g_fopen failure, fstat failure, mmap failure, g_malloc failure,
calloc failure, and fread failure.

Also fixes a latent NULL pointer dereference on the mmap failure
path, which previously set fd = NULL and fell through to
fd->filename = g_strdup(...) instead of returning.

Ref: gerbv#302
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant