5 A Linux/Unix toolset and driver for Nokia mobile phones.
7 Released under the terms of the GNU GPL, see file COPYING for more details.
9 Header file for miscellaneous defines, typedefs etc.
22 /* Use gsprintf instead of sprintf and sprintf */
24 # define gsprintf(a, b, c...) snprintf(a, b, c)
26 # define gsprintf(a, b, c...) sprintf(a, c)
31 /* Some general defines. */
45 /* This one is for NLS. */
51 #define _(x) gettext(x)
60 /* Definitions for u8, u16, u32 and u64, borrowed from
61 /usr/src/linux/include/asm-i38/types.h */
64 typedef unsigned char u8;
68 typedef unsigned short u16;
72 typedef unsigned int u32;
79 #if defined(__GNUC__) && !defined(__STRICT_ANSI__)
81 typedef unsigned long long u64;
85 typedef signed long long s64;
89 /* This one is for FreeBSD and similar systems without __ptr_t_ */
90 /* FIXME: autoconf should take care of this. */
93 typedef void * __ptr_t;
97 /* Add here any timer operations which are not supported by libc5 */
100 #include <sys/time.h>
103 #define timersub(a, b, result) \
105 (result)->tv_sec = (a)->tv_sec - (b)->tv_sec; \
106 (result)->tv_usec = (a)->tv_usec - (b)->tv_usec; \
107 if ((result)->tv_usec < 0) { \
108 --(result)->tv_sec; \
109 (result)->tv_usec += 1000000; \
114 #endif /* HAVE_TIMEOPS */
118 extern int GetLine(FILE *File, char *Line, int count);
120 int mem_to_int(const char str[], int len);
122 void hexdump(u16 MessageLength, u8 *MessageBuffer);
123 void txhexdump(u16 MessageLength, u8 *MessageBuffer);
125 #endif /* __misc_h */