#! /usr/bin/gawk -f
# Last edited on 2003-09-18 13:11:16 by stolfi

BEGIN { had_pose = 0; }

/^ *[#]include "dcc-pose-x.inc"/ { next; }
/^ *[\/][\/] *[#]include/ { next; }
/^ *[\/][\/] *[#]declare/ { next; }

/^ *[#]include "dcc-.*abacus/ {
  if (had_pose == 0) 
    { printf "#include \"dcc-pose-0.inc\"\n";  had_pose = 1; }
  print;
  next;
}

/[#]include "dcc-pose-0.inc"/ {
  if (had_pose == 0) { print; }
  had_pose = 1;
  next; 
}

// { print; }

END { if (had_pose == 0) { printf "#include \"dcc-pose-x.inc\"\n"; }
}

