gnokii-commit
[Top][All Lists]
Advanced

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

[SCM] libgnokii and core programs branch, master, updated. rel_0_6_29-92


From: Pawel Kot
Subject: [SCM] libgnokii and core programs branch, master, updated. rel_0_6_29-92-g0290250
Date: Mon, 17 Jan 2011 22:44:35 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "libgnokii and core programs".

The branch, master has been updated
       via  02902502ab5925a890c6813b25737b1fd3e4a05d (commit)
      from  3ebc3096c0a035d1d0fc2f605a45811516e48f50 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit/gnokii.git/commit/?id=02902502ab5925a890c6813b25737b1fd3e4a05d


commit 02902502ab5925a890c6813b25737b1fd3e4a05d
Author: Pawel Kot <address@hidden>
Date:   Mon Jan 17 23:44:25 2011 +0100

    Add gn_lib_phoneprofile_load_from_external() for 3rd party apps to 
initialize gnokii not using gnokii config file (opensync being a requestor).

diff --git a/ChangeLog b/ChangeLog
index dc0b6fa..98a4a06 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -22,6 +22,9 @@
     o use libiconv on WIN32                             (Paweł Kot)
        o avoid segfault with gn_cfg_phone_load() when state is not
          initialized                                       (Paweł Kot)
+       o add gn_lib_phoneprofile_load_from_external() for 3rd party
+         apps to initialize gnokii not using gnokii config file
+                                                           (Paweł Kot)
  * nk6510 driver updates
     o fix parsing SMS date from saved messages, bug #29830
                                                         (Paweł Kot)
diff --git a/common/libfunctions.c b/common/libfunctions.c
index fd18099..fa0f2ac 100644
--- a/common/libfunctions.c
+++ b/common/libfunctions.c
@@ -1,5 +1,4 @@
 /*
-  $Id$
 
   G N O K I I
 
@@ -23,7 +22,7 @@
 
   Copyright (C) 1999-2000 Hugh Blemings & Pavel Janík ml.
   Copyright (C) 2001      Chris Kemp
-  Copyrught (C) 2001-2004 Pawel Kot
+  Copyrught (C) 2001-2011 Pawel Kot
   Copyright (C) 2002-2003 BORBELY Zoltan
   Copyright (C) 2002      Pavel Machek, Marcin Wiacek
   Copyright (C) 2006      Helge Deller
@@ -85,18 +84,24 @@ GNOKII_API unsigned int gn_lib_version()
        return LIBGNOKII_VERSION;
 }
 
-GNOKII_API gn_error gn_lib_phoneprofile_load_from_file(const char *configfile, 
const char *configname, struct gn_statemachine **state)
+static gn_error load_from_file(const char *configfile, const char *configname)
+{
+       if (configfile && *configfile)
+               return gn_cfg_file_read(configfile);
+       else
+               return gn_cfg_read_default();
+}
+
+static gn_error load_from_memory(char **lines)
+{
+       return gn_cfg_memory_read(lines);
+}
+
+static gn_error phoneprofile_load(const char *configname, gn_error error, 
struct gn_statemachine **state)
 {
-       gn_error error = GN_ERR_NONE;
        *state = NULL;
 
-       if (!gn_cfg_info) {
-               if (configfile && *configfile)
-                       error = gn_cfg_file_read(configfile);
-               else
-                       error = gn_cfg_read_default();
-       }
-       if (GN_ERR_NONE == error) {
+       if (error = GN_ERR_NONE) {
                /* allocate and initialize data structures */
                *state = malloc(sizeof(**state));
                if (*state) {
@@ -116,12 +121,31 @@ GNOKII_API gn_error 
gn_lib_phoneprofile_load_from_file(const char *configfile, c
        return LASTERROR((*state), GN_ERR_NONE);
 }
 
+GNOKII_API gn_error gn_lib_phoneprofile_load_from_file(const char *configfile, 
const char *configname, struct gn_statemachine **state)
+{
+       gn_error error = GN_ERR_NONE;
+
+       if (!gn_cfg_info)
+               error = load_from_file(configfile, configname);
+
+       return phoneprofile_load(configname, error, state);
+}
+
+GNOKII_API gn_error gn_lib_phoneprofile_load_from_external(char **lines, 
struct gn_statemachine **state)
+{
+       gn_error error = GN_ERR_NONE;
+
+       if (!gn_cfg_info)
+               error = load_from_memory(lines);
+
+       return phoneprofile_load(NULL, error, state);
+}
+
 GNOKII_API gn_error gn_lib_phoneprofile_load(const char *configname, struct 
gn_statemachine **state)
 {
        return gn_lib_phoneprofile_load_from_file(NULL, configname, state);
 }
 
-
 GNOKII_API gn_error gn_lib_phoneprofile_free( struct gn_statemachine **state )
 {
        /* free data structure */
diff --git a/configure.in b/configure.in
index f6a57e2..af977f4 100644
--- a/configure.in
+++ b/configure.in
@@ -24,9 +24,9 @@ AC_INIT([gnokii],
 # - If binary compatibility has been broken (eg removed or changed interfaces)
 #   change to C-A+1:0:0
 # - If the interface is the same as the previous version, change to C:R+1:A
-GNOKII_LT_VERSION_CURRENT=6
+GNOKII_LT_VERSION_CURRENT=7
 GNOKII_LT_VERSION_REVISION=0
-GNOKII_LT_VERSION_AGE=0
+GNOKII_LT_VERSION_AGE=1
 AC_SUBST(GNOKII_LT_VERSION_CURRENT)
 AC_SUBST(GNOKII_LT_VERSION_REVISION)
 AC_SUBST(GNOKII_LT_VERSION_AGE)
diff --git a/include/gnokii.h.in b/include/gnokii.h.in
index 7d1c322..7e56f0d 100644
--- a/include/gnokii.h.in
+++ b/include/gnokii.h.in
@@ -1,7 +1,5 @@
 /*
 
-  $Id$
-
   G N O K I I
 
   A Linux/Unix toolset and driver for Nokia mobile phones.
@@ -23,7 +21,7 @@
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
   Copyright (C) 1999-2000 Hugh Blemings & Pavel Janik ml.
-  Copyright (C) 2001-2005 Pawel Kot
+  Copyright (C) 2001-2011 Pawel Kot
   Copyright (C) 2001      Chris Kemp
   copyright (C) 2002      Markus Plail
   Copyright (C) 2002-2003 BORBELY Zoltan, Ladis Michl
@@ -110,6 +108,9 @@ GNOKII_API gn_error gn_lib_lasterror(struct gn_statemachine 
*state);
    gn_lib_phoneprofile_load assumes default config file. */
 GNOKII_API gn_error gn_lib_phoneprofile_load_from_file(const char *configfile, 
const char *configname, struct gn_statemachine **state);
 GNOKII_API gn_error gn_lib_phoneprofile_load(const char *configname, struct 
gn_statemachine **state);
+/* initialize gnokii library and structures for given phone
+   lines is line by line representation as it was read from the config file. */
+GNOKII_API gn_error gn_lib_phoneprofile_load_from_external(char **lines, 
struct gn_statemachine **state);
 
 /* Free any structures and resources which were loaded in this state machine. 
*/
 GNOKII_API gn_error gn_lib_phoneprofile_free(struct gn_statemachine **state);

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog             |    3 +++
 common/libfunctions.c |   48 ++++++++++++++++++++++++++++++++++++------------
 configure.in          |    4 ++--
 include/gnokii.h.in   |    7 ++++---
 4 files changed, 45 insertions(+), 17 deletions(-)


hooks/post-receive
-- 
libgnokii and core programs



reply via email to

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