* pqTraceOutputNchar: output a string of exactly len bytes message to the log */
| 185 | * pqTraceOutputNchar: output a string of exactly len bytes message to the log |
| 186 | */ |
| 187 | static void |
| 188 | pqTraceOutputNchar(FILE *pfdebug, int len, const char *data, int *cursor) |
| 189 | { |
| 190 | int i, |
| 191 | next; /* first char not yet printed */ |
| 192 | const char *v = data + *cursor; |
| 193 | |
| 194 | fprintf(pfdebug, " \'"); |
| 195 | |
| 196 | for (next = i = 0; i < len; ++i) |
| 197 | { |
| 198 | if (isprint((unsigned char) v[i])) |
| 199 | continue; |
| 200 | else |
| 201 | { |
| 202 | fwrite(v + next, 1, i - next, pfdebug); |
| 203 | fprintf(pfdebug, "\\x%02x", v[i]); |
| 204 | next = i + 1; |
| 205 | } |
| 206 | } |
| 207 | if (next < len) |
| 208 | fwrite(v + next, 1, len - next, pfdebug); |
| 209 | |
| 210 | fprintf(pfdebug, "\'"); |
| 211 | *cursor += len; |
| 212 | } |
| 213 | |
| 214 | /* |
| 215 | * Output functions by protocol message type |
no outgoing calls
no test coverage detected