martin-helmich/libcintelhex — pull request #19 by acolomb (2014-03-22 13:46:38+00:00)
Title: More powerful version of ihex_byte_copy()

This one is based on and contains the changes of Pull Request #17.

This alternative version is more flexible and allows an offset to be specified, in case the user wants to copy just a part of the data. Setting the new last argument to zero behaves just as the previous implementation. A bit more error checking is added on top of that, to detect when the requested data range was not contained in the record set at all.

This one works well together with Pull Request #18 to find the most sensible values for ```off``` and ```n``` parameters.

* No unit tests yet.
* An example in the README.md would probably be nice for grokking this part of the API.
* The code to iterate through records while adjusting offset addresses, checking for premature EOF, etc. should probably be factored out and reused where applicable. I have some ideas there, but it's probably better to discuss the new parts of the API first.