gnokii-users
[Top][All Lists]
Advanced

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

Re: How to write a phone number ?


From: Reiner Steib
Subject: Re: How to write a phone number ?
Date: Tue, 17 Feb 2004 18:46:49 +0100
User-agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3.50 (gnu/linux)

On Tue, Feb 17 2004, Pawel Kot wrote:

> On Mon, 16 Feb 2004, Reiner Steib wrote:
>
>> The memory_type entries are different:
>>
>> - gnokii: "SM"
>>
>> - xgnokii: "A"
>
> Changed. xgnokii uses now SM and ME instead A and B.

It doesn't work for me.  AFAICS, your change (in CListCompareFunc)
isn't sufficient.

I could fix the xgnokii _export_ with the following patch:

--8<---------------cut here---------------start------------->8---
--- xgnokii_contacts.c.~1.53.~  Tue Feb 17 17:39:25 2004
+++ xgnokii_contacts.c  Tue Feb 17 18:17:18 2004
@@ -2664,9 +2664,9 @@
                        }
 
                        if (pbEntry->entry.memory_type == GN_MT_ME)
-                               sprintf(buf2, "B;%d;%d;", i + 1, 
pbEntry->entry.caller_group);
+                               sprintf(buf2, "ME;%d;%d;", i + 1, 
pbEntry->entry.caller_group);
                        else
-                               sprintf(buf2, "A;%d;%d;", i - 
memoryStatus.MaxME + 1,
+                               sprintf(buf2, "SM;%d;%d;", i - 
memoryStatus.MaxME + 1,
                                        pbEntry->entry.caller_group);
                        strcat(buf, buf2);
 
--8<---------------cut here---------------end--------------->8---

But _importing_ a gnokii generated file[1] in xgnokii still fails.
Probably the function ParseLine() in xgnokii_contacts.c, line 2841,
has to be changed too:

,----
| /* FIXME: This is very similar to gnokii.c: decodephonebook */
| static bool ParseLine(gn_phonebook_entry * entry, gint * num, gchar * buf)
| [...]
|       if (!strncmp(buf, "B;", 2)) {
|               entry->memory_type = GN_MT_ME;
|               buf += 2;
|       } else if (!strncmp(buf, "A;", 2)) {
|               entry->memory_type = GN_MT_SM;
|               buf += 2;
|       } else if (!strncmp(buf, "ME;", 3)) {
|               entry->memory_type = GN_MT_ME;
|               buf += 3;
|       } else if (!strncmp(buf, "SM;", 3)) {
|               entry->memory_type = GN_MT_SM;
|               buf += 3;
|       } else
|               return FALSE;
`----

But I'm not sure about this.  Probably it would be better to use
decodephonebook() from gnokii.c instead, also for xgnokii.

Bye, Reiner.

[1] gnokii --getphonebook SM 1 3 --raw
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo--- PGP key available via WWW   http://rsteib.home.pages.de/





reply via email to

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