From 00ca4579c9fb356710543b9665215e7d81672c38 Mon Sep 17 00:00:00 2001 From: Romain Tartiere Date: Mon, 21 Dec 2009 02:35:28 +0000 Subject: [PATCH] - Rename MifareSector to MifareSectorNumber; - Fix includes (use '<>' instead of '""'); - Add -I. to cc arguments. --- Makefile.am | 2 +- mad.c | 10 +++++----- mad.h | 12 ++++++------ mifare_classic.c | 2 +- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Makefile.am b/Makefile.am index 2ed5052..ac138f9 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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 diff --git a/mad.c b/mad.c index 212425c..a8f764d 100644 --- a/mad.c +++ b/mad.c @@ -30,7 +30,7 @@ #include #include -#include "mad.h" +#include 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; diff --git a/mad.h b/mad.h index 3b68f30..3bf916a 100644 --- a/mad.h +++ b/mad.h @@ -19,9 +19,9 @@ #ifndef __MIFARE_APPLICATION_DIRECTORY_H__ #define __MIFARE_APPLICATION_DIRECTORY_H__ -#include "mifare_classic.h" +#include -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__ */ diff --git a/mifare_classic.c b/mifare_classic.c index b39533d..2f2d6bc 100644 --- a/mifare_classic.c +++ b/mifare_classic.c @@ -37,7 +37,7 @@ #include -#include "mifare_classic.h" +#include struct mifare_classic_tag { nfc_device_t *device;