google-code-export / nativelibs4java

Automatically exported from code.google.com/p/nativelibs4java
1 stars 1 forks source link

BridJ: Add support for time_t #70

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
As suggested in issue #68, we could add a TimeT class like the SizeT one... to 
be investigated !

Original issue reported on code.google.com by olivier.chafik@gmail.com on 20 Jun 2011 at 8:29

GoogleCodeExporter commented 9 years ago
This this thread for more info :
http://old.nabble.com/UNIX-2038-bug---looking-for-a-list-td17310556.html

Original comment by olivier.chafik@gmail.com on 22 Jun 2011 at 3:03

GoogleCodeExporter commented 9 years ago
Hi Olivier,

Thanks!
I use "@Ptr long" for time_t mapping at present, but it doesn't look 100% 
correct
(as follows from the discussion you mentioned).

So I think that TimeT is necessary. Or may be you have other suggestion?

Regards, Andrei.

Original comment by andrei.s...@gmail.com on 22 Jun 2011 at 4:50

GoogleCodeExporter commented 9 years ago
I need "struct timeval" implemented correctly (used in Pcap pcap_pkthdr and 
V4L2 v4l2_buffer structures).

timeval definition is 
(http://pubs.opengroup.org/onlinepubs/007908799/xsh/systime.h.html):

The <sys/time.h> header defines the timeval structure that includes at least 
the following members:

time_t         tv_sec      seconds
suseconds_t    tv_usec     microseconds

What is the best approach in this case?

Regards, Andrei.

Original comment by andrei.s...@gmail.com on 22 Jun 2011 at 5:03

GoogleCodeExporter commented 9 years ago
Hi Olivier,

Regarding "timeval" structure:
Timeval structure is defined as
typedef struct timeval {
  long tv_sec;
  long tv_usec;
} timeval;
on Windows (http://msdn.microsoft.com/en-us/library/ms740560%28v=vs.85%29.aspx),
so it looks differently (in general case) than timeval from <sys/time.h> 
(mentioned above)...

Is it possible to define timeval mapping in BridJ API also?

Regards, Andrei.

Original comment by andrei.s...@gmail.com on 24 Jun 2011 at 6:40

GoogleCodeExporter commented 9 years ago
Hi Andrei,

Supporting time_t and timeval requires quite a bit of work, since they're 
different on virtually every platform, but it's definitely doable. I'm thinking 
about how to proceed right now... will keep you updated !
Cheers
--
zOlive

Original comment by olivier.chafik@gmail.com on 23 Aug 2011 at 12:43

GoogleCodeExporter commented 9 years ago
Hi Olivier,

Afaik JNA doesn't provide timeval/time_t mapping class. Right?
Thanks for accepting and working on this features!!!

Regards, Andrei.

Original comment by andrei.s...@gmail.com on 23 Aug 2011 at 1:07

GoogleCodeExporter commented 9 years ago
Hi Andrei,

Just so you know, I've just enhanced the struct customization mechanism in 
BridJ, so timeval should be easier to implement (I've added an untested binding 
for it) :
https://github.com/ochafik/nativelibs4java/commit/402e637b3c4b11a7a2c9270ac67436
9833a0e38a

As for time_t, I'm still considering various implementation options, stay tuned 
!
Cheers
--
zOlive

Original comment by olivier.chafik@gmail.com on 28 Aug 2011 at 12:12

GoogleCodeExporter commented 9 years ago
Hi Olivier,

Great. Thanks.
I suppose org.bridj.TimeT.timeval should be static class?

Regards, Andrei.

Original comment by andrei.s...@gmail.com on 29 Aug 2011 at 5:54

GoogleCodeExporter commented 9 years ago
Hi,
This issue moved to Github :
https://github.com/ochafik/nativelibs4java/issues/72

Thanks for not updating this page anymore and adding further comments on Github.
Cheers
--
zOlive

Original comment by olivier.chafik@gmail.com on 1 Sep 2011 at 7:29