|
|
| version 1.51, 2007/08/20 10:37:21 | version 1.53, 2008/06/16 12:38:41 |
|---|---|
| Line 491 static void _crc32(Request& r, MethodPar | Line 491 static void _crc32(Request& r, MethodPar |
| r.write_no_lang(*new VInt(pa_crc32(string, strlen(string)))); | r.write_no_lang(*new VInt(pa_crc32(string, strlen(string)))); |
| } | } |
| static void _long2ip(Request& r, MethodParams& params) { | |
| unsigned long l=(unsigned long)trunc(params.as_double(0, "parameter must be expression", r)); | |
| static const int ip_cstr_bufsize=15+1+1; | |
| char* ip_cstr=new(PointerFreeGC) char[ip_cstr_bufsize]; | |
| snprintf(ip_cstr, ip_cstr_bufsize, "%d.%d.%d.%d", | |
| (l>>24) & 0xFF, | |
| (l>>16) & 0xFF, | |
| (l>>8) & 0xFF, | |
| l & 0xFF); | |
| r.write_no_lang(*new String(ip_cstr)); | |
| } | |
| // constructor | // constructor |
| MMath::MMath(): Methoded("math") { | MMath::MMath(): Methoded("math") { |
| Line 542 MMath::MMath(): Methoded("math") { | Line 528 MMath::MMath(): Methoded("math") { |
| // ^math:crc32[string] | // ^math:crc32[string] |
| ADD1(crc32); | ADD1(crc32); |
| ADD1(long2ip); | |
| // ^math:uuid[] | // ^math:uuid[] |
| ADD0(uuid); | ADD0(uuid); |