In file output.h:

void out_addsubstvar

(char* name, char* (*varcalc)(void))

Install a new substitution variable.

Documentation

Install a new substitution variable.

This function may be called from within your own modules to install new, local substitution variables. This function only adds a single variable. You might find it handy to add multiple variables by using this little trick:

    struct substvar table []={
            {"BBS",sv_bbstitle,NULL},
            {"COMPANY",sv_company,NULL},
            {"ADDRESS1",sv_address1,NULL},
            {"",NULL,NULL}
    };
    
    int i=0;
    while(table[i].varname[0]){
            out_addsubstvar(table[i].varname,table[i].varcalc);
            i++;
    }
    

This has the additional advantage of reusing the struct substvar datatype for our own, vile purposes. Note how the next (i.e. the third) field isn't used here.

Parameters:
name - The name of the substitution variable, as a string. You can either specify the name with the enclosing at-signs @, or plain. The function will add any missing at-signs internally.
varcalc - A function of that returns a string. This function will be called in response to encountering a variable name. The return value of the function will used instead of the variable. This allows pretty complex functionality.
See Also:
out_initsubstvars().

Alphabetic index



This page was generated with the help of DOC++.