git://git.jankratochvil.net
/
gnokii.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
This commit was generated by cvs2svn to compensate for changes in r158,
[gnokii.git]
/
common
/
misc.c
diff --git
a/common/misc.c
b/common/misc.c
index
9ab975f
..
bf9887b
100644
(file)
--- a/
common/misc.c
+++ b/
common/misc.c
@@
-11,14
+11,8
@@
$Id$
$Log$
$Id$
$Log$
- Revision 1.1.1.2 2001/11/27 04:19:24 short
- :pserver:cvs@pserver.samba.org:/cvsroot - gnokii - Tue Nov 27 05:17 CET 2001
-
- Revision 1.20 2001/11/26 18:06:08 pkot
- Checking for *printf functions, N_(x) for localization, generic ARRAY_LEN, SAFE_STRNCPY, G_GNUC_PRINTF (Jan Kratochvil)
-
- Revision 1.19 2001/11/22 17:56:53 pkot
- smslib update. sms sending
+ Revision 1.1.1.9 2002/04/03 00:07:59 short
+ Found in "gnokii-working" directory, some November-patches version
Revision 1.18 2001/09/09 21:45:49 machek
Cleanups from Ladislav Michl <ladis@psi.cz>:
Revision 1.18 2001/09/09 21:45:49 machek
Cleanups from Ladislav Michl <ladis@psi.cz>:
@@
-52,6
+46,7
@@
#include <stdlib.h>
#include "misc.h"
#include <stdlib.h>
#include "misc.h"
+
int GetLine(FILE *File, char *Line, int count)
{
char *ptr;
int GetLine(FILE *File, char *Line, int count)
{
char *ptr;
@@
-59,8
+54,8
@@
int GetLine(FILE *File, char *Line, int count)
if (fgets(Line, count, File)) {
ptr = Line + strlen(Line) - 1;
if (fgets(Line, count, File)) {
ptr = Line + strlen(Line) - 1;
- while ( (*ptr == '\n' || *ptr == '\r') && ptr
>=
Line)
- *ptr--
=
'\0';
+ while ( (*ptr == '\n' || *ptr == '\r') && ptr
>=
Line)
+ *ptr--
=
'\0';
return strlen(Line);
}
return strlen(Line);
}
@@
-92,7
+87,7
@@
static PhoneModel models[] = {
{"616x", "NSW-3", PM_CALLERGROUP | PM_CALENDAR | PM_NETMONITOR | PM_KEYBOARD | PM_SMS | PM_DTMF | PM_DATA | PM_SPEEDDIAL | PM_AUTHENTICATION },
{"6185", "NSD-3", PM_CALLERGROUP | PM_CALENDAR | PM_NETMONITOR | PM_KEYBOARD | PM_SMS | PM_DTMF | PM_DATA | PM_SPEEDDIAL | PM_AUTHENTICATION },
{"6190", "NSB-3", PM_CALLERGROUP | PM_CALENDAR | PM_NETMONITOR | PM_KEYBOARD | PM_SMS | PM_DTMF | PM_DATA | PM_SPEEDDIAL | PM_AUTHENTICATION },
{"616x", "NSW-3", PM_CALLERGROUP | PM_CALENDAR | PM_NETMONITOR | PM_KEYBOARD | PM_SMS | PM_DTMF | PM_DATA | PM_SPEEDDIAL | PM_AUTHENTICATION },
{"6185", "NSD-3", PM_CALLERGROUP | PM_CALENDAR | PM_NETMONITOR | PM_KEYBOARD | PM_SMS | PM_DTMF | PM_DATA | PM_SPEEDDIAL | PM_AUTHENTICATION },
{"6190", "NSB-3", PM_CALLERGROUP | PM_CALENDAR | PM_NETMONITOR | PM_KEYBOARD | PM_SMS | PM_DTMF | PM_DATA | PM_SPEEDDIAL | PM_AUTHENTICATION },
- {"6210", "NPE-3", PM_CALLERGROUP | PM_CALENDAR | PM_EXTPBK
| PM_SMS
},
+ {"6210", "NPE-3", PM_CALLERGROUP | PM_CALENDAR | PM_EXTPBK },
{"6250", "NHM-3", PM_CALLERGROUP | PM_CALENDAR | PM_EXTPBK },
{"7110", "NSE-5", PM_CALLERGROUP | PM_SPEEDDIAL | PM_EXTPBK },
{"8810", "NSE-6", PM_SMS | PM_DTMF | PM_DATA },
{"6250", "NHM-3", PM_CALLERGROUP | PM_CALENDAR | PM_EXTPBK },
{"7110", "NSE-5", PM_CALLERGROUP | PM_SPEEDDIAL | PM_EXTPBK },
{"8810", "NSE-6", PM_SMS | PM_DTMF | PM_DATA },
@@
-104,6
+99,11
@@
static PhoneModel models[] = {
{"540", "THF-11", 0 },
{"650", "THF-12", 0 },
{"640", "THF-13", 0 },
{"540", "THF-11", 0 },
{"650", "THF-12", 0 },
{"640", "THF-13", 0 },
+/* "AT" modele, all are prefixed by "AT-" to not to clash with FBUS interface to the same phone!
+ */
+ {"M20", "AT-M20", PM_SMS },
+ {"9110", "AT-RAE-2", PM_SMS },
+ {"9210", "AT-Nokia Communicator GSM900/1800", PM_SMS },
{NULL, NULL, 0 }
};
{NULL, NULL, 0 }
};
@@
-132,46
+132,46
@@
inline char *GetModel (const char *num)
#ifndef HAVE_VASPRINTF
/* Adapted from snprintf(3) man page: */
#ifndef HAVE_VASPRINTF
/* Adapted from snprintf(3) man page: */
-int gvasprintf(char **destp,
const char *fmt,
va_list ap)
+int gvasprintf(char **destp,
const char *fmt,
va_list ap)
{
{
-
int n, size =
0x100;
-
char *p,
*pnew;
+
int n,size=
0x100;
+
char *p,
*pnew;
- if (!(p
=
malloc(size))) {
- *destp
=
NULL;
+ if (!(p
=
malloc(size))) {
+ *destp
=
NULL;
return(-1);
return(-1);
- }
+
}
for (;;) {
/* Try to print in the allocated space. */
for (;;) {
/* Try to print in the allocated space. */
- n
= gvsprintf(p, size, fmt,
ap);
+ n
=gvsprintf(p,size,fmt,
ap);
/* If that worked, return the string. */
/* If that worked, return the string. */
- if (n
> -1 && n <
size) {
- *destp
=
p;
+ if (n
>-1 && n<
size) {
+ *destp
=
p;
return(n);
return(n);
- }
+
}
/* Else try again with more space. */
/* Else try again with more space. */
- if (n
> -1)
/* glibc 2.1 */
- size
= n + 1;
/* precisely what is needed */
+ if (n
>-1)
/* glibc 2.1 */
+ size
=n+1;
/* precisely what is needed */
else /* glibc 2.0 */
else /* glibc 2.0 */
- size
*= 2;
/* twice the old size */
- if (!(pnew
= realloc(p,
size))) {
+ size
*=2;
/* twice the old size */
+ if (!(pnew
=realloc(p,
size))) {
free(p);
free(p);
- *destp
=
NULL;
+ *destp
=
NULL;
return(-1);
return(-1);
- }
- p
=
pnew;
+
}
+ p
=
pnew;
}
}
#endif
#ifndef HAVE_ASPRINTF
}
}
#endif
#ifndef HAVE_ASPRINTF
-int gasprintf(char **destp,
const char *fmt,...)
+int gasprintf(char **destp,const char *fmt,...)
{
{
-
va_list ap;
-
int r;
+va_list ap;
+int r;
va_start(ap,fmt);
va_start(ap,fmt);
- r
= gvasprintf(destp, fmt,
ap);
+ r
=gvasprintf(destp,fmt,
ap);
va_end(ap);
return(r);
}
va_end(ap);
return(r);
}