[PATCH] string conversion extension
swen
swen at linux.ibm.com
Tue Jun 4 08:17:52 UTC 2019
At the time of the introduction of the internal string to int
conversion routines a few more ideas were voiced what
this coversion could offer.
This patch-set is introducing an API with which the functionality and
features of the conversion routines can be controlled by flags.
Offering the capabiltiy to add features in future without changing the
function API again.
Currently the following flags are defined
SMB_STR_STANDARD # current behaviour as it is now
SMB_STR_ALLOW_NEGATIVE # allow strings with a leading "-"
SMB_STR_FULL_STR_CONV # entire string must be converted
SMB_STR_ALLOW_NO_CONVERSION # allow empty strings or non-numeric
SMB_STR_GLIBC_STANDARD # act exactly as the standard glibc strtoul
Moving these extra capabilities to the conversion routines,
simplifies the code of the consuming functions.
Offering a common "one-stop-shop" for string to integer conversions
providing the individual flexibility required paired with extensibility for
future needs.
In addition this patchset adds a bunch of tests for the already existing and
the newly introduced conversion capabilities.
The patch-set has passed all gitlab tests at
https://gitlab.com/samba-team/devel/samba/commits/sswen-string_conv_extension
https://gitlab.com/samba-team/devel/samba/pipelines/64563900
Merge request
https://gitlab.com/samba-team/samba/merge_requests/521
Please review and push if happy.
Thanks for your support in advance.
Cheers Swen
-------------- next part --------------
A non-text attachment was scrubbed...
Name: strtoul_extension_incl_test.patch
Type: text/x-patch
Size: 85500 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20190604/3cab31a7/strtoul_extension_incl_test.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20190604/3cab31a7/signature.sig>
More information about the samba-technical
mailing list