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


From: Daniele Forsi
Subject: [SCM] libgnokii and core programs branch, master, updated. rel_0_6_29-23-gf0e6996
Date: Fri, 18 Jun 2010 22:03:41 +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  f0e699677c616bfff729d260a713e4384a17506a (commit)
       via  5d411b6bc77408a9c06b0dbf1e88b2a3106716f6 (commit)
       via  eabcd79fe588e376f1034ea2c95943d58afd3acb (commit)
      from  4982e224054594473b8335812a6397c3abf879b6 (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=f0e699677c616bfff729d260a713e4384a17506a


commit f0e699677c616bfff729d260a713e4384a17506a
Author: Daniele Forsi <address@hidden>
Date:   Fri Jun 18 23:53:30 2010 +0200

    Implement GN_OP_DeleteSMS in fake driver for internal and for file SMS

diff --git a/ChangeLog b/ChangeLog
index 77415e2..f81d859 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -14,6 +14,9 @@
  * win32 updates
     o enable compile under cywin/mingw             (Santeri Toikka)
     o enable MSVS 2010 compilation                 (Santeri Toikka)
+ * fake driver updates
+    o implement enough GN_OP_GetSMSStatus and GN_OP_DeleteSMS to
+      test smsd receiving with static and file SMS  (Daniele Forsi)
 
 0.6.29
 ======
diff --git a/common/phones/fake.c b/common/phones/fake.c
index 45d8e80..7252f24 100644
--- a/common/phones/fake.c
+++ b/common/phones/fake.c
@@ -185,6 +185,16 @@ static gn_error at_sms_get_status_static(gn_data *data, 
struct gn_statemachine *
        return count;
 }
 
+static gn_error at_sms_delete_static(gn_data *data, struct gn_statemachine 
*state, int position)
+{
+       if (position > sizeof(sms_inbox)/sizeof(char *) || !sms_inbox[position 
- 1])
+               return GN_ERR_EMPTYLOCATION;
+
+       sms_inbox[position - 1] = NULL;
+
+       return GN_ERR_NONE;
+}
+
 #ifndef WIN32
 #define MAX_PATH_LEN 256
 static gn_error at_sms_get_from_file(gn_data *data, struct gn_statemachine 
*state, int position, DIR *d, const char *dirpath)
@@ -227,6 +237,32 @@ out:
        closedir(d);
        return e;
 }
+
+static gn_error at_sms_delete_from_file(gn_data *data, struct gn_statemachine 
*state, int position, DIR *d, const char *dirpath)
+{
+       gn_error e = GN_ERR_NONE;
+       int i, n;
+       struct dirent *dent;
+       struct stat buf;
+       char path[MAX_PATH_LEN];
+
+       /* iterate to Nth position */
+       for (i = 0; i < position; i++) {
+               dent = readdir(d);
+               if (dent) {
+                       snprintf(path, MAX_PATH_LEN, "%s/%s", dirpath, 
dent->d_name);
+                       n = stat(path, &buf);
+                       if (!S_ISREG(buf.st_mode))
+                               i--;
+               } else
+                       goto out;
+       }
+       if (unlink(path))
+               e = GN_ERR_FAILED;
+out:
+       closedir(d);
+       return e;
+}
 #endif
 
 #ifdef WIN32
@@ -239,6 +275,15 @@ static gn_error at_sms_get(gn_data *data, struct 
gn_statemachine *state)
        return at_sms_get_static(data, state, position);
 }
 
+static gn_error at_sms_delete(gn_data *data, struct gn_statemachine *state)
+{
+       int position;
+       if (!data || !data->raw_sms)
+               return GN_ERR_INTERNALERROR;
+       position = data->raw_sms->number;
+       return at_sms_delete_static(data, state, position);
+}
+
 static gn_error at_sms_get_sms_status(gn_data *data, struct gn_statemachine 
*state)
 {
        if (!data || !data->sms_status)
@@ -317,6 +362,33 @@ static gn_error at_sms_get_sms_status(gn_data *data, 
struct gn_statemachine *sta
        
        return GN_ERR_NONE;
 }
+
+static gn_error at_sms_delete(gn_data *data, struct gn_statemachine *state)
+{
+       gn_error e = GN_ERR_NONE;
+       const char *path;
+       DIR *d;
+       int position;
+
+       if (!data || !data->raw_sms) {
+               e = GN_ERR_INTERNALERROR;
+               goto out;
+       }
+       position = data->raw_sms->number;
+       if (position < 1) {
+               e = GN_ERR_INVALIDLOCATION;
+               goto out;
+       }
+
+       path = gn_lib_cfg_get("fake_driver", "sms_inbox");
+       if (!path || (d = opendir(path)) == NULL)
+               e = at_sms_delete_static(data, state, position);
+       else
+               e = at_sms_delete_from_file(data, state, position, d, path);
+
+out:
+       return e;
+}
 #endif
 
 static gn_error at_get_model(gn_data *data, struct gn_statemachine *state)
@@ -344,6 +416,8 @@ static gn_error fake_functions(gn_operation op, gn_data 
*data, struct gn_statema
                return at_sms_write(data, state, "CMGS");
        case GN_OP_GetSMS:
                return at_sms_get(data, state);
+       case GN_OP_DeleteSMS:
+               return at_sms_delete(data, state);
        case GN_OP_GetSMSCenter:
                return GN_ERR_NONE;
        case GN_OP_GetModel:

http://git.savannah.gnu.org/cgit/gnokii.git/commit/?id=5d411b6bc77408a9c06b0dbf1e88b2a3106716f6


commit f0e699677c616bfff729d260a713e4384a17506a
Author: Daniele Forsi <address@hidden>
Date:   Fri Jun 18 23:53:30 2010 +0200

    Implement GN_OP_DeleteSMS in fake driver for internal and for file SMS

diff --git a/ChangeLog b/ChangeLog
index 77415e2..f81d859 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -14,6 +14,9 @@
  * win32 updates
     o enable compile under cywin/mingw             (Santeri Toikka)
     o enable MSVS 2010 compilation                 (Santeri Toikka)
+ * fake driver updates
+    o implement enough GN_OP_GetSMSStatus and GN_OP_DeleteSMS to
+      test smsd receiving with static and file SMS  (Daniele Forsi)
 
 0.6.29
 ======
diff --git a/common/phones/fake.c b/common/phones/fake.c
index 45d8e80..7252f24 100644
--- a/common/phones/fake.c
+++ b/common/phones/fake.c
@@ -185,6 +185,16 @@ static gn_error at_sms_get_status_static(gn_data *data, 
struct gn_statemachine *
        return count;
 }
 
+static gn_error at_sms_delete_static(gn_data *data, struct gn_statemachine 
*state, int position)
+{
+       if (position > sizeof(sms_inbox)/sizeof(char *) || !sms_inbox[position 
- 1])
+               return GN_ERR_EMPTYLOCATION;
+
+       sms_inbox[position - 1] = NULL;
+
+       return GN_ERR_NONE;
+}
+
 #ifndef WIN32
 #define MAX_PATH_LEN 256
 static gn_error at_sms_get_from_file(gn_data *data, struct gn_statemachine 
*state, int position, DIR *d, const char *dirpath)
@@ -227,6 +237,32 @@ out:
        closedir(d);
        return e;
 }
+
+static gn_error at_sms_delete_from_file(gn_data *data, struct gn_statemachine 
*state, int position, DIR *d, const char *dirpath)
+{
+       gn_error e = GN_ERR_NONE;
+       int i, n;
+       struct dirent *dent;
+       struct stat buf;
+       char path[MAX_PATH_LEN];
+
+       /* iterate to Nth position */
+       for (i = 0; i < position; i++) {
+               dent = readdir(d);
+               if (dent) {
+                       snprintf(path, MAX_PATH_LEN, "%s/%s", dirpath, 
dent->d_name);
+                       n = stat(path, &buf);
+                       if (!S_ISREG(buf.st_mode))
+                               i--;
+               } else
+                       goto out;
+       }
+       if (unlink(path))
+               e = GN_ERR_FAILED;
+out:
+       closedir(d);
+       return e;
+}
 #endif
 
 #ifdef WIN32
@@ -239,6 +275,15 @@ static gn_error at_sms_get(gn_data *data, struct 
gn_statemachine *state)
        return at_sms_get_static(data, state, position);
 }
 
+static gn_error at_sms_delete(gn_data *data, struct gn_statemachine *state)
+{
+       int position;
+       if (!data || !data->raw_sms)
+               return GN_ERR_INTERNALERROR;
+       position = data->raw_sms->number;
+       return at_sms_delete_static(data, state, position);
+}
+
 static gn_error at_sms_get_sms_status(gn_data *data, struct gn_statemachine 
*state)
 {
        if (!data || !data->sms_status)
@@ -317,6 +362,33 @@ static gn_error at_sms_get_sms_status(gn_data *data, 
struct gn_statemachine *sta
        
        return GN_ERR_NONE;
 }
+
+static gn_error at_sms_delete(gn_data *data, struct gn_statemachine *state)
+{
+       gn_error e = GN_ERR_NONE;
+       const char *path;
+       DIR *d;
+       int position;
+
+       if (!data || !data->raw_sms) {
+               e = GN_ERR_INTERNALERROR;
+               goto out;
+       }
+       position = data->raw_sms->number;
+       if (position < 1) {
+               e = GN_ERR_INVALIDLOCATION;
+               goto out;
+       }
+
+       path = gn_lib_cfg_get("fake_driver", "sms_inbox");
+       if (!path || (d = opendir(path)) == NULL)
+               e = at_sms_delete_static(data, state, position);
+       else
+               e = at_sms_delete_from_file(data, state, position, d, path);
+
+out:
+       return e;
+}
 #endif
 
 static gn_error at_get_model(gn_data *data, struct gn_statemachine *state)
@@ -344,6 +416,8 @@ static gn_error fake_functions(gn_operation op, gn_data 
*data, struct gn_statema
                return at_sms_write(data, state, "CMGS");
        case GN_OP_GetSMS:
                return at_sms_get(data, state);
+       case GN_OP_DeleteSMS:
+               return at_sms_delete(data, state);
        case GN_OP_GetSMSCenter:
                return GN_ERR_NONE;
        case GN_OP_GetModel:

http://git.savannah.gnu.org/cgit/gnokii.git/commit/?id=eabcd79fe588e376f1034ea2c95943d58afd3acb


commit f0e699677c616bfff729d260a713e4384a17506a
Author: Daniele Forsi <address@hidden>
Date:   Fri Jun 18 23:53:30 2010 +0200

    Implement GN_OP_DeleteSMS in fake driver for internal and for file SMS

diff --git a/ChangeLog b/ChangeLog
index 77415e2..f81d859 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -14,6 +14,9 @@
  * win32 updates
     o enable compile under cywin/mingw             (Santeri Toikka)
     o enable MSVS 2010 compilation                 (Santeri Toikka)
+ * fake driver updates
+    o implement enough GN_OP_GetSMSStatus and GN_OP_DeleteSMS to
+      test smsd receiving with static and file SMS  (Daniele Forsi)
 
 0.6.29
 ======
diff --git a/common/phones/fake.c b/common/phones/fake.c
index 45d8e80..7252f24 100644
--- a/common/phones/fake.c
+++ b/common/phones/fake.c
@@ -185,6 +185,16 @@ static gn_error at_sms_get_status_static(gn_data *data, 
struct gn_statemachine *
        return count;
 }
 
+static gn_error at_sms_delete_static(gn_data *data, struct gn_statemachine 
*state, int position)
+{
+       if (position > sizeof(sms_inbox)/sizeof(char *) || !sms_inbox[position 
- 1])
+               return GN_ERR_EMPTYLOCATION;
+
+       sms_inbox[position - 1] = NULL;
+
+       return GN_ERR_NONE;
+}
+
 #ifndef WIN32
 #define MAX_PATH_LEN 256
 static gn_error at_sms_get_from_file(gn_data *data, struct gn_statemachine 
*state, int position, DIR *d, const char *dirpath)
@@ -227,6 +237,32 @@ out:
        closedir(d);
        return e;
 }
+
+static gn_error at_sms_delete_from_file(gn_data *data, struct gn_statemachine 
*state, int position, DIR *d, const char *dirpath)
+{
+       gn_error e = GN_ERR_NONE;
+       int i, n;
+       struct dirent *dent;
+       struct stat buf;
+       char path[MAX_PATH_LEN];
+
+       /* iterate to Nth position */
+       for (i = 0; i < position; i++) {
+               dent = readdir(d);
+               if (dent) {
+                       snprintf(path, MAX_PATH_LEN, "%s/%s", dirpath, 
dent->d_name);
+                       n = stat(path, &buf);
+                       if (!S_ISREG(buf.st_mode))
+                               i--;
+               } else
+                       goto out;
+       }
+       if (unlink(path))
+               e = GN_ERR_FAILED;
+out:
+       closedir(d);
+       return e;
+}
 #endif
 
 #ifdef WIN32
@@ -239,6 +275,15 @@ static gn_error at_sms_get(gn_data *data, struct 
gn_statemachine *state)
        return at_sms_get_static(data, state, position);
 }
 
+static gn_error at_sms_delete(gn_data *data, struct gn_statemachine *state)
+{
+       int position;
+       if (!data || !data->raw_sms)
+               return GN_ERR_INTERNALERROR;
+       position = data->raw_sms->number;
+       return at_sms_delete_static(data, state, position);
+}
+
 static gn_error at_sms_get_sms_status(gn_data *data, struct gn_statemachine 
*state)
 {
        if (!data || !data->sms_status)
@@ -317,6 +362,33 @@ static gn_error at_sms_get_sms_status(gn_data *data, 
struct gn_statemachine *sta
        
        return GN_ERR_NONE;
 }
+
+static gn_error at_sms_delete(gn_data *data, struct gn_statemachine *state)
+{
+       gn_error e = GN_ERR_NONE;
+       const char *path;
+       DIR *d;
+       int position;
+
+       if (!data || !data->raw_sms) {
+               e = GN_ERR_INTERNALERROR;
+               goto out;
+       }
+       position = data->raw_sms->number;
+       if (position < 1) {
+               e = GN_ERR_INVALIDLOCATION;
+               goto out;
+       }
+
+       path = gn_lib_cfg_get("fake_driver", "sms_inbox");
+       if (!path || (d = opendir(path)) == NULL)
+               e = at_sms_delete_static(data, state, position);
+       else
+               e = at_sms_delete_from_file(data, state, position, d, path);
+
+out:
+       return e;
+}
 #endif
 
 static gn_error at_get_model(gn_data *data, struct gn_statemachine *state)
@@ -344,6 +416,8 @@ static gn_error fake_functions(gn_operation op, gn_data 
*data, struct gn_statema
                return at_sms_write(data, state, "CMGS");
        case GN_OP_GetSMS:
                return at_sms_get(data, state);
+       case GN_OP_DeleteSMS:
+               return at_sms_delete(data, state);
        case GN_OP_GetSMSCenter:
                return GN_ERR_NONE;
        case GN_OP_GetModel:

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

Summary of changes:
 ChangeLog            |    3 +
 common/phones/fake.c |  126 +++++++++++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 128 insertions(+), 1 deletions(-)


hooks/post-receive
-- 
libgnokii and core programs



reply via email to

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