perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <>
Subject Apache::Util::size_string issues
Date Mon, 28 Jan 2002 06:26:21 GMT
Doug MacEachern wrote:

> On Fri, 25 Jan 2002, Stas Bekman wrote:

>>- size_string (has nothing to do with Apache
>>                or should it stay in Apache::Util?)
> it used to be a string version of ap_send_size(), which no longer exists
> in favor of the new apr_strfsize() function.  we should use that in 2.0
> and add a compat wrapper for Apache::Util::size_string.

OK, how about this then:

static MP_INLINE
SV *mpxs_Apache__Util_size_string(pTHX_ apr_off_t  size)
     char buff[5];

     apr_strfsize(size, buff);

     return newSVpvn(buff, 4);

we want it to be perlish, right?

there is a problem with apr_off_t since we typedef it as IV, therefore 
if you try:


it looses data when converting from NV or PV to IV. Which means that we 
can use this function only up to 1G numbers or so. Doesn't sound good.

Also apr_strfsize is in the APR::Strings module in the map file. Should 
we have APR::Strings::strfsize instead of Apache__Util_size_string.

Stas Bekman             JAm_pH      --   Just Another mod_perl Hacker      mod_perl Guide

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message