how can I insert something into another "include" file

I want to insert something into original files for transformation.Now I can
do it in a single file with Rewriter class,but have some problems in
multiple files.for example,I want to insert some codes in the bold area as
int main()
  char ss="ASSD";
  return 0;

I can insert my codes into test.c with the help of Rewriter class,but add.t
is missing.As long as i insert in test.c, the add.t is also inserted,that is
my finally target.I can get both the location of the first ss[1] and the
second ss[1],and i also know the first one is in test.c and the second is in
add.t by some codes. but they don't have some help in achieving my goal.
Anybody have ideas in dealing with it by Rewriter class.I was curious about
how rewriter class can work in single file,but don't in multiple
files.Thanks for your help!