[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] --savesms --datetime
From: |
Pawel Kot |
Subject: |
Re: [PATCH] --savesms --datetime |
Date: |
Sun, 31 Oct 2004 20:45:40 +0100 (CET) |
On Sun, 31 Oct 2004, Pawel Kot wrote:
> On Sun, 31 Oct 2004, Adam Gołębiowski wrote:
>
> > On Sun, Oct 31, 2004 at 04:03:55PM +0100, Pawel Kot wrote:
> > > > Attached you can find small patch that adds --datetime option to
> > > > --savesms command. Basically it allows user to set date and time of
> > > > message delivery (in YYMMDDHHMMSS format).
> > >
> > > It's been a while, but the patch is in CVS now. It would be good to
> > > validate the input datetime as well. :-)
> >
> > Good point. I think I managed to do it. Any comments are welcome - I am
> > not a programmer and would like to know if what I did could be done
> > simplier/beter.
>
> What about doing a generic function gn_datetime_isvalid in eg.
> common/misc.c accepting gn_timestamp at input returning 0/1?
>
> We would avoid polluting gnokii.c with such solution. And you miss non
> leap-year support :-)
>
> To make a code more readable you may want to define a macro:
> #define BETWEEN(a, x, y) ((a >= x) && (a <= y))
> or similiar. (yes I know, this is not type safe but I don't care ;-)).
There's a quick patch. Complies, not tested.
pkot
--
p k o t a t b e z s e n s u d o t p l
http://www.gnokii.org/
validatedatetime.patch
Description: Text document