summaryrefslogtreecommitdiff
path: root/proto.h
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2018-04-30 10:46:01 -0600
committerKarl Williamson <khw@cpan.org>2018-06-25 07:33:26 -0600
commit6928bedc792ff80f0cb915460a7eacae25fa9bdd (patch)
treecb3daacc7529120825d1bbe72bd3a112cdf9f9f6 /proto.h
parent808ea3ad2891b03a3f9c239b9b99d56b4765d765 (diff)
downloadperl-6928bedc792ff80f0cb915460a7eacae25fa9bdd.tar.gz
Create my_atof3()
This is like my_atof2(), but with an extra argument signifying the length of the input string to parse. If that length is 0, it uses strlen() to determine it. Then my_atof2() just calls my_atof3() with a zero final parameter. And this commit just uses the bulk of the current my_atof2() as the core of my_atof3(). Changes were needed however, because it relied on NUL-termination in a number of places. This allows one to convert a string that isn't necessarily NUL-terminated to an NV.
Diffstat (limited to 'proto.h')
-rw-r--r--proto.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/proto.h b/proto.h
index 818acd9941..7be8fbd4d2 100644
--- a/proto.h
+++ b/proto.h
@@ -2220,6 +2220,9 @@ PERL_CALLCONV NV Perl_my_atof(pTHX_ const char *s);
PERL_CALLCONV char* Perl_my_atof2(pTHX_ const char *orig, NV* value);
#define PERL_ARGS_ASSERT_MY_ATOF2 \
assert(orig); assert(value)
+PERL_CALLCONV char* Perl_my_atof3(pTHX_ const char *orig, NV* value, const STRLEN len);
+#define PERL_ARGS_ASSERT_MY_ATOF3 \
+ assert(orig); assert(value)
PERL_CALLCONV OP * Perl_my_attrs(pTHX_ OP *o, OP *attrs);
#define PERL_ARGS_ASSERT_MY_ATTRS \
assert(o)