gedcom7code / c-converter

Converts GEDCOM 5.5.1 to GEDCOM 7
The Unlicense
3 stars 2 forks source link

GEDCOM 5.5.1 to GEDCOM 7.0 converter

GEDCOM 7.0 is a breaking change with GEDCOM 5.5.1. This means that 5.5.1 files cannot be parsed as-is as if they were 7.0 files. This project is a zero-dependency public-domain ANSI-C implementation of a 5.5.1 to 7.0 converter. C was chosen because it as very few features, so it should be able to convert the code to other languages easily; and because many other languages have methods for calling C code natively.

Current status:

Usage

Building using the Makefile

Edit Makefile as needed; likely changes include

Then run make.

Building using Visual Studio

To instead build using Visual Studio, simply open the c-converter.sln file with Visual Studio and build the solution normally.

Running

To run, execute the resulting ged5to7. Run ged5to7 --help for a list of command-line options.

Design Notes

The code is designed to be thread-safe (no mutable globals or static locals) though threading has not yet been added.

The code is currently first-draft status by someone who usually does not write large code bases others read. It has inconsistent naming (e.g., ged_destroy_event vs changePayloadToDynamic), some shortcuts (e.g., some structs are allocated as longs and cast to struct), inconsistent style (e.g., three different ways to emit locally-created GedEvents), etc. In some places some energy was spent making it efficient, in other places it is definitely not as efficient as it easily could be. Overall, the code needs a major refactor before it is easy to read.