{
  #
  #     AWK script for filtering the unions in the ALSEC and FILESTORAGE
  #     structure declarations, so h2inc can generate storage.inc
  #
  if ($0=="") {
    print $0
    next
  }
  if (InStruc != 1) {
    if (($1=="typedef") && ($2=="struct")) {   # structure declaration ?
      if (substr($4,1,1)=="{") {
        InStruc = 1
        name = $3
        print $0
        next
      }
    }
  }
  else {
    #
    #   The following is a dirty hack to handle unions within
    #   a structre - and only works for the unions in ALSEC and FILESTORAGE !
    #
    #   NOTE: This relies on the fact that
    #      sizeof(ALLEAF)*LEAFPERSEC == sizeof(ALNODE)*NODEPERSEC
    #   and
    #      sizeof(ALLEAF)*LEAFPERFNODE == sizeof(ALNODE)*NODEPERFNODE
    #
    if ($1=="union") {
      InUnion = 1
      next
    }
    if (InUnion==1) {
        if ($1=="}") {
          InUnion = 0
          if (name=="ALSEC")
            print "    ALLEAF a[LEAFPERSEC]; /* HACK HACK !!! */"
          else
            print "    ALLEAF a[LEAFPERFNODE]; /* HACK HACK !!! */"
          next
        }
        next
    }
    if (substr($1,1,1)=="}") {
        InStruc = 0
    }
  }
  print $0
}
