** Output the given string as a quoted according to C or TCL quoting rules. */
| 11729 | ** Output the given string as a quoted according to C or TCL quoting rules. |
| 11730 | */ |
| 11731 | static void output_c_string(FILE *out, const char *z){ |
| 11732 | unsigned int c; |
| 11733 | fputc('"', out); |
| 11734 | while( (c = *(z++))!=0 ){ |
| 11735 | if( c=='\\' ){ |
| 11736 | fputc(c, out); |
| 11737 | fputc(c, out); |
| 11738 | }else if( c=='"' ){ |
| 11739 | fputc('\\', out); |
| 11740 | fputc('"', out); |
| 11741 | }else if( c=='\t' ){ |
| 11742 | fputc('\\', out); |
| 11743 | fputc('t', out); |
| 11744 | }else if( c=='\n' ){ |
| 11745 | fputc('\\', out); |
| 11746 | fputc('n', out); |
| 11747 | }else if( c=='\r' ){ |
| 11748 | fputc('\\', out); |
| 11749 | fputc('r', out); |
| 11750 | }else if( !isprint(c&0xff) ){ |
| 11751 | raw_printf(out, "\\%03o", c&0xff); |
| 11752 | }else{ |
| 11753 | fputc(c, out); |
| 11754 | } |
| 11755 | } |
| 11756 | fputc('"', out); |
| 11757 | } |
| 11758 | |
| 11759 | /* |
| 11760 | ** Output the given string as a quoted according to JSON quoting rules. |
no outgoing calls
no test coverage detected