gnokii-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

gnokii ChangeLog common/cfgreader.c common/libf...


From: Helge Deller
Subject: gnokii ChangeLog common/cfgreader.c common/libf...
Date: Sun, 11 Jun 2006 20:41:39 +0000

CVSROOT:        /sources/gnokii
Module name:    gnokii
Changes by:     Helge Deller <deller>   06/06/11 20:41:39

Modified files:
        .              : ChangeLog 
        common         : cfgreader.c libfunctions.c 
        config         : config.guess config.sub 
        include        : gnokii-internal.h gnokii.h 
        include/gnokii : common.h 

Log message:
        add gn_lib_get_supported_connection() and 
gn_lib_search_one_connected_phone()

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnokii/ChangeLog?cvsroot=gnokii&r1=1.1195&r2=1.1196
http://cvs.savannah.gnu.org/viewcvs/gnokii/common/cfgreader.c?cvsroot=gnokii&r1=1.72&r2=1.73
http://cvs.savannah.gnu.org/viewcvs/gnokii/common/libfunctions.c?cvsroot=gnokii&r1=1.23&r2=1.24
http://cvs.savannah.gnu.org/viewcvs/gnokii/config/config.guess?cvsroot=gnokii&r1=1.8&r2=1.9
http://cvs.savannah.gnu.org/viewcvs/gnokii/config/config.sub?cvsroot=gnokii&r1=1.7&r2=1.8
http://cvs.savannah.gnu.org/viewcvs/gnokii/include/gnokii-internal.h?cvsroot=gnokii&r1=1.31&r2=1.32
http://cvs.savannah.gnu.org/viewcvs/gnokii/include/gnokii.h?cvsroot=gnokii&r1=1.98&r2=1.99
http://cvs.savannah.gnu.org/viewcvs/gnokii/include/gnokii/common.h?cvsroot=gnokii&r1=1.146&r2=1.147

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnokii/gnokii/ChangeLog,v
retrieving revision 1.1195
retrieving revision 1.1196
diff -u -b -r1.1195 -r1.1196
--- ChangeLog   11 Jun 2006 16:40:17 -0000      1.1195
+++ ChangeLog   11 Jun 2006 20:41:38 -0000      1.1196
@@ -27,6 +27,8 @@
     o lots of changes all around to use new libgnokii
       functions                                             (Helge Deller)
     o add GNOKII_DEPRECATED and API for Linux        (Helge Deller)
+    o add gn_lib_get_supported_connection() and 
+      gn_lib_search_one_connected_phone()            (Helge Deller)
     o added gn_lib_addressbook_memstat(),
       gn_lib_phonebook_read_entry(),
       gn_lib_phonebook_entry_isempty()               (Helge Deller)

Index: common/cfgreader.c
===================================================================
RCS file: /sources/gnokii/gnokii/common/cfgreader.c,v
retrieving revision 1.72
retrieving revision 1.73
diff -u -b -r1.72 -r1.73
--- common/cfgreader.c  11 Jun 2006 16:39:48 -0000      1.72
+++ common/cfgreader.c  11 Jun 2006 20:41:39 -0000      1.73
@@ -1,6 +1,6 @@
 /*
 
-  $Id: cfgreader.c,v 1.72 2006/06/11 16:39:48 deller Exp $
+  $Id: cfgreader.c,v 1.73 2006/06/11 20:41:39 deller Exp $
 
   G N O K I I
 
@@ -419,33 +419,8 @@
        if (!(val = gn_cfg_get(gn_cfg_info, section, "connection")))
                cfg->connection_type = def->connection_type;
        else {
-               if (!strcasecmp(val, "serial"))
-                       cfg->connection_type = GN_CT_Serial;
-               else if (!strcasecmp(val, "dau9p"))
-                       cfg->connection_type = GN_CT_DAU9P;
-               else if (!strcasecmp(val, "dlr3p"))
-                       cfg->connection_type = GN_CT_DLR3P;
-               else if (!strcasecmp(val, "infrared"))
-                       cfg->connection_type = GN_CT_Infrared;
-               else if (!strcasecmp(val, "m2bus"))
-                       cfg->connection_type = GN_CT_M2BUS;
-               else if (!strcasecmp(val, "irda"))
-                       cfg->connection_type = GN_CT_Irda;
-               else if (!strcasecmp(val, "bluetooth"))
-                       cfg->connection_type = GN_CT_Bluetooth;
-               else if (!strcasecmp(val, "dku5"))
-                       cfg->connection_type = GN_CT_DLR3P;
-               else if (!strcasecmp(val, "dku2"))
-                       cfg->connection_type = GN_CT_DKU2;
-               else if (!strcasecmp(val, "dku2libusb"))
-                       cfg->connection_type = GN_CT_DKU2LIBUSB;
-#ifndef WIN32
-               else if (!strcasecmp(val, "tcp"))
-                       cfg->connection_type = GN_CT_TCP;
-#endif
-               else if (!strcasecmp(val, "tekram"))
-                       cfg->connection_type = GN_CT_Tekram;
-               else {
+               cfg->connection_type = gn_get_connectiontype(val);
+               if (cfg->connection_type == GN_CT_NONE) {
                        fprintf(stderr, _("Unsupported [%s] %s value 
\"%s\"\n"), section, "connection", val);
                        return false;
                }

Index: common/libfunctions.c
===================================================================
RCS file: /sources/gnokii/gnokii/common/libfunctions.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -b -r1.23 -r1.24
--- common/libfunctions.c       11 Jun 2006 16:39:48 -0000      1.23
+++ common/libfunctions.c       11 Jun 2006 20:41:39 -0000      1.24
@@ -1,5 +1,5 @@
 /*
-  $Id: libfunctions.c,v 1.23 2006/06/11 16:39:48 deller Exp $
+  $Id: libfunctions.c,v 1.24 2006/06/11 20:41:39 deller Exp $
 
   G N O K I I
 
@@ -436,3 +436,51 @@
        if (second) *second = dt->second;
        if (timezone) *timezone = dt->timezone;
 }
+
+static struct { gn_connection_type ct; const char *str; } connectiontypes[] = {
+       { GN_CT_Serial,     "serial" },
+       { GN_CT_DAU9P,      "dau9p" },
+       { GN_CT_DLR3P,      "dlr3p" },
+       { GN_CT_Infrared,   "infrared" },
+       { GN_CT_M2BUS,      "m2bus" },
+       { GN_CT_Irda,       "irda" },
+       { GN_CT_Bluetooth,  "bluetooth" },
+       { GN_CT_DLR3P,      "dku5" },
+       { GN_CT_DKU2,       "dku2" },
+       { GN_CT_DKU2LIBUSB, "dku2libusb" },
+#ifndef WIN32
+       { GN_CT_TCP,        "tcp" },
+#endif
+       { GN_CT_Tekram,     "tekram" }
+};
+
+gn_connection_type gn_get_connectiontype(const char *connection_type_string)
+{ 
+       int i;
+       for (i = 0; i < sizeof(connectiontypes)/sizeof(connectiontypes[0]); i++)
+               if (!strcasecmp(connection_type_string, connectiontypes[i].str))
+                       return connectiontypes[i].ct;
+       return GN_CT_NONE;
+}
+
+GNOKII_API const char *gn_lib_get_supported_connection(const int num)
+{
+       if (num < 0 || num >= 
sizeof(connectiontypes)/sizeof(connectiontypes[0]))
+               return NULL;
+       return connectiontypes[num].str;
+}
+
+
+GNOKII_API gn_error gn_lib_search_one_connected_phone(struct gn_statemachine 
**state)
+{
+       /* allocate and initialize data structures */
+       *state = malloc(sizeof(**state));
+       if (!*state)
+               return GN_ERR_MEMORYFULL;
+       memset(*state, 0, sizeof(**state));
+
+       /* not yet implemented */
+       free(*state);
+       return LASTERROR((*state), GN_ERR_UNKNOWNMODEL);
+}
+

Index: config/config.guess
===================================================================
RCS file: /sources/gnokii/gnokii/config/config.guess,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- config/config.guess 7 Jan 2006 18:41:59 -0000       1.8
+++ config/config.guess 11 Jun 2006 20:41:39 -0000      1.9
@@ -3,7 +3,7 @@
 #   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
 #   2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
 
-timestamp='2005-08-03'
+timestamp='2005-07-08'
 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
@@ -138,6 +138,16 @@
 UNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
 UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
 
+case "${UNAME_MACHINE}" in
+    i?86)
+       test -z "$VENDOR" && VENDOR=pc
+       ;;
+    *)
+       test -z "$VENDOR" && VENDOR=unknown
+       ;;
+esac
+test -f /etc/SuSE-release -o -f /.buildenv && VENDOR=suse
+
 # Note: order is significant - the case branches are not exclusive.
 
 case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
@@ -794,7 +804,7 @@
     i*:UWIN*:*)
        echo ${UNAME_MACHINE}-pc-uwin
        exit ;;
-    amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
+    amd64:CYGWIN*:*:*)
        echo x86_64-unknown-cygwin
        exit ;;
     p*:CYGWIN*:*)
@@ -815,25 +825,25 @@
        echo ${UNAME_MACHINE}-pc-minix
        exit ;;
     arm*:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       echo ${UNAME_MACHINE}-${VENDOR}-linux
        exit ;;
     cris:Linux:*:*)
-       echo cris-axis-linux-gnu
+       echo cris-axis-linux
        exit ;;
     crisv32:Linux:*:*)
-       echo crisv32-axis-linux-gnu
+       echo crisv32-axis-linux
        exit ;;
     frv:Linux:*:*)
-       echo frv-unknown-linux-gnu
+       echo frv-${VENDOR}-linux
        exit ;;
     ia64:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       echo ${UNAME_MACHINE}-${VENDOR}-linux
        exit ;;
     m32r*:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       echo ${UNAME_MACHINE}-${VENDOR}-linux
        exit ;;
     m68*:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       echo ${UNAME_MACHINE}-${VENDOR}-linux
        exit ;;
     mips:Linux:*:*)
        eval $set_cc_for_build
@@ -852,7 +862,7 @@
        #endif
 EOF
        eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
-       test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
+       test x"${CPU}" != x && { echo "${CPU}-${VENDOR}-linux"; exit; }
        ;;
     mips64:Linux:*:*)
        eval $set_cc_for_build
@@ -871,16 +881,13 @@
        #endif
 EOF
        eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
-       test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
+       test x"${CPU}" != x && { echo "${CPU}-${VENDOR}-linux"; exit; }
        ;;
-    or32:Linux:*:*)
-       echo or32-unknown-linux-gnu
-       exit ;;
     ppc:Linux:*:*)
-       echo powerpc-unknown-linux-gnu
+       echo powerpc-${VENDOR}-linux
        exit ;;
     ppc64:Linux:*:*)
-       echo powerpc64-unknown-linux-gnu
+       echo powerpc64-${VENDOR}-linux
        exit ;;
     alpha:Linux:*:*)
        case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
@@ -894,33 +901,33 @@
         esac
        objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
        if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
-       echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
+       echo ${UNAME_MACHINE}-${VENDOR}-linux${LIBC}
        exit ;;
     parisc:Linux:*:* | hppa:Linux:*:*)
        # Look for CPU level
        case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
-         PA7*) echo hppa1.1-unknown-linux-gnu ;;
-         PA8*) echo hppa2.0-unknown-linux-gnu ;;
-         *)    echo hppa-unknown-linux-gnu ;;
+         PA7*) echo hppa1.1-${VENDOR}-linux ;;
+         PA8*) echo hppa2.0-${VENDOR}-linux ;;
+         *)    echo hppa-${VENDOR}-linux ;;
        esac
        exit ;;
     parisc64:Linux:*:* | hppa64:Linux:*:*)
-       echo hppa64-unknown-linux-gnu
+       echo hppa64-${VENDOR}-linux
        exit ;;
     s390:Linux:*:* | s390x:Linux:*:*)
        echo ${UNAME_MACHINE}-ibm-linux
        exit ;;
     sh64*:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       echo ${UNAME_MACHINE}-${VENDOR}-linux
        exit ;;
     sh*:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       echo ${UNAME_MACHINE}-${VENDOR}-linux
        exit ;;
     sparc:Linux:*:* | sparc64:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       echo ${UNAME_MACHINE}-${VENDOR}-linux
        exit ;;
     x86_64:Linux:*:*)
-       echo x86_64-unknown-linux-gnu
+       echo x86_64-${VENDOR}-linux
        exit ;;
     i*86:Linux:*:*)
        # The BFD linker knows what the default object file format is, so
@@ -935,18 +942,18 @@
                                    p'`
         case "$ld_supported_targets" in
          elf32-i386)
-               TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
+               TENTATIVE="${UNAME_MACHINE}-${VENDOR}-linux"
                ;;
          a.out-i386-linux)
-               echo "${UNAME_MACHINE}-pc-linux-gnuaout"
+               echo "${UNAME_MACHINE}-${VENDOR}-linuxaout"
                exit ;;
          coff-i386)
-               echo "${UNAME_MACHINE}-pc-linux-gnucoff"
+               echo "${UNAME_MACHINE}-${VENDOR}-linuxcoff"
                exit ;;
          "")
-               # Either a pre-BFD a.out linker (linux-gnuoldld) or
+               # Either a pre-BFD a.out linker (linuxoldld) or
                # one that does not give us useful --help.
-               echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
+               echo "${UNAME_MACHINE}-${VENDOR}-linuxoldld"
                exit ;;
        esac
        # Determine whether the default compiler is a.out or elf
@@ -976,7 +983,7 @@
 EOF
        eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
        test x"${LIBC}" != x && {
-               echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
+               echo "${UNAME_MACHINE}-${VENDOR}-linux-${LIBC}" | sed 
's/linux-gnu/linux/'
                exit
        }
        test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }

Index: config/config.sub
===================================================================
RCS file: /sources/gnokii/gnokii/config/config.sub,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- config/config.sub   7 Jan 2006 18:41:59 -0000       1.7
+++ config/config.sub   11 Jun 2006 20:41:39 -0000      1.8
@@ -1181,7 +1181,7 @@
              | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
              | -chorusos* | -chorusrdb* \
              | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
-             | -mingw32* | -linux-gnu* | -linux-uclibc* | -uxpv* | -beos* | 
-mpeix* | -udk* \
+             | -mingw32* | -linux* | -linux-uclibc* | -uxpv* | -beos* | 
-mpeix* | -udk* \
              | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
              | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
              | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
@@ -1215,9 +1215,6 @@
        -linux-dietlibc)
                os=-linux-dietlibc
                ;;
-       -linux*)
-               os=`echo $os | sed -e 's|linux|linux-gnu|'`
-               ;;
        -sunos5*)
                os=`echo $os | sed -e 's|sunos5|solaris2|'`
                ;;

Index: include/gnokii-internal.h
===================================================================
RCS file: /sources/gnokii/gnokii/include/gnokii-internal.h,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -b -r1.31 -r1.32
--- include/gnokii-internal.h   23 Apr 2006 19:44:31 -0000      1.31
+++ include/gnokii-internal.h   11 Jun 2006 20:41:39 -0000      1.32
@@ -1,6 +1,6 @@
 /*
 
-  $Id: gnokii-internal.h,v 1.31 2006/04/23 19:44:31 deller Exp $
+  $Id: gnokii-internal.h,v 1.32 2006/06/11 20:41:39 deller Exp $
 
   G N O K I I
 
@@ -40,6 +40,9 @@
 #include "misc.h"
 #include "gnokii.h"
 
+/* utils */
+gn_connection_type gn_get_connectiontype(const char *connection_type_string);
+
 /* SMS */
 gn_error sms_parse(int offset, gn_data *data);
 gn_error sms_request(gn_data *data, struct gn_statemachine *state);

Index: include/gnokii.h
===================================================================
RCS file: /sources/gnokii/gnokii/include/gnokii.h,v
retrieving revision 1.98
retrieving revision 1.99
diff -u -b -r1.98 -r1.99
--- include/gnokii.h    11 Jun 2006 16:39:11 -0000      1.98
+++ include/gnokii.h    11 Jun 2006 20:41:39 -0000      1.99
@@ -1,6 +1,6 @@
 /*
 
-  $Id: gnokii.h,v 1.98 2006/06/11 16:39:11 deller Exp $
+  $Id: gnokii.h,v 1.99 2006/06/11 20:41:39 deller Exp $
 
   G N O K I I
 
@@ -183,6 +183,15 @@
    Just start with num=0 and increase until you get back NULL */
 GNOKII_API const char *gn_lib_get_supported_phone_model( const int num );
 
+/* use this function to get list of all supported connection type strings.
+   Just start with num=0 and increase until you get back NULL */
+GNOKII_API const char *gn_lib_get_supported_connection( const int num );
+
+/* use this function to search for a phone which is connected to this
+   computer. Currently libgnokii will search only on IRDA and bluetooth.
+   The state variable will be initialized if a phone was found. */
+GNOKII_API gn_error gn_lib_search_one_connected_phone( struct gn_statemachine 
**state );
+
 /* Misc */
 GNOKII_API gn_memory_type gn_str2memory_type(const char *s);
 GNOKII_API const char *gn_memory_type2str(gn_memory_type mt);

Index: include/gnokii/common.h
===================================================================
RCS file: /sources/gnokii/gnokii/include/gnokii/common.h,v
retrieving revision 1.146
retrieving revision 1.147
diff -u -b -r1.146 -r1.147
--- include/gnokii/common.h     7 May 2006 10:41:11 -0000       1.146
+++ include/gnokii/common.h     11 Jun 2006 20:41:39 -0000      1.147
@@ -1,6 +1,6 @@
 /*
 
-  $Id: common.h,v 1.146 2006/05/07 10:41:11 deller Exp $
+  $Id: common.h,v 1.147 2006/06/11 20:41:39 deller Exp $
 
   G N O K I I
 
@@ -41,6 +41,7 @@
 /* Type of connection. Now we support serial connection with FBUS cable and
    IR (only with 61x0 models) */
 typedef enum {
+        GN_CT_NONE = -1,/* no connection type (error) */
        GN_CT_Serial,   /* Serial connection. */
        GN_CT_DAU9P,    /* Serial connection using DAU9P cable; use only with 
6210/7110 if you want faster initialization */
        GN_CT_DLR3P,    /* Serial connection using DLR3P cable */




reply via email to

[Prev in Thread] Current Thread [Next in Thread]