/*
 *                            COPYRIGHT
 *
 *  catlayer, simple layer file include into pcb file 
 *  Copyright (C) 2001 Luis Claudio Gambôa Lopes
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 *
 *  Contact address for Email:
 *  lcgamboa@yahoo.com
 *
 */
#include<iostream>
#include<fstream>
#include<string>

using namespace std;

void
main (int argc, char **argv)
{
  if (argc != 4)
    {
      cout << "usage: " << argv[0] << " layernum file.pcb file.lpcb" << endl;
      exit (0);
    };

  ifstream fin1 (argv[2]);
  ifstream fin2 (argv[3]);

  string s;
  string layer = "Layer(";
  layer += argv[1];
  int test;
  while (getline (fin1, s))
    {
      cout << s << endl;
      test = s.find (layer);
      if (test >= 0)
	{
	  getline (fin1, s);
	  cout << s << endl;
	  while (getline (fin2, s))
	    cout << s << endl;
	};

    };
};
