This header is not available on e.g. FreeBSD so detect it's presence in configure.ac and only include it if appropriate. Then, if byte order manipulation macros are not defined (old glibc like the one provided by Debian GNU/Linux) define them.
- New mifare_classic_first_sector_block(), mifare_classic_last_sector_block() functions to ease detection of sectors boundaries;
- New unit tests for mifare_classic_first_sector_block() and mifare_classic_last_sector_block();
- Start to update the API for consistently using blocks and not mixing blocks and sectors with mifare_classic_*() functions;
- Update the mifare-classic-format(1) example to handle MIFARE Classic 1k and 4k.
Many thanks to Johann Dantant from SpringCard for giving me MIFARE Classic 4k cards.
- New mifare_*_tag_new() functions for allocating and initialising memory for a given MIFARE tag;
- Rename mifare_*_free_tag() to mifare_*_tag_free() for consistent names with mifare_*_tag_new() functions.
- Factorize Mifare*Tag as MifareTag;
- Factorize mifare_*_get_tags() / mifare_*_free_tags() as freefare_get_tags() and freefare_free_tags();
- Add a new freefare_get_tag_type() function to get a tag type;
- Update regression test suite;
- Update example.
While this is a major change that basically change all the API, programs using libfreefare should be easily modified by replacing any Mifare*Tag variable by a generic MifareTag one, adding a few lines of code to check the target's type using freefare_get_tag_type(), and changing any call to mifare_*_get_tags() / mifare_*_free_tags() by the generic freefare_get_tags() and freefare_free_tags() functions.
Okay, either I lost some code somewhere, or I am really mad _AND_ fu**ing good at writing C code 'cause I am pretty sure I already fixed that at the very beginning of the UltraLight tags support and only after wrote all these test I don't have to modify so they pass.
Do not assume nfc_initiator_select_tag() and nfc_initiator_deselect_tag() will not return an error if the provided tag is supposed to be ready for the operation (it might have move out of the field), and let the error propagate through libfreefare to the application calling the functions.