- Rename MifareSector to MifareSectorNumber;
- Fix includes (use '<>' instead of '""'); - Add -I. to cc arguments.
This commit is contained in:
parent
89dd817a63
commit
00ca4579c9
4 changed files with 13 additions and 13 deletions
|
@ -1,7 +1,7 @@
|
|||
|
||||
ACLOCAL_AMFLAGS = -I m4
|
||||
|
||||
AM_CFLAGS = -std=c99 @LIBNFC_CFLAGS@
|
||||
AM_CFLAGS = -I. -std=c99 @LIBNFC_CFLAGS@
|
||||
AM_LDFLAGS = @LIBNFC_LIBS@
|
||||
|
||||
lib_LTLIBRARIES = libfreefare.la
|
||||
|
|
10
mad.c
10
mad.c
|
@ -30,7 +30,7 @@
|
|||
#include <errno.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "mad.h"
|
||||
#include <mad.h>
|
||||
|
||||
struct aid {
|
||||
uint8_t function_cluster_code;
|
||||
|
@ -264,7 +264,7 @@ mad_set_version (Mad mad, uint8_t version)
|
|||
/*
|
||||
* Return the MAD card publisher sector.
|
||||
*/
|
||||
MifareSector
|
||||
MifareSectorNumber
|
||||
mad_get_card_publisher_sector(Mad mad)
|
||||
{
|
||||
return (mad->sector_0x00.info & 0x3f);
|
||||
|
@ -274,7 +274,7 @@ mad_get_card_publisher_sector(Mad mad)
|
|||
* Set the MAD card publisher sector.
|
||||
*/
|
||||
int
|
||||
mad_set_card_publisher_sector(Mad mad, MifareSector cps)
|
||||
mad_set_card_publisher_sector(Mad mad, MifareSectorNumber cps)
|
||||
{
|
||||
if (((mad->version == 2) && (cps > 0x27)) | (mad->version == 1) && (cps > 0x0f)) {
|
||||
errno = EINVAL;
|
||||
|
@ -289,7 +289,7 @@ mad_set_card_publisher_sector(Mad mad, MifareSector cps)
|
|||
* Get the provided sector's application identifier.
|
||||
*/
|
||||
int
|
||||
mad_get_aid(Mad mad, MifareSector sector, uint8_t *function_cluster_code, uint8_t *application_code)
|
||||
mad_get_aid(Mad mad, MifareSectorNumber sector, uint8_t *function_cluster_code, uint8_t *application_code)
|
||||
{
|
||||
if (sector > 0x27) {
|
||||
errno = EINVAL;
|
||||
|
@ -316,7 +316,7 @@ mad_get_aid(Mad mad, MifareSector sector, uint8_t *function_cluster_code, uint8_
|
|||
* Set the provided sector's application identifier.
|
||||
*/
|
||||
int
|
||||
mad_set_aid(Mad mad, MifareSector sector, uint8_t function_cluster_code, uint8_t application_code)
|
||||
mad_set_aid(Mad mad, MifareSectorNumber sector, uint8_t function_cluster_code, uint8_t application_code)
|
||||
{
|
||||
if (sector > 0x27) {
|
||||
errno = EINVAL;
|
||||
|
|
12
mad.h
12
mad.h
|
@ -19,9 +19,9 @@
|
|||
#ifndef __MIFARE_APPLICATION_DIRECTORY_H__
|
||||
#define __MIFARE_APPLICATION_DIRECTORY_H__
|
||||
|
||||
#include "mifare_classic.h"
|
||||
#include <mifare_classic.h>
|
||||
|
||||
typedef uint8_t MifareSector;
|
||||
typedef uint8_t MifareSectorNumber;
|
||||
|
||||
struct mad;
|
||||
typedef struct mad *Mad;
|
||||
|
@ -31,10 +31,10 @@ Mad mad_read (MifareClassicTag tag);
|
|||
int mad_write (MifareClassicTag tag, Mad mad, MifareClassicKey key_b_sector_00, MifareClassicKey key_b_sector_10);
|
||||
int mad_get_version (Mad mad);
|
||||
void mad_set_version (Mad mad, uint8_t version);
|
||||
MifareSector mad_get_card_publisher_sector(Mad mad);
|
||||
int mad_set_card_publisher_sector(Mad mad, MifareSector cps);
|
||||
int mad_get_aid(Mad mad, MifareSector sector, uint8_t *function_cluster_code, uint8_t *application_code);
|
||||
int mad_set_aid(Mad mad, MifareSector sector, uint8_t function_cluster_code, uint8_t application_code);
|
||||
MifareSectorNumber mad_get_card_publisher_sector(Mad mad);
|
||||
int mad_set_card_publisher_sector(Mad mad, MifareSectorNumber cps);
|
||||
int mad_get_aid(Mad mad, MifareSectorNumber sector, uint8_t *function_cluster_code, uint8_t *application_code);
|
||||
int mad_set_aid(Mad mad, MifareSectorNumber sector, uint8_t function_cluster_code, uint8_t application_code);
|
||||
void mad_free (Mad mad);
|
||||
|
||||
#endif /* !__MIFARE_APPLICATION_DIRECTORY_H__ */
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
|
||||
#include <nfc/nfc.h>
|
||||
|
||||
#include "mifare_classic.h"
|
||||
#include <mifare_classic.h>
|
||||
|
||||
struct mifare_classic_tag {
|
||||
nfc_device_t *device;
|
||||
|
|
Loading…
Reference in a new issue