gnokii-users
[Top][All Lists]
Advanced

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

Re: SMS syntax question


From: Daniele Forsi
Subject: Re: SMS syntax question
Date: Sun, 28 Nov 2004 22:34:47 +0100
User-agent: KMail/1.4.3

Alle 21:11, venerdì 19 novembre 2004, David Andel ha scritto:

> And why does "gnokii --getsms IN 0 end -F inbox-18.11.04" not work at all?

I noticed that a while ago, then I learnt that my phone stores up to 20 SMS's 
so I tried no more :-) but tonight I wrote this patch to handle the "end" 
keyword. Note that this is an hack: to do it the "right way" one should know 
how many SMS's each phone can store in each memory type which IMHO is an 
overkill

Daniele, gnokii user

Index: gnokii/gnokii.c
===================================================================
RCS file: /cvsroot/gnokii/gnokii/gnokii/gnokii.c,v
retrieving revision 1.411
diff -u -r1.411 gnokii.c
--- gnokii/gnokii.c     31 Oct 2004 15:05:52 -0000      1.411
+++ gnokii/gnokii.c     28 Nov 2004 21:17:36 -0000
@@ -1272,7 +1272,11 @@
 
                /* [end] can be only argv[4] */
                if (argv[4][0] != '-') {
-                       end_message = atoi(argv[4]);
+                       if (!strcmp(argv[4], "end" )) {
+                               end_message = INT_MAX;
+                       } else {
+                               end_message = atoi(argv[4]);
+                       }
                }
 
                /* parse all options (beginning with '-' */
@@ -1485,6 +1489,9 @@
                        }
                        break;
                default:
+                       if ((error == GN_ERR_INVALIDLOCATION) && (end_message 
== INT_MAX) && 
(count > start_message)) {
+                               return GN_ERR_NONE;
+                       }
                        fprintf(stderr, _("GetSMS %s %d failed! (%s)\n"), 
memory_type_string, 
count, gn_error_print(error));
                        if (error == GN_ERR_INVALIDMEMORYTYPE)
                                fprintf(stderr, _("See the gnokii manual page 
for the supported memory 
types with the phone\nyou use.\n"));





reply via email to

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