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

Function copy_union

extern/btyacc/reader.c:432–480  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

430}
431
432void copy_union()
433{
434 FILE *dc_file;
435 register int c;
436 int depth;
437 int u_lineno = lineno;
438 char *u_line = dup_line();
439 char *u_cptr = u_line + (cptr - line - 6);
440
441 if (unionized) over_unionized(cptr - 6);
442 unionized = 1;
443
444 if (!lflag)
445 fprintf(text_file, line_format, lineno, (inc_file?inc_file_name:input_file_name));
446
447 /* VM: Print to either code file or defines file but not to both */
448 dc_file = dflag ? union_file : text_file;
449
450 fprintf(dc_file, "\ntypedef union");
451
452 depth = 0;
453loop:
454 c = *cptr++;
455 putc(c, dc_file);
456 switch (c) {
457 case '\n':
458 get_line();
459 if (line == 0) unterminated_union(u_lineno, u_line, u_cptr);
460 goto loop;
461 case '{':
462 ++depth;
463 goto loop;
464 case '}':
465 if (--depth == 0) {
466 fprintf(dc_file, " YYSTYPE;\n");
467 FREE(u_line);
468 return; }
469 goto loop;
470 case '\'':
471 case '"':
472 copy_string(c, dc_file, 0);
473 goto loop;
474 case '/':
475 copy_comment(dc_file, 0);
476 goto loop;
477 default:
478 goto loop;
479 }
480}
481
482int hexval(int c)
483{

Callers 1

read_declarationsFunction · 0.85

Calls 7

dup_lineFunction · 0.85
over_unionizedFunction · 0.85
putcFunction · 0.85
unterminated_unionFunction · 0.85
copy_stringFunction · 0.85
copy_commentFunction · 0.85
get_lineFunction · 0.70

Tested by

no test coverage detected