MCPcopy Create free account
hub / github.com/ElementsProject/elements / outputEscape

Function outputEscape

src/univalue/gen/gen.cpp:39–74  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37}
38
39static void outputEscape()
40{
41 printf( "// Automatically generated file. Do not modify.\n"
42 "#ifndef BITCOIN_UNIVALUE_UNIVALUE_ESCAPES_H\n"
43 "#define BITCOIN_UNIVALUE_UNIVALUE_ESCAPES_H\n"
44 "static const char *escapes[256] = {\n");
45
46 for (unsigned int i = 0; i < 256; i++) {
47 if (escapes[i].empty()) {
48 printf("\tnullptr,\n");
49 } else {
50 printf("\t\"");
51
52 unsigned int si;
53 for (si = 0; si < escapes[i].size(); si++) {
54 char ch = escapes[i][si];
55 switch (ch) {
56 case '"':
57 printf("\\\"");
58 break;
59 case '\\':
60 printf("\\\\");
61 break;
62 default:
63 printf("%c", escapes[i][si]);
64 break;
65 }
66 }
67
68 printf("\",\n");
69 }
70 }
71
72 printf( "};\n"
73 "#endif // BITCOIN_UNIVALUE_UNIVALUE_ESCAPES_H\n");
74}
75
76int main (int argc, char *argv[])
77{

Callers 1

mainFunction · 0.85

Calls 3

printfFunction · 0.85
emptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected