|
|
| version 1.44, 2006/11/14 17:24:49 | version 1.48, 2007/04/24 08:40:12 |
|---|---|
| Line 166 static inline int _random(uint top) { | Line 166 static inline int _random(uint top) { |
| static void _random(Request& r, MethodParams& params) { | static void _random(Request& r, MethodParams& params) { |
| double top=params.as_double(0, "range must be expression", r); | double top=params.as_double(0, "range must be expression", r); |
| if(top<=0 || top>MAX_UINT) | if(top<=0 || top>MAX_UINT) |
| throw Exception("parser.runtime", | throw Exception(PARSER_RUNTIME, |
| 0, | 0, |
| "top(%g) must be [1..%u]", top, MAX_UINT); | "top(%g) must be [1..%u]", top, MAX_UINT); |
| Line 196 static void math1(Request& r, MethodPara | Line 196 static void math1(Request& r, MethodPara |
| MATH1(round); MATH1(floor); MATH1P(ceiling, ceil); | MATH1(round); MATH1(floor); MATH1P(ceiling, ceil); |
| MATH1(trunc); MATH1(frac); | MATH1(trunc); MATH1(frac); |
| MATH1P(abs, fabs); MATH1(sign); | MATH1P(abs, fabs); MATH1(sign); |
| MATH1(exp); MATH1(log); | MATH1(exp); |
| MATH1(log); MATH1(log10); | |
| MATH1(sin); MATH1(asin); | MATH1(sin); MATH1(asin); |
| MATH1(cos); MATH1(acos); | MATH1(cos); MATH1(acos); |
| MATH1(tan); MATH1(atan); | MATH1(tan); MATH1(atan); |
| Line 268 static void _crypt(Request& r, MethodPar | Line 269 static void _crypt(Request& r, MethodPar |
| if(!static_sample_buf // nothing generated | if(!static_sample_buf // nothing generated |
| || !static_sample_buf[0] // generated nothing | || !static_sample_buf[0] // generated nothing |
| || strncmp(static_sample_buf, normal_salt, prefix_size)!=0) // salt prefix not preserved | || strncmp(static_sample_buf, normal_salt, prefix_size)!=0) // salt prefix not preserved |
| throw Exception("parser.runtime", | throw Exception(PARSER_RUNTIME, |
| 0, | 0, |
| "crypt on this platform does not support '%.*s' salt prefix", prefix_size, normal_salt); | "crypt on this platform does not support '%.*s' salt prefix", prefix_size, normal_salt); |
| r.write_pass_lang(String(pa_strdup(static_sample_buf))); | r.write_pass_lang(String(pa_strdup(static_sample_buf))); |
| #else | #else |
| throw Exception("parser.runtime", | throw Exception(PARSER_RUNTIME, |
| 0, | 0, |
| "salt must start with '" PA_MD5PW_ID "'"); | "salt must start with '" PA_MD5PW_ID "'"); |
| #endif | #endif |
| Line 362 MMath::MMath(): Methoded("math") { | Line 363 MMath::MMath(): Methoded("math") { |
| ADD1(round); ADD1(floor); ADD1(ceiling); | ADD1(round); ADD1(floor); ADD1(ceiling); |
| ADD1(trunc); ADD1(frac); | ADD1(trunc); ADD1(frac); |
| ADD1(abs); ADD1(sign); | ADD1(abs); ADD1(sign); |
| ADD1(exp); ADD1(log); | ADD1(exp); |
| ADD1(log); ADD1(log10); | |
| ADD1(sin); ADD1(asin); | ADD1(sin); ADD1(asin); |
| ADD1(cos); ADD1(acos); | ADD1(cos); ADD1(acos); |
| ADD1(tan); ADD1(atan); | ADD1(tan); ADD1(atan); |