process_string.c

final_realms_fluffos_v1/lib/secure/simul_efun/process_string.c · 802 B

From the archive final_realms_fluffos_v1.zip

Download the archive   « Back to the archive contents

mixed process_value(string func) {
    int tmp;
    string arg;
    object obj;

    if (!func || !stringp(func))
    return 0;

   if((tmp = strsrch(func,'|')) != -1 ) {
    arg = func[tmp+1..];
    func = func[0..tmp-1];
    }
   if(( tmp = strsrch(func,':')) != -1 ) {
    obj = find_object(func[tmp+1..]);
    func = func[0..tmp-1];
    } else {
    obj = previous_object();
    }
    if (!obj)
    return 0;

    return call_other(obj, func, explode(arg, "|")...);
}

string process_string(string str) {
    int pr_start;
    string *parts = explode(str, "@@");
    
    pr_start = !(str[0..1]=="@@");
    
    for (int il = pr_start; il < sizeof(parts); il += 2) {
    string tmp = process_value(parts[il]);
    if (stringp(tmp))
        parts[il] = tmp;
    }

    return implode(parts, "");
}

Site Stats

Snippets: 1791
Codebases: 571