libs/gen/src/msgDict.cxx
// esc_to_ctrl(esc)
//
// esc - string containing escape sequences (e.g. \n)
//
// Converts escape sequences into control codes; leaves 
// other characters intact. Returns a copy of esc with 
// the escape sequences converted into control codes (from 
// newbugwin.C).
esc_to_ctrl(esc)
esc - string containing escape sequences

Converts escape sequences into control codes; leaves
other characters intact. Returns a copy of esc with
the escape sequences converted into control codes (from
newbugwin.C).
esc_to_ctrl ( esc ) esc - string containing escape sequences Converts escape sequences into control codes ; leaves other characters intact . Returns a copy of esc with the escape sequences converted into control codes ( from newbugwin . C ) .
static char *esc_to_ctrl(char *esc)
{
  if (!esc) return NULL;
  char *s = new char[strlen(esc) + 1];
  char *ctrl;
  for (ctrl = s; *esc; ctrl++, esc++) {
    if (*esc == '\\') 
      switch (*(++esc)) {
        case 'a': *ctrl = '\a'; break;
	case 'b': *ctrl = '\b'; break;
	case 'f': *ctrl = '\f'; break;
	case 'n': *ctrl = '\n'; break;
        case 'r': *ctrl = '\r'; break;
        case 't': *ctrl = '\t'; break;
	case 'v': *ctrl = '\v'; break;
        case '\\':
	case '\?':
        case '\'':
        case '\"': 
	default: *ctrl = *esc; break;
      }
    else
      *ctrl = *esc;
  }
  *ctrl = '\0';
  return s;
}
static char * esc_to_ctrl ( char * esc ) { if ( ! esc ) return NULL ; char * s = new char [ strlen ( esc ) + 1 ] ; char * ctrl ; for ( ctrl = s ; * esc ; ctrl ++ , esc ++ ) { if ( * esc == ' \\ ' ) switch ( * ( ++ esc ) ) { case ' ' : * ctrl = ' \a ' ; break ; case ' ' : * ctrl = ' \b ' ; break ; case ' ' : * ctrl = ' \f ' ; break ; case ' ' : * ctrl = ' \n ' ; break ; case ' ' : * ctrl = ' \r ' ; break ; case ' ' : * ctrl = ' \t ' ; break ; case ' ' : * ctrl = ' \v ' ; break ; case ' \\ ' : case ' \? ' : case ' \' ' : case ' \" ' : default : * ctrl = * esc ; break ; } else * ctrl = * esc ; } * ctrl = ' \0 ' ; return s ; }
esc_to_ctrl(esc)
esc - string containing escape sequences (e.g.
esc_to_ctrl ( esc ) esc - string containing escape sequences ( e . g .