MCPcopy Create free account
hub / github.com/KAlO2/PerfectShow / PrintOnce

Function PrintOnce

jni/stasm/print.cpp:116–139  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

114// log prints make tasm slow).
115
116void PrintOnce(
117 int& printed, // io: zero=print, nonzero=no print
118 const char* format, ...) // in: args like printf
119{
120 char s[SBIG];
121 va_list args;
122 va_start(args, format);
123 VSPRINTF(s, format, args);
124 va_end(args);
125 if (printed == 0 && print_g)
126 {
127 printed = 1;
128 printf("%s", s);
129 fflush(stdout); // flush so if there is a crash we can see what happened
130 }
131 if (printed < 100 && logfile_g)
132 {
133 fputs(s, logfile_g);
134 fflush(logfile_g);
135 printed++;
136 if (printed == 100)
137 logprintf("no more prints of the above message (printed == 100)\n");
138 }
139}
140
141} // namespace stasm

Callers 1

Shape17OrEmptyFunction · 0.85

Calls 1

logprintfFunction · 0.85

Tested by

no test coverage detected