Rework data structures allocations / frees.
- 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.
This commit is contained in:
parent
e52fbccb4a
commit
e0d2405a30
4 changed files with 53 additions and 21 deletions
|
|
@ -131,22 +131,37 @@ int get_block_access_bits (MifareTag tag, const MifareClassicBlockNumber block,
|
|||
|
||||
|
||||
/*
|
||||
* MIFARE card communication preparation functions
|
||||
*
|
||||
* The following functions send NFC commands to the initiator to prepare
|
||||
* communication with a MIFARE card, and perform required cleannups after using
|
||||
* the target.
|
||||
* Memory management functions.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Free the provided tag list.
|
||||
* Allocates and initialize a MIFARE Classic tag.
|
||||
*/
|
||||
|
||||
MifareTag
|
||||
mifare_classic_tag_new (void)
|
||||
{
|
||||
return malloc (sizeof (struct mifare_classic_tag));
|
||||
}
|
||||
|
||||
/*
|
||||
* Free the provided tag.
|
||||
*/
|
||||
void
|
||||
mifare_classic_free_tag (MifareTag tag)
|
||||
mifare_classic_tag_free (MifareTag tag)
|
||||
{
|
||||
free (tag);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* MIFARE card communication preparation functions
|
||||
*
|
||||
* The following functions send NFC commands to the initiator to prepare
|
||||
* communication with a MIFARE card, and perform required cleanups after using
|
||||
* the target.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Establish connection to the provided tag.
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue