Prevent from exporting messages macros outside of libnfc.

This commit is contained in:
Romuald Conty 2009-09-08 10:25:59 +00:00
parent b73d9f03fa
commit 7924d10fad
12 changed files with 58 additions and 16 deletions

View file

@ -5,7 +5,11 @@ bin_PROGRAMS = nfc-anticol nfc-list nfc-mftool nfc-mfultool nfc-relay nfc-emulat
# set the include path found by configure
INCLUDES= $(all_includes)
nfcinclude_HEADERS = libnfc.h bitutils.h defines.h types.h mifaretag.h mifareultag.h devices.h rs232.h dev_arygon.h dev_pn531.h dev_pn533.h
nfc_devices_headers = dev_arygon.h dev_pn531.h dev_pn533.h
nfc_examples_headers = mifaretag.h mifareultag.h
nfcinclude_HEADERS = libnfc.h bitutils.h defines.h types.h rs232.h devices.h messages.h
nfcinclude_HEADERS += $(nfc_devices_headers)
nfcinclude_HEADERS += $(nfc_examples_headers)
nfcincludedir = $(includedir)/libnfc
lib_LTLIBRARIES = libnfc.la

View file

@ -27,6 +27,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
#include "libnfc.h"
#include "messages.h"
#define SAK_FLAG_ATS_SUPPORTED 0x20
static byte_t abtRx[MAX_FRAME_LEN];

View file

@ -29,18 +29,6 @@ typedef void* dev_spec; // Device connection specification
#define DEVICE_NAME_LENGTH 256
#define MAX_DEVICES 16
// Useful macros
#ifdef DEBUG
// #define DBG(x, args...) printf("DBG %s:%d: " x "\n", __FILE__, __LINE__,## args )
#define DBG(x, ...) printf("DBG %s:%d: " x "\n", __FILE__, __LINE__, ## __VA_ARGS__ )
#else
#define DBG(...) {}
#endif
#define INFO(x, ...) printf("INFO: " x "\n", ## __VA_ARGS__ )
#define WARN(x, ...) printf("WARNING: " x "\n", ## __VA_ARGS__ )
#define ERR(x, ...) printf("ERROR: " x "\n", ## __VA_ARGS__ )
#if defined __cplusplus
#define LIBNFC_EXTERN_C extern "C"
#else

View file

@ -31,6 +31,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
#endif
#include "defines.h"
#include "messages.h"
#include "bitutils.h"
// WINDOWS: #define IOCTL_CCID_ESCAPE_SCARD_CTL_CODE SCARD_CTL_CODE(3500)

View file

@ -19,8 +19,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
*/
#include "dev_arygon.h"
#include "rs232.h"
#include "bitutils.h"
#include "messages.h"
#ifdef _WIN32
#define SERIAL_STRING "COM"

View file

@ -21,14 +21,15 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
/*
Thanks to d18c7db and Okko for example code
*/
#include "defines.h"
#include "dev_pn533.h"
#include <usb.h>
#include <stdio.h>
#include <string.h>
#include "dev_pn533.h"
#include "defines.h"
#include "bitutils.h"
#include "messages.h"
#define BUFFER_LENGTH 256
#define USB_TIMEOUT 30000

View file

@ -25,6 +25,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
#include <string.h>
#include "libnfc.h"
#include "messages.h"
static byte_t abtRecv[MAX_FRAME_LEN];
static uint32_t uiRecvBits;

View file

@ -27,6 +27,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
#include "devices.h"
#include "bitutils.h"
#include "messages.h"
// Registers and symbols masks used to covers parts within a register
#define REG_CIU_TX_MODE 0x6302

View file

@ -25,6 +25,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
#include <string.h>
#include "libnfc.h"
#include "messages.h"
static dev_info* pdi;
static byte_t abtFelica[5] = { 0x00, 0xff, 0xff, 0x00, 0x00 };

38
src/messages.h Normal file
View file

@ -0,0 +1,38 @@
/*
Public platform independent Near Field Communication (NFC) library
Copyright (C) 2009, Roel Verdult
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>
*/
#ifndef _LIBNFC_MESSAGES_H_
#define _LIBNFC_MESSAGES_H_
// #define DEBUG /* DEBUG flag can also be enabled using ./configure --enable-debug */
// Useful macros
#ifdef DEBUG
// #define DBG(x, args...) printf("DBG %s:%d: " x "\n", __FILE__, __LINE__,## args )
#define DBG(x, ...) printf("DBG %s:%d: " x "\n", __FILE__, __LINE__, ## __VA_ARGS__ )
#else
#define DBG(...) {}
#endif
#define INFO(x, ...) printf("INFO: " x "\n", ## __VA_ARGS__ )
#define WARN(x, ...) printf("WARNING: " x "\n", ## __VA_ARGS__ )
#define ERR(x, ...) printf("ERROR: " x "\n", ## __VA_ARGS__ )
#endif // _LIBNFC_MESSAGES_H_

View file

@ -24,6 +24,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
#include <string.h>
#include "libnfc.h"
#include "messages.h"
static byte_t abtReaderRx[MAX_FRAME_LEN];
static byte_t abtReaderRxPar[MAX_FRAME_LEN];

View file

@ -26,6 +26,8 @@ available: http://www.teuniz.net/RS-232/index.html
#include "rs232.h"
#include "messages.h"
// Test if we are dealing with unix operating systems
#ifndef _WIN32