// Pup a string void pup(const char *shortname,std::string &value) { if (count_newlines(value)==0) { // short string (no newlines) inner(shortname,escape_HTML(value).c_str()); } else { // long string, with newlines std::string fullname=address+shortname; html+=startform() +shortname+":<br>\n" "<textarea name=\""+fullname+"\" cols=\"85\" rows=\""+itos(count_newlines(value)+2)+"\">" +escape_HTML(value) +"</textarea><br>"+endform(); } }
void outputter_t::output_str (str s) { if (_mode == OUTPUT_TREADMILL) { static rxx x ("\n"); vec<str> v; split (&v, x, s); for (u_int i = 0; i < v.size (); i++) { output_line_number (); _output_str (v[i], "\n"); } } else { // we might have set up a defered output_line_number from // within switch_to_mode; now is the time to do it. if (s.len () && _do_output_line_number) { output_line_number (); _do_output_line_number = false; } _output_str (s, NULL); if (_mode == OUTPUT_PASSTHROUGH) _lineno += count_newlines (s); } }
int main (int argc, char *argv[]) { char buffer[4]="test"; write (1, "Main called successfully\n",25); find_seek_place(buffer); count_newlines(); print_remaining(); }