2 * (c) Oleg Puchinin 2006
3 * graycardinalster@gmail.com
10 // $ silent_bob --structs
11 void got_structs (char * d_file
)
13 struct tt_state_t
* d_tt_state
= CNEW (tt_state_t
, 1);
22 bzero (d_tt_state
, sizeof (struct tt_state_t
));
23 d_tt_state
->d_file_name
= d_file
;
24 d_ptr
= do_tt (d_tt_state
);
27 ch
= t_op (&d_ptr
, &d_out
);
33 if (!strncmp (d_out
, "typedef", 7))
35 else if (!strncmp (d_out
, "struct", 6))
38 if (b_typedef
|| b_struct
) {
39 if (ch
== ';' && b_typedef
&& !SB_FLGET (SB_FLNOLINKS
)) // Link...
40 printf ("%s;\n", d_out
);
44 printf ("%s{\n", d_out
);
45 while (brace_depth
> 0) {
46 ch
= t_op (&d_ptr
, &d_out
);
50 printf ("%s\n", d_out
);
57 for (i
= 0; i
< brace_depth
; i
++)
63 if (ch
!= '}' && ch
!= '{' && strlen (d_out
)) {
64 printf ("%s;\n", d_out
);
66 else if (brace_depth
) {
70 t_op (&d_ptr
, &d_out
);
72 printf (" %s;", d_out
);
79 } // while (brace_deph > 0)
80 ch
= t_op (&d_ptr
, &d_out
);
82 printf ("} %s;\n\n", d_out
);
87 } // if (!strncmp (d_out, "typedef", 7))
90 free_tt_state (d_tt_state
);