1
0
Fork 0
mirror of git://git.psyced.org/git/psyced synced 2024-08-15 03:25:10 +00:00

ja ja ja!

This commit is contained in:
psyc://psyced.org/~lynX 2010-03-01 19:18:31 +01:00
parent d52ad5084c
commit 7fca953dde
2 changed files with 13 additions and 11 deletions

View file

@ -172,20 +172,22 @@ varargs void w(string mc, string data, mixed vars) {
}
#endif
// a simple implementation of perl's x operator
string x(string str, int n) {
int i;
string res = "";
for (i = 0; i < n; i++) res += str;
return res;
// a simple implementation of perl's x repetition operator
string repeat(string str, int n) {
int i;
string res = "";
for (i = 0; i < n; i++) res += str;
return res;
}
int is_true(string v) {
if (strlen(v) && regmatch(v, "^(?:on|yes|true|enabled|1)$")) return 1;
return 0;
if (strlen(v) && regmatch(v, "^(?:on|yes|y|ja|true|enabled|1)$"))
return 1;
return 0;
}
int is_false(string v) {
if (strlen(v) && regmatch(v, "^(?:off|no|false|disabled|0)$")) return 1;
return 0;
if (strlen(v) && regmatch(v, "^(?:off|no|n|nein|false|disabled|0)$"))
return 1;
return 0;
}