[Devel] Unification of str converter function in database modules
Henning Westerholt
henning.westerholt at 1und1.de
Wed Mar 7 11:44:59 CET 2007
Am Dienstag, 6. März 2007 18:16 schrieb Bogdan-Andrei Iancu:
> Hi Henning,
>
> yes, this will be usefull, especially when there are more plan regarding
> unification of DB types (STR versus STRING) - this difference makes
> usage of dbtext underlayer impossible for some modules.
Hello Bogdan,
ok, i see. At the moment there are both types in the db interface present. Is
the usage of he zero terminated chars obselet and should they not be used
anymore? All functions should only accept and return "str", e.g. val2str and
str2val?
What do you mean with "dbtext underlayer"? The dbtext module?
> to answer to your question - yes, make a new .h file in db/ and prefix
> all the function with db_ to avoid any overlapping. Also try to reuse as
> much as possible the functions from ut.h .
I reworked the patch a little bit according your suggestions. There are only
one function in ut.h that could be reused, but this function provide no error
logging. I don't use it for now.
The patch ("unify-str-convert-functions") creates two new files in db, db_ut.h
and db_ut.c. It removes four functions in three db modules, and change their
includes to use the new (copied) implementation.
I also attached two other small patches:
unify-str_fixup-function:
This patch delete the three slightly different copies of the str_fixup
functions in six modules. It changes the modules to use the right function in
the mod_fix.h file.
db-add-fetch_result-docs:
Adds some documentation for the fetch_result callback to db-api.txt and
extends the comments in the header file.
Best regards,
Henning
-------------- next part --------------
A non-text attachment was scrubbed...
Name: unify-str_fixup-function.patch
Type: text/x-diff
Size: 7734 bytes
Desc: not available
Url : http://openser.org/pipermail/devel/attachments/20070307/f49d778a/unify-str_fixup-function-0001.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: unify-str-convert-functions.patch
Type: text/x-diff
Size: 14980 bytes
Desc: not available
Url : http://openser.org/pipermail/devel/attachments/20070307/f49d778a/unify-str-convert-functions-0001.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: db-add-fetch_result-docs.patch
Type: text/x-diff
Size: 1355 bytes
Desc: not available
Url : http://openser.org/pipermail/devel/attachments/20070307/f49d778a/db-add-fetch_result-docs-0001.bin
More information about the Devel
mailing list