dis_sql/src/sql_iff.cxx
//
// iff_literal_text - Output a literal string.
//
// Puts a backslash in front of embedded quotes and backslashes.
//
Output a literal string.
Puts a backslash in front of embedded quotes and backslashes.
Output a literal string . Puts a backslash in front of embedded quotes and backslashes .
static int iff_literal_text (const char * text)
{
   const char * s;
   for (s = text; *s; ++s) {
      if (*s == '\n') {
	 if (fputc ('\\', iff_fp) == EOF) {
	    return (iff_io_error ());
	 }
	 if (fputc ('n', iff_fp) == EOF) {
	    return (iff_io_error ());
	 }
      } else {	 
	 if ((*s == '"') || (*s == '\\')) {
	    if (fputc ('\\', iff_fp) == EOF) {
	       return (iff_io_error ());
	    }
	 }
	 if (fputc (*s, iff_fp) == EOF) {
	    return (iff_io_error ());
	 }
      }
   }
   return (0);
}
static int iff_literal_text ( const char * text ) { const char * s ; for ( s = text ; * s ; ++ s ) { if ( * s == ' \n ' ) { if ( fputc ( ' \\ ' , iff_fp ) == EOF ) { return ( iff_io_error ( ) ) ; } if ( fputc ( ' ' , iff_fp ) == EOF ) { return ( iff_io_error ( ) ) ; } } else { if ( ( * s == ' ' ) || ( * s == ' \\ ' ) ) { if ( fputc ( ' \\ ' , iff_fp ) == EOF ) { return ( iff_io_error ( ) ) ; } } if ( fputc ( * s , iff_fp ) == EOF ) { return ( iff_io_error ( ) ) ; } } } return ( 0 ) ; }
iff_literal_text - Output a literal string.
iff_literal_text - Output a literal string .
// output text // add a backslash before double-quotes and backslashes