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-40


From: Jan Derfinak
Subject: [SCM] libgnokii and core programs branch, master, updated. rel_0_6_29-407-g7896fed
Date: Mon, 11 Jun 2012 07:27:26 +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  7896feda4d2bd4d4b623d963419401184e06437c (commit)
      from  eacf911533f2acf599b7ed0804ec4d2d8ed057ee (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=7896feda4d2bd4d4b623d963419401184e06437c


commit 7896feda4d2bd4d4b623d963419401184e06437c
Author: Jan Derfinak <address@hidden>
Date:   Mon Jun 11 09:25:07 2012 +0200

    Added possibility to specify non default gnokii config file (alonso acuña).

diff --git a/configure.in b/configure.in
index 958b5aa..e476324 100644
--- a/configure.in
+++ b/configure.in
@@ -35,7 +35,7 @@ dnl xgnokii version
 XVERSION=1.0
 
 dnl smsd version
-SVERSION=1.5.2
+SVERSION=1.5.3
 
 AC_CANONICAL_SYSTEM
 AC_GNU_SOURCE
diff --git a/smsd/ChangeLog b/smsd/ChangeLog
index ef7b524..4b24388 100644
--- a/smsd/ChangeLog
+++ b/smsd/ChangeLog
@@ -1,3 +1,8 @@
+* Mon 11 Jun 2012 Jan Derfinak
+- Version 1.5.3
+- Added possibility to specify non default gnokii config file (alonso acuña).
+
+
 * Thu 01 Dec 2011 Paweł Kot
 - Version changed to 1.5.2
 
diff --git a/smsd/lowlevel.c b/smsd/lowlevel.c
index 793c9ac..d50f131 100644
--- a/smsd/lowlevel.c
+++ b/smsd/lowlevel.c
@@ -91,19 +91,24 @@ static gn_error fbusinit (const char * const iname)
 {
   gn_error error;
 
-  error = gn_lib_phoneprofile_load(iname, &sm);
+  error = gn_lib_phoneprofile_load_from_file (smsdConfig.configFile, iname, 
&sm);
   if (error != GN_ERR_NONE)
   {
-    g_print (_("Cannot load phone %s!\nDo you have proper section in the 
config file?\n"), iname);
+    if (smsdConfig.configFile)
+      g_print (_("Cannot load phone %s from config file %s!\nDo you have 
proper section in the config file?\n"),
+               iname, smsdConfig.configFile);
+    else
+      g_print (_("Cannot load phone %s from default config file!\nDo you have 
proper section in the config file?\n"),
+               iname);
     g_print (_("Error: %s\n"), gn_error_print (error));
     exit (-1);
   }
 
   /* register cleanup function */
-  atexit(busterminate);
+  atexit (busterminate);
 
   /* Initialise the code for the GSM interface. */     
-  error = gn_lib_phone_open(sm);
+  error = gn_lib_phone_open (sm);
   gn_log_xdebug ("fbusinit: error %d\n", error);
   if (error != GN_ERR_NONE)
   {
diff --git a/smsd/smsd.c b/smsd/smsd.c
index daf5172..25f9e28 100644
--- a/smsd/smsd.c
+++ b/smsd/smsd.c
@@ -141,6 +141,7 @@ static void Usage (gchar *p)
              "            -e, --encoding client_encoding\n"
              "            -m, --module db_module (pq, mysql, sqlite, file)\n"
              "            -l, --libdir path_to_db_module\n"
+             "            -C, --config path_to_config_file\n"
              "            -f, --logfile file\n"
              "            -t, --phone phone_number\n"
              "            -i, --interval 
polling_interval_for_incoming_sms's_in_seconds\n"
@@ -195,6 +196,7 @@ static void ReadConfig (gint argc, gchar *argv[])
   connection.clientEncoding = g_strdup ("");
   smsdConfig.dbMod = g_strdup ("file");
   smsdConfig.libDir = g_strdup (MODULES_DIR);
+  smsdConfig.configFile = NULL;
   smsdConfig.logFile = NULL;
   smsdConfig.phone = g_strdup ("");
   smsdConfig.refreshInt = 1;     // Phone querying interval in seconds
@@ -217,6 +219,7 @@ static void ReadConfig (gint argc, gchar *argv[])
       {"encoding", 1, 0, 'e'},
       {"module", 1, 0, 'm'},
       {"libdir", 1, 0, 'l'},
+      {"config", 1, 0, 'C'},
       {"logfile", 1, 0, 'f'},
       {"phone", 1, 0, 't'},
       {"version", 0, 0, 'v'},
@@ -228,7 +231,7 @@ static void ReadConfig (gint argc, gchar *argv[])
       {0, 0, 0, 0}
     };
     
-    c = getopt_long (argc, argv, "u:p:d:c:s:e:m:l:f:t:vi:S:b:0h", longOptions, 
&optionIndex);
+    c = getopt_long (argc, argv, "u:p:d:c:s:e:m:l:C:f:t:vi:S:b:0h", 
longOptions, &optionIndex);
     if (c == EOF)
       break;
     switch (c)
@@ -279,6 +282,12 @@ static void ReadConfig (gint argc, gchar *argv[])
         smsdConfig.libDir = g_strdup (optarg);
         break;
 
+      case 'C':
+        if (smsdConfig.configFile)
+          g_free (smsdConfig.configFile);
+        smsdConfig.configFile = g_strdup (optarg);
+        break;
+
       case 'f':
         if (smsdConfig.logFile)
           g_free (smsdConfig.logFile);
diff --git a/smsd/smsd.h b/smsd/smsd.h
index 7e6327d..a5d4ddf 100644
--- a/smsd/smsd.h
+++ b/smsd/smsd.h
@@ -36,6 +36,7 @@ typedef struct {
   gchar *bindir;
   gchar *dbMod;
   gchar *libDir;
+  gchar *configFile;
   gchar *logFile;
   gchar *phone;
   gint   refreshInt;

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

Summary of changes:
 configure.in    |    2 +-
 smsd/ChangeLog  |    5 +++++
 smsd/lowlevel.c |   13 +++++++++----
 smsd/smsd.c     |   11 ++++++++++-
 smsd/smsd.h     |    1 +
 5 files changed, 26 insertions(+), 6 deletions(-)


hooks/post-receive
-- 
libgnokii and core programs



reply via email to

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