head	8.7;
access;
symbols;
locks; strict;
comment	@ * @;


8.7
date	2026.05.11.12.01.10;	author mcalabre;	state Exp;
branches;
next	8.6;

8.6
date	2026.03.29.13.53.56;	author mcalabre;	state Exp;
branches
	8.6.1.1;
next	8.5;

8.5
date	2025.12.06.13.47.41;	author mcalabre;	state Exp;
branches
	8.5.1.1;
next	8.4;

8.4
date	2024.10.28.13.56.16;	author mcalabre;	state Exp;
branches
	8.4.1.1;
next	8.3;

8.3
date	2024.05.13.16.33.00;	author mcalabre;	state Exp;
branches
	8.3.1.1;
next	8.2;

8.2
date	2023.11.16.10.00.29;	author mcalabre;	state Exp;
branches
	8.2.1.1;
next	8.1;

8.1
date	2023.07.05.17.12.07;	author mcalabre;	state Exp;
branches
	8.1.1.1;
next	8.0;

8.0
date	2023.07.01.06.15.04;	author mcalabre;	state Exp;
branches
	8.0.1.1;
next	7.13;

7.13
date	2022.10.07.03.43.35;	author mcalabre;	state Exp;
branches
	7.13.1.1;
next	7.12;

7.12
date	2022.09.09.04.57.58;	author mcalabre;	state Exp;
branches
	7.12.1.1;
next	7.11;

7.11
date	2022.04.26.06.13.52;	author mcalabre;	state Exp;
branches
	7.11.1.1;
next	7.10;

7.10
date	2022.04.23.14.25.15;	author mcalabre;	state Exp;
branches
	7.10.1.1;
next	7.9;

7.9
date	2022.03.25.15.14.48;	author mcalabre;	state Exp;
branches
	7.9.1.1;
next	7.8;

7.8
date	2022.03.25.06.11.49;	author mcalabre;	state Exp;
branches
	7.8.1.1;
next	7.7;

7.7
date	2021.07.12.06.36.49;	author mcalabre;	state Exp;
branches
	7.7.1.1;
next	7.6;

7.6
date	2021.04.13.12.57.01;	author mcalabre;	state Exp;
branches
	7.6.1.1;
next	7.5;

7.5
date	2021.03.20.05.54.58;	author mcalabre;	state Exp;
branches
	7.5.1.1;
next	7.4;

7.4
date	2021.01.31.02.24.51;	author mcalabre;	state Exp;
branches
	7.4.1.1;
next	7.3;

7.3
date	2020.06.03.03.37.02;	author mcalabre;	state Exp;
branches
	7.3.1.1;
next	7.2;

7.2
date	2020.03.09.07.31.23;	author mcalabre;	state Exp;
branches
	7.2.1.1;
next	7.1;

7.1
date	2019.12.31.13.25.19;	author mcalabre;	state Exp;
branches
	7.1.1.1;
next	6.4;

6.4
date	2019.08.15.09.30.18;	author mcalabre;	state Exp;
branches
	6.4.1.1;
next	6.3;

6.3
date	2019.07.12.07.33.39;	author mcalabre;	state Exp;
branches
	6.3.1.1;
next	6.2;

6.2
date	2018.10.20.10.03.13;	author mcalabre;	state Exp;
branches
	6.2.1.1;
next	6.1;

6.1
date	2018.10.19.08.35.17;	author mcalabre;	state Exp;
branches
	6.1.1.1;
next	5.20;

5.20
date	2018.10.05.05.32.41;	author mcalabre;	state Exp;
branches
	5.20.1.1;
next	5.19;

5.19
date	2018.07.26.15.37.04;	author mcalabre;	state Exp;
branches
	5.19.1.1;
next	5.18;

5.18
date	2018.01.10.08.32.14;	author mcalabre;	state Exp;
branches
	5.18.1.1;
next	5.17;

5.17
date	2017.09.18.08.44.23;	author mcalabre;	state Exp;
branches
	5.17.1.1;
next	5.16;

5.16
date	2017.01.15.04.25.01;	author mcalabre;	state Exp;
branches
	5.16.1.1;
next	5.15;

5.15
date	2016.04.05.12.55.10;	author mcalabre;	state Exp;
branches
	5.15.1.1;
next	5.14;

5.14
date	2016.02.07.10.49.31;	author mcalabre;	state Exp;
branches
	5.14.1.1;
next	5.13;

5.13
date	2016.01.26.08.51.13;	author mcalabre;	state Exp;
branches
	5.13.1.1;
next	5.12;

5.12
date	2015.11.15.02.13.00;	author mcalabre;	state Exp;
branches
	5.12.1.1;
next	5.11;

5.11
date	2015.10.18.09.13.05;	author mcalabre;	state Exp;
branches
	5.11.1.1;
next	5.10;

5.10
date	2015.10.09.08.19.15;	author mcalabre;	state Exp;
branches
	5.10.1.1;
next	5.9;

5.9
date	2015.07.21.09.20.01;	author mcalabre;	state Exp;
branches
	5.9.1.1;
next	5.8;

5.8
date	2015.07.08.11.03.59;	author mcalabre;	state Exp;
branches
	5.8.1.1;
next	5.7;

5.7
date	2015.06.29.02.44.16;	author mcalabre;	state Exp;
branches
	5.7.1.1;
next	5.6;

5.6
date	2015.06.14.07.11.24;	author mcalabre;	state Exp;
branches
	5.6.1.1;
next	5.5;

5.5
date	2015.05.05.13.16.31;	author mcalabre;	state Exp;
branches
	5.5.1.1;
next	5.4;

5.4
date	2015.04.21.14.41.05;	author mcalabre;	state Exp;
branches
	5.4.1.1;
next	5.3;

5.3
date	2015.04.21.02.50.51;	author mcalabre;	state Exp;
branches
	5.3.1.1;
next	5.2;

5.2
date	2015.04.15.12.35.07;	author mcalabre;	state Exp;
branches
	5.2.1.1;
next	5.1;

5.1
date	2015.04.07.10.56.36;	author mcalabre;	state Exp;
branches
	5.1.1.1;
next	5.0;

5.0
date	2015.04.05.12.24.59;	author mcalabre;	state Exp;
branches
	5.0.1.1;
next	4.25;

4.25
date	2014.12.14.14.29.36;	author mcalabre;	state Exp;
branches
	4.25.1.1;
next	4.24;

4.24
date	2014.09.18.15.25.00;	author mcalabre;	state Exp;
branches
	4.24.1.1;
next	4.23;

4.23
date	2014.05.13.05.50.51;	author mcalabre;	state Exp;
branches
	4.23.1.1;
next	4.22;

4.22
date	2014.04.12.15.03.52;	author mcalabre;	state Exp;
branches
	4.22.1.1;
next	4.21;

4.21
date	2014.03.24.05.12.27;	author mcalabre;	state Exp;
branches
	4.21.1.1;
next	4.20;

4.20
date	2013.12.18.05.42.49;	author mcalabre;	state Exp;
branches
	4.20.1.1;
next	4.19;

4.19
date	2013.09.29.14.17.51;	author mcalabre;	state Exp;
branches
	4.19.1.1;
next	4.18;

4.18
date	2013.07.13.10.00.04;	author mcalabre;	state Exp;
branches
	4.18.1.1;
next	4.17;

4.17
date	2013.01.29.05.29.20;	author cal103;	state Exp;
branches
	4.17.1.1;
next	4.16;

4.16
date	2012.11.07.04.42.44;	author cal103;	state Exp;
branches
	4.16.1.1;
next	4.15;

4.15
date	2012.09.26.14.26.05;	author cal103;	state Exp;
branches
	4.15.1.1;
next	4.14;

4.14
date	2012.07.13.10.02.27;	author cal103;	state Exp;
branches
	4.14.1.1;
next	4.13;

4.13
date	2012.03.14.07.39.30;	author cal103;	state Exp;
branches
	4.13.1.1;
next	4.12;

4.12
date	2012.02.29.07.57.56;	author cal103;	state Exp;
branches
	4.12.1.1;
next	4.11;

4.11
date	2012.02.20.23.30.02;	author cal103;	state Exp;
branches
	4.11.1.1;
next	4.10;

4.10
date	2012.02.05.23.41.44;	author cal103;	state Exp;
branches
	4.10.1.1;
next	4.9;

4.9
date	2012.01.24.05.40.29;	author cal103;	state Exp;
branches
	4.9.1.1;
next	4.8;

4.8
date	2011.08.15.08.05.53;	author cal103;	state Exp;
branches
	4.8.1.1;
next	4.7;

4.7
date	2011.02.07.07.03.42;	author cal103;	state Exp;
branches
	4.7.1.1;
next	4.6;

4.6
date	2010.11.16.06.15.31;	author cal103;	state Exp;
branches
	4.6.1.1;
next	4.5;

4.5
date	2010.07.16.07.01.25;	author cal103;	state Exp;
branches
	4.5.1.1;
next	4.4;

4.4
date	2009.08.06.07.41.33;	author cal103;	state Exp;
branches
	4.4.1.1;
next	4.3;

4.3
date	2007.12.27.05.41.36;	author cal103;	state Exp;
branches
	4.3.1.1;
next	4.2;

4.2
date	2005.09.21.13.21.57;	author cal103;	state Exp;
branches
	4.2.1.1;
next	4.1;

4.1
date	2005.08.25.07.26.29;	author cal103;	state Exp;
branches;
next	0.0;

0.0
date	2005.08.25.07.01.28;	author cal103;	state Exp;
branches;
next	;

4.2.1.1
date	2005.12.05.02.39.43;	author cal103;	state Exp;
branches;
next	4.2.1.2;

4.2.1.2
date	2007.07.11.08.47.57;	author cal103;	state Exp;
branches;
next	4.2.1.3;

4.2.1.3
date	2007.07.12.03.53.28;	author cal103;	state Exp;
branches;
next	4.2.1.4;

4.2.1.4
date	2007.07.12.04.06.04;	author cal103;	state Exp;
branches;
next	4.2.1.5;

4.2.1.5
date	2007.07.12.07.22.06;	author cal103;	state Exp;
branches;
next	4.2.1.6;

4.2.1.6
date	2007.08.02.04.55.13;	author cal103;	state Exp;
branches;
next	4.2.1.7;

4.2.1.7
date	2007.08.02.05.08.03;	author cal103;	state Exp;
branches;
next	4.2.1.8;

4.2.1.8
date	2007.08.08.04.16.11;	author cal103;	state Exp;
branches;
next	4.2.1.9;

4.2.1.9
date	2007.12.03.05.02.17;	author cal103;	state Exp;
branches;
next	4.2.1.10;

4.2.1.10
date	2007.12.27.05.05.17;	author cal103;	state Exp;
branches;
next	;

4.3.1.1
date	2007.12.27.13.23.47;	author cal103;	state Exp;
branches;
next	4.3.1.2;

4.3.1.2
date	2008.04.02.03.51.53;	author cal103;	state Exp;
branches;
next	4.3.1.3;

4.3.1.3
date	2009.07.22.04.53.58;	author cal103;	state Exp;
branches;
next	;

4.4.1.1
date	2009.08.10.08.52.49;	author cal103;	state Exp;
branches;
next	4.4.1.2;

4.4.1.2
date	2009.09.03.02.42.20;	author cal103;	state Exp;
branches;
next	4.4.1.3;

4.4.1.3
date	2010.01.19.03.42.50;	author cal103;	state Exp;
branches;
next	;

4.5.1.1
date	2010.07.16.07.05.31;	author cal103;	state Exp;
branches;
next	;

4.6.1.1
date	2010.11.16.06.16.19;	author cal103;	state Exp;
branches;
next	4.6.1.2;

4.6.1.2
date	2011.01.14.06.33.16;	author cal103;	state Exp;
branches;
next	;

4.7.1.1
date	2011.02.07.07.04.22;	author cal103;	state Exp;
branches;
next	;

4.8.1.1
date	2011.08.15.08.07.06;	author cal103;	state Exp;
branches;
next	4.8.1.2;

4.8.1.2
date	2012.01.24.05.23.06;	author cal103;	state Exp;
branches;
next	;

4.9.1.1
date	2012.01.24.05.41.45;	author cal103;	state Exp;
branches;
next	;

4.10.1.1
date	2012.02.05.23.42.46;	author cal103;	state Exp;
branches;
next	;

4.11.1.1
date	2012.02.20.23.31.13;	author cal103;	state Exp;
branches;
next	;

4.12.1.1
date	2012.02.29.07.59.10;	author cal103;	state Exp;
branches;
next	;

4.13.1.1
date	2012.03.14.07.40.37;	author cal103;	state Exp;
branches;
next	4.13.1.2;

4.13.1.2
date	2012.07.12.15.21.26;	author cal103;	state Exp;
branches;
next	4.13.1.3;

4.13.1.3
date	2012.07.13.03.34.20;	author cal103;	state Exp;
branches;
next	4.13.1.4;

4.13.1.4
date	2012.07.13.07.58.31;	author cal103;	state Exp;
branches;
next	;

4.14.1.1
date	2012.07.13.10.04.44;	author cal103;	state Exp;
branches;
next	;

4.15.1.1
date	2012.09.26.14.27.51;	author cal103;	state Exp;
branches;
next	;

4.16.1.1
date	2012.11.07.04.45.56;	author cal103;	state Exp;
branches;
next	4.16.1.2;

4.16.1.2
date	2013.01.29.05.09.44;	author cal103;	state Exp;
branches;
next	;

4.17.1.1
date	2013.01.29.05.32.32;	author cal103;	state Exp;
branches;
next	;

4.18.1.1
date	2013.07.13.10.02.37;	author mcalabre;	state Exp;
branches;
next	;

4.19.1.1
date	2013.09.29.14.20.38;	author mcalabre;	state Exp;
branches;
next	;

4.20.1.1
date	2013.12.18.05.46.55;	author mcalabre;	state Exp;
branches;
next	4.20.1.2;

4.20.1.2
date	2014.03.21.06.32.19;	author mcalabre;	state Exp;
branches;
next	;

4.21.1.1
date	2014.03.24.05.15.28;	author mcalabre;	state Exp;
branches;
next	;

4.22.1.1
date	2014.04.12.15.06.32;	author mcalabre;	state Exp;
branches;
next	;

4.23.1.1
date	2014.05.13.05.53.49;	author mcalabre;	state Exp;
branches;
next	;

4.24.1.1
date	2014.09.18.15.28.09;	author mcalabre;	state Exp;
branches;
next	;

4.25.1.1
date	2014.12.14.14.32.45;	author mcalabre;	state Exp;
branches;
next	4.25.1.2;

4.25.1.2
date	2015.01.06.01.01.06;	author mcalabre;	state Exp;
branches;
next	4.25.1.3;

4.25.1.3
date	2015.03.13.06.43.58;	author mcalabre;	state Exp;
branches;
next	;

5.0.1.1
date	2015.04.05.12.28.00;	author mcalabre;	state Exp;
branches;
next	;

5.1.1.1
date	2015.04.07.11.01.10;	author mcalabre;	state Exp;
branches;
next	;

5.2.1.1
date	2015.04.15.12.39.14;	author mcalabre;	state Exp;
branches;
next	;

5.3.1.1
date	2015.04.21.02.54.02;	author mcalabre;	state Exp;
branches;
next	;

5.4.1.1
date	2015.04.21.14.44.28;	author mcalabre;	state Exp;
branches;
next	;

5.5.1.1
date	2015.05.05.13.21.00;	author mcalabre;	state Exp;
branches;
next	;

5.6.1.1
date	2015.06.14.07.14.44;	author mcalabre;	state Exp;
branches;
next	;

5.7.1.1
date	2015.06.29.02.47.24;	author mcalabre;	state Exp;
branches;
next	;

5.8.1.1
date	2015.07.08.11.07.18;	author mcalabre;	state Exp;
branches;
next	;

5.9.1.1
date	2015.07.21.09.28.07;	author mcalabre;	state Exp;
branches;
next	;

5.10.1.1
date	2015.10.09.08.22.35;	author mcalabre;	state Exp;
branches;
next	;

5.11.1.1
date	2015.10.18.09.16.27;	author mcalabre;	state Exp;
branches;
next	;

5.12.1.1
date	2015.11.15.02.16.14;	author mcalabre;	state Exp;
branches;
next	5.12.1.2;

5.12.1.2
date	2016.01.25.05.17.04;	author mcalabre;	state Exp;
branches;
next	;

5.13.1.1
date	2016.01.26.08.54.32;	author mcalabre;	state Exp;
branches;
next	;

5.14.1.1
date	2016.02.07.10.52.44;	author mcalabre;	state Exp;
branches;
next	;

5.15.1.1
date	2016.04.05.12.58.35;	author mcalabre;	state Exp;
branches;
next	5.15.1.2;

5.15.1.2
date	2017.01.15.04.14.00;	author mcalabre;	state Exp;
branches;
next	;

5.16.1.1
date	2017.01.15.04.28.59;	author mcalabre;	state Exp;
branches;
next	5.16.1.2;

5.16.1.2
date	2017.09.12.13.30.44;	author mcalabre;	state Exp;
branches;
next	;

5.17.1.1
date	2017.09.18.08.45.59;	author mcalabre;	state Exp;
branches;
next	5.17.1.2;

5.17.1.2
date	2017.12.05.01.38.46;	author mcalabre;	state Exp;
branches;
next	5.17.1.3;

5.17.1.3
date	2018.01.10.08.25.34;	author mcalabre;	state Exp;
branches;
next	;

5.18.1.1
date	2018.01.10.08.33.04;	author mcalabre;	state Exp;
branches;
next	;

5.19.1.1
date	2018.07.26.15.41.40;	author mcalabre;	state Exp;
branches;
next	;

5.20.1.1
date	2018.10.05.05.33.33;	author mcalabre;	state Exp;
branches;
next	;

6.1.1.1
date	2018.10.19.08.36.15;	author mcalabre;	state Exp;
branches;
next	;

6.2.1.1
date	2018.10.20.10.04.15;	author mcalabre;	state Exp;
branches;
next	6.2.1.2;

6.2.1.2
date	2019.05.10.01.56.50;	author mcalabre;	state Exp;
branches;
next	6.2.1.3;

6.2.1.3
date	2019.07.08.08.02.29;	author mcalabre;	state Exp;
branches;
next	;

6.3.1.1
date	2019.07.12.07.34.37;	author mcalabre;	state Exp;
branches;
next	;

6.4.1.1
date	2019.08.15.09.31.29;	author mcalabre;	state Exp;
branches;
next	6.4.1.2;

6.4.1.2
date	2019.12.31.03.28.03;	author mcalabre;	state Exp;
branches;
next	;

7.1.1.1
date	2019.12.31.13.28.19;	author mcalabre;	state Exp;
branches;
next	;

7.2.1.1
date	2020.03.09.07.34.50;	author mcalabre;	state Exp;
branches;
next	;

7.3.1.1
date	2020.06.03.03.38.10;	author mcalabre;	state Exp;
branches;
next	7.3.1.2;

7.3.1.2
date	2020.08.17.11.19.09;	author mcalabre;	state Exp;
branches;
next	7.3.1.3;

7.3.1.3
date	2021.01.19.14.09.10;	author mcalabre;	state Exp;
branches;
next	7.3.1.4;

7.3.1.4
date	2021.01.28.12.29.30;	author mcalabre;	state Exp;
branches;
next	;

7.4.1.1
date	2021.01.31.02.26.24;	author mcalabre;	state Exp;
branches;
next	7.4.1.2;

7.4.1.2
date	2021.02.23.04.44.02;	author mcalabre;	state Exp;
branches;
next	7.4.1.3;

7.4.1.3
date	2021.02.25.13.41.02;	author mcalabre;	state Exp;
branches;
next	7.4.1.4;

7.4.1.4
date	2021.02.25.13.55.05;	author mcalabre;	state Exp;
branches;
next	;

7.5.1.1
date	2021.03.20.05.56.42;	author mcalabre;	state Exp;
branches;
next	;

7.6.1.1
date	2021.04.13.13.00.35;	author mcalabre;	state Exp;
branches;
next	;

7.7.1.1
date	2021.07.12.06.38.27;	author mcalabre;	state Exp;
branches;
next	7.7.1.2;

7.7.1.2
date	2022.03.25.06.05.58;	author mcalabre;	state Exp;
branches;
next	;

7.8.1.1
date	2022.03.25.06.14.14;	author mcalabre;	state Exp;
branches;
next	;

7.9.1.1
date	2022.03.25.15.16.40;	author mcalabre;	state Exp;
branches;
next	;

7.10.1.1
date	2022.04.23.14.26.54;	author mcalabre;	state Exp;
branches;
next	;

7.11.1.1
date	2022.04.26.06.15.32;	author mcalabre;	state Exp;
branches;
next	;

7.12.1.1
date	2022.09.09.05.00.36;	author mcalabre;	state Exp;
branches;
next	;

7.13.1.1
date	2022.10.07.03.45.47;	author mcalabre;	state Exp;
branches;
next	7.13.1.2;

7.13.1.2
date	2023.06.15.04.17.19;	author mcalabre;	state Exp;
branches;
next	;

8.0.1.1
date	2023.07.01.06.22.44;	author mcalabre;	state Exp;
branches;
next	;

8.1.1.1
date	2023.07.05.17.15.00;	author mcalabre;	state Exp;
branches;
next	;

8.2.1.1
date	2023.11.16.10.05.57;	author mcalabre;	state Exp;
branches;
next	8.2.1.2;

8.2.1.2
date	2024.04.02.14.01.58;	author mcalabre;	state Exp;
branches;
next	;

8.3.1.1
date	2024.05.13.16.35.39;	author mcalabre;	state Exp;
branches;
next	;

8.4.1.1
date	2024.10.28.13.58.41;	author mcalabre;	state Exp;
branches;
next	8.4.1.2;

8.4.1.2
date	2025.12.06.13.37.15;	author mcalabre;	state Exp;
branches;
next	;

8.5.1.1
date	2025.12.06.14.05.15;	author mcalabre;	state Exp;
branches;
next	8.5.1.2;

8.5.1.2
date	2026.03.29.13.36.16;	author mcalabre;	state Exp;
branches;
next	;

8.6.1.1
date	2026.03.29.14.19.26;	author mcalabre;	state Exp;
branches;
next	8.6.1.2;

8.6.1.2
date	2026.04.10.03.51.28;	author mcalabre;	state Exp;
branches;
next	;


desc
@Flex description file containing a lexical scanner definition for a generic
FITS header parser.
@


8.7
log
@WCSLIB 8.7
@
text
@/*============================================================================
  WCSLIB 8.7 - an implementation of the FITS WCS standard.
  Copyright (C) 1995-2026, Mark Calabretta

  This file is part of WCSLIB.

  WCSLIB is free software: you can redistribute it and/or modify it under the
  terms of the GNU Lesser General Public License as published by the Free
  Software Foundation, either version 3 of the License, or (at your option)
  any later version.

  WCSLIB 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 Lesser General Public License for
  more details.

  You should have received a copy of the GNU Lesser General Public License
  along with WCSLIB.  If not, see http://www.gnu.org/licenses.

  Author: Mark Calabretta, Australia Telescope National Facility, CSIRO.
  http://www.atnf.csiro.au/computing/software/wcs
  $Id: fitshdr.l,v 8.6.1.2 2026/04/10 03:51:28 mcalabre Exp mcalabre $
*=============================================================================
*
* fitshdr.l is a Flex description file containing a lexical scanner
* definition for extracting keywords and keyvalues from a FITS header.
*
* It requires Flex v2.5.4 or later.
*
* Refer to fitshdr.h for a description of the user interface and operating
* notes.
*
*===========================================================================*/

/* Options. */
%option full
%option never-interactive
%option noinput
%option nounput
%option noyywrap
%option outfile="fitshdr.c"
%option prefix="fitshdr"
%option reentrant
%option extra-type="struct fitshdr_extra *"

/* Keywords. */
KEYCHR	[-_A-Z0-9]
KW1	{KEYCHR}{1}" "{7}
KW2	{KEYCHR}{2}" "{6}
KW3	{KEYCHR}{3}" "{5}
KW4	{KEYCHR}{4}" "{4}
KW5	{KEYCHR}{5}" "{3}
KW6	{KEYCHR}{6}" "{2}
KW7	{KEYCHR}{7}" "{1}
KW8	{KEYCHR}{8}
KEYWORD	({KW1}|{KW2}|{KW3}|{KW4}|{KW5}|{KW6}|{KW7}|{KW8})

/* Keyvalue data types. */
LOGICAL	[TF]
INT32	[+-]?0*[0-9]{1,9}
INT64	[+-]?0*[0-9]{10,18}
INTVL	[+-]?0*[0-9]{19,}
INTEGER	[+-]?[0-9]+
FLOAT	[+-]?([0-9]+\.?[0-9]*|\.[0-9]+)([eEdD][+-]?[0-9]+)?
ICOMPLX	\(" "*{INTEGER}" "*," "*{INTEGER}" "*\)
FCOMPLX	\(" "*{FLOAT}" "*," "*{FLOAT}" "*\)
STRING	'([^']|'')*'

/* Characters forming standard unit strings (jwBIQX are not used). */
UNITSTR \[[-+*/^(). 0-9a-zA-Z]+\]

/* Exclusive start states. */
%x VALUE INLINE UNITS COMMENT ERROR FLUSH

%{
#include <math.h>
#include <limits.h>
#include <setjmp.h>
#include <stdlib.h>
#include <string.h>

#include "fitshdr.h"
#include "wcsutil.h"

// User data associated with yyscanner.
struct fitshdr_extra {
  // Values passed to YY_INPUT.
  const char *hdr;
  int  nkeyrec;

  // Used in preempting the call to exit() by yy_fatal_error().
  jmp_buf abort_jmp_env;
};

#define YY_DECL int fitshdr_scanner(const char header[], int nkeyrec, \
  int nkeyids, struct fitskeyid keyids[], int *nreject, \
  struct fitskey **keys, yyscan_t yyscanner)

#define YY_INPUT(inbuff, count, bufsize) \
	{ \
	  if (yyextra->nkeyrec) { \
	    strncpy(inbuff, yyextra->hdr, 80); \
	    inbuff[80] = '\n'; \
	    yyextra->hdr += 80; \
	    yyextra->nkeyrec--; \
	    count = 81; \
	  } else { \
	    count = YY_NULL; \
	  } \
	}

// Preempt the call to exit() by yy_fatal_error().
#define exit(status) longjmp(yyextra->abort_jmp_env, status);

// Internal helper functions.
static YY_DECL;
static void nullfill(char cptr[], int len);

// Map status return value to message.
const char *fitshdr_errmsg[] = {
   "Success",
   "Null fitskey pointer-pointer passed",
   "Memory allocation failed",
   "Fatal error returned by Flex parser"};

%}

%%
	char ctmp[72];
	
	if (keys == 0x0) {
	  return FITSHDRERR_NULL_POINTER;
	}
	
	// Allocate memory for the required number of fitskey structs.
	// Recall that calloc() initializes allocated memory to zero.
	struct fitskey *kptr;
	if (!(kptr = *keys = calloc(nkeyrec, sizeof(struct fitskey)))) {
	  return FITSHDRERR_MEMORY;
	}
	
	// Initialize returned values.
	*nreject = 0;
	
	// Initialize keyids[].
	struct fitskeyid *iptr = keyids;
	for (int j = 0; j < nkeyids; j++, iptr++) {
	  iptr->count  = 0;
	  iptr->idx[0] = -1;
	  iptr->idx[1] = -1;
	}

	int keyno = 0;
	
	int blank = 0;
	int continuation = 0;
	int end = 0;
	
	#ifdef WCSLIB_INT64
	  #define asString(S) stringize(S)
	  #define stringize(S) #S
	
	  const char *int64fmt;
	  if (strcmp(asString(WCSLIB_INT64), "long long int") == 0) {
	    int64fmt = "%lld";
	  } else if (strcmp(asString(WCSLIB_INT64), "long int") == 0) {
	    int64fmt = "%ld";
	  } else if (strcmp(asString(WCSLIB_INT64), "int") == 0) {
	    int64fmt = "%d";
	  } else {
	    return FITSHDRERR_DATA_TYPE;
	  }
	#endif
	
	// User data associated with yyscanner.
	yyextra->hdr = header;
	yyextra->nkeyrec = nkeyrec;
	
	// Return here via longjmp() invoked by yy_fatal_error().
	if (setjmp(yyextra->abort_jmp_env)) {
	  return FITSHDRERR_FLEX_PARSER;
	}
	
	BEGIN(INITIAL);

^" "{80} {
	  // A completely blank keyrecord.
	  strncpy(kptr->keyword, yytext, 8);
	  yyless(0);
	  blank = 1;
	  BEGIN(COMMENT);
	}

^(COMMENT|HISTORY|" "{8}) {
	  strncpy(kptr->keyword, yytext, 8);
	  BEGIN(COMMENT);
	}

^END" "{77} {
	  strncpy(kptr->keyword, yytext, 8);
	  end = 1;
	  BEGIN(FLUSH);
	}

^END" "{5}=" "+ {
	  // Illegal END keyrecord.
	  strncpy(kptr->keyword, yytext, 8);
	  kptr->status |= FITSHDR_KEYREC;
	  BEGIN(VALUE);
	}

^END" "{5} {
	  // Illegal END keyrecord.
	  strncpy(kptr->keyword, yytext, 8);
	  kptr->status |= FITSHDR_KEYREC;
	  BEGIN(COMMENT);
	}

^{KEYWORD}=" "+ {
	  strncpy(kptr->keyword, yytext, 8);
	  BEGIN(VALUE);
	}

^CONTINUE"  "+{STRING} {
	  // Continued string keyvalue.
	  strncpy(kptr->keyword, yytext, 8);
	
	  if (keyno > 0 && (kptr-1)->type%10 == 8) {
	    // Put back the string keyvalue.
	    int k;
	    for (k = 10; yytext[k] != '\''; k++);
	    yyless(k);
	    continuation = 1;
	    BEGIN(VALUE);
	
	  } else {
	    // Not a valid continuation.
	    yyless(8);
	    BEGIN(COMMENT);
	  }
	}

^{KEYWORD} {
	  // Keyword without value.
	  strncpy(kptr->keyword, yytext, 8);
	  BEGIN(COMMENT);
	}

^.{8}=" "+ {
	  // Illegal keyword, carry on regardless.
	  strncpy(kptr->keyword, yytext, 8);
	  kptr->status |= FITSHDR_KEYWORD;
	  BEGIN(VALUE);
	}

^.{8}	{
	  // Illegal keyword, carry on regardless.
	  strncpy(kptr->keyword, yytext, 8);
	  kptr->status |= FITSHDR_KEYWORD;
	  BEGIN(COMMENT);
	}

<VALUE>" "*/\/ {
	  // Null keyvalue.
	  BEGIN(INLINE);
	}

<VALUE>{LOGICAL} {
	  // Logical keyvalue.
	  kptr->type = 1;
	  kptr->keyvalue.i = (*yytext == 'T');
	  BEGIN(INLINE);
	}

<VALUE>{INT32} {
	  // 32-bit signed integer keyvalue.
	  kptr->type = 2;
	  if (sscanf(yytext, "%d", &(kptr->keyvalue.i)) < 1) {
	    kptr->status |= FITSHDR_KEYVALUE;
	    BEGIN(ERROR);
	  }
	
	  BEGIN(INLINE);
	}

<VALUE>{INT64} {
	  // 64-bit signed integer keyvalue (up to 18 digits).
	  double dtmp;
	  if (wcsutil_str2double(yytext, &dtmp)) {
	    kptr->status |= FITSHDR_KEYVALUE;
	    BEGIN(ERROR);
	
	  } else if (INT_MIN <= dtmp && dtmp <= INT_MAX) {
	    // Can be accomodated as a 32-bit signed integer.
	    kptr->type = 2;
	    if (sscanf(yytext, "%d", &(kptr->keyvalue.i)) < 1) {
	      kptr->status |= FITSHDR_KEYVALUE;
	      BEGIN(ERROR);
	    }
	
	  } else {
	    // 64-bit signed integer.
	    kptr->type = 3;
	    #ifdef WCSLIB_INT64
	      // Native 64-bit integer is available.
	      if (sscanf(yytext, int64fmt, &(kptr->keyvalue.k)) < 1) {
	        kptr->status |= FITSHDR_KEYVALUE;
	        BEGIN(ERROR);
	      }
	    #else
	      // 64-bit integer (up to 18 digits) implemented as int[3].
	      kptr->keyvalue.k[2] = 0;
	
	      snprintf(ctmp, 72, "%%%dd%%9d", yyleng-9);
	      if (sscanf(yytext, ctmp, kptr->keyvalue.k+1,
	                 kptr->keyvalue.k) < 1) {
	        kptr->status |= FITSHDR_KEYVALUE;
	        BEGIN(ERROR);
	      } else if (*yytext == '-') {
	        kptr->keyvalue.k[0] *= -1;
	      }
	    #endif
	  }
	
	  BEGIN(INLINE);
	}

<VALUE>{INTVL} {
	  // Very long integer keyvalue (and 19-digit int64).
	  kptr->type = 4;
	  strncpy(ctmp, yytext, 72);
	  int j, k = yyleng;
	  for (j = 0; j < 8; j++) {
	    // Read it backwards.
	    k -= 9;
	    if (k < 0) k = 0;
	    if (sscanf(ctmp+k, "%d", kptr->keyvalue.l+j) < 1) {
	      kptr->status |= FITSHDR_KEYVALUE;
	      BEGIN(ERROR);
	    }
	    if (*yytext == '-') {
	      kptr->keyvalue.l[j] = -abs(kptr->keyvalue.l[j]);
	    }
	
	    if (k == 0) break;
	    ctmp[k] = '\0';
	  }
	
	  // Can it be accomodated as a 64-bit signed integer?
	  if (j == 2 && abs(kptr->keyvalue.l[2]) <=  9 &&
	                abs(kptr->keyvalue.l[1]) <=  223372036 &&
	                    kptr->keyvalue.l[0]  <=  854775807 &&
	                    kptr->keyvalue.l[0]  >= -854775808) {
	    kptr->type = 3;
	
	    #ifdef WCSLIB_INT64
	      // Native 64-bit integer is available.
	      kptr->keyvalue.l[2] = 0;
	      if (sscanf(yytext, int64fmt, &(kptr->keyvalue.k)) < 1) {
	        kptr->status |= FITSHDR_KEYVALUE;
	        BEGIN(ERROR);
	      }
	    #endif
	  }
	
	  BEGIN(INLINE);
	}

<VALUE>{FLOAT} {
	  // Float keyvalue.
	  kptr->type = 5;
	  if (wcsutil_str2double(yytext, &(kptr->keyvalue.f))) {
	    kptr->status |= FITSHDR_KEYVALUE;
	    BEGIN(ERROR);
	  }
	
	  BEGIN(INLINE);
	}

<VALUE>{ICOMPLX} {
	  // Integer complex keyvalue.
	  kptr->type = 6;
	  if (sscanf(yytext, "(%lf,%lf)", kptr->keyvalue.c,
	      kptr->keyvalue.c+1) < 2) {
	    kptr->status |= FITSHDR_KEYVALUE;
	    BEGIN(ERROR);
	  }
	
	  BEGIN(INLINE);
	}

<VALUE>{FCOMPLX} {
	  // Floating point complex keyvalue.
	  kptr->type = 7;
	
	  char *cptr;
	  int k;
	  for (cptr = ctmp, k = 1; yytext[k] != ','; cptr++, k++) {
	    *cptr = yytext[k];
	  }
	  *cptr = '\0';
	
	  if (wcsutil_str2double(ctmp, kptr->keyvalue.c)) {
	    kptr->status |= FITSHDR_KEYVALUE;
	    BEGIN(ERROR);
	  }
	
	  for (cptr = ctmp, k++; yytext[k] != ')'; cptr++, k++) {
	    *cptr = yytext[k];
	  }
	  *cptr = '\0';
	
	  if (wcsutil_str2double(ctmp, kptr->keyvalue.c+1)) {
	    kptr->status |= FITSHDR_KEYVALUE;
	    BEGIN(ERROR);
	  }
	
	  BEGIN(INLINE);
	}

<VALUE>{STRING} {
	  // String keyvalue.
	  kptr->type = 8;
	  char *cptr = kptr->keyvalue.s;
	  strncpy(cptr, yytext+1, 72);
	
	  // Squeeze out repeated quotes.
	  int k = 0;
	  for (int j = 0; j < 72; j++) {
	    if (k < j) {
	      cptr[k] = cptr[j];
	    }
	
	    if (cptr[j] == '\0') {
	      if (k) cptr[k-1] = '\0';
	      break;
	    } else if (cptr[j] == '\'' && cptr[j+1] == '\'') {
	      j++;
	    }
	
	    k++;
	  }
	
	  if (*cptr) {
	    // Retain the initial blank in all-blank strings.
	    nullfill(cptr+1, 71);
	  } else {
	    nullfill(cptr, 72);
	  }
	
	  BEGIN(INLINE);
	}

<VALUE>. {
	  kptr->status |= FITSHDR_KEYVALUE;
	  BEGIN(ERROR);
	}

<INLINE>" "*$ {
	  BEGIN(FLUSH);
	}

<INLINE>" "*\/" "*$ {
	  BEGIN(FLUSH);
	}

<INLINE>" "*\/" "* {
	  BEGIN(UNITS);
	}

<INLINE>" " {
	  kptr->status |= FITSHDR_COMMENT;
	  BEGIN(ERROR);
	}

<INLINE>. {
	  // Keyvalue parsing must now also be suspect.
	  kptr->status |= FITSHDR_COMMENT;
	  kptr->type = 0;
	  BEGIN(ERROR);
	}

<UNITS>{UNITSTR} {
	  kptr->ulen = yyleng;
	  yymore();
	  BEGIN(COMMENT);
	}

<UNITS>. {
	  yymore();
	  BEGIN(COMMENT);
	}

<COMMENT>.* {
	  strncpy(kptr->comment, yytext, 84);
	  nullfill(kptr->comment, 84);
	  BEGIN(FLUSH);
	}

<ERROR>.* {
	  if (!continuation) kptr->type = -abs(kptr->type);
	
	  snprintf(kptr->comment, 84, "%.80s", yyextra->hdr-80);
	  kptr->comment[80] = '\0';
	  nullfill(kptr->comment+80, 4);
	
	  BEGIN(FLUSH);
	}

<FLUSH>.*\n {
	  // Discard the rest of the input line.
	  kptr->keyno = ++keyno;
	
	  // Null-fill the keyword.
	  kptr->keyword[8] = '\0';
	  nullfill(kptr->keyword, 12);
	
	  // Do indexing.
	  iptr = keyids;
	  kptr->keyid = -1;
	  for (int j = 0; j < nkeyids; j++, iptr++) {
	    int k;
	    char *cptr = iptr->name;
	    cptr[8] = '\0';
	    nullfill(cptr, 12);
	    for (k = 0; k < 8; k++, cptr++) {
	      if (*cptr != '.' && *cptr != kptr->keyword[k]) break;
	    }
	
	    if (k == 8) {
	      // Found a match.
	      iptr->count++;
	      if (iptr->idx[0] == -1) {
	        iptr->idx[0] = keyno-1;
	      } else {
	        iptr->idx[1] = keyno-1;
	      }
	
	      kptr->keyno = -abs(kptr->keyno);
	      if (kptr->keyid < 0) kptr->keyid = j;
	    }
	  }
	
	  // Deal with continued strings.
	  if (continuation) {
	    // Tidy up the previous string keyvalue.
	    if ((kptr-1)->type == 8) (kptr-1)->type += 10;
	    char *cptr = (kptr-1)->keyvalue.s;
	    if (cptr[strlen(cptr)-1] == '&') cptr[strlen(cptr)-1] = '\0';
	
	    kptr->type = (kptr-1)->type + 10;
	  }
	
	  // Check for keyrecords following the END keyrecord.
	  if (end && (end++ > 1) && !blank) {
	    kptr->status |= FITSHDR_TRAILER;
	  }
	  if (kptr->status) (*nreject)++;
	
	  kptr++;
	  blank = 0;
	  continuation = 0;
	
	  BEGIN(INITIAL);
	}

<<EOF>>	{
	  // End-of-input.
	  return 0;
	}

%%

/*----------------------------------------------------------------------------
* External interface to the scanner.
*---------------------------------------------------------------------------*/

int fitshdr(
  const char header[],
  int nkeyrec,
  int nkeyids,
  struct fitskeyid keyids[],
  int *nreject,
  struct fitskey **keys)

{
  // Function prototypes.
  int yylex_init_extra(YY_EXTRA_TYPE extra, yyscan_t *yyscanner);
  int yylex_destroy(yyscan_t yyscanner);

  struct fitshdr_extra extra;
  yyscan_t yyscanner;
  yylex_init_extra(&extra, &yyscanner);
  int status = fitshdr_scanner(header, nkeyrec, nkeyids, keyids, nreject,
                               keys, yyscanner);
  yylex_destroy(yyscanner);

  return status;
}

/*----------------------------------------------------------------------------
* Pad a string with null characters.
*---------------------------------------------------------------------------*/

void nullfill(char cptr[], int len)

{
  // Propagate the terminating null to the end of the string.
  int j;
  for (j = 0; j < len; j++) {
    if (cptr[j] == '\0') {
      for (int k = j+1; k < len; k++) {
        cptr[k] = '\0';
      }
      break;
    }
  }

  // Remove trailing blanks.
  for (int k = j-1; k >= 0; k--) {
    if (cptr[k] != ' ') break;
    cptr[k] = '\0';
  }

  return;
}
@


8.6
log
@WCSLIB 8.6
@
text
@d2 1
a2 1
  WCSLIB 8.6 - an implementation of the FITS WCS standard.
d22 1
a22 1
  $Id: fitshdr.l,v 8.5.1.2 2026/03/29 13:36:16 mcalabre Exp mcalabre $
d314 1
a314 1
	      sprintf(ctmp, "%%%dd%%9d", yyleng-9);
d331 1
a331 1
	  strcpy(ctmp, yytext);
d425 1
a425 1
	  strcpy(cptr, yytext+1);
d495 1
a495 1
	  strcpy(kptr->comment, yytext);
d503 1
a503 1
	  sprintf(kptr->comment, "%.80s", yyextra->hdr-80);
@


8.6.1.1
log
@WCSLIB 8.6 development branch.
@
text
@d22 1
a22 1
  $Id: fitshdr.l,v 8.6 2026/03/29 13:53:56 mcalabre Exp $
@


8.6.1.2
log
@Replaced use of strcpy() with strncpy(), and sprintf() with snprintf().
@
text
@d22 1
a22 1
  $Id: fitshdr.l,v 8.6.1.1 2026/03/29 14:19:26 mcalabre Exp mcalabre $
d314 1
a314 1
	      snprintf(ctmp, 72, "%%%dd%%9d", yyleng-9);
d331 1
a331 1
	  strncpy(ctmp, yytext, 72);
d425 1
a425 1
	  strncpy(cptr, yytext+1, 72);
d495 1
a495 1
	  strncpy(kptr->comment, yytext, 84);
d503 1
a503 1
	  snprintf(kptr->comment, 84, "%.80s", yyextra->hdr-80);
@


8.5
log
@WCSLIB 8.5
@
text
@d2 2
a3 2
  WCSLIB 8.5 - an implementation of the FITS WCS standard.
  Copyright (C) 1995-2025, Mark Calabretta
d21 2
a22 2
  http://www.atnf.csiro.au/people/Mark.Calabretta
  $Id: fitshdr.l,v 8.4.1.2 2025/12/06 13:37:15 mcalabre Exp mcalabre $
@


8.5.1.1
log
@WCSLIB 8.5 development branch.
@
text
@d22 1
a22 1
  $Id: fitshdr.l,v 8.5 2025/12/06 13:47:41 mcalabre Exp $
@


8.5.1.2
log
@Updated date in copyright notice.
@
text
@d3 1
a3 1
  Copyright (C) 1995-2026, Mark Calabretta
d21 2
a22 2
  http://www.atnf.csiro.au/computing/software/wcs
  $Id: fitshdr.l,v 8.5.1.1 2025/12/06 14:05:15 mcalabre Exp mcalabre $
@


8.4
log
@WCSLIB 8.4
@
text
@d2 2
a3 2
  WCSLIB 8.4 - an implementation of the FITS WCS standard.
  Copyright (C) 1995-2024, Mark Calabretta
d22 1
a22 1
  $Id: fitshdr.l,v 8.3.1.1 2024/05/13 16:35:39 mcalabre Exp mcalabre $
@


8.4.1.1
log
@WCSLIB 8.4 development branch.
@
text
@d22 1
a22 1
  $Id: fitshdr.l,v 8.4 2024/10/28 13:56:16 mcalabre Exp $
@


8.4.1.2
log
@Updated date in copyright notice.
@
text
@d3 1
a3 1
  Copyright (C) 1995-2025, Mark Calabretta
d22 1
a22 1
  $Id: fitshdr.l,v 8.4.1.1 2024/10/28 13:58:41 mcalabre Exp mcalabre $
@


8.3
log
@WCSLIB 8.3
@
text
@d2 1
a2 1
  WCSLIB 8.3 - an implementation of the FITS WCS standard.
d22 1
a22 1
  $Id: fitshdr.l,v 8.2.1.2 2024/04/02 14:01:58 mcalabre Exp mcalabre $
@


8.3.1.1
log
@WCSLIB 8.3 development branch.
@
text
@d22 1
a22 1
  $Id: fitshdr.l,v 8.3 2024/05/13 16:33:00 mcalabre Exp $
@


8.2
log
@WCSLIB 8.2
@
text
@d2 2
a3 2
  WCSLIB 8.2 - an implementation of the FITS WCS standard.
  Copyright (C) 1995-2023, Mark Calabretta
d22 1
a22 1
  $Id: fitshdr.l,v 8.1.1.1 2023/07/05 17:15:00 mcalabre Exp mcalabre $
@


8.2.1.1
log
@WCSLIB 8.2 development branch.
@
text
@d22 1
a22 1
  $Id: fitshdr.l,v 8.2 2023/11/16 10:00:29 mcalabre Exp $
@


8.2.1.2
log
@Updated date in copyright notice.
@
text
@d3 1
a3 1
  Copyright (C) 1995-2024, Mark Calabretta
d22 1
a22 1
  $Id: fitshdr.l,v 8.2.1.1 2023/11/16 10:05:57 mcalabre Exp mcalabre $
@


8.1
log
@WCSLIB 8.1
@
text
@d2 1
a2 1
  WCSLIB 8.1 - an implementation of the FITS WCS standard.
d22 1
a22 1
  $Id: fitshdr.l,v 8.0.1.1 2023/07/01 06:22:44 mcalabre Exp mcalabre $
@


8.1.1.1
log
@WCSLIB 8.1 development branch.
@
text
@d22 1
a22 1
  $Id: fitshdr.l,v 8.1 2023/07/05 17:12:07 mcalabre Exp $
@


8.0
log
@WCSLIB 8.0
@
text
@d2 1
a2 1
  WCSLIB 8.0 - an implementation of the FITS WCS standard.
d22 1
a22 1
  $Id: fitshdr.l,v 7.13.1.2 2023/06/15 04:17:19 mcalabre Exp mcalabre $
@


8.0.1.1
log
@WCSLIB 8.0 development branch.
@
text
@d22 1
a22 1
  $Id: fitshdr.l,v 8.0 2023/07/01 06:15:04 mcalabre Exp $
@


7.13
log
@WCSLIB 7.13
@
text
@d2 2
a3 2
  WCSLIB 7.13 - an implementation of the FITS WCS standard.
  Copyright (C) 1995-2022, Mark Calabretta
d22 1
a22 1
  $Id: fitshdr.l,v 7.12.1.1 2022/09/09 05:00:36 mcalabre Exp mcalabre $
@


7.13.1.1
log
@WCSLIB 7.13 development branch.
@
text
@d22 1
a22 1
  $Id: fitshdr.l,v 7.13 2022/10/07 03:43:35 mcalabre Exp $
@


7.13.1.2
log
@Updated date in copyright notice.
@
text
@d3 1
a3 1
  Copyright (C) 1995-2023, Mark Calabretta
d22 1
a22 1
  $Id: fitshdr.l,v 7.13.1.1 2022/10/07 03:45:47 mcalabre Exp mcalabre $
@


7.12
log
@WCSLIB 7.12
@
text
@d2 1
a2 1
  WCSLIB 7.12 - an implementation of the FITS WCS standard.
d22 1
a22 1
  $Id: fitshdr.l,v 7.11.1.1 2022/04/26 06:15:32 mcalabre Exp mcalabre $
@


7.12.1.1
log
@WCSLIB 7.12 development branch.
@
text
@d22 1
a22 1
  $Id: fitshdr.l,v 7.12 2022/09/09 04:57:58 mcalabre Exp $
@


7.11
log
@WCSLIB 7.11
@
text
@d2 1
a2 1
  WCSLIB 7.11 - an implementation of the FITS WCS standard.
d22 1
a22 1
  $Id: fitshdr.l,v 7.10.1.1 2022/04/23 14:26:54 mcalabre Exp mcalabre $
@


7.11.1.1
log
@WCSLIB 7.11 development branch.
@
text
@d22 1
a22 1
  $Id: fitshdr.l,v 7.11 2022/04/26 06:13:52 mcalabre Exp $
@


7.10
log
@WCSLIB 7.10
@
text
@d2 1
a2 1
  WCSLIB 7.10 - an implementation of the FITS WCS standard.
d22 1
a22 1
  $Id: fitshdr.l,v 7.9.1.1 2022/03/25 15:16:40 mcalabre Exp mcalabre $
@


7.10.1.1
log
@WCSLIB 7.10 development branch.
@
text
@d22 1
a22 1
  $Id: fitshdr.l,v 7.10 2022/04/23 14:25:15 mcalabre Exp $
@


7.9
log
@WCSLIB 7.9
@
text
@d2 1
a2 1
  WCSLIB 7.9 - an implementation of the FITS WCS standard.
d22 1
a22 1
  $Id: fitshdr.l,v 7.8.1.1 2022/03/25 06:14:14 mcalabre Exp mcalabre $
@


7.9.1.1
log
@WCSLIB 7.9 development branch.
@
text
@d22 1
a22 1
  $Id: fitshdr.l,v 7.9 2022/03/25 15:14:48 mcalabre Exp $
@


7.8
log
@WCSLIB 7.8
@
text
@d2 1
a2 1
  WCSLIB 7.8 - an implementation of the FITS WCS standard.
d22 1
a22 1
  $Id: fitshdr.l,v 7.7.1.2 2022/03/25 06:05:58 mcalabre Exp mcalabre $
@


7.8.1.1
log
@WCSLIB 7.8 development branch.
@
text
@d22 1
a22 1
  $Id: fitshdr.l,v 7.8 2022/03/25 06:11:49 mcalabre Exp $
@


7.7
log
@WCSLIB 7.7
@
text
@d2 2
a3 2
  WCSLIB 7.7 - an implementation of the FITS WCS standard.
  Copyright (C) 1995-2021, Mark Calabretta
d22 1
a22 1
  $Id: fitshdr.l,v 7.6.1.1 2021/04/13 13:00:35 mcalabre Exp mcalabre $
@


7.7.1.1
log
@WCSLIB 7.7 development branch.
@
text
@d22 1
a22 1
  $Id: fitshdr.l,v 7.7 2021/07/12 06:36:49 mcalabre Exp $
@


7.7.1.2
log
@Updated date in copyright notice.
@
text
@d3 1
a3 1
  Copyright (C) 1995-2022, Mark Calabretta
d22 1
a22 1
  $Id: fitshdr.l,v 7.7.1.1 2021/07/12 06:38:27 mcalabre Exp mcalabre $
@


7.6
log
@WCSLIB 7.6
@
text
@d2 1
a2 1
  WCSLIB 7.6 - an implementation of the FITS WCS standard.
d22 1
a22 1
  $Id: fitshdr.l,v 7.5.1.1 2021/03/20 05:56:42 mcalabre Exp mcalabre $
@


7.6.1.1
log
@WCSLIB 7.6 development branch.
@
text
@d22 1
a22 1
  $Id: fitshdr.l,v 7.6 2021/04/13 12:57:01 mcalabre Exp $
@


7.5
log
@WCSLIB 7.5
@
text
@d2 1
a2 1
  WCSLIB 7.5 - an implementation of the FITS WCS standard.
d22 1
a22 1
  $Id: fitshdr.l,v 7.4.1.4 2021/02/25 13:55:05 mcalabre Exp mcalabre $
@


7.5.1.1
log
@WCSLIB 7.5 development branch.
@
text
@d22 1
a22 1
  $Id: fitshdr.l,v 7.5 2021/03/20 05:54:58 mcalabre Exp $
@


7.4
log
@WCSLIB 7.4
@
text
@d2 1
a2 1
  WCSLIB 7.4 - an implementation of the FITS WCS standard.
d22 1
a22 1
  $Id: fitshdr.l,v 7.3.1.4 2021/01/28 12:29:30 mcalabre Exp mcalabre $
d44 1
d85 9
a93 29
static int fitshdr_scanner(const char header[], int nkeyrec, int nkeyids, \
                           struct fitskeyid keyids[], int *nreject, \
                           struct fitskey **keys, yyscan_t yyscanner);

//----------------------------------------------------------------------------

int fitshdr(
  const char header[],
  int nkeyrec,
  int nkeyids,
  struct fitskeyid keyids[],
  int *nreject,
  struct fitskey **keys)

{
  int status;
  yyscan_t yyscanner;
  int yylex_init(yyscan_t *yyscanner);
  int yylex_destroy(yyscan_t yyscanner);

  yylex_init(&yyscanner);
  status = fitshdr_scanner(header, nkeyrec, nkeyids, keyids, nreject,
                           keys, yyscanner);
  yylex_destroy(yyscanner);

  return status;
}

//----------------------------------------------------------------------------
d101 2
a102 2
	  if (fitshdr_nkeyrec) { \
	    strncpy(inbuff, fitshdr_hdr, 80); \
d104 2
a105 2
	    fitshdr_hdr += 80; \
	    fitshdr_nkeyrec--; \
d112 6
a117 7
// These global variables are required by YY_INPUT.
const char *fitshdr_hdr;
int  fitshdr_nkeyrec;

// Used in preempting the call to exit() by yy_fatal_error().
jmp_buf fitshdr_abort_jmp_env;
#define exit(status) longjmp(fitshdr_abort_jmp_env, status)
d129 1
a129 12
	char *cptr, ctmp[72];
	int  blank, continuation, end, j, k, keyno;
	double dtmp;
	struct fitskey *kptr;
	struct fitskeyid *iptr;
	void nullfill(char cptr[], int len);
	
	fitshdr_hdr = header;
	fitshdr_nkeyrec = nkeyrec;
	
	*nreject = 0;
	keyno = 0;
d132 1
a132 1
	  return 1;
d137 1
d139 1
a139 1
	  return 2;
d142 3
d146 2
a147 2
	iptr = keyids;
	for (j = 0; j < nkeyids; j++, iptr++) {
d152 2
d155 23
a177 3
	blank = 0;
	continuation = 0;
	end = 0;
d180 2
a181 2
	if (setjmp(fitshdr_abort_jmp_env)) {
	  return 3;
d230 1
d288 1
d306 1
a306 1
	      if (sscanf(yytext, "%lld", &(kptr->keyvalue.k)) < 1) {
d332 1
a332 1
	  k = yyleng;
d359 1
a359 1
	      if (sscanf(yytext, "%lld", &(kptr->keyvalue.k)) < 1) {
d396 2
d424 1
a424 1
	  cptr = kptr->keyvalue.s;
d428 2
a429 2
	  k = 0;
	  for (j = 0; j < 72; j++) {
d503 1
a503 1
	  sprintf(kptr->comment, "%.80s", fitshdr_hdr-80);
d521 3
a523 2
	  for (j = 0; j < nkeyids; j++, iptr++) {
	    cptr = iptr->name;
d548 1
a548 1
	    cptr = (kptr-1)->keyvalue.s;
d574 30
a603 1
//----------------------------------------------------------------------------
d608 2
a609 3
  int j, k;

  // Null-fill the string.
d612 1
a612 1
      for (k = j+1; k < len; k++) {
d619 2
a620 1
  for (k = j-1; k >= 0; k--) {
@


7.4.1.1
log
@WCSLIB 7.4 development branch.
@
text
@d22 1
a22 1
  $Id: fitshdr.l,v 7.4 2021/01/31 02:24:51 mcalabre Exp $
@


7.4.1.2
log
@The sscanf() format descriptor for 64-bit integers must match the
WCSLIB_INT64 data type.
@
text
@d22 1
a22 1
  $Id: fitshdr.l,v 7.4.1.1 2021/01/31 02:26:24 mcalabre Exp mcalabre $
a148 1
	const char *int64fmt;
d163 1
a163 1
	  return FITSHDRERR_NULL_POINTER;
d169 1
a169 1
	  return FITSHDRERR_MEMORY;
a183 14
	#ifdef WCSLIB_INT64
	  #define asString(S) stringize(S)
	  #define stringize(S) #S
	  if (strcmp(asString(WCSLIB_INT64), "long long int") == 0) {
	    int64fmt = "%lld";
	  } else if (strcmp(asString(WCSLIB_INT64), "long int") == 0) {
	    int64fmt = "%ld";
	  } else if (strcmp(asString(WCSLIB_INT64), "int") == 0) {
	    int64fmt = "%d";
	  } else {
	    return FITSHDRERR_DATA_TYPE;
	  }
	#endif
	
d186 1
a186 1
	  return FITSHDRERR_FLEX_PARSER;
d309 1
a309 1
	      if (sscanf(yytext, int64fmt, &(kptr->keyvalue.k)) < 1) {
d362 1
a362 1
	      if (sscanf(yytext, int64fmt, &(kptr->keyvalue.k)) < 1) {
@


7.4.1.3
log
@Use of global variables (fitshdr_hdr, fitshdr_nkeyrec, and
fitshdr_abort_jmp_env) made the code thread-unsafe.  Modified to use
the yyextra mechanism instead.
@
text
@d22 1
a22 1
  $Id: fitshdr.l,v 7.4.1.2 2021/02/23 04:44:02 mcalabre Exp mcalabre $
a43 1
%option extra-type="struct fitshdr_extra *"
d84 29
a112 9
// User data associated with yyscanner.
struct fitshdr_extra {
  // Values passed to YY_INPUT.
  const char *hdr;
  int  nkeyrec;

  // Used in preempting the call to exit() by yy_fatal_error().
  jmp_buf abort_jmp_env;
};
d120 2
a121 2
	  if (yyextra->nkeyrec) { \
	    strncpy(inbuff, yyextra->hdr, 80); \
d123 2
a124 2
	    yyextra->hdr += 80; \
	    yyextra->nkeyrec--; \
d131 7
a137 6
// Preempt the call to exit() by yy_fatal_error().
#define exit(status) longjmp(yyextra->abort_jmp_env, status);

// Internal helper functions.
static YY_DECL;
static void nullfill(char cptr[], int len);
d157 3
a198 4
	// User data associated with yyscanner.
	yyextra->hdr = header;
	yyextra->nkeyrec = nkeyrec;
	
d200 1
a200 1
	if (setjmp(yyextra->abort_jmp_env)) {
d519 1
a519 1
	  sprintf(kptr->comment, "%.80s", yyextra->hdr-80);
d589 1
a589 30
/*----------------------------------------------------------------------------
* External interface to the scanner.
*---------------------------------------------------------------------------*/

int fitshdr(
  const char header[],
  int nkeyrec,
  int nkeyids,
  struct fitskeyid keyids[],
  int *nreject,
  struct fitskey **keys)

{
  // Function prototypes.
  int yylex_init_extra(YY_EXTRA_TYPE extra, yyscan_t *yyscanner);
  int yylex_destroy(yyscan_t yyscanner);

  struct fitshdr_extra extra;
  yyscan_t yyscanner;
  yylex_init_extra(&extra, &yyscanner);
  int status = fitshdr_scanner(header, nkeyrec, nkeyids, keyids, nreject,
                               keys, yyscanner);
  yylex_destroy(yyscanner);

  return status;
}

/*----------------------------------------------------------------------------
* Pad a string with null characters.
*---------------------------------------------------------------------------*/
@


7.4.1.4
log
@Converted to C99-style intermingled variable declarations.
@
text
@d22 1
a22 1
  $Id: fitshdr.l,v 7.4.1.3 2021/02/25 13:41:02 mcalabre Exp mcalabre $
d129 10
a138 1
	char ctmp[72];
a145 1
	struct fitskey *kptr;
a149 3
	// Initialize returned values.
	*nreject = 0;
	
d151 2
a152 2
	struct fitskeyid *iptr = keyids;
	for (int j = 0; j < nkeyids; j++, iptr++) {
a156 2

	int keyno = 0;
d158 3
a160 3
	int blank = 0;
	int continuation = 0;
	int end = 0;
a164 2
	
	  const char *int64fmt;
a230 1
	    int k;
a287 1
	  double dtmp;
d331 1
a331 1
	  int j, k = yyleng;
a394 2
	  char *cptr;
	  int k;
d421 1
a421 1
	  char *cptr = kptr->keyvalue.s;
d425 2
a426 2
	  int k = 0;
	  for (int j = 0; j < 72; j++) {
d518 2
a519 3
	  for (int j = 0; j < nkeyids; j++, iptr++) {
	    int k;
	    char *cptr = iptr->name;
d544 1
a544 1
	    char *cptr = (kptr-1)->keyvalue.s;
d604 3
a606 2
  // Propagate the terminating null to the end of the string.
  int j;
d609 1
a609 1
      for (int k = j+1; k < len; k++) {
d616 1
a616 2
  // Remove trailing blanks.
  for (int k = j-1; k >= 0; k--) {
@


7.3
log
@WCSLIB 7.3
@
text
@d2 2
a3 3

  WCSLIB 7.3 - an implementation of the FITS WCS standard.
  Copyright (C) 1995-2020, Mark Calabretta
a19 2
  Direct correspondence concerning WCSLIB to mark@@calabretta.id.au

d22 1
a22 1
  $Id: fitshdr.l,v 7.2.1.1 2020/03/09 07:34:50 mcalabre Exp mcalabre $
d88 1
a88 1
/*--------------------------------------------------------------------------*/
d112 1
a112 1
/*--------------------------------------------------------------------------*/
d131 1
a131 1
/* These global variables are required by YY_INPUT. */
d135 1
a135 1
/* Used in preempting the call to exit() by yy_fatal_error(). */
d139 1
a139 1
/* Map status return value to message. */
d166 2
a167 2
	/* Allocate memory for the required number of fitskey structs. */
	/* Recall that calloc() initializes allocated memory to zero.  */
d172 1
a172 1
	/* Initialize keyids[]. */
d184 1
a184 1
	/* Return here via longjmp() invoked by yy_fatal_error(). */
d192 1
a192 1
	  /* A completely blank keyrecord. */
d211 1
a211 1
	  /* Illegal END keyrecord. */
d218 1
a218 1
	  /* Illegal END keyrecord. */
d230 1
a230 1
	  /* Continued string keyvalue. */
d234 1
a234 1
	    /* Put back the string keyvalue. */
d241 1
a241 1
	    /* Not a valid continuation. */
d248 1
a248 1
	  /* Keyword without value. */
d254 1
a254 1
	  /* Illegal keyword, carry on regardless. */
d261 1
a261 1
	  /* Illegal keyword, carry on regardless. */
d268 1
a268 1
	  /* Null keyvalue. */
d273 1
a273 1
	  /* Logical keyvalue. */
d280 1
a280 1
	  /* 32-bit signed integer keyvalue. */
d291 1
a291 1
	  /* 64-bit signed integer keyvalue (up to 18 digits). */
d297 1
a297 1
	    /* Can be accomodated as a 32-bit signed integer. */
d305 1
a305 1
	    /* 64-bit signed integer. */
d308 1
a308 1
	      /* Native 64-bit integer is available. */
d314 1
a314 1
	      /* 64-bit integer (up to 18 digits) implemented as int[3]. */
d332 1
a332 1
	  /* Very long integer keyvalue (and 19-digit int64). */
d337 1
a337 1
	    /* Read it backwards. */
d352 1
a352 1
	  /* Can it be accomodated as a 64-bit signed integer? */
d360 1
a360 1
	      /* Native 64-bit integer is available. */
d373 1
a373 1
	  /* Float keyvalue. */
d384 1
a384 1
	  /* Integer complex keyvalue. */
d396 1
a396 1
	  /* Floating point complex keyvalue. */
d423 1
a423 1
	  /* String keyvalue. */
d428 1
a428 1
	  /* Squeeze out repeated quotes. */
d446 1
a446 1
	    /* Retain the initial blank in all-blank strings. */
d478 1
a478 1
	  /* Keyvalue parsing must now also be suspect. */
d512 1
a512 1
	  /* Discard the rest of the input line. */
d515 1
a515 1
	  /* Null-fill the keyword. */
d519 1
a519 1
	  /* Do indexing. */
d531 1
a531 1
	      /* Found a match. */
d544 1
a544 1
	  /* Deal with continued strings. */
d546 1
a546 1
	    /* Tidy up the previous string keyvalue. */
d554 1
a554 1
	  /* Check for keyrecords following the END keyrecord. */
d568 1
a568 1
	  /* End-of-input. */
d574 1
a574 1
/*--------------------------------------------------------------------------*/
d581 1
a581 1
  /* Null-fill the string. */
@


7.3.1.1
log
@WCSLIB 7.3 development branch.
@
text
@d25 1
a25 1
  $Id: fitshdr.l,v 7.3 2020/06/03 03:37:02 mcalabre Exp $
@


7.3.1.2
log
@Switched to C99 style commenting (i.e. using //) within the code.
@
text
@d2 1
d25 1
a25 1
  $Id: fitshdr.l,v 7.3.1.1 2020/06/03 03:38:10 mcalabre Exp mcalabre $
d91 1
a91 1
//----------------------------------------------------------------------------
d115 1
a115 1
//----------------------------------------------------------------------------
d134 1
a134 1
// These global variables are required by YY_INPUT.
d138 1
a138 1
// Used in preempting the call to exit() by yy_fatal_error().
d142 1
a142 1
// Map status return value to message.
d169 2
a170 2
	// Allocate memory for the required number of fitskey structs.
	// Recall that calloc() initializes allocated memory to zero.
d175 1
a175 1
	// Initialize keyids[].
d187 1
a187 1
	// Return here via longjmp() invoked by yy_fatal_error().
d195 1
a195 1
	  // A completely blank keyrecord.
d214 1
a214 1
	  // Illegal END keyrecord.
d221 1
a221 1
	  // Illegal END keyrecord.
d233 1
a233 1
	  // Continued string keyvalue.
d237 1
a237 1
	    // Put back the string keyvalue.
d244 1
a244 1
	    // Not a valid continuation.
d251 1
a251 1
	  // Keyword without value.
d257 1
a257 1
	  // Illegal keyword, carry on regardless.
d264 1
a264 1
	  // Illegal keyword, carry on regardless.
d271 1
a271 1
	  // Null keyvalue.
d276 1
a276 1
	  // Logical keyvalue.
d283 1
a283 1
	  // 32-bit signed integer keyvalue.
d294 1
a294 1
	  // 64-bit signed integer keyvalue (up to 18 digits).
d300 1
a300 1
	    // Can be accomodated as a 32-bit signed integer.
d308 1
a308 1
	    // 64-bit signed integer.
d311 1
a311 1
	      // Native 64-bit integer is available.
d317 1
a317 1
	      // 64-bit integer (up to 18 digits) implemented as int[3].
d335 1
a335 1
	  // Very long integer keyvalue (and 19-digit int64).
d340 1
a340 1
	    // Read it backwards.
d355 1
a355 1
	  // Can it be accomodated as a 64-bit signed integer?
d363 1
a363 1
	      // Native 64-bit integer is available.
d376 1
a376 1
	  // Float keyvalue.
d387 1
a387 1
	  // Integer complex keyvalue.
d399 1
a399 1
	  // Floating point complex keyvalue.
d426 1
a426 1
	  // String keyvalue.
d431 1
a431 1
	  // Squeeze out repeated quotes.
d449 1
a449 1
	    // Retain the initial blank in all-blank strings.
d481 1
a481 1
	  // Keyvalue parsing must now also be suspect.
d515 1
a515 1
	  // Discard the rest of the input line.
d518 1
a518 1
	  // Null-fill the keyword.
d522 1
a522 1
	  // Do indexing.
d534 1
a534 1
	      // Found a match.
d547 1
a547 1
	  // Deal with continued strings.
d549 1
a549 1
	    // Tidy up the previous string keyvalue.
d557 1
a557 1
	  // Check for keyrecords following the END keyrecord.
d571 1
a571 1
	  // End-of-input.
d577 1
a577 1
//----------------------------------------------------------------------------
d584 1
a584 1
  // Null-fill the string.
@


7.3.1.3
log
@Updated date in copyright notice.
@
text
@d3 1
a3 1
  Copyright (C) 1995-2021, Mark Calabretta
d24 1
a24 1
  $Id: fitshdr.l,v 7.3.1.2 2020/08/17 11:19:09 mcalabre Exp mcalabre $
@


7.3.1.4
log
@Removed my email address from the copyright notice.
@
text
@d20 2
d24 1
a24 1
  $Id: fitshdr.l,v 7.3.1.3 2021/01/19 14:09:10 mcalabre Exp mcalabre $
@


7.2
log
@WCSLIB 7.2
@
text
@d3 1
a3 1
  WCSLIB 7.2 - an implementation of the FITS WCS standard.
d25 1
a25 1
  $Id: fitshdr.l,v 7.1.1.1 2019/12/31 13:28:19 mcalabre Exp mcalabre $
@


7.2.1.1
log
@WCSLIB 7.2 development branch.
@
text
@d25 1
a25 1
  $Id: fitshdr.l,v 7.2 2020/03/09 07:31:23 mcalabre Exp $
@


7.1
log
@WCSLIB 7.1
@
text
@d3 1
a3 1
  WCSLIB 7.1 - an implementation of the FITS WCS standard.
d25 1
a25 1
  $Id: fitshdr.l,v 6.4.1.2 2019/12/31 03:28:03 mcalabre Exp mcalabre $
@


7.1.1.1
log
@WCSLIB 7.1 development branch.
@
text
@d25 1
a25 1
  $Id: fitshdr.l,v 7.1 2019/12/31 13:25:19 mcalabre Exp $
@


6.4
log
@WCSLIB 6.4
@
text
@d3 2
a4 2
  WCSLIB 6.4 - an implementation of the FITS WCS standard.
  Copyright (C) 1995-2019, Mark Calabretta
d25 1
a25 1
  $Id: fitshdr.l,v 6.3.1.1 2019/07/12 07:34:37 mcalabre Exp mcalabre $
@


6.4.1.1
log
@WCSLIB 6.4 development branch.
@
text
@d25 1
a25 1
  $Id: fitshdr.l,v 6.4 2019/08/15 09:30:18 mcalabre Exp $
@


6.4.1.2
log
@Updated date in copyright notice.
@
text
@d4 1
a4 1
  Copyright (C) 1995-2020, Mark Calabretta
d25 1
a25 1
  $Id: fitshdr.l,v 6.4.1.1 2019/08/15 09:31:29 mcalabre Exp mcalabre $
@


6.3
log
@WCSLIB 6.3
@
text
@d3 1
a3 1
  WCSLIB 6.3 - an implementation of the FITS WCS standard.
d25 1
a25 1
  $Id: fitshdr.l,v 6.2.1.3 2019/07/08 08:02:29 mcalabre Exp mcalabre $
@


6.3.1.1
log
@WCSLIB 6.3 development branch.
@
text
@d25 1
a25 1
  $Id: fitshdr.l,v 6.3 2019/07/12 07:33:39 mcalabre Exp $
@


6.2
log
@WCSLIB 6.2
@
text
@d3 2
a4 2
  WCSLIB 6.2 - an implementation of the FITS WCS standard.
  Copyright (C) 1995-2018, Mark Calabretta
d25 1
a25 1
  $Id: fitshdr.l,v 6.1.1.1 2018/10/19 08:36:15 mcalabre Exp mcalabre $
d41 1
@


6.2.1.1
log
@WCSLIB 6.2 development branch.
@
text
@d25 1
a25 1
  $Id: fitshdr.l,v 6.2 2018/10/20 10:03:13 mcalabre Exp $
@


6.2.1.2
log
@Updated date in copyright notice.
@
text
@d4 1
a4 1
  Copyright (C) 1995-2019, Mark Calabretta
d25 1
a25 1
  $Id: fitshdr.l,v 6.2.1.1 2018/10/20 10:04:15 mcalabre Exp mcalabre $
@


6.2.1.3
log
@Set '%option noinput' to quench -Wunused-function compiler warnings that
arise from not using flex's input() function.
@
text
@d25 1
a25 1
  $Id: fitshdr.l,v 6.2.1.3 2019/07/08 06:55:39 mcalabre Exp mcalabre $
a40 1
%option noinput
@


6.1
log
@WCSLIB 6.1
@
text
@d3 1
a3 1
  WCSLIB 6.1 - an implementation of the FITS WCS standard.
d25 1
a25 1
  $Id: fitshdr.l,v 5.20.1.1 2018/10/05 05:33:33 mcalabre Exp mcalabre $
@


6.1.1.1
log
@WCSLIB 6.1 development branch.
@
text
@d25 1
a25 1
  $Id: fitshdr.l,v 6.1 2018/10/19 08:35:17 mcalabre Exp $
@


5.20
log
@WCSLIB 5.20
@
text
@d3 1
a3 1
  WCSLIB 5.20 - an implementation of the FITS WCS standard.
d25 1
a25 1
  $Id: fitshdr.l,v 5.19.1.1 2018/07/26 15:41:40 mcalabre Exp mcalabre $
@


5.20.1.1
log
@WCSLIB 5.20 development branch.
@
text
@d25 1
a25 1
  $Id: fitshdr.l,v 5.20 2018/10/05 05:32:41 mcalabre Exp $
@


5.19
log
@WCSLIB 5.19
@
text
@d3 1
a3 1
  WCSLIB 5.19 - an implementation of the FITS WCS standard.
d25 1
a25 1
  $Id: fitshdr.l,v 5.18.1.1 2018/01/10 08:33:04 mcalabre Exp mcalabre $
@


5.19.1.1
log
@WCSLIB 5.19 development branch.
@
text
@d25 1
a25 1
  $Id: fitshdr.l,v 5.19 2018/07/26 15:37:04 mcalabre Exp $
@


5.18
log
@WCSLIB 5.18
@
text
@d3 1
a3 1
  WCSLIB 5.18 - an implementation of the FITS WCS standard.
d25 1
a25 1
  $Id: fitshdr.l,v 5.17.1.3 2018/01/10 08:25:34 mcalabre Exp mcalabre $
@


5.18.1.1
log
@WCSLIB 5.18 development branch.
@
text
@d25 1
a25 1
  $Id: fitshdr.l,v 5.18 2018/01/10 08:32:14 mcalabre Exp $
@


5.17
log
@WCSLIB 5.17
@
text
@d3 2
a4 2
  WCSLIB 5.17 - an implementation of the FITS WCS standard.
  Copyright (C) 1995-2017, Mark Calabretta
d25 1
a25 1
  $Id: fitshdr.l,v 5.16.1.2 2017/09/12 13:30:44 mcalabre Exp mcalabre $
d45 1
d86 33
a118 3
#define YY_DECL int fitshdr(const char header[], int nkeyrec, int nkeyids, \
                            struct fitskeyid keyids[], int *nreject, \
                            struct fitskey **keys)
a156 1
	int  yylex_destroy(void);
a570 1
	  yylex_destroy();
@


5.17.1.1
log
@WCSLIB 5.17 development branch.
@
text
@d25 1
a25 1
  $Id: fitshdr.l,v 5.17 2017/09/18 08:44:23 mcalabre Exp $
@


5.17.1.2
log
@Implemented as a reentrant scanner (with the same API) by means of a thin
wrapper over the original Flex scanner modified as required (with changed
API) to use the "reentrant" option.
@
text
@d25 1
a25 1
  $Id: fitshdr.l,v 5.17.1.1 2017/09/18 08:45:59 mcalabre Exp mcalabre $
a44 1
%option reentrant
d85 3
a87 33
static int fitshdr_scanner(const char header[], int nkeyrec, int nkeyids, \
                           struct fitskeyid keyids[], int *nreject, \
                           struct fitskey **keys, yyscan_t yyscanner);

/*--------------------------------------------------------------------------*/

int fitshdr(
  const char header[],
  int nkeyrec,
  int nkeyids,
  struct fitskeyid keyids[],
  int *nreject,
  struct fitskey **keys)

{
  int status;
  yyscan_t yyscanner;
  int yylex_init(yyscan_t *yyscanner);
  int yylex_destroy(yyscan_t yyscanner);

  yylex_init(&yyscanner);
  status = fitshdr_scanner(header, nkeyrec, nkeyids, keyids, nreject,
                           keys, yyscanner);
  yylex_destroy(yyscanner);

  return status;
}

/*--------------------------------------------------------------------------*/

#define YY_DECL int fitshdr_scanner(const char header[], int nkeyrec, \
  int nkeyids, struct fitskeyid keyids[], int *nreject, \
  struct fitskey **keys, yyscan_t yyscanner)
d126 1
d541 1
@


5.17.1.3
log
@Updated date in copyright notice.
@
text
@d4 1
a4 1
  Copyright (C) 1995-2018, Mark Calabretta
d25 1
a25 1
  $Id: fitshdr.l,v 5.17.1.2 2017/12/05 01:38:46 mcalabre Exp mcalabre $
@


5.16
log
@WCSLIB 5.16
@
text
@d3 1
a3 1
  WCSLIB 5.16 - an implementation of the FITS WCS standard.
d25 1
a25 1
  $Id: fitshdr.l,v 5.15.1.2 2017/01/15 04:14:00 mcalabre Exp mcalabre $
d264 1
a264 1
	  if (wcsutil_str2double(yytext, "%lf", &dtmp)) {
d347 1
a347 1
	  if (wcsutil_str2double(yytext, "%lf", &(kptr->keyvalue.f))) {
d376 1
a376 1
	  if (wcsutil_str2double(ctmp, "%lf", kptr->keyvalue.c)) {
d386 1
a386 1
	  if (wcsutil_str2double(ctmp, "%lf", kptr->keyvalue.c+1)) {
@


5.16.1.1
log
@WCSLIB 5.16 development branch.
@
text
@d25 1
a25 1
  $Id: fitshdr.l,v 5.16 2017/01/15 04:25:01 mcalabre Exp $
@


5.16.1.2
log
@Revised argument list to wcsutil_str2double().
@
text
@d25 1
a25 1
  $Id: fitshdr.l,v 5.16.1.1 2017/01/15 04:28:59 mcalabre Exp mcalabre $
d264 1
a264 1
	  if (wcsutil_str2double(yytext, &dtmp)) {
d347 1
a347 1
	  if (wcsutil_str2double(yytext, &(kptr->keyvalue.f))) {
d376 1
a376 1
	  if (wcsutil_str2double(ctmp, kptr->keyvalue.c)) {
d386 1
a386 1
	  if (wcsutil_str2double(ctmp, kptr->keyvalue.c+1)) {
@


5.15
log
@WCSLIB 5.15
@
text
@d3 2
a4 2
  WCSLIB 5.15 - an implementation of the FITS WCS standard.
  Copyright (C) 1995-2016, Mark Calabretta
d25 1
a25 1
  $Id: fitshdr.l,v 5.14.1.1 2016/02/07 10:52:44 mcalabre Exp mcalabre $
@


5.15.1.1
log
@WCSLIB 5.15 development branch.
@
text
@d25 1
a25 1
  $Id: fitshdr.l,v 5.15 2016/04/05 12:55:10 mcalabre Exp $
@


5.15.1.2
log
@Updated date in copyright notice.
@
text
@d4 1
a4 1
  Copyright (C) 1995-2017, Mark Calabretta
d25 1
a25 1
  $Id: fitshdr.l,v 5.15.1.1 2016/04/05 12:58:35 mcalabre Exp mcalabre $
@


5.14
log
@WCSLIB 5.14
@
text
@d3 1
a3 1
  WCSLIB 5.14 - an implementation of the FITS WCS standard.
d25 1
a25 1
  $Id: fitshdr.l,v 5.13.1.1 2016/01/26 08:54:32 mcalabre Exp mcalabre $
@


5.14.1.1
log
@WCSLIB 5.14 development branch.
@
text
@d25 1
a25 1
  $Id: fitshdr.l,v 5.14 2016/02/07 10:49:31 mcalabre Exp $
@


5.13
log
@WCSLIB 5.13
@
text
@d3 1
a3 1
  WCSLIB 5.13 - an implementation of the FITS WCS standard.
d25 1
a25 1
  $Id: fitshdr.l,v 5.12.1.2 2016/01/25 05:17:04 mcalabre Exp mcalabre $
@


5.13.1.1
log
@WCSLIB 5.13 development branch.
@
text
@d25 1
a25 1
  $Id: fitshdr.l,v 5.13 2016/01/26 08:51:13 mcalabre Exp $
@


5.12
log
@WCSLIB 5.12
@
text
@d3 2
a4 2
  WCSLIB 5.12 - an implementation of the FITS WCS standard.
  Copyright (C) 1995-2015, Mark Calabretta
d25 1
a25 1
  $Id: fitshdr.l,v 5.11.1.1 2015/10/18 09:16:27 mcalabre Exp mcalabre $
@


5.12.1.1
log
@WCSLIB 5.12 development branch.
@
text
@d25 1
a25 1
  $Id: fitshdr.l,v 5.12 2015/11/15 02:13:00 mcalabre Exp $
@


5.12.1.2
log
@Updated date in copyright notice.
@
text
@d4 1
a4 1
  Copyright (C) 1995-2016, Mark Calabretta
d25 1
a25 1
  $Id: fitshdr.l,v 5.12.1.1 2015/11/15 02:16:14 mcalabre Exp mcalabre $
@


5.11
log
@WCSLIB 5.11
@
text
@d3 1
a3 1
  WCSLIB 5.11 - an implementation of the FITS WCS standard.
d25 1
a25 1
  $Id: fitshdr.l,v 5.10.1.1 2015/10/09 08:22:35 mcalabre Exp mcalabre $
@


5.11.1.1
log
@WCSLIB 5.11 development branch.
@
text
@d25 1
a25 1
  $Id: fitshdr.l,v 5.11 2015/10/18 09:13:05 mcalabre Exp $
@


5.10
log
@WCSLIB 5.10
@
text
@d3 1
a3 1
  WCSLIB 5.10 - an implementation of the FITS WCS standard.
d25 1
a25 1
  $Id: fitshdr.l,v 5.9.1.1 2015/07/21 09:28:07 mcalabre Exp mcalabre $
@


5.10.1.1
log
@WCSLIB 5.10 development branch.
@
text
@d25 1
a25 1
  $Id: fitshdr.l,v 5.10 2015/10/09 08:19:15 mcalabre Exp $
@


5.9
log
@WCSLIB 5.9
@
text
@d3 1
a3 1
  WCSLIB 5.9 - an implementation of the FITS WCS standard.
d25 1
a25 1
  $Id: fitshdr.l,v 5.8.1.1 2015/07/08 11:07:18 mcalabre Exp mcalabre $
@


5.9.1.1
log
@WCSLIB 5.9 development branch.
@
text
@d25 1
a25 1
  $Id: fitshdr.l,v 5.9 2015/07/21 09:20:01 mcalabre Exp $
@


5.8
log
@WCSLIB 5.8
@
text
@d3 1
a3 1
  WCSLIB 5.8 - an implementation of the FITS WCS standard.
d25 1
a25 1
  $Id: fitshdr.l,v 5.7.1.1 2015/06/29 02:47:24 mcalabre Exp mcalabre $
@


5.8.1.1
log
@WCSLIB 5.8 development branch.
@
text
@d25 1
a25 1
  $Id: fitshdr.l,v 5.8 2015/07/08 11:03:59 mcalabre Exp $
@


5.7
log
@WCSLIB 5.7
@
text
@d3 1
a3 1
  WCSLIB 5.7 - an implementation of the FITS WCS standard.
d25 1
a25 1
  $Id: fitshdr.l,v 5.6.1.1 2015/06/14 07:14:44 mcalabre Exp mcalabre $
@


5.7.1.1
log
@WCSLIB 5.7 development branch.
@
text
@d25 1
a25 1
  $Id: fitshdr.l,v 5.7 2015/06/29 02:44:16 mcalabre Exp $
@


5.6
log
@WCSLIB 5.6
@
text
@d3 1
a3 1
  WCSLIB 5.6 - an implementation of the FITS WCS standard.
d25 1
a25 1
  $Id: fitshdr.l,v 5.5.1.1 2015/05/05 13:21:00 mcalabre Exp mcalabre $
@


5.6.1.1
log
@WCSLIB 5.6 development branch.
@
text
@d25 1
a25 1
  $Id: fitshdr.l,v 5.6 2015/06/14 07:11:24 mcalabre Exp $
@


5.5
log
@WCSLIB 5.5
@
text
@d3 1
a3 1
  WCSLIB 5.5 - an implementation of the FITS WCS standard.
d25 1
a25 1
  $Id: fitshdr.l,v 5.4.1.1 2015/04/21 14:44:28 mcalabre Exp mcalabre $
@


5.5.1.1
log
@WCSLIB 5.5 development branch.
@
text
@d25 1
a25 1
  $Id: fitshdr.l,v 5.5 2015/05/05 13:16:31 mcalabre Exp $
@


5.4
log
@WCSLIB 5.4
@
text
@d3 1
a3 1
  WCSLIB 5.4 - an implementation of the FITS WCS standard.
d25 1
a25 1
  $Id: fitshdr.l,v 5.3.1.1 2015/04/21 02:54:02 mcalabre Exp mcalabre $
@


5.4.1.1
log
@WCSLIB 5.4 development branch.
@
text
@d25 1
a25 1
  $Id: fitshdr.l,v 5.4 2015/04/21 14:41:05 mcalabre Exp $
@


5.3
log
@WCSLIB 5.3
@
text
@d3 1
a3 1
  WCSLIB 5.3 - an implementation of the FITS WCS standard.
d25 1
a25 1
  $Id: fitshdr.l,v 5.2.1.1 2015/04/15 12:39:14 mcalabre Exp mcalabre $
@


5.3.1.1
log
@WCSLIB 5.3 development branch.
@
text
@d25 1
a25 1
  $Id: fitshdr.l,v 5.3 2015/04/21 02:50:51 mcalabre Exp $
@


5.2
log
@WCSLIB 5.2
@
text
@d3 1
a3 1
  WCSLIB 5.2 - an implementation of the FITS WCS standard.
d25 1
a25 1
  $Id: fitshdr.l,v 5.1.1.1 2015/04/07 11:01:10 mcalabre Exp mcalabre $
@


5.2.1.1
log
@WCSLIB 5.2 development branch.
@
text
@d25 1
a25 1
  $Id: fitshdr.l,v 5.2 2015/04/15 12:35:07 mcalabre Exp $
@


5.1
log
@WCSLIB 5.1
@
text
@d3 1
a3 1
  WCSLIB 5.1 - an implementation of the FITS WCS standard.
d25 1
a25 1
  $Id: fitshdr.l,v 5.0.1.1 2015/04/05 12:28:00 mcalabre Exp mcalabre $
@


5.1.1.1
log
@WCSLIB 5.1 development branch.
@
text
@d25 1
a25 1
  $Id: fitshdr.l,v 5.1 2015/04/07 10:56:36 mcalabre Exp $
@


5.0
log
@WCSLIB 5.0
@
text
@d3 1
a3 1
  WCSLIB 5.0 - an implementation of the FITS WCS standard.
d25 1
a25 1
  $Id: fitshdr.l,v 4.25.1.3 2015/03/13 06:43:58 mcalabre Exp mcalabre $
@


5.0.1.1
log
@WCSLIB 5.0 development branch.
@
text
@d25 1
a25 1
  $Id: fitshdr.l,v 5.0 2015/04/05 12:24:59 mcalabre Exp $
@


4.25
log
@WCSLIB 4.25
@
text
@d3 2
a4 2
  WCSLIB 4.25 - an implementation of the FITS WCS standard.
  Copyright (C) 1995-2014, Mark Calabretta
d25 1
a25 1
  $Id: fitshdr.l,v 4.24.1.1 2014/09/18 15:28:09 mcalabre Exp mcalabre $
d64 1
a64 1
FLOAT	[+-]?([0-9]+\.?[0-9]*|\.[0-9]+)([eE][+-]?[0-9]+)?
@


4.25.1.1
log
@WCSLIB 4.25 development branch.
@
text
@d25 1
a25 1
  $Id: fitshdr.l,v 4.25 2014/12/14 14:29:36 mcalabre Exp $
@


4.25.1.2
log
@Updated date in copyright notice.
@
text
@d4 1
a4 1
  Copyright (C) 1995-2015, Mark Calabretta
d25 1
a25 1
  $Id: fitshdr.l,v 4.25.1.1 2014/12/14 14:32:45 mcalabre Exp mcalabre $
@


4.25.1.3
log
@Allow 'D' and also 'd' (non-standard) to be used to demark the exponent in
floating point numbers.
@
text
@d25 1
a25 1
  $Id: fitshdr.l,v 4.25.1.2 2015/01/06 01:01:06 mcalabre Exp mcalabre $
d64 1
a64 1
FLOAT	[+-]?([0-9]+\.?[0-9]*|\.[0-9]+)([eEdD][+-]?[0-9]+)?
@


4.24
log
@WCSLIB 4.24
@
text
@d3 1
a3 1
  WCSLIB 4.24 - an implementation of the FITS WCS standard.
d25 1
a25 1
  $Id: fitshdr.l,v 4.23.1.1 2014/05/13 05:53:49 mcalabre Exp mcalabre $
@


4.24.1.1
log
@WCSLIB 4.24 development branch.
@
text
@d25 1
a25 1
  $Id: fitshdr.l,v 4.24 2014/09/18 15:25:00 mcalabre Exp $
@


4.23
log
@WCSLIB 4.23
@
text
@d3 1
a3 1
  WCSLIB 4.23 - an implementation of the FITS WCS standard.
d25 1
a25 1
  $Id: fitshdr.l,v 4.22.1.1 2014/04/12 15:06:32 mcalabre Exp mcalabre $
@


4.23.1.1
log
@WCSLIB 4.23 development branch.
@
text
@d25 1
a25 1
  $Id: fitshdr.l,v 4.23 2014/05/13 05:50:51 mcalabre Exp $
@


4.22
log
@WCSLIB 4.22
@
text
@d3 1
a3 1
  WCSLIB 4.22 - an implementation of the FITS WCS standard.
d25 1
a25 1
  $Id: fitshdr.l,v 4.21.1.1 2014/03/24 05:15:28 mcalabre Exp mcalabre $
@


4.22.1.1
log
@WCSLIB 4.22 development branch.
@
text
@d25 1
a25 1
  $Id: fitshdr.l,v 4.22 2014/04/12 15:03:52 mcalabre Exp $
@


4.21
log
@WCSLIB 4.21
@
text
@d3 1
a3 1
  WCSLIB 4.21 - an implementation of the FITS WCS standard.
d25 1
a25 1
  $Id: fitshdr.l,v 4.20.1.2 2014/03/21 06:32:19 mcalabre Exp mcalabre $
@


4.21.1.1
log
@WCSLIB 4.21 development branch.
@
text
@d25 1
a25 1
  $Id: fitshdr.l,v 4.21 2014/03/24 05:12:27 mcalabre Exp $
@


4.20
log
@WCSLIB 4.20
@
text
@d3 2
a4 2
  WCSLIB 4.20 - an implementation of the FITS WCS standard.
  Copyright (C) 1995-2013, Mark Calabretta
d25 1
a25 1
  $Id: fitshdr.l,v 4.19.1.1 2013/09/29 14:20:38 mcalabre Exp mcalabre $
@


4.20.1.1
log
@WCSLIB 4.20 development branch.
@
text
@d25 1
a25 1
  $Id: fitshdr.l,v 4.20 2013/12/18 05:42:49 mcalabre Exp $
@


4.20.1.2
log
@Updated date in copyright notice.
@
text
@d4 1
a4 1
  Copyright (C) 1995-2014, Mark Calabretta
d25 1
a25 1
  $Id: fitshdr.l,v 4.20.1.1 2013/12/18 05:46:55 mcalabre Exp mcalabre $
@


4.19
log
@WCSLIB 4.19
@
text
@d3 1
a3 1
  WCSLIB 4.19 - an implementation of the FITS WCS standard.
d25 1
a25 1
  $Id: fitshdr.l,v 4.18.1.1 2013/07/13 10:02:37 mcalabre Exp mcalabre $
@


4.19.1.1
log
@WCSLIB 4.19 development branch.
@
text
@d25 1
a25 1
  $Id: fitshdr.l,v 4.19 2013/09/29 14:17:51 mcalabre Exp $
@


4.18
log
@WCSLIB 4.18
@
text
@d3 1
a3 1
  WCSLIB 4.18 - an implementation of the FITS WCS standard.
d25 1
a25 1
  $Id: fitshdr.l,v 4.17.1.1 2013/01/29 05:32:32 cal103 Exp cal103 $
@


4.18.1.1
log
@WCSLIB 4.18 development branch.
@
text
@d25 1
a25 1
  $Id: fitshdr.l,v 4.18 2013/07/13 10:00:04 mcalabre Exp $
@


4.17
log
@WCSLIB 4.17
@
text
@d3 1
a3 1
  WCSLIB 4.17 - an implementation of the FITS WCS standard.
d25 1
a25 1
  $Id: fitshdr.l,v 4.16.1.2 2013/01/29 05:09:44 cal103 Exp cal103 $
@


4.17.1.1
log
@WCSLIB 4.17 development branch.
@
text
@d25 1
a25 1
  $Id: fitshdr.l,v 4.17 2013/01/29 05:29:20 cal103 Exp $
@


4.16
log
@WCSLIB 4.16
@
text
@d3 2
a4 2
  WCSLIB 4.16 - an implementation of the FITS WCS standard.
  Copyright (C) 1995-2012, Mark Calabretta
d25 1
a25 1
  $Id: fitshdr.l,v 4.15.1.1 2012/09/26 14:27:51 cal103 Exp cal103 $
@


4.16.1.1
log
@WCSLIB 4.16 development branch.
@
text
@d25 1
a25 1
  $Id: fitshdr.l,v 4.16 2012/11/07 04:42:44 cal103 Exp $
@


4.16.1.2
log
@Updated date in copyright notice.
@
text
@d4 1
a4 1
  Copyright (C) 1995-2013, Mark Calabretta
d25 1
a25 1
  $Id: fitshdr.l,v 4.16.1.1 2012/11/07 04:45:56 cal103 Exp cal103 $
@


4.15
log
@WCSLIB 4.15
@
text
@d3 1
a3 1
  WCSLIB 4.15 - an implementation of the FITS WCS standard.
d25 1
a25 1
  $Id: fitshdr.l,v 4.14.1.1 2012/07/13 10:04:44 cal103 Exp cal103 $
@


4.15.1.1
log
@WCSLIB 4.15 development branch.
@
text
@d25 1
a25 1
  $Id: fitshdr.l,v 4.15 2012/09/26 14:26:05 cal103 Exp $
@


4.14
log
@WCSLIB 4.14
@
text
@d3 1
a3 1
  WCSLIB 4.14 - an implementation of the FITS WCS standard.
d25 1
a25 1
  $Id: fitshdr.l,v 4.13.1.4 2012/07/13 07:58:31 cal103 Exp cal103 $
@


4.14.1.1
log
@WCSLIB 4.14 development branch.
@
text
@d25 1
a25 1
  $Id: fitshdr.l,v 4.14 2012/07/13 10:02:27 cal103 Exp $
@


4.13
log
@WCSLIB 4.13
@
text
@d3 1
a3 1
  WCSLIB 4.13 - an implementation of the FITS WCS standard.
d19 1
a19 1
  along with WCSLIB.  If not, see <http://www.gnu.org/licenses/>.
d21 5
a25 11
  Correspondence concerning WCSLIB may be directed to:
    Internet email: mcalabre@@atnf.csiro.au
    Postal address: Dr. Mark Calabretta
                    Australia Telescope National Facility, CSIRO
                    PO Box 76
                    Epping NSW 1710
                    AUSTRALIA

  Author: Mark Calabretta, Australia Telescope National Facility
  http://www.atnf.csiro.au/~mcalabre/index.html
  $Id: fitshdr.l,v 4.12.1.1 2012/02/29 07:59:10 cal103 Exp cal103 $
d83 1
d264 1
a264 1
	  if (sscanf(yytext, "%lf", &dtmp) < 1) {
d347 1
a347 1
	  if (sscanf(yytext, "%lf", &(kptr->keyvalue.f)) < 1) {
d370 17
a386 2
	  if (sscanf(yytext, "(%lf,%lf)", kptr->keyvalue.c,
	      kptr->keyvalue.c+1) < 2) {
@


4.13.1.1
log
@WCSLIB 4.13 development branch.
@
text
@d31 1
a31 1
  $Id: fitshdr.l,v 4.13 2012/03/14 07:39:30 cal103 Exp $
@


4.13.1.2
log
@Handle locales such as fr_FR where a comma is used to delimit the decimal
part of a floating point number.  Patch provided by Michael Droettboom.
@
text
@d31 1
a31 1
  $Id: fitshdr.l,v 4.13.1.1 2012/03/14 07:40:37 cal103 Exp cal103 $
a88 1
#include "wcsutil.h"
d125 1
a125 1
	char *cptr, ctmp[72], ctmp2[72];
d269 1
a269 1
	  if (wcsutil_str2double(yytext, "%lf", &dtmp)) {
d352 1
a352 1
	  if (wcsutil_str2double(yytext, "%lf", &(kptr->keyvalue.f))) {
d375 2
a376 9
	  if (sscanf(yytext, "(%s,%s)", ctmp, ctmp2) < 2) {
	    kptr->status |= FITSHDR_KEYVALUE;
	    BEGIN(ERROR);
	  }
	  if (wcsutil_str2double(ctmp, "%lf", kptr->keyvalue.c)) {
	    kptr->status |= FITSHDR_KEYVALUE;
	    BEGIN(ERROR);
	  }
	  if (wcsutil_str2double(ctmp2, "%lf", kptr->keyvalue.c+1)) {
@


4.13.1.3
log
@Changed contact details.
@
text
@d19 1
a19 1
  along with WCSLIB.  If not, see http://www.gnu.org/licenses.
d21 11
a31 5
  Direct correspondence concerning WCSLIB to mark@@calabretta.id.au

  Author: Mark Calabretta, Australia Telescope National Facility, CSIRO.
  http://www.atnf.csiro.au/people/Mark.Calabretta
  $Id: fitshdr.l,v 4.13.1.2 2012/07/12 15:21:26 cal103 Exp cal103 $
@


4.13.1.4
log
@Bug fix for parsing floating point complex keyvalues.
@
text
@d25 1
a25 1
  $Id: fitshdr.l,v 4.13.1.3 2012/07/13 03:34:20 cal103 Exp cal103 $
d120 1
a120 1
	char *cptr, ctmp[72];
d370 3
a372 3
	
	  for (cptr = ctmp, k = 1; yytext[k] != ','; cptr++, k++) {
	    *cptr = yytext[k];
a373 2
	  *cptr = '\0';
	
d378 1
a378 7
	
	  for (cptr = ctmp, k++; yytext[k] != ')'; cptr++, k++) {
	    *cptr = yytext[k];
	  }
	  *cptr = '\0';
	
	  if (wcsutil_str2double(ctmp, "%lf", kptr->keyvalue.c+1)) {
@


4.12
log
@WCSLIB 4.12
@
text
@d3 1
a3 1
  WCSLIB 4.12 - an implementation of the FITS WCS standard.
d31 1
a31 1
  $Id: fitshdr.l,v 4.11.1.1 2012/02/20 23:31:13 cal103 Exp cal103 $
@


4.12.1.1
log
@WCSLIB 4.12 development branch.
@
text
@d31 1
a31 1
  $Id: fitshdr.l,v 4.12 2012/02/29 07:57:56 cal103 Exp $
@


4.11
log
@WCSLIB 4.11
@
text
@d3 1
a3 1
  WCSLIB 4.11 - an implementation of the FITS WCS standard.
d31 1
a31 1
  $Id: fitshdr.l,v 4.10.1.1 2012/02/05 23:42:46 cal103 Exp cal103 $
@


4.11.1.1
log
@WCSLIB 4.11 development branch.
@
text
@d31 1
a31 1
  $Id: fitshdr.l,v 4.11 2012/02/20 23:30:02 cal103 Exp $
@


4.10
log
@WCSLIB 4.10
@
text
@d3 1
a3 1
  WCSLIB 4.10 - an implementation of the FITS WCS standard.
d31 1
a31 1
  $Id: fitshdr.l,v 4.9.1.1 2012/01/24 05:41:45 cal103 Exp cal103 $
@


4.10.1.1
log
@WCSLIB 4.10 development branch.
@
text
@d31 1
a31 1
  $Id: fitshdr.l,v 4.10 2012/02/05 23:41:44 cal103 Exp $
@


4.9
log
@WCSLIB 4.9
@
text
@d3 1
a3 1
  WCSLIB 4.9 - an implementation of the FITS WCS standard.
d31 1
a31 1
  $Id: fitshdr.l,v 4.8.1.2 2012/01/24 05:23:06 cal103 Exp cal103 $
@


4.9.1.1
log
@WCSLIB 4.9 development branch.
@
text
@d31 1
a31 1
  $Id: fitshdr.l,v 4.9 2012/01/24 05:40:29 cal103 Exp $
@


4.8
log
@WCSLIB 4.8
@
text
@d3 2
a4 2
  WCSLIB 4.8 - an implementation of the FITS WCS standard.
  Copyright (C) 1995-2011, Mark Calabretta
d31 1
a31 1
  $Id: fitshdr.l,v 4.7.1.1 2011/02/07 07:04:22 cal103 Exp cal103 $
@


4.8.1.1
log
@WCSLIB 4.8 development branch.
@
text
@d31 1
a31 1
  $Id: fitshdr.l,v 4.8 2011/08/15 08:05:53 cal103 Exp $
@


4.8.1.2
log
@Updated date in copyright notice.
@
text
@d4 1
a4 1
  Copyright (C) 1995-2012, Mark Calabretta
d31 1
a31 1
  $Id: fitshdr.l,v 4.8.1.1 2011/08/15 08:07:06 cal103 Exp cal103 $
@


4.7
log
@WCSLIB 4.7
@
text
@d3 1
a3 1
  WCSLIB 4.7 - an implementation of the FITS WCS standard.
d31 1
a31 1
  $Id: fitshdr.l,v 4.6.1.2 2011/01/14 06:33:16 cal103 Exp cal103 $
@


4.7.1.1
log
@WCSLIB 4.7 development branch.
@
text
@d31 1
a31 1
  $Id: fitshdr.l,v 4.7 2011/02/07 07:03:42 cal103 Exp $
@


4.6
log
@WCSLIB 4.6
@
text
@d3 2
a4 2
  WCSLIB 4.6 - an implementation of the FITS WCS standard.
  Copyright (C) 1995-2010, Mark Calabretta
d31 1
a31 1
  $Id: fitshdr.l,v 4.5.1.1 2010/07/16 07:05:31 cal103 Exp cal103 $
@


4.6.1.1
log
@WCSLIB 4.6 development branch.
@
text
@d31 1
a31 1
  $Id: fitshdr.l,v 4.6 2010/11/16 06:15:31 cal103 Exp $
@


4.6.1.2
log
@Updated date in copyright notice.
@
text
@d4 1
a4 1
  Copyright (C) 1995-2011, Mark Calabretta
d31 1
a31 1
  $Id: fitshdr.l,v 4.6.1.1 2010/11/16 06:16:19 cal103 Exp cal103 $
@


4.5
log
@WCSLIB 4.5
@
text
@d3 1
a3 1
  WCSLIB 4.5 - an implementation of the FITS WCS standard.
d31 1
a31 1
  $Id: fitshdr.l,v 4.4.1.3 2010/01/19 03:42:50 cal103 Exp cal103 $
@


4.5.1.1
log
@WCSLIB 4.5 development branch.
@
text
@d31 1
a31 1
  $Id: fitshdr.l,v 4.5 2010/07/16 07:01:25 cal103 Exp $
@


4.4
log
@WCSLIB 4.4
@
text
@d3 2
a4 2
  WCSLIB 4.4 - an implementation of the FITS WCS standard.
  Copyright (C) 1995-2009, Mark Calabretta
d31 1
a31 1
  $Id: fitshdr.l,v 4.3.1.3 2009/07/22 04:53:58 cal103 Exp cal103 $
a106 5
#ifdef DEBUG
  /* Print text as it is matched. */
  #define YY_USER_ACTION printf("Rule %03d: \"%s\"\n", yy_act, yytext);
#endif

d169 1
a169 1
	  /* Rule 001: A completely blank keyrecord. */
a176 1
	  /* Rule 002. */
a181 1
	  /* Rule 003. */
d188 1
a188 1
	  /* Rule 004: Illegal END keyrecord. */
d195 1
a195 1
	  /* Rule 005: Illegal END keyrecord. */
a201 1
	  /* Rule 006. */
d207 1
a207 1
	  /* Rule 007: Continued string keyvalue. */
d225 1
a225 1
	  /* Rule 008: Keyword without value. */
d231 1
a231 1
	  /* Rule 009: Illegal keyword, carry on regardless. */
d238 1
a238 1
	  /* Rule 010: Illegal keyword, carry on regardless. */
d245 1
a245 1
	  /* Rule 011: Null keyvalue. */
d250 1
a250 1
	  /* Rule 012: Logical keyvalue. */
d257 1
a257 1
	  /* Rule 013: 32-bit signed integer keyvalue. */
d268 1
a268 1
	  /* Rule 014: 64-bit signed integer keyvalue (up to 18 digits). */
d309 1
a309 1
	  /* Rule 015: Very long integer keyvalue (and 19-digit int64). */
d350 1
a350 1
	  /* Rule 016: Float keyvalue. */
d361 1
a361 1
	  /* Rule 017: Integer complex keyvalue. */
d373 1
a373 1
	  /* Rule 018: Floating point complex keyvalue. */
d385 1
a385 1
	  /* Rule 019: String keyvalue. */
a417 1
	  /* Rule 020. */
a422 1
	  /* Rule 021. */
a426 1
	  /* Rule 022. */
a430 1
	  /* Rule 023. */
a434 1
	  /* Rule 024. */
d440 1
a440 1
	  /* Rule 025: Keyvalue parsing must now also be suspect. */
a446 1
	  /* Rule 026. */
a452 1
	  /* Rule 027. */
a457 1
	  /* Rule 028. */
a463 1
	  /* Rule 029. */
d474 1
a474 1
	  /* Rule 030: Discard the rest of the input line. */
d530 1
a530 1
	  /* Rule unnumbered: End-of-input. */
@


4.4.1.1
log
@WCSLIB 4.4 development branch.
@
text
@d31 1
a31 1
  $Id: fitshdr.l,v 4.4 2009/08/06 07:41:33 cal103 Exp $
@


4.4.1.2
log
@Removed the high-maintenance rule numbering and the debug output
implemented via YY_USER_ACTION since flex's '--debug' option provides
what's needed.
@
text
@d31 1
a31 1
  $Id: fitshdr.l,v 4.4.1.1 2009/08/10 08:52:49 cal103 Exp cal103 $
d107 5
d174 1
a174 1
	  /* A completely blank keyrecord. */
d182 1
d188 1
d195 1
a195 1
	  /* Illegal END keyrecord. */
d202 1
a202 1
	  /* Illegal END keyrecord. */
d209 1
d215 1
a215 1
	  /* Continued string keyvalue. */
d233 1
a233 1
	  /* Keyword without value. */
d239 1
a239 1
	  /* Illegal keyword, carry on regardless. */
d246 1
a246 1
	  /* Illegal keyword, carry on regardless. */
d253 1
a253 1
	  /* Null keyvalue. */
d258 1
a258 1
	  /* Logical keyvalue. */
d265 1
a265 1
	  /* 32-bit signed integer keyvalue. */
d276 1
a276 1
	  /* 64-bit signed integer keyvalue (up to 18 digits). */
d317 1
a317 1
	  /* Very long integer keyvalue (and 19-digit int64). */
d358 1
a358 1
	  /* Float keyvalue. */
d369 1
a369 1
	  /* Integer complex keyvalue. */
d381 1
a381 1
	  /* Floating point complex keyvalue. */
d393 1
a393 1
	  /* String keyvalue. */
d426 1
d432 1
d437 1
d442 1
d447 1
d453 1
a453 1
	  /* Keyvalue parsing must now also be suspect. */
d460 1
d467 1
d473 1
d480 1
d491 1
a491 1
	  /* Discard the rest of the input line. */
d547 1
a547 1
	  /* End-of-input. */
@


4.4.1.3
log
@Updated date in copyright notice.
@
text
@d4 1
a4 1
  Copyright (C) 1995-2010, Mark Calabretta
d31 1
a31 1
  $Id: fitshdr.l,v 4.4.1.2 2009/09/03 02:42:20 cal103 Exp cal103 $
@


4.3
log
@WCSLIB 4.3
@
text
@d3 2
a4 2
    WCSLIB 4.3 - an implementation of the FITS WCS standard.
    Copyright (C) 1995-2007, Mark Calabretta
d6 1
a6 1
    This file is part of WCSLIB.
d8 24
a31 24
    WCSLIB is free software: you can redistribute it and/or modify it under
    the terms of the GNU Lesser General Public License as published by the
    Free Software Foundation, either version 3 of the License, or (at your
    option) any later version.

    WCSLIB 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 Lesser General Public License for
    more details.

    You should have received a copy of the GNU Lesser General Public License
    along with WCSLIB.  If not, see <http://www.gnu.org/licenses/>.

    Correspondence concerning WCSLIB may be directed to:
       Internet email: mcalabre@@atnf.csiro.au
       Postal address: Dr. Mark Calabretta
                       Australia Telescope National Facility, CSIRO
                       PO Box 76
                       Epping NSW 1710
                       AUSTRALIA

    Author: Mark Calabretta, Australia Telescope National Facility
    http://www.atnf.csiro.au/~mcalabre/index.html
    $Id: fitshdr.l,v 4.2.1.10 2007/12/27 05:05:17 cal103 Exp cal103 $
d34 2
a35 2
*   fitshdr.l is a Flex description file containing a lexical scanner
*   definition for extracting keywords and keyvalues from a FITS header.
d37 1
a37 1
*   It requires Flex v2.5.4 or later.
d39 2
a40 2
*   Refer to fitshdr.h for a description of the user interface and operating
*   notes.
d84 1
d116 4
d124 2
a125 3
   "Memory allocation failed"};

void fitshdr_nullfill(char cptr[], int len);
d135 2
a136 1
        int yylex_destroy(void);
d166 5
d217 1
a217 1

d224 1
a224 1

d353 1
a353 1

d417 1
a417 1
	    fitshdr_nullfill(cptr+1, 71);
d419 1
a419 1
	    fitshdr_nullfill(cptr, 72);
d475 1
a475 1
	  fitshdr_nullfill(kptr->comment, 84);
d485 1
a485 1
	  fitshdr_nullfill(kptr->comment+80, 4);
d496 1
a496 1
	  fitshdr_nullfill(kptr->keyword, 12);
d504 1
a504 1
	    fitshdr_nullfill(cptr, 12);
d529 1
a529 1

d546 1
a546 1
<<EOF>> {
d556 1
a556 1
void fitshdr_nullfill(char cptr[], int len)
@


4.3.1.1
log
@WCSLIB 4.3 development branch.
@
text
@d3 2
a4 2
    WCSLIB 4.4 - an implementation of the FITS WCS standard.
    Copyright (C) 1995-2008, Mark Calabretta
d31 1
a31 1
    $Id: fitshdr.l,v 4.3 2007/12/27 05:41:36 cal103 Exp cal103 $
@


4.3.1.2
log
@Moved the declaration of helper functions out of global scope and
simplified their names.
@
text
@d31 1
a31 1
    $Id: fitshdr.l,v 4.3.1.1 2007/12/27 13:23:47 cal103 Exp cal103 $
d121 2
d131 1
a131 2
	void nullfill(char cptr[], int len);
	int  yylex_destroy(void);
d407 1
a407 1
	    nullfill(cptr+1, 71);
d409 1
a409 1
	    nullfill(cptr, 72);
d465 1
a465 1
	  nullfill(kptr->comment, 84);
d475 1
a475 1
	  nullfill(kptr->comment+80, 4);
d486 1
a486 1
	  nullfill(kptr->keyword, 12);
d494 1
a494 1
	    nullfill(cptr, 12);
d546 1
a546 1
void nullfill(char cptr[], int len)
@


4.3.1.3
log
@Use setjmp/longjmp to preempt the call to exit() by yy_fatal_error();
changed indentation in the prologue.
@
text
@d3 2
a4 2
  WCSLIB 4.4 - an implementation of the FITS WCS standard.
  Copyright (C) 1995-2009, Mark Calabretta
d6 1
a6 1
  This file is part of WCSLIB.
d8 24
a31 24
  WCSLIB is free software: you can redistribute it and/or modify it under the
  terms of the GNU Lesser General Public License as published by the Free
  Software Foundation, either version 3 of the License, or (at your option)
  any later version.

  WCSLIB 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 Lesser General Public License for
  more details.

  You should have received a copy of the GNU Lesser General Public License
  along with WCSLIB.  If not, see <http://www.gnu.org/licenses/>.

  Correspondence concerning WCSLIB may be directed to:
    Internet email: mcalabre@@atnf.csiro.au
    Postal address: Dr. Mark Calabretta
                    Australia Telescope National Facility, CSIRO
                    PO Box 76
                    Epping NSW 1710
                    AUSTRALIA

  Author: Mark Calabretta, Australia Telescope National Facility
  http://www.atnf.csiro.au/~mcalabre/index.html
  $Id: fitshdr.l,v 4.3.1.2 2008/04/02 03:51:53 cal103 Exp cal103 $
d34 2
a35 2
* fitshdr.l is a Flex description file containing a lexical scanner
* definition for extracting keywords and keyvalues from a FITS header.
d37 1
a37 1
* It requires Flex v2.5.4 or later.
d39 2
a40 2
* Refer to fitshdr.h for a description of the user interface and operating
* notes.
a83 1
#include <setjmp.h>
a114 4
/* Used in preempting the call to exit() by yy_fatal_error(). */
jmp_buf fitshdr_abort_jmp_env;
#define exit(status) longjmp(fitshdr_abort_jmp_env, status)

d119 1
a119 2
   "Memory allocation failed",
   "Fatal error returned by Flex parser"};
a159 5
	/* Return here via longjmp() invoked by yy_fatal_error(). */
	if (setjmp(fitshdr_abort_jmp_env)) {
	  return 3;
	}
	
d206 1
a206 1
	
d213 1
a213 1
	
d342 1
a342 1
	
d518 1
a518 1
	
d535 1
a535 1
<<EOF>>	{
@


4.2
log
@WCSLIB 4.2
@
text
@d2 30
a31 28
*
*   WCSLIB 4.2 - an implementation of the FITS WCS standard.
*   Copyright (C) 1995-2005, Mark Calabretta
*
*   WCSLIB 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.
*
*   WCSLIB 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 WCSLIB; if not, write to the Free Software Foundation, Inc.,
*   59 Temple Place, Suite 330, Boston, MA  02111-1307, USA
*
*   Correspondence concerning WCSLIB may be directed to:
*      Internet email: mcalabre@@atnf.csiro.au
*      Postal address: Dr. Mark Calabretta
*                      Australia Telescope National Facility, CSIRO
*                      PO Box 76
*                      Epping NSW 1710
*                      AUSTRALIA
*
*   Author: Mark Calabretta, Australia Telescope National Facility
*   $Id: fitshdr.l,v 4.1 2005/08/25 07:26:29 cal103 Exp cal103 $
d47 1
d49 2
d89 1
a89 1
#define YY_DECL int fitshdr(const char header[], int ncards, int nkeyids, \
d95 1
a95 1
	  if (fitshdr_ncards) { \
d99 1
a99 1
	    fitshdr_ncards--; \
d113 1
a113 1
int  fitshdr_ncards;
d131 1
d134 1
a134 1
	fitshdr_ncards = ncards;
d144 2
a145 2
	/* Note that calloc() initializes allocated memory to zero.    */
	if (!(kptr = *keys = calloc(ncards, sizeof(struct fitskey)))) {
d164 1
a164 1
	  /* Rule 001: A completely blank card. */
d185 1
a185 1
	  /* Rule 004: Illegal END card. */
d187 1
a187 1
	  kptr->status |= FITSHDR_CARD;
d192 1
a192 1
	  /* Rule 005: Illegal END card. */
d194 1
a194 1
	  kptr->status |= FITSHDR_CARD;
d282 3
a284 3
	    #ifdef WCS_INT64
	      /* Native long long int is available. */
	      if (sscanf(yytext, "%Ld", &(kptr->keyvalue.k)) < 1) {
d289 1
a289 1
	      /* long long int (up to 18 digits) implemented as int[3]. */
d334 2
a335 2
	    #ifdef WCS_INT64
	      /* Native long long int is available. */
d337 1
a337 1
	      if (sscanf(yytext, "%Ld", &(kptr->keyvalue.k)) < 1) {
d523 1
a523 1
	  /* Check for cards following the END card. */
d538 1
@


4.2.1.1
log
@WCSLIB 4.2 development branch.
@
text
@d3 1
a3 1
*   WCSLIB 4.3 - an implementation of the FITS WCS standard.
d29 1
a29 1
*   $Id: fitshdr.l,v 4.2 2005/09/21 13:21:57 cal103 Exp cal103 $
@


4.2.1.2
log
@Invoke yy_delete_buffer(YY_CURRENT_BUFFER) before returning to avoid a 16kiB
memory leak.
@
text
@d4 1
a4 1
*   Copyright (C) 1995-2007, Mark Calabretta
d29 1
a29 1
*   $Id: fitshdr.l,v 4.2.1.1 2005/12/05 02:39:43 cal103 Exp cal103 $
a133 1
	  yy_delete_buffer(YY_CURRENT_BUFFER);
a139 1
	  yy_delete_buffer(YY_CURRENT_BUFFER);
a531 1
	  yy_delete_buffer(YY_CURRENT_BUFFER);
@


4.2.1.3
log
@Replaced the non-ANSI compliant %Ld format specification in sscanf() with
%lld.
@
text
@d29 1
a29 1
*   $Id: fitshdr.l,v 4.2.1.2 2007/07/11 08:47:57 cal103 Exp cal103 $
d280 1
a280 1
	      if (sscanf(yytext, "%lld", &(kptr->keyvalue.k)) < 1) {
d333 1
a333 1
	      if (sscanf(yytext, "%lld", &(kptr->keyvalue.k)) < 1) {
@


4.2.1.4
log
@Added '%option nounput' to defeat compiler warnings about yyunput being
"defined but not used".
@
text
@d29 1
a29 1
*   $Id: fitshdr.l,v 4.2.1.3 2007/07/12 03:53:28 cal103 Exp cal103 $
a44 1
%option nounput
@


4.2.1.5
log
@Amended comments that referred to "long long ints", this is not necessarily
the way that 64-bit integers are implemented.
@
text
@d29 1
a29 1
*   $Id: fitshdr.l,v 4.2.1.4 2007/07/12 04:06:04 cal103 Exp cal103 $
d140 1
a140 1
	/* Recall that calloc() initializes allocated memory to zero.  */
d280 1
a280 1
	      /* Native 64-bit integer is available. */
d286 1
a286 1
	      /* 64-bit integer (up to 18 digits) implemented as int[3]. */
d332 1
a332 1
	      /* Native 64-bit integer is available. */
@


4.2.1.6
log
@Replaced use of the obsolete term "card".
@
text
@d29 1
a29 1
*   $Id: fitshdr.l,v 4.2.1.5 2007/07/12 07:22:06 cal103 Exp cal103 $
d85 1
a85 1
#define YY_DECL int fitshdr(const char header[], int nkeyrec, int nkeyids, \
d91 1
a91 1
	  if (fitshdr_nkeyrec) { \
d95 1
a95 1
	    fitshdr_nkeyrec--; \
d109 1
a109 1
int  fitshdr_nkeyrec;
d129 1
a129 1
	fitshdr_nkeyrec = nkeyrec;
d141 1
a141 1
	if (!(kptr = *keys = calloc(nkeyrec, sizeof(struct fitskey)))) {
d161 1
a161 1
	  /* Rule 001: A completely blank keyrecord. */
d182 1
a182 1
	  /* Rule 004: Illegal END keyrecord. */
d189 1
a189 1
	  /* Rule 005: Illegal END keyrecord. */
d520 1
a520 1
	  /* Check for keyrecords following the END keyrecord. */
@


4.2.1.7
log
@Replaced use of FITSHDR_CARD with its alias, FITSHDR_KEYREC.
@
text
@d29 1
a29 1
*   $Id: fitshdr.l,v 4.2.1.6 2007/08/02 04:55:13 cal103 Exp cal103 $
d184 1
a184 1
	  kptr->status |= FITSHDR_KEYREC;
d191 1
a191 1
	  kptr->status |= FITSHDR_KEYREC;
@


4.2.1.8
log
@Renamed WCS_INT64 -> WCSLIB_INT64.
@
text
@d29 1
a29 1
*   $Id: fitshdr.l,v 4.2.1.7 2007/08/02 05:08:03 cal103 Exp cal103 $
d279 1
a279 1
	    #ifdef WCSLIB_INT64
d331 1
a331 1
	    #ifdef WCSLIB_INT64
@


4.2.1.9
log
@Switched to LGPL 3.0.
@
text
@d2 28
a29 30

    WCSLIB 4.3 - an implementation of the FITS WCS standard.
    Copyright (C) 1995-2007, Mark Calabretta

    This file is part of WCSLIB.

    WCSLIB is free software: you can redistribute it and/or modify it under
    the terms of the GNU Lesser General Public License as published by the
    Free Software Foundation, either version 3 of the License, or (at your
    option) any later version.

    WCSLIB 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 Lesser General Public License for
    more details.

    You should have received a copy of the GNU Lesser General Public License
    along with WCSLIB.  If not, see <http://www.gnu.org/licenses/>.

    Correspondence concerning WCSLIB may be directed to:
       Internet email: mcalabre@@atnf.csiro.au
       Postal address: Dr. Mark Calabretta
                       Australia Telescope National Facility, CSIRO
                       PO Box 76
                       Epping NSW 1710
                       AUSTRALIA

    Author: Mark Calabretta, Australia Telescope National Facility
    http://www.atnf.csiro.au/~mcalabre/index.html
    $Id: fitshdr.l,v 4.2.1.8 2007/08/08 04:16:11 cal103 Exp cal103 $
@


4.2.1.10
log
@Call yylex_destroy() to free buffer memory rather than yy_delete_buffer()
as the former reinitializes global variables for subsequent calls.  Set
%option for outfile and prefix to save doing it on the flex command line.
@
text
@d31 1
a31 1
    $Id: fitshdr.l,v 4.2.1.9 2007/12/03 05:02:17 cal103 Exp cal103 $
a48 2
%option outfile="fitshdr.c"
%option prefix="fitshdr"
a128 1
        int yylex_destroy(void);
d137 1
d144 1
d537 1
a537 1
	  yylex_destroy();
@


4.1
log
@WCSLIB 4.1: initial revision.
@
text
@d3 1
a3 1
*   WCSLIB 4.1 - an implementation of the FITS WCS standard.
d29 1
a29 1
*   $Id$
@


0.0
log
@Empty revision
@
text
@d1 560
@
