gnokii-commit
[Top][All Lists]
Advanced

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

[SCM] Additional programs and language bindings branch, master, updated.


From: Daniele Forsi
Subject: [SCM] Additional programs and language bindings branch, master, updated. 403dd44aa0e1b19bbae722521ce30a6acd602c66
Date: Mon, 02 Nov 2009 15:14:21 +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 "Additional programs and language bindings".

The branch, master has been updated
       via  403dd44aa0e1b19bbae722521ce30a6acd602c66 (commit)
       via  1c14bcf0d8e755c7cbc267b5fd4e43ed920dd2cd (commit)
       via  dab437323b8bfa1f68fed7afb749889bd0cf74af (commit)
       via  851afb7ac2db92ab193fc4c8eb4d147a3f0acf92 (commit)
       via  4012c3cd586077230b59fee91c57e1c7a7f69618 (commit)
       via  66aeef7389885d3e3e2b40c6ccb269d690d7e030 (commit)
      from  5adcc1eec2b9b456809de4c83c98d37ebf2191e0 (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/gnokii-extras.gitcommit/?id=403dd44aa0e1b19bbae722521ce30a6acd602c66

commit 403dd44aa0e1b19bbae722521ce30a6acd602c66
Author: Daniele Forsi <address@hidden>
Date:   Mon Nov 2 16:12:18 2009 +0100

    Fix compiler warnings
    
    vcal2gnokii.c:74: warning: unused parameter ‘signal’
    error_codes.c:32: warning: unused parameter ‘argc’
    error_codes.c:32: warning: unused parameter ‘argv’
    error_codes_intl.c:35: warning: unused parameter ‘argc’
    error_codes_intl.c:35: warning: unused parameter ‘argv’
    events.c:74: warning: unused parameter ‘signal’
    events.c: In function ‘my_perror’:
    events.c:94: warning: format not a string literal and no format arguments
    memory_names.c:36: warning: unused parameter ‘argc’
    memory_names.c:36: warning: unused parameter ‘argv’
    rf_level.c:74: warning: unused parameter ‘signal’
    waitcall.c:88: warning: unused parameter ‘signal’
    waitcall.c:127: warning: unused parameter ‘state’
    waitcall.c:127: warning: unused parameter ‘callback_data’
    net_list_html.c:33: warning: unused parameter ‘argc’
    net_list_html.c:33: warning: unused parameter ‘argv’
    press_key.c:72: warning: unused parameter ‘signal’
    phonebook_status.c:70: warning: unused parameter ‘signal’
    sms_status.c:70: warning: unused parameter ‘signal’
    sms_status.c: In function ‘main’:
    sms_status.c:77: warning: missing initializer
    sms_status.c:77: warning: (near initialization for 
‘smsstatus.new_message_store’)

diff --git a/snippets/calendar/vcal2gnokii.c b/snippets/calendar/vcal2gnokii.c
index 557a6af..99ee69e 100644
--- a/snippets/calendar/vcal2gnokii.c
+++ b/snippets/calendar/vcal2gnokii.c
@@ -72,6 +72,7 @@ void businit(void) {
 }
 
 void signal_handler(int signal) {
+       (void)signal;
        exit(-2);
 }
 
diff --git a/snippets/misc/error_codes.c b/snippets/misc/error_codes.c
index fbdd47c..00a230d 100644
--- a/snippets/misc/error_codes.c
+++ b/snippets/misc/error_codes.c
@@ -29,7 +29,7 @@
 
 #include <gnokii.h>
 
-int main(int argc, char *argv[]) {
+int main(void) {
 
 #define macro_text(x) printf("%d %s %s\n", x, #x, gn_error_print(x))
 #define macro_html(x) printf("<tr><td>%d<td>%s<td>%s\n", x, #x, 
gn_error_print(x))
diff --git a/snippets/misc/error_codes_intl.c b/snippets/misc/error_codes_intl.c
index 555b9db..9795a03 100644
--- a/snippets/misc/error_codes_intl.c
+++ b/snippets/misc/error_codes_intl.c
@@ -32,7 +32,7 @@
 
 #include <gnokii.h>
 
-int main(int argc, char *argv[]) {
+int main(void) {
 
        setlocale(LC_ALL, "");
        textdomain("gnokii");
diff --git a/snippets/misc/events.c b/snippets/misc/events.c
index 51f76c4..6dd43ce 100644
--- a/snippets/misc/events.c
+++ b/snippets/misc/events.c
@@ -72,6 +72,7 @@ void businit(void) {
 }
 
 void signal_handler(int signal) {
+       (void)signal;
        exit(-2);
 }
 
@@ -91,7 +92,7 @@ void my_perror(const char *s, gn_error error) {
                if (s && *s) {
                        fprintf(stderr, "%s: ", s);
                }
-               fprintf(stderr, gn_error_print(error));
+               fprintf(stderr, "%s\n", gn_error_print(error));
        }
 }
 
diff --git a/snippets/misc/memory_names.c b/snippets/misc/memory_names.c
index 6a98a46..b087388 100644
--- a/snippets/misc/memory_names.c
+++ b/snippets/misc/memory_names.c
@@ -33,7 +33,7 @@
 
 #define _(x) gettext(x)
 
-int main(int argc, char *argv[]) {
+int main(void) {
 
        setlocale(LC_ALL, "");
        textdomain("gnokii");
diff --git a/snippets/monitor/rf_level.c b/snippets/monitor/rf_level.c
index 901551f..0f59137 100644
--- a/snippets/monitor/rf_level.c
+++ b/snippets/monitor/rf_level.c
@@ -72,6 +72,7 @@ void businit(void) {
 }
 
 void signal_handler(int signal) {
+       (void)signal;
        exit(-2);
 }
 
diff --git a/snippets/monitor/waitcall.c b/snippets/monitor/waitcall.c
index d7f8fac..abd2577 100644
--- a/snippets/monitor/waitcall.c
+++ b/snippets/monitor/waitcall.c
@@ -86,6 +86,7 @@ void businit(void) {
 }
 
 void signal_handler(int signal) {
+       (void)signal;
        quit = 1;
 }
 
@@ -126,6 +127,8 @@ gn_error answer(int lowlevel_id) {
 
 void notify_call(gn_call_status call_status, gn_call_info *call_info, struct 
gn_statemachine *state, void *callback_data) {
        /* in this callback function you can't use those libgnokii functions 
that send a packet */
+       (void)state;
+       (void)callback_data;
        
        if (call_status != GN_CALL_Incoming) return;
        
diff --git a/snippets/other/net_list_html.c b/snippets/other/net_list_html.c
index 5441cf7..d4095a7 100644
--- a/snippets/other/net_list_html.c
+++ b/snippets/other/net_list_html.c
@@ -30,7 +30,7 @@
 
 #include <gnokii.h>
 
-int main(int argc, char *argv[]) {
+int main(void) {
        int i;
        gn_network network;
        char country_code[4] = {0,0,0,0};
diff --git a/snippets/other/press_key.c b/snippets/other/press_key.c
index 952b2a3..b847f17 100644
--- a/snippets/other/press_key.c
+++ b/snippets/other/press_key.c
@@ -70,6 +70,7 @@ void businit(void) {
 }
 
 void signal_handler(int signal) {
+       (void)signal;
        exit(-2);
 }
 
diff --git a/snippets/phonebook/phonebook_status.c 
b/snippets/phonebook/phonebook_status.c
index 5359110..1671ad9 100644
--- a/snippets/phonebook/phonebook_status.c
+++ b/snippets/phonebook/phonebook_status.c
@@ -68,6 +68,7 @@ void businit(void) {
 }
 
 void signal_handler(int signal) {
+       (void)signal;
        exit(-2);
 }
 
diff --git a/snippets/sms/sms_status.c b/snippets/sms/sms_status.c
index c520fd8..dc615b6 100644
--- a/snippets/sms/sms_status.c
+++ b/snippets/sms/sms_status.c
@@ -68,13 +68,14 @@ void businit(void) {
 }
 
 void signal_handler(int signal) {
+       (void)signal;
        exit(-2);
 }
 
 int main(int argc, char *argv[]) {
        gn_data         data;
        gn_error        error;
-       gn_sms_status smsstatus = {0, 0, 0, 0};
+       gn_sms_status smsstatus = {0, 0, 0, 0, 0};
 
        if (argc != 1) {
                fprintf(stderr, _("Usage: %s\nPurpose: print the number of 
unread SM's and the total number\n"), argv[0]);

http://git.savannah.gnu.org/cgit/gnokii/gnokii-extras.gitcommit/?id=1c14bcf0d8e755c7cbc267b5fd4e43ed920dd2cd

commit 1c14bcf0d8e755c7cbc267b5fd4e43ed920dd2cd
Author: Daniele Forsi <address@hidden>
Date:   Mon Nov 2 15:40:58 2009 +0100

    Fix typo

diff --git a/snippets/other/net_list_html.readme 
b/snippets/other/net_list_html.readme
index fae6f7b..a154583 100644
--- a/snippets/other/net_list_html.readme
+++ b/snippets/other/net_list_html.readme
@@ -1,4 +1,4 @@
 $Id$
 
-Prints a list of all networks known by the currently installed libgnokii 
ordered by country code MCC and operator code MNC, just like gnokii 
--listnetworks, but formattted as an HTML unordered list.
+Prints a list of all networks known by the currently installed libgnokii 
ordered by country code MCC and operator code MNC, just like gnokii 
--listnetworks, but formatted as an HTML unordered list.
 Note that there is no escaping for special chars like "&".

http://git.savannah.gnu.org/cgit/gnokii/gnokii-extras.gitcommit/?id=dab437323b8bfa1f68fed7afb749889bd0cf74af

commit dab437323b8bfa1f68fed7afb749889bd0cf74af
Author: Daniele Forsi <address@hidden>
Date:   Mon Nov 2 15:21:22 2009 +0100

    Add gnokii_memory.c to print the translated description of a memory type

diff --git a/snippets/ChangeLog b/snippets/ChangeLog
index dda0145..9a0d262 100644
--- a/snippets/ChangeLog
+++ b/snippets/ChangeLog
@@ -2,6 +2,9 @@
  * misc/memory_names
     o print descriptions of memory names, not the names again; add missing
       memories BD, SD, TA, CB, SR, DR and OUS                (Daniele Forsi)
+ * misc/
+    o add gnokii_memory.c to print the translated description of a memory
+      type, showing the use of gn_lib_init() to enable i18n  (Daniele Forsi)
 
 2009/11/01
  * build system
diff --git a/snippets/misc/.gitignore b/snippets/misc/.gitignore
index 44574a0..5e0840d 100644
--- a/snippets/misc/.gitignore
+++ b/snippets/misc/.gitignore
@@ -3,4 +3,5 @@ error_codes_intl
 events
 get_supported_phone_model
 gnokii_error
+gnokii_memory
 memory_names
diff --git a/snippets/misc/Makefile b/snippets/misc/Makefile
index 5fc0786..eaf3a9f 100644
--- a/snippets/misc/Makefile
+++ b/snippets/misc/Makefile
@@ -1,6 +1,6 @@
 # $Id$
 
-PROGS = error_codes error_codes_intl events get_supported_phone_model 
gnokii_error memory_names
+PROGS = error_codes error_codes_intl events get_supported_phone_model 
gnokii_error gnokii_memory memory_names
 
 TOPDIR = ..
 include ${TOPDIR}/Makefile.global
diff --git a/snippets/misc/gnokii_memory.c b/snippets/misc/gnokii_memory.c
new file mode 100644
index 0000000..d89ae8f
--- /dev/null
+++ b/snippets/misc/gnokii_memory.c
@@ -0,0 +1,52 @@
+/*
+
+  $Id$
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; either version 2 of the License, or
+  (at your option) any later version.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with this program, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+  Copyright (c) 2009 by Daniele Forsi
+
+  Prints the description of the given error memory names.
+
+  Compile and test:
+  gcc -Wall gnokii_memory.c -o gnokii_memory $(pkg-config --libs gnokii) && 
./gnokii_memory SM
+
+*/
+
+#include <stdio.h>
+
+#include <gnokii.h>
+
+int main(int argc, char *argv[]) {
+       gn_error error = GN_ERR_NONE;
+       int i;
+
+       if ((argc < 2)) {
+               printf("Usage %s memory_type...\n", argv[0]);
+               return 1;
+       }
+
+       /* In this simple example gn_lib_init() is only needed to enable i18n */
+       error = gn_lib_init();
+       if (error != GN_ERR_NONE) {
+               fprintf(stderr, "%s\n", gn_error_print(error));
+       } else {
+               for (i = 1; i < argc; i++) {
+                       printf("%s\n", 
gn_memory_type_print(gn_str2memory_type(argv[i])));
+               }
+       }
+
+       return error;
+}
diff --git a/snippets/misc/gnokii_memory.readme 
b/snippets/misc/gnokii_memory.readme
new file mode 100644
index 0000000..a721b0c
--- /dev/null
+++ b/snippets/misc/gnokii_memory.readme
@@ -0,0 +1,15 @@
+$Id$
+
+Prints the description of the given memory types.
+To get translations this example uses gn_lib_init(), a function added in
+libgnokii 0.6.28; programs that "open" a phone don't need to call this
+function explicitely. Compare this example with memory_names.c that needs to
+ues setlocale(), textdomain() and _().
+
+Example:
+
+gnokii_memory SM ME F1
+SIM card
+Internal memory
+SMS Folder 1
+

http://git.savannah.gnu.org/cgit/gnokii/gnokii-extras.gitcommit/?id=851afb7ac2db92ab193fc4c8eb4d147a3f0acf92

commit 851afb7ac2db92ab193fc4c8eb4d147a3f0acf92
Author: Daniele Forsi <address@hidden>
Date:   Mon Nov 2 14:50:18 2009 +0100

    Add missing memories BD, SD, TA, CB, SR, DR and OUS

diff --git a/snippets/ChangeLog b/snippets/ChangeLog
index 890f83d..dda0145 100644
--- a/snippets/ChangeLog
+++ b/snippets/ChangeLog
@@ -1,7 +1,7 @@
 2009/11/02
  * misc/memory_names
-    o print descriptions of memory names, not the names again
-                                                             (Daniele Forsi)
+    o print descriptions of memory names, not the names again; add missing
+      memories BD, SD, TA, CB, SR, DR and OUS                (Daniele Forsi)
 
 2009/11/01
  * build system
diff --git a/snippets/misc/memory_names.c b/snippets/misc/memory_names.c
index 58eb9e9..6a98a46 100644
--- a/snippets/misc/memory_names.c
+++ b/snippets/misc/memory_names.c
@@ -53,11 +53,18 @@ int main(int argc, char *argv[]) {
        macro(RC);
        macro(MC);
        macro(LD);
+       macro(BD);
+       macro(SD);
        macro(MT);
+       macro(TA);
+       macro(CB);
        macro(IN);
        macro(OU);
        macro(AR);
        macro(TE);
+       macro(SR);
+       macro(DR);
+       macro(OUS);
        macro(F1);
        macro(F2);
        macro(F3);

http://git.savannah.gnu.org/cgit/gnokii/gnokii-extras.gitcommit/?id=4012c3cd586077230b59fee91c57e1c7a7f69618

commit 4012c3cd586077230b59fee91c57e1c7a7f69618
Author: Daniele Forsi <address@hidden>
Date:   Mon Nov 2 14:46:54 2009 +0100

    Print descriptions of memory names, not the names again

diff --git a/snippets/ChangeLog b/snippets/ChangeLog
index c5b641e..890f83d 100644
--- a/snippets/ChangeLog
+++ b/snippets/ChangeLog
@@ -1,3 +1,8 @@
+2009/11/02
+ * misc/memory_names
+    o print descriptions of memory names, not the names again
+                                                             (Daniele Forsi)
+
 2009/11/01
  * build system
     o add -W compiler flag and add Makefile ${TOPDIR}/Makefile.global to
diff --git a/snippets/misc/memory_names.c b/snippets/misc/memory_names.c
index bcb2753..58eb9e9 100644
--- a/snippets/misc/memory_names.c
+++ b/snippets/misc/memory_names.c
@@ -38,9 +38,9 @@ int main(int argc, char *argv[]) {
        setlocale(LC_ALL, "");
        textdomain("gnokii");
 
-#define macro_text(x) printf("%s %s\n", x, #x, 
_(gn_memory_type2str(GN_MT_##x)))
-#define macro_html(x) printf("<tr><td>%s<td>%s\n", #x, 
_(gn_memory_type2str(GN_MT_##x)))
-#define macro_php(x) printf("%s => '%s',\n", #x, 
_(gn_memory_type2str(GN_MT_##x)))
+#define macro_text(x) printf("%s %s\n", x, #x, 
_(gn_memory_type_print(GN_MT_##x)))
+#define macro_html(x) printf("<tr><td>%s<td>%s\n", #x, 
_(gn_memory_type_print(GN_MT_##x)))
+#define macro_php(x) printf("%s => '%s',\n", #x, 
_(gn_memory_type_print(GN_MT_##x)))
 
 #define macro(x) macro_html(x)
 

http://git.savannah.gnu.org/cgit/gnokii/gnokii-extras.gitcommit/?id=66aeef7389885d3e3e2b40c6ccb269d690d7e030

commit 66aeef7389885d3e3e2b40c6ccb269d690d7e030
Author: Daniele Forsi <address@hidden>
Date:   Sun Nov 1 12:00:30 2009 +0100

    Add -W compiler flag and add Makefile ${TOPDIR}/Makefile.global to 
prerequisites
    
    Programs must be rebuilt if makefiles are changed.

diff --git a/snippets/ChangeLog b/snippets/ChangeLog
index c5fa154..c5b641e 100644
--- a/snippets/ChangeLog
+++ b/snippets/ChangeLog
@@ -1,3 +1,9 @@
+2009/11/01
+ * build system
+    o add -W compiler flag and add Makefile ${TOPDIR}/Makefile.global to
+      prerequisites for $(PROGS) so that everything is rebuilt if makefiles
+      are changed                                            (Daniele Forsi)
+
 2008/03/22
  * phonebook/
     o use the new gn_memory_type2str() and snprintf() in phonebook_convert.c
diff --git a/snippets/Makefile.global b/snippets/Makefile.global
index 2adce29..7597c4b 100644
--- a/snippets/Makefile.global
+++ b/snippets/Makefile.global
@@ -6,8 +6,10 @@ LDFLAGS += $$(pkg-config --libs gnokii)
 
 all: $(PROGS)
 
+$(PROGS): Makefile ${TOPDIR}/Makefile.global
+
 %: %.c
-       $(CC) -Wall address@hidden -o $@ $(CFLAGS) $(LDFLAGS)
+       $(CC) -W -Wall address@hidden -o $@ $(CFLAGS) $(LDFLAGS)
 
 clean:
        rm -f $(PROGS)

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

Summary of changes:
 snippets/ChangeLog                                |   14 +++++++++++
 snippets/Makefile.global                          |    4 ++-
 snippets/calendar/vcal2gnokii.c                   |    1 +
 snippets/misc/.gitignore                          |    1 +
 snippets/misc/Makefile                            |    2 +-
 snippets/misc/error_codes.c                       |    2 +-
 snippets/misc/error_codes_intl.c                  |    2 +-
 snippets/misc/events.c                            |    3 +-
 snippets/misc/{gnokii_error.c => gnokii_memory.c} |   26 ++++++++++++++------
 snippets/misc/gnokii_memory.readme                |   15 ++++++++++++
 snippets/misc/memory_names.c                      |   15 +++++++++---
 snippets/monitor/rf_level.c                       |    1 +
 snippets/monitor/waitcall.c                       |    3 ++
 snippets/other/net_list_html.c                    |    2 +-
 snippets/other/net_list_html.readme               |    2 +-
 snippets/other/press_key.c                        |    1 +
 snippets/phonebook/phonebook_status.c             |    1 +
 snippets/sms/sms_status.c                         |    3 +-
 18 files changed, 78 insertions(+), 20 deletions(-)
 copy snippets/misc/{gnokii_error.c => gnokii_memory.c} (57%)
 create mode 100644 snippets/misc/gnokii_memory.readme


hooks/post-receive
-- 
Additional programs and language bindings




reply via email to

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