From: Denis Kenzior <denkenz@gmail.com>
To: ell@lists.01.org
Subject: Re: ELL API changes before stabilizing
Date: Wed, 05 Oct 2016 17:33:04 -0500 [thread overview]
Message-ID: <57F57FA0.7000509@gmail.com> (raw)
In-Reply-To: <alpine.OSX.2.20.1610051332130.26281@mjmartin-mac01.local>
[-- Attachment #1: Type: text/plain, Size: 2513 bytes --]
Hi Mat,
On 10/05/2016 04:45 PM, Mat Martineau wrote:
>
> We will soon reach a point where breaking changes to the ELL APIs will
> get a lot more painful - changes already create a headache for the
> handful of projects we know about. Given that, I took a look over the
> public headers to see if there were any obvious adjustments to be made,
> and only found a few issues that jumped out at me.
>
>
> 1. timeout: extra nanosecond APIs with extremely_long_function_names. We
> could scrap the *_with_nanosecond calls and include nanoseconds in
> l_timeout_create and l_timeout_modify.
So the background on this is that oFono/ConnMan/BlueZ tend to use
g_timeout_add_seconds since it was supposedly cheaper than using the
g_timeout_add version. Hence in ell we used the seconds as the
'preferred' version and introduced l_idle class as a g_timeout_add(0,
...) replacement.
It is rare (non-existent in iwd & oFono) that we need timers that
contain both seconds and microseconds, it is usually one-or-the-other
situation.
Do we have any users of the nanosecond version? iwd doesn't use it
currently.
>
>
> 2. timeout: Why not use time_t for seconds? Yeah, 4 billion seconds
> should be enough for anyone, but the same argument could be made for the
> underlying struct timespec that's used for the system calls.
What's the advantage besides requiring an extra #include? time_t is a
long in the end. So on 32-bit you're not buying anything, and on 64-bit
you're in overkill territory.
>
>
> 3. main: We recently changed l_main_exit() to be a cleanup function. It
> used to trigger an exit action. It would be more consistent to name the
> function for what it does rather than when it should be run
> (l_main_cleanup()?).
We tend to use _init to init modules and _exit to tear them down. So
the naming sort of makes sense. I also like the symmetry between
l_main_init and l_main_exit.
>
>
> 4. uintset: Why does uintset_new() create a set with min == 1? C
> programmers are more likely to assume it's 0-indexed. Maybe we don't
> need both l_uintset_new and l_uintset_new_from_range. One function that
> takes min and max seems sufficient.
>
This class was a straight up port from ofono's idmap utility. It is
generally used where 0 is not a valid value. But I agree that having
two constructors is redundant.
>
> Anything else you've noticed?
>
Thanks for doing this btw, its still on my TODO list.
Regards,
-Denis
next prev parent reply other threads:[~2016-10-05 22:33 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-05 21:45 ELL API changes before stabilizing Mat Martineau
2016-10-05 22:33 ` Denis Kenzior [this message]
2016-10-06 16:36 ` Mat Martineau
2016-10-06 17:03 ` Denis Kenzior
2016-10-06 18:15 ` Mat Martineau
2016-10-06 18:21 ` Marcel Holtmann
2016-10-07 18:42 ` Mat Martineau
2016-10-06 18:22 ` Gix, Brian
2016-10-06 18:51 ` Denis Kenzior
2016-10-07 18:05 ` Mat Martineau
2016-10-07 18:41 ` Denis Kenzior
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=57F57FA0.7000509@gmail.com \
--to=denkenz@gmail.com \
--cc=ell@lists.01.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.