MCPcopy Create free account
hub / github.com/GJDuck/e9patch / sendString

Method sendString

src/e9tool/e9frontend.cpp:222–257  ·  view source on GitHub ↗

* Send a string parameter. */

Source from the content-addressed store, hash-verified

220 * Send a string parameter.
221 */
222void e9tool::sendString(FILE *out, const char *s)
223{
224 putc('\"', out);
225 for (unsigned i = 0; s[i] != '\0'; i++)
226 {
227 char c = s[i];
228 switch (c)
229 {
230 case '\\':
231 fputs("\\\\", out);
232 break;
233 case '\"':
234 fputs("\\\"", out);
235 break;
236 case '\n':
237 fputs("\\n", out);
238 break;
239 case '\t':
240 fputs("\\t", out);
241 break;
242 case '\r':
243 fputs("\\r", out);
244 break;
245 case '\b':
246 fputs("\\b", out);
247 break;
248 case '\f':
249 fputs("\\f", out);
250 break;
251 default:
252 putc(c, out);
253 break;
254 }
255 }
256 putc('\"', out);
257}
258
259/*
260 * Send code/data.

Callers

nothing calls this directly

Calls 2

putcFunction · 0.85
fputsFunction · 0.85

Tested by

no test coverage detected