gnokii-commit
[Top][All Lists]
Advanced

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

gnokii/gnokii gnokii.c,1.371,1.372


From: BORBELY Zoltan <address@hidden>
Subject: gnokii/gnokii gnokii.c,1.371,1.372
Date: Mon, 01 Dec 2003 23:33:06 +0000

Update of /cvsroot/gnokii/gnokii/gnokii
In directory subversions:/tmp/cvs-serv4203/gnokii

Modified Files:
        gnokii.c 
Log Message:
getcalendarnote accepts "end" keyword,
getcalendarnote and sendsms help output fixes


Index: gnokii.c
===================================================================
RCS file: /cvsroot/gnokii/gnokii/gnokii/gnokii.c,v
retrieving revision 1.371
retrieving revision 1.372
diff -C2 -d -r1.371 -r1.372
*** gnokii.c    30 Nov 2003 18:55:13 -0000      1.371
--- gnokii.c    1 Dec 2003 23:33:03 -0000       1.372
***************
*** 50,53 ****
--- 50,54 ----
  #include <sys/stat.h>
  #include <ctype.h>
+ #include <limits.h>
  
  
***************
*** 294,298 ****
                     "          gnokii --writetodo vcardfile number\n"
                     "          gnokii --deletealltodos\n"
!                    "          gnokii --getcalendarnote start [end] [-v]\n"
                     "          gnokii --writecalendarnote vcardfile number\n"
                     "          gnokii --deletecalendarnote start [end]\n"
--- 295,299 ----
                     "          gnokii --writetodo vcardfile number\n"
                     "          gnokii --deletealltodos\n"
!                    "          gnokii --getcalendarnote start_number 
[end_number|end] [-v]\n"
                     "          gnokii --writecalendarnote vcardfile number\n"
                     "          gnokii --deletecalendarnote start [end]\n"
***************
*** 426,432 ****
  }
  
! static void sendsms_usage()
  {
!       fprintf(stderr, _(" usage: gnokii --sendsms destination\n"
                          "               [--smsc message_center_number | 
--smscno message_center_index]\n"
                          "               [-r] [-C n] [-v n] [--long n] 
[--animation file;file;file;file]\n"
--- 427,433 ----
  }
  
! static void sendsms_usage(FILE *f, int exitval)
  {
!       fprintf(f, _(" usage: gnokii --sendsms destination\n"
                          "               [--smsc message_center_number | 
--smscno message_center_index]\n"
                          "               [-r] [-C n] [-v n] [--long n] 
[--animation file;file;file;file]\n"
***************
*** 442,446 ****
                          "\n"
                ));
!       exit(-1);
  }
  
--- 443,459 ----
                          "\n"
                ));
!       exit(exitval);
! }
! 
! static void getcalendarnote_usage(FILE *f, int exitval)
! {
!       fprintf(f, _("usage: gnokii --getcalendarnote start_number [end_number 
| end] [-v]\n"
!                                        "       start_number - entry number in 
the phone calendar (numeric)\n"
!                                        "       end_number   - until this 
entry in the phone calendar (numeric, optional)\n"
!                                        "       end          - the string 
\"end\" indicates all entries from start to end\n"
!                                        "       -v           - output in 
iCalendar format\n"
!                                        "  NOTE: if no end is given, only the 
start entry is written\n"
!       ));
!       exit(exitval);
  }
  
***************
*** 581,585 ****
                        if (data.message_center->id < 1 || 
data.message_center->id > 5) {
                                free(data.message_center);
!                               sendsms_usage();
                        }
                        if (gn_sm_functions(GN_OP_GetSMSCenter, &data, &state) 
== GN_ERR_NONE) {
--- 594,598 ----
                        if (data.message_center->id < 1 || 
data.message_center->id > 5) {
                                free(data.message_center);
!                               sendsms_usage(stderr, -1);
                        }
                        if (gn_sm_functions(GN_OP_GetSMSCenter, &data, &state) 
== GN_ERR_NONE) {
***************
*** 643,647 ****
                        case '2': sms.dcs.u.general.m_class = 3; break;
                        case '3': sms.dcs.u.general.m_class = 4; break;
!                       default: sendsms_usage();
                        }
                        break;
--- 656,660 ----
                        case '2': sms.dcs.u.general.m_class = 3; break;
                        case '3': sms.dcs.u.general.m_class = 4; break;
!                       default: sendsms_usage(stderr, -1);
                        }
                        break;
***************
*** 668,672 ****
                        break;
                default:
!                       sendsms_usage();
                }
        }
--- 681,685 ----
                        break;
                default:
!                       sendsms_usage(stderr, -1);
                }
        }
***************
*** 784,788 ****
                        if (data.message_center->id < 1 || 
data.message_center->id > 5) {
                                free(data.message_center);
!                               sendsms_usage();
                        }
                        if (gn_sm_functions(GN_OP_GetSMSCenter, &data, &state) 
== GN_ERR_NONE) {
--- 797,801 ----
                        if (data.message_center->id < 1 || 
data.message_center->id > 5) {
                                free(data.message_center);
!                               sendsms_usage(stderr, -1);
                        }
                        if (gn_sm_functions(GN_OP_GetSMSCenter, &data, &state) 
== GN_ERR_NONE) {
***************
*** 2196,2201 ****
        first_location = last_location = atoi(argv[0]);
        if ((argc > 1) && (argv[1][0] != '-')) {
!               last_location = atoi(argv[1]);
        }
  
        while ((i = getopt_long(argc, argv, "v", options, NULL)) != -1) {
--- 2209,2219 ----
        first_location = last_location = atoi(argv[0]);
        if ((argc > 1) && (argv[1][0] != '-')) {
!               if (!strcasecmp(argv[1], "end"))
!                       last_location = INT_MAX;
!               else
!                       last_location = atoi(argv[1]);
        }
+       if (last_location < first_location)
+               last_location = first_location;
  
        while ((i = getopt_long(argc, argv, "v", options, NULL)) != -1) {
***************
*** 2205,2210 ****
                        break;
                default:
!                       usage(stderr, -1); /* Would be better to have an 
calendar_usage() here. */
!                       return -1;
                }
        }
--- 2223,2227 ----
                        break;
                default:
!                       getcalendarnote_usage(stderr, -1);
                }
        }
***************
*** 2305,2308 ****
--- 2322,2328 ----
                default:
                        fprintf(stderr, _("The calendar note can not be read: 
%s\n"), gn_error_print(error));
+                       /* stop processing if the last note was specified as 
"end" */
+                       if (last_location == INT_MAX)
+                               last_location = 0;
                        break;
                }





reply via email to

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