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

Function gen_tpb

src/gpre/obj_cxx.cpp:3393–3435  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3391//
3392
3393static void gen_tpb(const tpb* tpb_buffer, int column)
3394{
3395 TEXT buffer[80];
3396 SSHORT length;
3397
3398 printa(column, "static %sunsigned char\n", CONST_STR);
3399 column += INDENT;
3400 TEXT* p = buffer;
3401
3402 for (length = 0; length < column; length++)
3403 *p++ = ' ';
3404
3405 sprintf(p, "fb_tpb_%d [%d] = {", tpb_buffer->tpb_ident, tpb_buffer->tpb_length);
3406 while (*p)
3407 p++;
3408
3409 SSHORT tpb_length = tpb_buffer->tpb_length;
3410 const TEXT* text = (TEXT*) tpb_buffer->tpb_string;
3411
3412 while (--tpb_length >= 0)
3413 {
3414 const TEXT c = *text++;
3415 if ((c >= 'A' && c <= 'Z') || c == '$' || c == '_')
3416 sprintf(p, "'%c'", c);
3417 else
3418 sprintf(p, "%d", c);
3419 while (*p)
3420 p++;
3421 if (tpb_length)
3422 *p++ = ',';
3423 if (p - buffer > 60)
3424 {
3425 *p = 0;
3426 fprintf(gpreGlob.out_file, " %s\n", buffer);
3427 p = buffer;
3428 for (length = 0; length < column + INDENT; length++)
3429 *p++ = ' ';
3430 *p = 0;
3431 }
3432 }
3433
3434 fprintf(gpreGlob.out_file, "%s};\n", buffer);
3435}
3436
3437
3438//____________________________________________________________

Callers 1

gen_databaseFunction · 0.70

Calls 1

printaFunction · 0.70

Tested by

no test coverage detected