From 7b12ce912aaddd1bd2f0dfc4cef735d45600d0fa Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Thu, 18 Feb 2021 16:08:19 -0700 Subject: Add my_strftime8() This is like plain my_strftime(), but additionally returns an indication of the UTF-8ness of the returned string --- util.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'util.c') diff --git a/util.c b/util.c index 231daf06da..930ae8ea60 100644 --- a/util.c +++ b/util.c @@ -4189,16 +4189,23 @@ Perl_my_strftime(pTHX_ const char *fmt, int sec, int min, int hour, int mday, in /* =for apidoc_section $time -=for apidoc my_strftime +=for apidoc my_strftime +=for apidoc_item my_strftime8 + strftime(), but with a different API so that the return value is a pointer to the formatted result (which MUST be arranged to be FREED BY THE -CALLER). This allows this function to increase the buffer size as needed, +CALLER). This allows these functions to increase the buffer size as needed, so that the caller doesn't have to worry about that. -Note that yday and wday effectively are ignored by this function, as +C is the same as plain C, but has an extra +parameter, a pointer to a variable declared as L>. +Upon return, its variable will be set to indicate how the resultant string +should be treated with regards to its UTF-8ness. + +Note that yday and wday effectively are ignored by these functions, as mini_mktime() overwrites them -Also note that this is always executed in the underlying locale of the program, +Also note that they are always executed in the underlying locale of the program, giving localized results. =cut -- cgit v1.2.1