MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / printInfo

Function printInfo

examples/interfaces/11.batch.cpp:119–162  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

117// batch info printer - prints what we know about batch
118
119static void printInfo(ThrowStatusWrapper& status, const char* hdr, IBatch* b, IUtil* utl)
120{
121 printf("\n%s\n", hdr);
122
123 const unsigned char items[] = {IBatch::INF_BLOB_ALIGNMENT, IBatch::INF_BUFFER_BYTES_SIZE,
124 IBatch::INF_DATA_BYTES_SIZE, IBatch::INF_BLOBS_BYTES_SIZE};
125 unsigned char buffer[29];
126 b->getInfo(&status, sizeof items, items, sizeof buffer, buffer);
127
128 IXpbBuilder* pb = utl->getXpbBuilder(&status, IXpbBuilder::INFO_RESPONSE, buffer, sizeof buffer);
129 for (pb->rewind(&status); !pb->isEof(&status); pb->moveNext(&status))
130 {
131 int val = pb->getInt(&status);
132 const char* text = "Unknown tag";
133 switch (pb->getTag(&status))
134 {
135 case IBatch::INF_BLOB_ALIGNMENT:
136 text = "Blob alignment";
137 break;
138 case IBatch::INF_BUFFER_BYTES_SIZE:
139 text = "Buffer size";
140 break;
141 case IBatch::INF_DATA_BYTES_SIZE:
142 text = "Messages size";
143 break;
144 case IBatch::INF_BLOBS_BYTES_SIZE:
145 text = "Blobs size";
146 break;
147 case isc_info_truncated:
148 printf(" truncated\n");
149 // fall down...
150 case isc_info_end:
151 pb->dispose();
152 return;
153 default:
154 printf("Unexpected item %d\n", pb->getTag(&status));
155 pb->dispose();
156 return;
157 }
158
159 printf("%s = %d\n", text, val);
160 }
161 pb->dispose();
162}
163
164// BatchCompletionState printer - prints all what we know about completed batch
165

Callers 1

mainFunction · 0.70

Calls 8

getInfoMethod · 0.45
getXpbBuilderMethod · 0.45
rewindMethod · 0.45
isEofMethod · 0.45
moveNextMethod · 0.45
getIntMethod · 0.45
getTagMethod · 0.45
disposeMethod · 0.45

Tested by

no test coverage detected