"));
make_buffer();
write_213(def_213_filename);
using_213Template = false;
}
void cb_213_html()
{
string fname_name = fl_filename_name(def_213_filename.c_str());
size_t p = fname_name.rfind('.');
if (p != string::npos) fname_name.erase(p);
string icsname = ICS_dir;
icsname.append(fname_name);
icsname.append(".html");
string html_text = "";
update_fields();
string form = ics213_html_template;
replacestr(form, TITLE, fname_name);
for (int i = 0; i < numfields; i++) {
if (fields[i].w_type != 'e')
replacestr( form, fields[i].f_type, fields[i].f_data );
else {
string ww = wordwrap(fields[i].f_data, progStatus.charcount);
int lfcount = 0;
size_t pos = 0;
while ((pos = ww.find("\n", pos)) != string::npos){
lfcount++; pos++;
}
if (lfcount < 10) for (int i = 0; i < (10 - lfcount); i++) ww.append("\n");
html_text.assign("");
html_text.append(ww);
html_text.append("
");
replacestr( form, fields[i].f_type, html_text );
}
}
for (int i = 0; i < numfields; i++)
replacestr( form, fields[i].f_type, fields[i].f_data );
FILE *icsfile = fopen(icsname.c_str(), "w");
fprintf(icsfile,"%s", form.c_str());
fclose(icsfile);
open_url(icsname.c_str());
}
void cb_213_textout()
{
string icsname = ICS_dir;
icsname.append("ics213.txt");
update_fields();
string form = ics213_text_template;
for (int i = 0; i < numfields; i++)
replacestr( form, fields[i].f_type, fields[i].f_data);
FILE *icsfile = fopen(icsname.c_str(), "w");
fprintf(icsfile,"%s", form.c_str());
fclose(icsfile);
open_url(icsname.c_str());
}