Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

localtime_l and mktime_l in a independent shared library #8

Open
CurlyMoo opened this issue Aug 20, 2017 · 4 comments
Open

localtime_l and mktime_l in a independent shared library #8

CurlyMoo opened this issue Aug 20, 2017 · 4 comments

Comments

@CurlyMoo
Copy link

CurlyMoo commented Aug 20, 2017

I'm curious what you think about the idea to release localtime_l and mktime_l as two functions in a independent shared library. Until today, i have not found a good library that does what these functions do, purely converting between timezones based on the IANA timezone database.

Because such a library does not exists, i integrated your localtime_l code inside my own program, but that requires (as you do now) a new release as soon as the IANA database is updated. If these functions would exist in a independent shared library, that update mechanism would be far easier, by just updating the shared library.

I also think a lot of C developers would be interested in these two functions alone without having to use the full cloudlibc library.

@EdSchouten
Copy link
Member

EdSchouten commented Aug 20, 2017

Hi there! Great to hear there's interest in this code! \o/

This sounds like a good idea. I would love to keep them integrated in the C library in CloudABI's case, but if we could somehow make it so that I can just put an unmodified copy of this in contrib/ and link that into the C library, that would be fine by me.

Right now these functions are somewhat tied into cloudlibc's localisation framework (through newlocale(LC_TIMEZONE_MASK)). When moving this into a separate library, we'd better create a separate type for the time zone handle. In the case of cloudlibc, locale_t could be adjusted to embed this handle.

Is this something that you've already taken a stab at solving, or shall I go ahead and create a repo under NuxiNL for us to work on this?

@CurlyMoo
Copy link
Author

CurlyMoo commented Aug 20, 2017

Is this something that you've already taken a stab at solving, or shall I go ahead and create a repo under NuxiNL for us to work on this?

Yes, i already extracted the core of localtime_l so i can use it independently. I did alter it a bit to make it crossplatform (Windows, Linux, FreeBSD). A new repo would be great.

@sdalu
Copy link

sdalu commented Sep 14, 2020

It would be very nice to have it in a separate code/library so it could also be used in embedded system.

@EdSchouten
Copy link
Member

This project is no longer maintained. Feel free to fork this code. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants