2 * (c) Oleg Puchinin 2006
3 * graycardinalster@gmail.com
9 // $ silent_bob --structs
10 void got_structs (char * d_file
)
12 struct tt_state_t
* d_tt_state
= CNEW (tt_state_t
, 1);
21 bzero (d_tt_state
, sizeof (struct tt_state_t
));
22 d_tt_state
->d_file_name
= d_file
;
23 d_ptr
= do_tt (d_tt_state
);
26 ch
= t_op (&d_ptr
, &d_out
);
32 if (!strncmp (d_out
, "typedef", 7))
34 else if (!strncmp (d_out
, "struct", 6))
37 if (b_typedef
|| b_struct
) {
38 if (ch
== ';' && b_typedef
&& !SB_FLGET (SB_FLNOLINKS
)) // Link...
39 printf ("%s;\n", d_out
);
43 printf ("%s{\n", d_out
);
44 while (brace_depth
> 0) {
45 ch
= t_op (&d_ptr
, &d_out
);
49 printf ("%s\n", d_out
);
56 for (i
= 0; i
< brace_depth
; i
++)
62 if (ch
!= '}' && ch
!= '{' && strlen (d_out
)) {
63 printf ("%s;\n", d_out
);
65 else if (brace_depth
) {
69 t_op (&d_ptr
, &d_out
);
71 printf (" %s;", d_out
);
78 } // while (brace_deph > 0)
79 ch
= t_op (&d_ptr
, &d_out
);
81 printf ("} %s;\n\n", d_out
);
86 } // if (!strncmp (d_out, "typedef", 7))
89 THE_TT::free_tt_state (d_tt_state
);