X-Git-Url: https://git.jankratochvil.net/?p=gnokii.git;a=blobdiff_plain;f=include%2Fmisc.h;h=2a16e51f28b2a268d92eca2dc742fc5c7ddcc270;hp=3e91ff0eb6cef6852522127efd216662699df8c4;hb=a2dfc99dc499ea8600bf5178f8122125d7d7d557;hpb=4ee1266711b695852ec88f06784fd84400cd70bb diff --git a/include/misc.h b/include/misc.h index 3e91ff0..2a16e51 100644 --- a/include/misc.h +++ b/include/misc.h @@ -1,38 +1,32 @@ /* - $Id$ - G N O K I I A Linux/Unix toolset and driver for Nokia mobile phones. - Copyright (C) 1999, 2000 Hugh Blemings & Pavel Janík ml. - Released under the terms of the GNU GPL, see file COPYING for more details. Header file for miscellaneous defines, typedefs etc. - $Log$ - Revision 1.1.1.1 2001/11/25 21:59:21 short - :pserver:cvs@pserver.samba.org:/cvsroot - gnokii - Sun Nov 25 22:56 CET 2001 - - Revision 1.26 2001/11/14 10:46:12 pkot - Small cleanup with __unices__ - - Revision 1.25 2001/07/03 15:27:14 pkot - AT commands for SMS handling support (Tamas Bondar) - Small at-emulator code cleanup (me) - - Revision 1.24 2001/06/28 00:28:46 pkot - Small docs updates (Pawel Kot) - - */ #ifndef __misc_h #define __misc_h -#include "config.h" +#include +#include + +#ifndef VC6 + #include "config.h" + + /* Use gsprintf instead of sprintf and sprintf */ + #ifdef HAVE_SNPRINTF + # define gsprintf(a, b, c...) snprintf(a, b, c) + #else + # define gsprintf(a, b, c...) sprintf(a, c) + #endif + +#endif /* Some general defines. */ @@ -48,31 +42,17 @@ #define bool int #endif -/* A define to make debug printfs neat */ -#ifndef DEBUG -#define dprintf(a...) do { } while (0) -#else -#define dprintf(a...) do { fprintf(stderr, a); fflush(stderr); } while (0) -#endif +/* This one is for NLS. */ -/* Use gsprintf instead of sprintf and sprintf */ -#ifdef HAVE_SNPRINTF -# define gsprintf(a, b, c...) snprintf(a, b, c) -#else -# define gsprintf(a, b, c...) sprintf(a, c) -#endif +#ifdef USE_NLS -/* Get rid of long defines. Use #if __unices__ */ -#define __unices__ defined(__svr4__) || defined(__FreeBSD__) || defined(__bsdi__) -#if __unices__ -# include -# include -#endif + #ifndef VC6 + #include + #define _(x) gettext(x) + #else + #define _(x) (x) + #endif -/* This one is for NLS. */ -#ifdef USE_NLS - #include - #define _(x) gettext(x) #else #define _(x) (x) #endif /* USE_NLS */ @@ -117,22 +97,6 @@ /* Add here any timer operations which are not supported by libc5 */ #ifndef HAVE_TIMEOPS -#ifdef WIN32 - -#include -#include -#define timersub(a, b, result) - do { - (result)->tv_sec = (a)->time - (b)->time; - (result)->tv_usec = ((a)->millitm - (b)->millitm) * 1000; - if ((result)->tv_usec < 0) { - --(result)->tv_sec; - (result)->tv_usec += 1000000; - } - } while (0) -#define gettimeofday(a, b) _ftime(a) - -#else #include #ifndef timersub @@ -147,33 +111,15 @@ } while (0) #endif -#endif /* WIN32 */ #endif /* HAVE_TIMEOPS */ - #include + extern int GetLine(FILE *File, char *Line, int count); -/* For models table */ -typedef struct { - char *model; - char *number; - int flags; -} PhoneModel; - -#define PM_CALLERGROUP 0x0001 -#define PM_NETMONITOR 0x0002 -#define PM_KEYBOARD 0x0004 -#define PM_SMS 0x0008 -#define PM_CALENDAR 0x0010 -#define PM_DTMF 0x0020 -#define PM_DATA 0x0040 -#define PM_SPEEDDIAL 0x0080 -#define PM_EXTPBK 0x0100 -#define PM_AUTHENTICATION 0x0200 - -extern char *GetModel (const char *); -extern PhoneModel *GetPhoneModel (const char *); +int mem_to_int(const char str[], int len); -#endif /* __misc_h */ +void hexdump(u16 MessageLength, u8 *MessageBuffer); +void txhexdump(u16 MessageLength, u8 *MessageBuffer); +#endif /* __misc_h */