Exemple #1
0
void Template::record_indent (const char* line)
{
    if (!n_words_in (line)) return;

    indent = 0;

    for (int i = 0;  i < int(strlen(line));  i++)
    {
        if (line[i] != ' ') break;

	++indent;
    }
}
Exemple #2
0
Fichier : tpl.c Projet : R-W/pscf
void Template::chop_empty_vars ()
{
    for (int i = 1;  i <= n_vars;  i++)
    {
        char* var;
	strcpy (&var, vars[i]);

	while (replace_string_in_string (var, "\"", ""))
	    ;

	if (!n_words_in (var))
	{
	    n_vars = i-1;
	    free (var);
	    return;
	}

	free (var);
    }
}