Roxen.git/
server/
etc/
modules/
Roxen.pmod
Branch:
Tag:
Non-build tags
All tags
No tags
2001-08-29
2001-08-29 17:05:56 by Martin Nilsson <mani@lysator.liu.se>
8ff6722f12afd3bc04e4ba39abc8b90ec6a0f757 (
13
lines) (+
9
/-
4
)
[
Show
|
Annotate
]
Branch:
5.2
Updated the sizetostring prefixes. Bugfixed &roxen.time;
Rev: server/etc/modules/Roxen.pmod:1.120
1:
// This is a roxen pike module. Copyright © 1999 - 2000, Roxen IS. //
-
// $Id: Roxen.pmod,v 1.
119
2001/08/
28
18
:
10
:
00
per
Exp $
+
// $Id: Roxen.pmod,v 1.
120
2001/08/
29
17
:
05
:
56
nilsson
Exp $
#include <roxen.h> #include <config.h>
1481:
return "internal-gopher-unknown"; }
-
#define PREFIX ({ "bytes", "kb", "Mb", "Gb", "Tb", "
Hb
" })
+
#define PREFIX ({ "bytes", "kb", "Mb", "Gb", "Tb", "
Pb
"
,
"Eb", "Zb", "Yb"
})
string sizetostring( int size ) //! Returns the size as a memory size string with suffix,
-
//! e.g. 43210 is converted into "42.2 kb.
+
//! e.g. 43210 is converted into "42.2 kb
"
.
To be correct
+
//! to the latest standards it should really read "42.2 KiB",
+
//! but we have chosen to keep the old notation for a while.
+
//! The function knows about the quantifiers kilo, mega, giga,
+
//! tera, peta, exa, zetta and yotta.
{ if(size<0) return "--------"; float s = (float)size;
2868:
return ENCODE_RXML_TEXT(__roxen_build__, type); case "time": CACHE(c->id,1);
-
return ENCODE_RXML_INT(time(
1
), type);
+
return ENCODE_RXML_INT(time(), type);
case "server": return ENCODE_RXML_TEXT (c->id->url_base(), type); case "domain":