Roxen.git
/
server
/
etc
/
modules
/
Roxen.pmod
version
»
Context lines:
10
20
40
80
file
none
3
Roxen.git/server/etc/modules/Roxen.pmod:1:
// This is a roxen pike module. Copyright © 1999 - 2009, Roxen IS. //
-
// $Id: Roxen.pmod,v 1.
329
2012/
04
/
17
09
:
06
:
40
erikd
Exp $
+
// $Id: Roxen.pmod,v 1.
330
2012/
06
/
10
00
:
27
:
24
mast
Exp $
#include <roxen.h> #include <config.h> #include <version.h> #include <module.h> #include <stat.h> #define roxen roxenp() #ifdef HTTP_DEBUG # define HTTP_WERR(X) report_debug("HTTP: "+X+"\n");
Roxen.git/server/etc/modules/Roxen.pmod:1035:
sscanf(body, "<?%s?>", string hdr)) { hdr += "?"; if (sscanf(lower_case(hdr), "%*sencoding=%s%*[\n\r\t ?]", string xml_enc) == 3) charset = xml_enc - "'" - "\""; } } } }
+
// FIXME: Parse away BOM in xml documents also when the charset
+
// already is known.
+
if (charset) { Locale.Charset.Decoder decoder; if (mixed err = catch (decoder = Locale.Charset.decoder (charset))) { err_msg = sprintf ("Unrecognized charset %q.\n", charset); break proc; } if (mixed err = catch (body = decoder->feed (body)->drain())) { if (objectp (err) && err->is_charset_decode_error) { err_msg = describe_error (err); break proc;
Roxen.git/server/etc/modules/Roxen.pmod:4494:
object key = c->id->conf->getvar("license")->get_key(); return ENCODE_RXML_TEXT(key?sizeof(key->get_warnings()):0, type); } case "auto-charset-variable": return ENCODE_RXML_TEXT("magic_roxen_automatic_charset_variable", type); case "auto-charset-value": return ENCODE_RXML_TEXT(magic_charset_variable_value, type); case "null":
+
// Note that we don't need to check compat_level < 5.2 and
+
// return compat_5_1_null here, since this constant didn't exist
+
// prior to 5.2.
return Val->null; case "true": return Val->true; case "false": return Val->false; } return RXML.nil; }
Roxen.git/server/etc/modules/Roxen.pmod:5469:
Null null = Null(); //! Roxen replacement for @[Val.null] that adds rxml type conversions: //! It's false in boolean tests, yields "" in a string context and 0 //! or 0.0, as appropriate, in a numeric context. constant SqlNull = Null; Val.Null sql_null; // Compat aliases. sql_null is initialized in create() in roxen.pike.
+
class Compat51Null
+
// Null object for compat_level < 5.2. Also inherits RXML.Nil, which
+
// among other things allows casting to empty values of various types.
+
{
+
inherit Null;
+
inherit RXML.Nil;
-
+
protected string _sprintf (int flag)
+
{
+
return flag == 'O' && "Roxen.compat_5_1_null";
+
}
+
}
+
+
Compat51Null compat_5_1_null = Compat51Null();
+
+
#ifdef REQUEST_TRACE protected string trace_msg (mapping id_misc, string msg, string|int name_or_time, int enter) { array(string) lines = msg / "\n"; if (lines[-1] == "") lines = lines[..<1]; if (sizeof (lines)) { #if TOSTR (REQUEST_TRACE) == "TIMES" string byline = sprintf ("%*s%c %s",