>  > I had a somewhat deeper look at dbi_main now. I think four or five
>  > functions would need to be changed in the way you propose. However,
> as
> 
> The functions dbi_initialize(), dbi_shutdown(),
> dbi_driver_list(), and dbi_driver_open() access rootdriver. All of
> these can easily be modified to accept the sentinel as an additional
> parameter.

I suggest to add a "_r" prefix, e.g. dbi_initialize() becomes
dbi_initialize_r(). I think this is in line with clib functions like
strerror() and strerror_r(). While the actual code fix with strerror()
(renentrancy) is not 100% identical to what we see here, I think it is
sufficiently close to justify the naming. But of course, this are just
my personal thoughts...

>  > this is an interface change, the previous functions would need to
> remain
>  > as is (including the plugin problem). While I looked at the code, I
> 
> This is how we handled most incompatible changes in the past. The old
> functions were usually labelled as "deprecated", but in fact most of
> them are still around. We'll just have to find suitable names for the
> additional functions.

One thought on "deprecated" from my very limited point of view. I see
they are good to tell projects its time to upgrade. On the other hand,
there may be valid reasons to support both. For example, I intend to
check the version number and use dbi_initialize() if we are 0.8.3.1 or
lower - because that works well enough with my application in its
current state. And it is better to use what is there then to deny
functionality. After all, the user may be unable to compile a package
himself and so relies on whatever the distro provides - and that may be
an older release. Of course, I can issue a warning message in that case,
so that the more knowledgeable user can update. The bottom line is that
with that logic, the "deprecated" message will always spoil my build
log, which is a cosmetic issue but still not nice ;)

> 
>  > think a few mutex lock/unlock calls would also make it thread-safe.
> That
>  > is not a big issue for me, as rsyslog allows plugins to run on a
> single
>  > thread, but it may be a benefit for other situations.
>  >
>  > If you like, I can try to apply a number of changes and provide a
> patch
>  > file for your review.
>  >
> 
> Patches are more than welcome. Feel free to send them at your earliest
> convenience.

I'll see what I can put together :)

Rainer

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
libdbi-users mailing list
libdbi-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libdbi-users

Reply via email to