7 A Linux/Unix toolset and driver for Nokia mobile phones.
9 Copyright (C) 1999, 2000 Hugh Blemings & Pavel JanÃk ml.
11 Released under the terms of the GNU GPL, see file COPYING for more details.
13 Header file for miscellaneous defines, typedefs etc.
16 Revision 1.1.1.1 2001/11/25 21:59:21 short
17 :pserver:cvs@pserver.samba.org:/cvsroot - gnokii - Sun Nov 25 22:56 CET 2001
19 Revision 1.26 2001/11/14 10:46:12 pkot
20 Small cleanup with __unices__
22 Revision 1.25 2001/07/03 15:27:14 pkot
23 AT commands for SMS handling support (Tamas Bondar)
24 Small at-emulator code cleanup (me)
26 Revision 1.24 2001/06/28 00:28:46 pkot
27 Small docs updates (Pawel Kot)
37 /* Some general defines. */
51 /* A define to make debug printfs neat */
53 #define dprintf(a...) do { } while (0)
55 #define dprintf(a...) do { fprintf(stderr, a); fflush(stderr); } while (0)
58 /* Use gsprintf instead of sprintf and sprintf */
60 # define gsprintf(a, b, c...) snprintf(a, b, c)
62 # define gsprintf(a, b, c...) sprintf(a, c)
65 /* Get rid of long defines. Use #if __unices__ */
66 #define __unices__ defined(__svr4__) || defined(__FreeBSD__) || defined(__bsdi__)
69 # include <sys/file.h>
72 /* This one is for NLS. */
75 #define _(x) gettext(x)
80 /* Definitions for u8, u16, u32 and u64, borrowed from
81 /usr/src/linux/include/asm-i38/types.h */
84 typedef unsigned char u8;
88 typedef unsigned short u16;
92 typedef unsigned int u32;
99 #if defined(__GNUC__) && !defined(__STRICT_ANSI__)
101 typedef unsigned long long u64;
105 typedef signed long long s64;
109 /* This one is for FreeBSD and similar systems without __ptr_t_ */
110 /* FIXME: autoconf should take care of this. */
113 typedef void * __ptr_t;
117 /* Add here any timer operations which are not supported by libc5 */
123 #include <sys/timeb.h>
124 #define timersub(a, b, result)
126 (result)->tv_sec = (a)->time - (b)->time;
127 (result)->tv_usec = ((a)->millitm - (b)->millitm) * 1000;
128 if ((result)->tv_usec < 0) {
130 (result)->tv_usec += 1000000;
133 #define gettimeofday(a, b) _ftime(a)
136 #include <sys/time.h>
139 #define timersub(a, b, result) \
141 (result)->tv_sec = (a)->tv_sec - (b)->tv_sec; \
142 (result)->tv_usec = (a)->tv_usec - (b)->tv_usec; \
143 if ((result)->tv_usec < 0) { \
144 --(result)->tv_sec; \
145 (result)->tv_usec += 1000000; \
151 #endif /* HAVE_TIMEOPS */
155 extern int GetLine(FILE *File, char *Line, int count);
157 /* For models table */
164 #define PM_CALLERGROUP 0x0001
165 #define PM_NETMONITOR 0x0002
166 #define PM_KEYBOARD 0x0004
167 #define PM_SMS 0x0008
168 #define PM_CALENDAR 0x0010
169 #define PM_DTMF 0x0020
170 #define PM_DATA 0x0040
171 #define PM_SPEEDDIAL 0x0080
172 #define PM_EXTPBK 0x0100
173 #define PM_AUTHENTICATION 0x0200
175 extern char *GetModel (const char *);
176 extern PhoneModel *GetPhoneModel (const char *);
178 #endif /* __misc_h */