Removes some remaining ^M chars.

This commit is contained in:
romuald@libnfc.org 2012-09-23 10:44:23 +00:00
parent 91e4c89302
commit 6c8b6190cb
2 changed files with 645 additions and 645 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,82 +1,82 @@
/* /*
Package: Package:
MiFare Classic Universal toolKit (MFCUK) MiFare Classic Universal toolKit (MFCUK)
Package version: Package version:
0.1 0.1
Filename: Filename:
mfcuk_utils.h mfcuk_utils.h
Description: Description:
MFCUK common utility functions prototypes. MFCUK common utility functions prototypes.
License: License:
GPL2 (see below), Copyright (C) 2009, Andrei Costin GPL2 (see below), Copyright (C) 2009, Andrei Costin
* @file mfcuk_utils.h/ * @file mfcuk_utils.h/
* @brief * @brief
*/ */
/* /*
VERSION HISTORY VERSION HISTORY
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
| Number : 0.1 | Number : 0.1
| dd/mm/yyyy : 23/11/2009 | dd/mm/yyyy : 23/11/2009
| Author : zveriu@gmail.com, http://andreicostin.com | Author : zveriu@gmail.com, http://andreicostin.com
| Description: Moved bulk of defines and prototypes from "mfcuk_keyrecovery_darkside.c" | Description: Moved bulk of defines and prototypes from "mfcuk_keyrecovery_darkside.c"
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
*/ */
/* /*
LICENSE LICENSE
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or the Free Software Foundation, either version 2 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#ifndef _MFCUK_UTILS_H_ #ifndef _MFCUK_UTILS_H_
#define _MFCUK_UTILS_H_ #define _MFCUK_UTILS_H_
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#ifdef WIN32 #ifdef WIN32
#define NOMINMAX #define NOMINMAX
#include "windows.h" #include "windows.h"
#include "xgetopt.h" #include "xgetopt.h"
#elif __STDC__ #elif __STDC__
#include <unistd.h> #include <unistd.h>
#include <sys/time.h> #include <sys/time.h>
#include <sys/types.h> #include <sys/types.h>
#endif #endif
// "Portable" sleep(miliseconds) // "Portable" sleep(miliseconds)
#ifdef WIN32 #ifdef WIN32
#define sleep(x) Sleep(x) #define sleep(x) Sleep(x)
#elif __STDC__ #elif __STDC__
extern struct timeval global_timeout; extern struct timeval global_timeout;
#define sleep(x) { global_timeout.tv_usec = 1000 * (x); select(0,NULL,NULL,NULL,&global_timeout); } #define sleep(x) { global_timeout.tv_usec = 1000 * (x); select(0,NULL,NULL,NULL,&global_timeout); }
#endif #endif
// "Portable" clear_screen() - NOTE: system performance penalty introduced // "Portable" clear_screen() - NOTE: system performance penalty introduced
#ifdef WIN32 #ifdef WIN32
#define clear_screen() system("cls") #define clear_screen() system("cls")
#elif __STDC__ #elif __STDC__
#define clear_screen() system("sh -c clear") #define clear_screen() system("sh -c clear")
#endif #endif
/** /**
* @fn int is_hex(char c) * @fn int is_hex(char c)
* @brief Checks if an ASCII character is a valid hexadecimal base digit * @brief Checks if an ASCII character is a valid hexadecimal base digit
@ -85,9 +85,9 @@
* *
* Checks if an ASCII character is a valid hexadecimal base digit. * Checks if an ASCII character is a valid hexadecimal base digit.
* Used for hex2bin() functionality. * Used for hex2bin() functionality.
*/ */
int is_hex(char c); int is_hex(char c);
/** /**
* @fn unsigned char hex2bin(unsigned char h, unsigned char l) * @fn unsigned char hex2bin(unsigned char h, unsigned char l)
* @brief Converts from two nibbles (4 bits) into the corresponding byte * @brief Converts from two nibbles (4 bits) into the corresponding byte
@ -98,7 +98,7 @@ int is_hex(char c);
* Converts from two nibbles (4 bits) into the corresponding byte. * Converts from two nibbles (4 bits) into the corresponding byte.
* Uses the algorithm and implementation from here: * Uses the algorithm and implementation from here:
* http://www.velocityreviews.com/forums/t451319-advice-required-on-my-ascii-to-hex-conversion-c.html * http://www.velocityreviews.com/forums/t451319-advice-required-on-my-ascii-to-hex-conversion-c.html
*/ */
unsigned char hex2bin(unsigned char h, unsigned char l); unsigned char hex2bin(unsigned char h, unsigned char l);
#endif // _MFCUK_UTILS_H_ #endif // _MFCUK_UTILS_H_