Re: DateAndTime conversion

2006-08-29 Thread Dave Shield
On 29/08/06, <[EMAIL PROTECTED]> wrote: > In mib2c.old-api.conf approach ( 5.2.1 version in Fedora ), for > DateAndTime OIDs, I am retuning the value as > > return (u_char *) "1970-1-1,0:0:0.0,-0:0"; No - that's not correct. Please read the description of DateAndTime in SNM

Re: DateAndTime

2004-12-28 Thread Elisabeth Gloria
"David T. Perkins" wrote: David> ... the function gmtime should be replaced by the thread-safe versionDavid> called gmtime_r ... I agree   Do you Yahoo!? Take Yahoo! Mail with you! Get it on your mobile phone.

Re: DateAndTime

2004-12-28 Thread David T. Perkins
HI, Oh, by the way, I forgot to mention that the function gmtime should be replaced by the thread-safe version called gmtime_r, which has signature: struct tm *gmtime_r(cont time_t *clock, struct tm *result) Ok, I see why you need the length. On Tue, 28 Dec 2004, Elisabeth Gloria wrote: > Hi

Re: DateAndTime

2004-12-28 Thread Elisabeth Gloria
Hi David,   OK, please consider following changed code. I accept you criticism concerning thread safe issue. Concerning 'len', see comments inthe edge of the function. typedef struct snmp_data_and_time_s {  unsigned short year;  unsigned char  month;  unsigned char  day;  unsigned char  hour;  unsi

Re: DateAndTime

2004-12-27 Thread David T. Perkins
HI, Your example below is not thread-safe. I suggest that you change it to pass in a pointer to a place to store the result instead of using static "dtt" in the function (and remove the "len" argument, since it is not needed). That is, change the function signature to: DT_T *AGUTIL_get_date_and_

Re: DateAndTime

2004-12-26 Thread Elisabeth Gloria
I do have such one, you may try to use it: char * AGUTIL_get_date_and_time (time_t * tv,  size_t * len){  typedef struct snmp_data_and_time_s {    unsigned short year;    unsigned char  month;    unsigned char  day;    unsigned char  hour;    unsigned char  minutes; 

Re: DateAndTime

2004-12-12 Thread Wes Hardaker
> On Mon, 15 Nov 2004 13:11:42 +0100 (MET), "Sven Jonas" <[EMAIL > PROTECTED]> said: Sven> is there any funtion that converts an u_char time[11] to a Sven> time_t-Struct? Nope, but if you write one please send it to us! -- Wes Hardaker Sparta -