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.22.09.10.53;	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	2006.08.02.00.14.58;	author cal103;	state Exp;
branches;
next	4.2.1.3;

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

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

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

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

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

4.2.1.8
date	2007.12.22.07.28.05;	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.06.17.13;	author cal103;	state Exp;
branches;
next	4.3.1.3;

4.3.1.3
date	2009.07.22.05.10.07;	author cal103;	state Exp;
branches;
next	4.3.1.4;

4.3.1.4
date	2009.08.06.02.51.44;	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	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.7.1.2;

4.7.1.2
date	2011.08.09.02.10.43;	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.13.03.34.20;	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.19.1.2;

4.19.1.2
date	2013.12.17.14.53.20;	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.45.42;	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.4.1.2;

5.4.1.2
date	2015.04.23.11.03.11;	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.6.1.2;

5.6.1.2
date	2015.06.28.14.47.54;	author mcalabre;	state Exp;
branches;
next	;

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

5.7.1.2
date	2015.06.30.05.59.27;	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.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	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	5.20.1.2;

5.20.1.2
date	2018.10.19.05.51.14;	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.11.05.03.25;	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.25.14.19.38;	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	;


desc
@Header file and usage notes for the generic FITS header parser, fitshdr();
contains the definition of the "fitskey" and "fitskeyid" structs.
@


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.h,v 8.6.1.1 2026/03/29 14:19:26 mcalabre Exp mcalabre $
*=============================================================================
*
* WCSLIB 8.7 - C routines that implement the FITS World Coordinate System
* (WCS) standard.  Refer to the README file provided with WCSLIB for an
* overview of the library.
*
*
* Summary of the fitshdr routines
* -------------------------------
* The Flexible Image Transport System (FITS), is a data format widely used in
* astronomy for data interchange and archive.  It is described in
*
=   "Definition of the Flexible Image Transport System (FITS), version 3.0",
=   Pence, W.D., Chiappetti, L., Page, C.G., Shaw, R.A., & Stobie, E. 2010,
=   A&A, 524, A42 - http://dx.doi.org/10.1051/0004-6361/201015362
*
* See also http://fits.gsfc.nasa.gov
*
* fitshdr() is a generic FITS header parser provided to handle keyrecords that
* are ignored by the WCS header parsers, wcspih() and wcsbth().  Typically the
* latter may be set to remove WCS keyrecords from a header leaving fitshdr()
* to handle the remainder.
*
*
* fitshdr() - FITS header parser routine
* --------------------------------------
* fitshdr() parses a character array containing a FITS header, extracting
* all keywords and their values into an array of fitskey structs.
*
* Given:
*   header    const char []
*                       Character array containing the (entire) FITS header,
*                       for example, as might be obtained conveniently via the
*                       CFITSIO routine fits_hdr2str().
*
*                       Each header "keyrecord" (formerly "card image")
*                       consists of exactly 80 7-bit ASCII printing characters
*                       in the range 0x20 to 0x7e (which excludes NUL, BS,
*                       TAB, LF, FF and CR) especially noting that the
*                       keyrecords are NOT null-terminated.
*
*   nkeyrec   int       Number of keyrecords in header[].
*
*   nkeyids   int       Number of entries in keyids[].
*
* Given and returned:
*   keyids    struct fitskeyid []
*                       While all keywords are extracted from the header,
*                       keyids[] provides a convienient way of indexing them.
*                       The fitskeyid struct contains three members;
*                       fitskeyid::name must be set by the user while
*                       fitskeyid::count and fitskeyid::idx are returned by
*                       fitshdr().  All matched keywords will have their
*                       fitskey::keyno member negated.
*
* Returned:
*   nreject   int*      Number of header keyrecords rejected for syntax
*                       errors.
*
*   keys      struct fitskey**
*                       Pointer to an array of nkeyrec fitskey structs
*                       containing all keywords and keyvalues extracted from
*                       the header.
*
*                       Memory for the array is allocated by fitshdr() and
*                       this must be freed by the user.  See wcsdealloc().
*
* Function return value:
*             int       Status return value:
*                         0: Success.
*                         1: Null fitskey pointer passed.
*                         2: Memory allocation failed.
*                         3: Fatal error returned by Flex parser.
*                         4: Unrecognised data type.
*
* Notes:
*   1: Keyword parsing is done in accordance with the syntax defined by
*      NOST 100-2.0, noting the following points in particular:
*
*      a: Sect. 5.1.2.1 specifies that keywords be left-justified in columns
*         1-8, blank-filled with no embedded spaces, composed only of the
*         ASCII characters ABCDEFGHJKLMNOPQRSTUVWXYZ0123456789-_
*
*         fitshdr() accepts any characters in columns 1-8 but flags keywords
*         that do not conform to standard syntax.
*
*      b: Sect. 5.1.2.2 defines the "value indicator" as the characters "= "
*         occurring in columns 9 and 10.  If these are absent then the
*         keyword has no value and columns 9-80 may contain any ASCII text
*         (but see note 2 for CONTINUE keyrecords).  This is copied to the
*         comment member of the fitskey struct.
*
*      c: Sect. 5.1.2.3 states that a keyword may have a null (undefined)
*         value if the value/comment field, columns 11-80, consists entirely
*         of spaces, possibly followed by a comment.
*
*      d: Sect. 5.1.1 states that trailing blanks in a string keyvalue are
*         not significant and the parser always removes them.  A string
*         containing nothing but blanks will be replaced with a single
*         blank.
*
*         Sect. 5.2.1 also states that a quote character (') in a string
*         value is to be represented by two successive quote characters and
*         the parser removes the repeated quote.
*
*      e: The parser recognizes free-format character (NOST 100-2.0,
*         Sect. 5.2.1), integer (Sect. 5.2.3), and floating-point values
*         (Sect. 5.2.4) for all keywords.
*
*      f: Sect. 5.2.3 offers no comment on the size of an integer keyvalue
*         except indirectly in limiting it to 70 digits.  The parser will
*         translate an integer keyvalue to a 32-bit signed integer if it
*         lies in the range -2147483648 to +2147483647, otherwise it
*         interprets it as a 64-bit signed integer if possible, or else a
*         "very long" integer (see fitskey::type).
*
*      g: END not followed by 77 blanks is not considered to be a legitimate
*         end keyrecord.
*
*   2: The parser supports a generalization of the OGIP Long String Keyvalue
*      Convention (v1.0) whereby strings may be continued onto successive
*      header keyrecords.  A keyrecord contains a segment of a continued
*      string if and only if
*
*      a: it contains the pseudo-keyword CONTINUE,
*
*      b: columns 9 and 10 are both blank,
*
*      c: columns 11 to 80 contain what would be considered a valid string
*         keyvalue, including optional keycomment, if column 9 had contained
*         '=',
*
*      d: the previous keyrecord contained either a valid string keyvalue or
*         a valid CONTINUE keyrecord.
*
*      If any of these conditions is violated, the keyrecord is considered in
*      isolation.
*
*      Syntax errors in keycomments in a continued string are treated more
*      permissively than usual; the '/' delimiter may be omitted provided that
*      parsing of the string keyvalue is not compromised.  However, the
*      FITSHDR_COMMENT status bit will be set for the keyrecord (see
*      fitskey::status).
*
*      As for normal strings, trailing blanks in a continued string are not
*      significant.
*
*      In the OGIP convention "the '&' character is used as the last non-blank
*      character of the string to indicate that the string is (probably)
*      continued on the following keyword".  This additional syntax is not
*      required by fitshdr(), but if '&' does occur as the last non-blank
*      character of a continued string keyvalue then it will be removed, along
*      with any trailing blanks.  However, blanks that occur before the '&'
*      will be preserved.
*
*
* fitskeyid struct - Keyword indexing
* -----------------------------------
* fitshdr() uses the fitskeyid struct to return indexing information for
* specified keywords.  The struct contains three members, the first of which,
* fitskeyid::name, must be set by the user with the remainder returned by
* fitshdr().
*
*   char name[12]:
*     (Given) Name of the required keyword.  This is to be set by the user;
*     the '.' character may be used for wildcarding.  Trailing blanks will be
*     replaced with nulls.
*
*   int count:
*     (Returned) The number of matches found for the keyword.
*
*   int idx[2]:
*     (Returned) Indices into keys[], the array of fitskey structs returned by
*     fitshdr().  Note that these are 0-relative array indices, not keyrecord
*     numbers.
*
*     If the keyword is found in the header the first index will be set to the
*     array index of its first occurrence, otherwise it will be set to -1.
*
*     If multiples of the keyword are found, the second index will be set to
*     the array index of its last occurrence, otherwise it will be set to -1.
*
*
* fitskey struct - Keyword/value information
* ------------------------------------------
* fitshdr() returns an array of fitskey structs, each of which contains the
* result of parsing one FITS header keyrecord.  All members of the fitskey
* struct are returned by fitshdr(), none are given by the user.
*
*   int keyno
*     (Returned) Keyrecord number (1-relative) in the array passed as input to
*     fitshdr().  This will be negated if the keyword matched any specified in
*     the keyids[] index.
*
*   int keyid
*     (Returned) Index into the first entry in keyids[] with which the
*     keyrecord matches, else -1.
*
*   int status
*     (Returned) Status flag bit-vector for the header keyrecord employing the
*     following bit masks defined as preprocessor macros:
*
*       - FITSHDR_KEYWORD:    Illegal keyword syntax.
*       - FITSHDR_KEYVALUE:   Illegal keyvalue syntax.
*       - FITSHDR_COMMENT:    Illegal keycomment syntax.
*       - FITSHDR_KEYREC:     Illegal keyrecord, e.g. an END keyrecord with
*                             trailing text.
*       - FITSHDR_TRAILER:    Keyrecord following a valid END keyrecord.
*
*     The header keyrecord is syntactically correct if no bits are set.
*
*   char keyword[12]
*     (Returned) Keyword name, null-filled for keywords of less than eight
*     characters (trailing blanks replaced by nulls).
*
*     Use
*
=       sprintf(dst, "%.8s", keyword)
*
*     to copy it to a character array with null-termination, or
*
=       sprintf(dst, "%8.8s", keyword)
*
*     to blank-fill to eight characters followed by null-termination.
*
*   int type
*     (Returned) Keyvalue data type:
*       - 0: No keyvalue (both the value and type are undefined).
*       - 1: Logical, represented as int.
*       - 2: 32-bit signed integer.
*       - 3: 64-bit signed integer (see below).
*       - 4: Very long integer (see below).
*       - 5: Floating point (stored as double).
*       - 6: Integer complex (stored as double[2]).
*       - 7: Floating point complex (stored as double[2]).
*       - 8: String.
*       - 8+10*n: Continued string (described below and in fitshdr() note 2).
*
*     A negative type indicates that a syntax error was encountered when
*     attempting to parse a keyvalue of the particular type.
*
*     Comments on particular data types:
*       - 64-bit signed integers lie in the range
*
=           (-9223372036854775808 <= int64 <  -2147483648) ||
=                    (+2147483647 <  int64 <= +9223372036854775807)
*
*         A native 64-bit data type may be defined via preprocessor macro
*         WCSLIB_INT64 defined in wcsconfig.h, e.g. as 'long long int'; this
*         will be typedef'd to 'int64' here.  If WCSLIB_INT64 is not set, then
*         int64 is typedef'd to int[3] instead and fitskey::keyvalue is to be
*         computed as
*
=           ((keyvalue.k[2]) * 1000000000 +
=             keyvalue.k[1]) * 1000000000 +
=             keyvalue.k[0]
*
*         and may reported via
*
=            if (keyvalue.k[2]) {
=              printf("%d%09d%09d", keyvalue.k[2], abs(keyvalue.k[1]),
=                                   abs(keyvalue.k[0]));
=            } else {
=              printf("%d%09d", keyvalue.k[1], abs(keyvalue.k[0]));
=            }
*
*         where keyvalue.k[0] and keyvalue.k[1] range from -999999999 to
*         +999999999.
*
*       - Very long integers, up to 70 decimal digits in length, are encoded
*         in keyvalue.l as an array of int[8], each of which stores 9 decimal
*         digits.  fitskey::keyvalue is to be computed as
*
=           (((((((keyvalue.l[7]) * 1000000000 +
=                  keyvalue.l[6]) * 1000000000 +
=                  keyvalue.l[5]) * 1000000000 +
=                  keyvalue.l[4]) * 1000000000 +
=                  keyvalue.l[3]) * 1000000000 +
=                  keyvalue.l[2]) * 1000000000 +
=                  keyvalue.l[1]) * 1000000000 +
=                  keyvalue.l[0]
*
*       - Continued strings are not reconstructed, they remain split over
*         successive fitskey structs in the keys[] array returned by
*         fitshdr().  fitskey::keyvalue data type, 8 + 10n, indicates the
*         segment number, n, in the continuation.
*
*   int padding
*     (An unused variable inserted for alignment purposes only.)
*
*   union keyvalue
*     (Returned) A union comprised of
*
*       - fitskey::i,
*       - fitskey::k,
*       - fitskey::l,
*       - fitskey::f,
*       - fitskey::c,
*       - fitskey::s,
*
*     used by the fitskey struct to contain the value associated with a
*     keyword.
*
*   int i
*     (Returned) Logical (fitskey::type == 1) and 32-bit signed integer
*     (fitskey::type == 2) data types in the fitskey::keyvalue union.
*
*   int64 k
*     (Returned) 64-bit signed integer (fitskey::type == 3) data type in the
*     fitskey::keyvalue union.
*
*   int l[8]
*     (Returned) Very long integer (fitskey::type == 4) data type in the
*     fitskey::keyvalue union.
*
*   double f
*     (Returned) Floating point (fitskey::type == 5) data type in the
*     fitskey::keyvalue union.
*
*   double c[2]
*     (Returned) Integer and floating point complex (fitskey::type == 6 || 7)
*     data types in the fitskey::keyvalue union.
*
*   char s[72]
*     (Returned) Null-terminated string (fitskey::type == 8) data type in the
*     fitskey::keyvalue union.
*
*   int ulen
*     (Returned) Where a keycomment contains a units string in the standard
*     form, e.g. [m/s], the ulen member indicates its length, inclusive of
*     square brackets.  Otherwise ulen is zero.
*
*   char comment[84]
*     (Returned) Keycomment, i.e. comment associated with the keyword or, for
*     keyrecords rejected because of syntax errors, the compete keyrecord
*     itself with null-termination.
*
*     Comments are null-terminated with trailing spaces removed.  Leading
*     spaces are also removed from keycomments (i.e. those immediately
*     following the '/' character), but not from COMMENT or HISTORY keyrecords
*     or keyrecords without a value indicator ("= " in columns 9-80).
*
*
* Global variable: const char *fitshdr_errmsg[] - Status return messages
* ----------------------------------------------------------------------
* Error messages to match the status value returned from each function.
*
*===========================================================================*/

#ifndef WCSLIB_FITSHDR
#define WCSLIB_FITSHDR

#include "wcsconfig.h"

#ifdef __cplusplus
extern "C" {
#endif

#define FITSHDR_KEYWORD  0x01
#define FITSHDR_KEYVALUE 0x02
#define FITSHDR_COMMENT  0x04
#define FITSHDR_KEYREC   0x08
#define FITSHDR_CARD     0x08	// Alias for backwards compatibility.
#define FITSHDR_TRAILER  0x10


extern const char *fitshdr_errmsg[];

enum fitshdr_errmsg_enum {
  FITSHDRERR_SUCCESS      = 0,	// Success.
  FITSHDRERR_NULL_POINTER = 1,	// Null fitskey pointer passed.
  FITSHDRERR_MEMORY       = 2,	// Memory allocation failed.
  FITSHDRERR_FLEX_PARSER  = 3,	// Fatal error returned by Flex parser.
  FITSHDRERR_DATA_TYPE    = 4 	// Unrecognised data type.
};

#ifdef WCSLIB_INT64
  typedef WCSLIB_INT64 int64;
#else
  typedef int int64[3];
#endif


// Struct used for indexing the keywords.
struct fitskeyid {
  char name[12];		// Keyword name, null-terminated.
  int  count;			// Number of occurrences of keyword.
  int  idx[2];			// Indices into fitskey array.
};

// Size of the fitskeyid struct in int units, used by the Fortran wrappers.
#define KEYIDLEN (sizeof(struct fitskeyid)/sizeof(int))


// Struct used for storing FITS keywords.
struct fitskey {
  int  keyno;			// Header keyrecord sequence number (1-rel).
  int  keyid;			// Index into fitskeyid[].
  int  status;			// Header keyrecord status bit flags.
  char keyword[12];		// Keyword name, null-filled.
  int  type;			// Keyvalue type (see above).
  int  padding;			// (Dummy inserted for alignment purposes.)
  union {
    int    i;			// 32-bit integer and logical values.
    int64  k;			// 64-bit integer values.
    int    l[8];		// Very long signed integer values.
    double f;			// Floating point values.
    double c[2];		// Complex values.
    char   s[72];		// String values, null-terminated.
  } keyvalue;			// Keyvalue.
  int  ulen;			// Length of units string.
  char comment[84];		// Comment (or keyrecord), null-terminated.
};

// Size of the fitskey struct in int units, used by the Fortran wrappers.
#define KEYLEN (sizeof(struct fitskey)/sizeof(int))


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


#ifdef __cplusplus
}
#endif

#endif // WCSLIB_FITSHDR
@


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.h,v 8.5.1.2 2026/03/29 13:36:16 mcalabre Exp mcalabre $
d25 1
a25 1
* WCSLIB 8.6 - C routines that implement the FITS World Coordinate System
@


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


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.h,v 8.4.1.2 2025/12/06 13:37:15 mcalabre Exp mcalabre $
d25 1
a25 1
* WCSLIB 8.5 - C routines that implement the FITS World Coordinate System
@


8.5.1.1
log
@WCSLIB 8.5 development branch.
@
text
@d22 1
a22 1
  $Id: fitshdr.h,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.h,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.h,v 8.3.1.1 2024/05/13 16:35:39 mcalabre Exp mcalabre $
d25 1
a25 1
* WCSLIB 8.4 - C routines that implement the FITS World Coordinate System
@


8.4.1.1
log
@WCSLIB 8.4 development branch.
@
text
@d22 1
a22 1
  $Id: fitshdr.h,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.h,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.h,v 8.2.1.2 2024/04/02 14:01:58 mcalabre Exp mcalabre $
d25 1
a25 1
* WCSLIB 8.3 - C routines that implement the FITS World Coordinate System
@


8.3.1.1
log
@WCSLIB 8.3 development branch.
@
text
@d22 1
a22 1
  $Id: fitshdr.h,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.h,v 8.1.1.1 2023/07/05 17:15:00 mcalabre Exp mcalabre $
d25 1
a25 1
* WCSLIB 8.2 - C routines that implement the FITS World Coordinate System
@


8.2.1.1
log
@WCSLIB 8.2 development branch.
@
text
@d22 1
a22 1
  $Id: fitshdr.h,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.h,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.h,v 8.0.1.1 2023/07/01 06:22:44 mcalabre Exp mcalabre $
d25 1
a25 1
* WCSLIB 8.1 - C routines that implement the FITS World Coordinate System
@


8.1.1.1
log
@WCSLIB 8.1 development branch.
@
text
@d22 1
a22 1
  $Id: fitshdr.h,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.h,v 7.13.1.2 2023/06/15 04:17:19 mcalabre Exp mcalabre $
d25 1
a25 1
* WCSLIB 8.0 - C routines that implement the FITS World Coordinate System
@


8.0.1.1
log
@WCSLIB 8.0 development branch.
@
text
@d22 1
a22 1
  $Id: fitshdr.h,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.h,v 7.12.1.1 2022/09/09 05:00:36 mcalabre Exp mcalabre $
d25 1
a25 1
* WCSLIB 7.13 - C routines that implement the FITS World Coordinate System
@


7.13.1.1
log
@WCSLIB 7.13 development branch.
@
text
@d22 1
a22 1
  $Id: fitshdr.h,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.h,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.h,v 7.11.1.1 2022/04/26 06:15:32 mcalabre Exp mcalabre $
d25 1
a25 1
* WCSLIB 7.12 - C routines that implement the FITS World Coordinate System
@


7.12.1.1
log
@WCSLIB 7.12 development branch.
@
text
@d22 1
a22 1
  $Id: fitshdr.h,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.h,v 7.10.1.1 2022/04/23 14:26:54 mcalabre Exp mcalabre $
d25 1
a25 1
* WCSLIB 7.11 - C routines that implement the FITS World Coordinate System
@


7.11.1.1
log
@WCSLIB 7.11 development branch.
@
text
@d22 1
a22 1
  $Id: fitshdr.h,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.h,v 7.9.1.1 2022/03/25 15:16:40 mcalabre Exp mcalabre $
d25 1
a25 1
* WCSLIB 7.10 - C routines that implement the FITS World Coordinate System
@


7.10.1.1
log
@WCSLIB 7.10 development branch.
@
text
@d22 1
a22 1
  $Id: fitshdr.h,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.h,v 7.8.1.1 2022/03/25 06:14:14 mcalabre Exp mcalabre $
d25 1
a25 1
* WCSLIB 7.9 - C routines that implement the FITS World Coordinate System
@


7.9.1.1
log
@WCSLIB 7.9 development branch.
@
text
@d22 1
a22 1
  $Id: fitshdr.h,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.h,v 7.7.1.2 2022/03/25 06:05:58 mcalabre Exp mcalabre $
d25 1
a25 1
* WCSLIB 7.8 - C routines that implement the FITS World Coordinate System
@


7.8.1.1
log
@WCSLIB 7.8 development branch.
@
text
@d22 1
a22 1
  $Id: fitshdr.h,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.h,v 7.6.1.1 2021/04/13 13:00:35 mcalabre Exp mcalabre $
d25 1
a25 1
* WCSLIB 7.7 - C routines that implement the FITS World Coordinate System
@


7.7.1.1
log
@WCSLIB 7.7 development branch.
@
text
@d22 1
a22 1
  $Id: fitshdr.h,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.h,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.h,v 7.5.1.1 2021/03/20 05:56:42 mcalabre Exp mcalabre $
d25 1
a25 1
* WCSLIB 7.6 - C routines that implement the FITS World Coordinate System
@


7.6.1.1
log
@WCSLIB 7.6 development branch.
@
text
@d22 1
a22 1
  $Id: fitshdr.h,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.h,v 7.4.1.2 2021/02/25 14:19:38 mcalabre Exp mcalabre $
d25 1
a25 1
* WCSLIB 7.5 - C routines that implement the FITS World Coordinate System
@


7.5.1.1
log
@WCSLIB 7.5 development branch.
@
text
@d22 1
a22 1
  $Id: fitshdr.h,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.h,v 7.3.1.4 2021/01/28 12:29:30 mcalabre Exp $
d25 1
a25 1
* WCSLIB 7.4 - C routines that implement the FITS World Coordinate System
d96 1
d395 2
a396 1
  FITSHDRERR_FLEX_PARSER  = 3	// Fatal error returned by Flex parser.
@


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


7.4.1.2
log
@Added fitshdr() return code 4 (FITSHDRERR_DATA_TYPE).
@
text
@d22 1
a22 1
  $Id: fitshdr.h,v 7.4.1.1 2021/01/31 02:26:24 mcalabre Exp mcalabre $
a95 1
*                         4: Unrecognised data type.
d394 1
a394 2
  FITSHDRERR_FLEX_PARSER  = 3,	// Fatal error returned by Flex parser.
  FITSHDRERR_DATA_TYPE    = 4 	// Unrecognised data type.
@


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.h,v 7.2.1.1 2020/03/09 07:34:50 mcalabre Exp mcalabre $
d25 1
a25 1
* WCSLIB 7.3 - C routines that implement the FITS World Coordinate System
d384 1
a384 1
#define FITSHDR_CARD     0x08	/* Alias for backwards compatibility. */
d391 4
a394 4
  FITSHDRERR_SUCCESS      = 0,	/* Success.                                 */
  FITSHDRERR_NULL_POINTER = 1,	/* Null fitskey pointer passed.             */
  FITSHDRERR_MEMORY       = 2,	/* Memory allocation failed.                */
  FITSHDRERR_FLEX_PARSER  = 3	/* Fatal error returned by Flex parser.     */
d404 1
a404 1
/* Struct used for indexing the keywords. */
d406 3
a408 3
  char name[12];		/* Keyword name, null-terminated.           */
  int  count;			/* Number of occurrences of keyword.        */
  int  idx[2];			/* Indices into fitskey array.              */
d411 1
a411 1
/* Size of the fitskeyid struct in int units, used by the Fortran wrappers. */
d415 1
a415 1
/* Struct used for storing FITS keywords. */
d417 6
a422 6
  int  keyno;			/* Header keyrecord sequence number (1-rel).*/
  int  keyid;			/* Index into fitskeyid[].                  */
  int  status;			/* Header keyrecord status bit flags.       */
  char keyword[12];		/* Keyword name, null-filled.               */
  int  type;			/* Keyvalue type (see above).               */
  int  padding;			/* (Dummy inserted for alignment purposes.) */
d424 9
a432 9
    int    i;			/* 32-bit integer and logical values.       */
    int64  k;			/* 64-bit integer values.                   */
    int    l[8];		/* Very long signed integer values.         */
    double f;			/* Floating point values.                   */
    double c[2];		/* Complex values.                          */
    char   s[72];		/* String values, null-terminated.          */
  } keyvalue;			/* Keyvalue.                                */
  int  ulen;			/* Length of units string.                  */
  char comment[84];		/* Comment (or keyrecord), null-terminated. */
d435 1
a435 1
/* Size of the fitskey struct in int units, used by the Fortran wrappers. */
d447 1
a447 1
#endif /* WCSLIB_FITSHDR */
@


7.3.1.1
log
@WCSLIB 7.3 development branch.
@
text
@d25 1
a25 1
  $Id: fitshdr.h,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.h,v 7.3.1.1 2020/06/03 03:38:10 mcalabre Exp mcalabre $
d387 1
a387 1
#define FITSHDR_CARD     0x08	// Alias for backwards compatibility.
d394 4
a397 4
  FITSHDRERR_SUCCESS      = 0,	// Success.
  FITSHDRERR_NULL_POINTER = 1,	// Null fitskey pointer passed.
  FITSHDRERR_MEMORY       = 2,	// Memory allocation failed.
  FITSHDRERR_FLEX_PARSER  = 3	// Fatal error returned by Flex parser.
d407 1
a407 1
// Struct used for indexing the keywords.
d409 3
a411 3
  char name[12];		// Keyword name, null-terminated.
  int  count;			// Number of occurrences of keyword.
  int  idx[2];			// Indices into fitskey array.
d414 1
a414 1
// Size of the fitskeyid struct in int units, used by the Fortran wrappers.
d418 1
a418 1
// Struct used for storing FITS keywords.
d420 6
a425 6
  int  keyno;			// Header keyrecord sequence number (1-rel).
  int  keyid;			// Index into fitskeyid[].
  int  status;			// Header keyrecord status bit flags.
  char keyword[12];		// Keyword name, null-filled.
  int  type;			// Keyvalue type (see above).
  int  padding;			// (Dummy inserted for alignment purposes.)
d427 9
a435 9
    int    i;			// 32-bit integer and logical values.
    int64  k;			// 64-bit integer values.
    int    l[8];		// Very long signed integer values.
    double f;			// Floating point values.
    double c[2];		// Complex values.
    char   s[72];		// String values, null-terminated.
  } keyvalue;			// Keyvalue.
  int  ulen;			// Length of units string.
  char comment[84];		// Comment (or keyrecord), null-terminated.
d438 1
a438 1
// Size of the fitskey struct in int units, used by the Fortran wrappers.
d450 1
a450 1
#endif // WCSLIB_FITSHDR
@


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.h,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.h,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.h,v 7.1.1.1 2019/12/31 13:28:19 mcalabre Exp mcalabre $
d28 1
a28 1
* WCSLIB 7.2 - C routines that implement the FITS World Coordinate System
@


7.2.1.1
log
@WCSLIB 7.2 development branch.
@
text
@d25 1
a25 1
  $Id: fitshdr.h,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.h,v 6.4.1.2 2019/12/31 03:28:03 mcalabre Exp mcalabre $
d28 1
a28 1
* WCSLIB 7.1 - C routines that implement the FITS World Coordinate System
@


7.1.1.1
log
@WCSLIB 7.1 development branch.
@
text
@d25 1
a25 1
  $Id: fitshdr.h,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.h,v 6.3.1.1 2019/07/12 07:34:37 mcalabre Exp mcalabre $
d28 1
a28 1
* WCSLIB 6.4 - C routines that implement the FITS World Coordinate System
@


6.4.1.1
log
@WCSLIB 6.4 development branch.
@
text
@d25 1
a25 1
  $Id: fitshdr.h,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.h,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.h,v 6.2.1.3 2019/07/11 05:03:25 mcalabre Exp mcalabre $
d28 1
a28 1
* WCSLIB 6.3 - C routines that implement the FITS World Coordinate System
@


6.3.1.1
log
@WCSLIB 6.3 development branch.
@
text
@d25 1
a25 1
  $Id: fitshdr.h,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.h,v 6.1.1.1 2018/10/19 08:36:15 mcalabre Exp mcalabre $
d28 1
a28 1
* WCSLIB 6.2 - C routines that implement the FITS World Coordinate System
d91 1
a91 2
*                       this must be freed by the user by invoking free() on
*                       the array.
@


6.2.1.1
log
@WCSLIB 6.2 development branch.
@
text
@d25 1
a25 1
  $Id: fitshdr.h,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.h,v 6.2.1.1 2018/10/20 10:04:15 mcalabre Exp mcalabre $
@


6.2.1.3
log
@In the usage notes for fitshdr(), suggest using wcsdealloc() to free the
allocated memory returned to the user.
@
text
@d25 1
a25 1
  $Id: fitshdr.h,v 6.2.1.2 2019/05/10 01:56:50 mcalabre Exp mcalabre $
d91 2
a92 1
*                       this must be freed by the user.  See wcsdealloc().
@


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.h,v 5.20.1.2 2018/10/19 05:51:14 mcalabre Exp mcalabre $
d28 1
a28 1
* WCSLIB 6.1 - C routines that implement the FITS World Coordinate System
@


6.1.1.1
log
@WCSLIB 6.1 development branch.
@
text
@d25 1
a25 1
  $Id: fitshdr.h,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.h,v 5.19.1.1 2018/07/26 15:41:40 mcalabre Exp mcalabre $
d28 1
a28 1
* WCSLIB 5.20 - C routines that implement the FITS World Coordinate System
d393 7
@


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


5.20.1.2
log
@By analogy with most other WCSLIB headers, added an enum for the status values
returned by fitshdr(), though they are not actually used within WCSLIB.
@
text
@d25 1
a25 1
  $Id: fitshdr.h,v 5.20.1.1 2018/10/05 05:33:33 mcalabre Exp mcalabre $
a392 7

enum fitshdr_errmsg_enum {
  FITSHDRERR_SUCCESS      = 0,	/* Success.                                 */
  FITSHDRERR_NULL_POINTER = 1,	/* Null fitskey pointer passed.             */
  FITSHDRERR_MEMORY       = 2,	/* Memory allocation failed.                */
  FITSHDRERR_FLEX_PARSER  = 3	/* Fatal error returned by Flex parser.     */
};
@


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.h,v 5.18.1.1 2018/01/10 08:33:04 mcalabre Exp mcalabre $
d28 1
a28 1
* WCSLIB 5.19 - C routines that implement the FITS World Coordinate System
@


5.19.1.1
log
@WCSLIB 5.19 development branch.
@
text
@d25 1
a25 1
  $Id: fitshdr.h,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.h,v 5.17.1.2 2018/01/10 08:25:34 mcalabre Exp mcalabre $
d28 1
a28 1
* WCSLIB 5.18 - C routines that implement the FITS World Coordinate System
@


5.18.1.1
log
@WCSLIB 5.18 development branch.
@
text
@d25 1
a25 1
  $Id: fitshdr.h,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.h,v 5.16.1.1 2017/01/15 04:28:59 mcalabre Exp mcalabre $
d28 1
a28 1
* WCSLIB 5.17 - C routines that implement the FITS World Coordinate System
@


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


5.17.1.2
log
@Updated date in copyright notice.
@
text
@d4 1
a4 1
  Copyright (C) 1995-2018, Mark Calabretta
d25 1
a25 1
  $Id: fitshdr.h,v 5.17.1.1 2017/09/18 08:45:59 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.h,v 5.15.1.2 2017/01/15 04:14:00 mcalabre Exp mcalabre $
d28 1
a28 1
* WCSLIB 5.16 - C routines that implement the FITS World Coordinate System
@


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


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.h,v 5.14.1.1 2016/02/07 10:52:44 mcalabre Exp mcalabre $
d28 1
a28 1
* WCSLIB 5.15 - C routines that implement the FITS World Coordinate System
@


5.15.1.1
log
@WCSLIB 5.15 development branch.
@
text
@d25 1
a25 1
  $Id: fitshdr.h,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.h,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.h,v 5.13.1.1 2016/01/26 08:54:32 mcalabre Exp mcalabre $
d28 1
a28 1
* WCSLIB 5.14 - C routines that implement the FITS World Coordinate System
@


5.14.1.1
log
@WCSLIB 5.14 development branch.
@
text
@d25 1
a25 1
  $Id: fitshdr.h,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.h,v 5.12.1.2 2016/01/25 05:17:04 mcalabre Exp mcalabre $
d28 1
a28 1
* WCSLIB 5.13 - C routines that implement the FITS World Coordinate System
@


5.13.1.1
log
@WCSLIB 5.13 development branch.
@
text
@d25 1
a25 1
  $Id: fitshdr.h,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.h,v 5.11.1.1 2015/10/18 09:16:27 mcalabre Exp mcalabre $
d28 1
a28 1
* WCSLIB 5.12 - C routines that implement the FITS World Coordinate System
@


5.12.1.1
log
@WCSLIB 5.12 development branch.
@
text
@d25 1
a25 1
  $Id: fitshdr.h,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.h,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.h,v 5.10.1.1 2015/10/09 08:22:35 mcalabre Exp mcalabre $
d28 1
a28 1
* WCSLIB 5.11 - C routines that implement the FITS World Coordinate System
@


5.11.1.1
log
@WCSLIB 5.11 development branch.
@
text
@d25 1
a25 1
  $Id: fitshdr.h,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.h,v 5.9.1.1 2015/07/21 09:28:07 mcalabre Exp mcalabre $
d28 1
a28 1
* WCSLIB 5.10 - C routines that implement the FITS World Coordinate System
@


5.10.1.1
log
@WCSLIB 5.10 development branch.
@
text
@d25 1
a25 1
  $Id: fitshdr.h,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.h,v 5.8.1.1 2015/07/08 11:07:18 mcalabre Exp mcalabre $
d28 1
a28 1
* WCSLIB 5.9 - C routines that implement the FITS World Coordinate System
@


5.9.1.1
log
@WCSLIB 5.9 development branch.
@
text
@d25 1
a25 1
  $Id: fitshdr.h,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.h,v 5.7.1.2 2015/06/30 05:59:27 mcalabre Exp mcalabre $
d28 1
a28 1
* WCSLIB 5.8 - C routines that implement the FITS World Coordinate System
@


5.8.1.1
log
@WCSLIB 5.8 development branch.
@
text
@d25 1
a25 1
  $Id: fitshdr.h,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.h,v 5.6.1.2 2015/06/28 14:47:54 mcalabre Exp mcalabre $
d28 1
a28 1
* WCSLIB 5.7 - C routines that implement the FITS World Coordinate System
d77 1
a77 1
*                       fitskeyid::count and fitskeyid::name are returned by
@


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


5.7.1.2
log
@Fixed a comment in the prologue.
@
text
@d25 1
a25 1
  $Id: fitshdr.h,v 5.7.1.1 2015/06/29 02:47:24 mcalabre Exp mcalabre $
d77 1
a77 1
*                       fitskeyid::count and fitskeyid::idx are returned by
@


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.h,v 5.5.1.1 2015/05/05 13:21:00 mcalabre Exp mcalabre $
d28 1
a28 1
* WCSLIB 5.6 - C routines that implement the FITS World Coordinate System
d137 1
a137 1
*         translates an integer keyvalue to a 32-bit signed integer if it
@


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


5.6.1.2
log
@Trivial fix to a prologue comment.
@
text
@d25 1
a25 1
  $Id: fitshdr.h,v 5.6.1.1 2015/06/14 07:14:44 mcalabre Exp mcalabre $
d137 1
a137 1
*         translate an integer keyvalue to a 32-bit signed integer if it
@


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.h,v 5.4.1.2 2015/04/23 11:03:11 mcalabre Exp mcalabre $
d28 1
a28 1
* WCSLIB 5.5 - C routines that implement the FITS World Coordinate System
@


5.5.1.1
log
@WCSLIB 5.5 development branch.
@
text
@d25 1
a25 1
  $Id: fitshdr.h,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.h,v 5.3.1.1 2015/04/21 02:54:02 mcalabre Exp mcalabre $
d28 3
a30 2
* The Flexible Image Transport System (FITS), a data format widely used in
* astronomy for data interchange and archive, is described in
a31 3
*   "Definition of the Flexible Image Transport System (FITS), version 3.0",
*   Pence, W.D., Chiappetti, L., Page, C.G., Shaw, R.A., & Stobie, E. 2010,
*   A&A, 524, A42 - http://dx.doi.org/10.1051/0004-6361/201015362
d33 4
a36 1
* See also http://fits.gsfc.nasa.gov
d38 3
a40 2
* Refer to the README file provided with WCSLIB for an overview of the
* library.
d42 1
a43 2
* Summary of the fitshdr routines
* -------------------------------
@


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


5.4.1.2
log
@Boilerplate change to the prologue to ensure that references to the WCS
Papers appear in the doxygen manual.
@
text
@d25 1
a25 1
  $Id: fitshdr.h,v 5.4.1.1 2015/04/21 14:44:28 mcalabre Exp mcalabre $
d28 2
a29 3
* WCSLIB 5.4 - C routines that implement the FITS World Coordinate System
* (WCS) standard.  Refer to the README file provided with WCSLIB for an
* overview of the library.
d31 3
d35 1
a35 4
* Summary of the fitshdr routines
* -------------------------------
* The Flexible Image Transport System (FITS), is a data format widely used in
* astronomy for data interchange and archive.  It is described in
d37 2
a38 3
=   "Definition of the Flexible Image Transport System (FITS), version 3.0",
=   Pence, W.D., Chiappetti, L., Page, C.G., Shaw, R.A., & Stobie, E. 2010,
=   A&A, 524, A42 - http://dx.doi.org/10.1051/0004-6361/201015362
a39 1
* See also http://fits.gsfc.nasa.gov
d41 2
@


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.h,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.h,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.h,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.h,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.h,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.h,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.h,v 4.25.1.3 2015/03/13 06:45:42 mcalabre Exp mcalabre $
@


5.0.1.1
log
@WCSLIB 5.0 development branch.
@
text
@d25 1
a25 1
  $Id: fitshdr.h,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.h,v 4.24.1.1 2014/09/18 15:28:09 mcalabre Exp mcalabre $
d252 1
a252 1
*       - 0: No keyvalue.
@


4.25.1.1
log
@WCSLIB 4.25 development branch.
@
text
@d25 1
a25 1
  $Id: fitshdr.h,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.h,v 4.25.1.1 2014/12/14 14:32:45 mcalabre Exp mcalabre $
@


4.25.1.3
log
@Augmented the comment for fitskey::type to note that where the keyvalue is
absent, both the value and type are undefined (according to FITS 3.0).
@
text
@d25 1
a25 1
  $Id: fitshdr.h,v 4.25.1.2 2015/01/06 01:01:06 mcalabre Exp mcalabre $
d252 1
a252 1
*       - 0: No keyvalue (both the value and type are undefined).
@


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.h,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.h,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.h,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.h,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.h,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.h,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.h,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.h,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.h,v 4.19.1.2 2013/12/17 14:53:20 mcalabre Exp mcalabre $
@


4.20.1.1
log
@WCSLIB 4.20 development branch.
@
text
@d25 1
a25 1
  $Id: fitshdr.h,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.h,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.h,v 4.18.1.1 2013/07/13 10:02:37 mcalabre Exp mcalabre $
d31 3
a33 2
*   "Definition of The Flexible Image Transport System (FITS)",
*   Hanisch, R.J., Farris, A., Greisen, E.W., et al. 2001, A&A, 376, 359
d35 1
a35 2
* which formalizes NOST 100-2.0, a document produced by the NASA/Science
* Office of Standards and Technology, see http://fits.gsfc.nasa.gov.
@


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


4.19.1.2
log
@Updated the reference for the published FITS definition.
@
text
@d25 1
a25 1
  $Id: fitshdr.h,v 4.19.1.1 2013/09/29 14:20:38 mcalabre Exp mcalabre $
d31 2
a32 3
*   "Definition of the Flexible Image Transport System (FITS), version 3.0",
*   Pence, W.D., Chiappetti, L., Page, C.G., Shaw, R.A., & Stobie, E. 2010,
*   A&A, 524, A42 - http://dx.doi.org/10.1051/0004-6361/201015362
d34 2
a35 1
* See also http://fits.gsfc.nasa.gov
@


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.h,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.h,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.h,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.h,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.h,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.h,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.h,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.h,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.h,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.h,v 4.13.1.2 2012/07/13 03:34:20 cal103 Exp cal103 $
@


4.14.1.1
log
@WCSLIB 4.14 development branch.
@
text
@d25 1
a25 1
  $Id: fitshdr.h,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.h,v 4.12.1.1 2012/02/29 07:59:10 cal103 Exp cal103 $
@


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


4.13.1.2
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.h,v 4.13.1.1 2012/03/14 07:40:37 cal103 Exp cal103 $
@


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.h,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.h,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.h,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.h,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.h,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.h,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.h,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.h,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.h,v 4.7.1.2 2011/08/09 02:10:43 cal103 Exp cal103 $
@


4.8.1.1
log
@WCSLIB 4.8 development branch.
@
text
@d31 1
a31 1
  $Id: fitshdr.h,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.h,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.h,v 4.6.1.2 2011/01/14 06:33:16 cal103 Exp cal103 $
d73 1
d89 1
@


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


4.7.1.2
log
@Trivial formatting of prologue.
@
text
@d31 1
a31 1
  $Id: fitshdr.h,v 4.7.1.1 2011/02/07 07:04:22 cal103 Exp $
a72 1
*
a87 1
*
@


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.h,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.h,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.h,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.h,v 4.4.1.2 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.h,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.h,v 4.3.1.4 2009/08/06 02:51:44 cal103 Exp cal103 $
@


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


4.4.1.2
log
@Updated date in copyright notice.
@
text
@d4 1
a4 1
  Copyright (C) 1995-2010, Mark Calabretta
d31 1
a31 1
  $Id: fitshdr.h,v 4.4.1.1 2009/08/10 08:52:49 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.h,v 4.2.1.8 2007/12/22 07:28:05 cal103 Exp cal103 $
d34 2
a35 2
*   The Flexible Image Transport System (FITS), a data format widely used in
*   astronomy for data interchange and archive, is described in
d37 2
a38 2
*      "Definition of The Flexible Image Transport System (FITS)",
*      Hanisch, R.J., Farris, A., Greisen, E.W., et al. 2001, A&A, 376, 359
d40 2
a41 2
*   which formalizes NOST 100-2.0, a document produced by the NASA/Science
*   Office of Standards and Technology, see http://fits.gsfc.nasa.gov.
d43 332
a374 282
*   Refer to the README file provided with WCSLIB for an overview of the
*   library.
*
*
*   FITS header parser routine; fitshdr()
*   -------------------------------------
*   fitshdr() parses a character array containing a FITS header, extracting
*   all keywords and their values into an array of fitskey structs.
*
*   Given:
*      header   const char []
*                        Character array containing the (entire) FITS header,
*                        for example, as might be obtained conveniently via
*                        the CFITSIO routine fits_hdr2str().
*
*                        Each header "keyrecord" (formerly "card image")
*                        consists of exactly 80 7-bit ASCII printing
*                        characters in the range 0x20 to 0x7e (which excludes
*                        NUL, BS, TAB, LF, FF and CR) especially noting that
*                        the keyrecords are NOT null-terminated.
*
*      nkeyrec  int      Number of keyrecords in header[].
*      nkeyids  int      Number of entries in keyids[].
*
*   Given and returned:
*      keyids   struct fitskeyid []
*                        While all keywords are extracted from the header,
*                        keyids[] provides a convienient way of indexing them.
*                        The fitskeyid struct contains three members, the
*                        first of which must be set by the user with the
*                        remainder set by fitshdr():
*
*                           char name[12] Name of the required keyword.  This
*                                         is to be set by the caller; the '.'
*                                         character may be used for
*                                         wildcarding.  Trailing blanks will
*                                         be replaced with nulls.
*
*                           int count     The number of matches found for the
*                                         keyword.
*
*                           int idx[2]    Indices into keys[], the array of
*                                         fitskey structs returned by
*                                         fitshdr() (see below).  Note that
*                                         these are 0-relative array indices,
*                                         not keyrecord numbers.
*
*                        If the keyword is found in the header the first index
*                        will be set to the array index of its first
*                        occurrence, otherwise it will be set to -1.
*
*                        If multiples of the keyword are found, the second
*                        index will be set to the array index of its last
*                        occurrence, otherwise it will be set to -1.
*
*                        All matched keywords will have their fitskey.keyno
*                        member negated.
*
*   Returned:
*      nreject  int*     Number of header keyrecords rejected for syntax
*                        errors.
*      keys     struct fitskey**
*                        Pointer to an array of nkeyrec fitskey structs (see
*                        below) containing all keywords and keyvalues
*                        extracted from the header.
*
*                        Memory for the array is allocated by fitshdr() and
*                        this must be freed by the caller by invoking free()
*                        on the array.
*
*   Function return value:
*               int      Status return value:
*                           0: Success.
*                           1: Null fitskey pointer passed.
*                           2: Memory allocation failed.
*
*
*   Notes
*   -----
*    1) Keyword parsing is done in accordance with the syntax defined by
*       NOST 100-2.0, noting the following points in particular:
*
*       a) Sect. 5.1.2.1 specifies that keywords be left-justified in columns
*          1-8, blank-filled with no embedded spaces, composed only of the
*          ASCII characters ABCDEFGHJKLMNOPQRSTUVWXYZ0123456789-_
*
*          fitshdr() accepts any characters in columns 1-8 but flags keywords
*          that do not conform to standard syntax.
*
*       b) Sect. 5.1.2.2 defines the "value indicator" as the characters "= "
*          occurring in columns 9 and 10.  If these are absent then the
*          keyword has no value and columns 9-80 may contain any ASCII text
*          (but see note 2 for CONTINUE keyrecords).  This is copied to the
*          comment member of the fitskey struct.
*
*       c) Sect. 5.1.2.3 states that a keyword may have a null (undefined)
*          value if the value/comment field, columns 11-80, consists entirely
*          of spaces, possibly followed by a comment.
*
*       d) Sect. 5.1.1 states that trailing blanks in a string keyvalue are
*          not significant and the parser always removes them.  A string
*          containing nothing but blanks will be replaced with a single blank.
*
*          Sect. 5.2.1 also states that a quote character (') in a string
*          value is to be represented by two successive quote characters and
*          the parser removes the repeated quote.
*
*       e) The parser recognizes free-format character (NOST 100-2.0,
*          Sect. 5.2.1), integer (Sect. 5.2.3), and floating-point values
*          (Sect. 5.2.4) for all keywords.
*
*       f) Sect. 5.2.3 offers no comment on the size of an integer keyvalue
*          except indirectly in limiting it to 70 digits.  The parser will
*          translates an integer keyvalue to a 32-bit signed integer if it
*          lies in the range -2147483648 to +2147483647, otherwise it
*          interprets it as a 64-bit signed integer if possible, or else a
*          "very long" integer as described below.
*
*       g) "END     " not followed by 72 blanks is not considered to be a
*          legitimate end keyrecord.
*
*    2) The parser supports a generalization of the OGIP Long String Keyvalue
*       Convention (v1.0) whereby strings may be continued onto successive
*       header keyrecords.  A keyrecord contains a segment of a continued
*       string if and only if
*          a) it contains the pseudo-keyword "CONTINUE",
*          b) columns 9 and 10 are both blank,
*          c) columns 11 to 80 contain what would be considered a valid string
*             keyvalue, including optional keycomment, if column 9 had
*             contained '=',
*          d) the previous keyrecord contained either a valid string keyvalue
*             or a valid CONTINUE keyrecord.
*       If any of these conditions is violated, the keyrecord is considered in
*       isolation.
*
*       Syntax errors in keycomments in a continued string are treated more
*       permissively than usual; the '/' delimiter may be omitted provided
*       that parsing of the string keyvalue is not compromised.  However, the
*       FITSHDR_COMMENT status bit will be set for the keyrecord (see below).
*
*       As for normal strings, trailing blanks in a continued string are not
*       significant.
*
*       In the OGIP convention "the '&' character is used as the last non-
*       blank character of the string to indicate that the string is
*       (probably) continued on the following keyword".  This additional
*       syntax is not required by fitshdr(), but if '&' does occur as the last
*       non-blank character of a continued string keyvalue then it will be
*       removed, along with any trailing blanks.  However, blanks that occur
*       before the '&' will be preserved.
*
*
*   Keyword/value information
*   -------------------------
*   fitshdr() returns an array of fitskey structs, each of which contains the
*   result of parsing one FITS header keyrecord:
*
*      int keyno
*         Keyrecord number (1-relative) in the array passed as input to
*         fitshdr().  This will be negated if the keyword matched any
*         specified in the keyids[] index.
*
*      int keyid
*         Index into the first entry in keyids[] with which the keyrecord
*         matches, else -1.
*
*      int status
*         Status flag bit-vector for the header keyrecord employing the
*         following bit masks defined as preprocessor macros:
*
*           FITSHDR_KEYWORD    Illegal keyword syntax.
*           FITSHDR_KEYVALUE   Illegal keyvalue syntax.
*           FITSHDR_COMMENT    Illegal keycomment syntax.
*           FITSHDR_KEYREC     Illegal keyrecord, e.g. an END keyrecord with
*                              trailing text.
*           FITSHDR_TRAILER    Keyrecord following a valid END keyrecord.
*
*        The header keyrecord is syntactically correct if no bits are set.
*
*      char keyword[12]
*         Keyword name, is null-filled for keywords of less than eight
*         characters (trailing blanks replaced by nulls).
*
*         Use sprintf(dst, "%.8s", keyword) to copy it to a character array
*         with null-termination, or sprintf(dst, "%8.8s", keyword) to blank-
*         fill to eight characters followed by null-termination.
*
*      int type
*         Keyvalue data type:
*            0: No keyvalue.
*            1: Logical, represented as int.
*            2: 32-bit signed integer.
*            3: 64-bit signed integer (see below).
*            4: Very long integer (see below).
*            5: Floating point (stored as double).
*            6: Integer complex (stored as double[2]).
*            7: Floating point complex (stored as double[2]).
*            8: String.
*            8 + 10*n: Continued string (see note 2 and below).
*
*         A negative type indicates that a syntax error was encountered when
*         attempting to parse a keyvalue of the particular type.
*
*         64-bit signed integer:
*            64-bit signed integers lie in the range
*               -9223372036854775808 <= int64 <  -2147483648
*            or          +2147483647 <  int64 <= +9223372036854775807.
*            A native 64-bit data type may be defined via preprocessor macro
*            WCSLIB_INT64 defined in wcsconfig.h, e.g. as 'long long int';
*            this will be typedef'd to 'int64' here.  If WCSLIB_INT64 is not
*            set, then int64 is typedef'd to int[3] instead and the keyvalue
*            is to be computed as
*
*                    ((keyvalue.k[2]) * 1000000000 +
*                      keyvalue.k[1]) * 1000000000 +
*                      keyvalue.k[0]
*
*            and may reported via
*
*               if (keyvalue.k[2]) {
*                  printf("%d%09d%09d", keyvalue.k[2], abs(keyvalue.k[1]),
*                                    abs(keyvalue.k[0]));
*               } else {
*                  printf("%d%09d", keyvalue.k[1], abs(keyvalue.k[0]));
*               }
*
*            where keyvalue.k[0] and keyvalue.k[1] range from -999999999 to
*            +999999999.
*
*         Very long integers:
*            Integers up to 70 decimal digits in length are encoded in
*            keyvalue.l as an array of int[8], each of which stores 9 decimal
*            digits.  The keyvalue is to be computed as
*
*               (((((((keyvalue.l[7]) * 1000000000 +
*                      keyvalue.l[6]) * 1000000000 +
*                      keyvalue.l[5]) * 1000000000 +
*                      keyvalue.l[4]) * 1000000000 +
*                      keyvalue.l[3]) * 1000000000 +
*                      keyvalue.l[2]) * 1000000000 +
*                      keyvalue.l[1]) * 1000000000 +
*                      keyvalue.l[0]
*
*         Continued strings:
*            Continued strings are not reconstructed, they remain split over
*            successive fitskey structs in the keys[] array returned by
*            fitshdr().  The keyvalue data type, 8 + 10n, indicates the
*            segment number, n, in the continuation.
*
*      union keyvalue
*         A union containing the keyword value:
*            keyvalue.i (int):       Logical (type == 1), and
*                                    32-bit signed integer (type == 2).
*            keyvalue.k (int64):     64-bit signed integer (type == 3),
*                                    see above.
*            keyvalue.l (int[8]):    Very long integer (type == 4), see above.
*            keyvalue.f (double):    Floating point (type == 5).
*            keyvalue.c (double[2]): Integer and floating point complex
*                                    (type == 6 || 7).
*            keyvalue.s (char[72]):  String (type == 8), null-terminated.
*
*      int ulen
*         Where a keycomment contains a units string in the standard form,
*         e.g. [m/s], the ulen member indicates its length, inclusive of
*         square brackets.  Otherwise ulen is zero.
*
*      char comment[84]
*         Keycomment, i.e. comment associated with the keyword or, for
*         keyrecords rejected because of syntax errors, the compete keyrecord
*         itself with null-termination.
*
*         Comments are null-terminated with trailing spaces removed.  Leading
*         spaces are also removed from keycomments (i.e. those immediately
*         following the '/' character), but not from COMMENT or HISTORY
*         keyrecords or keyrecords without a value indicator ("= " in columns
*         9-80).
*
*
*   Status return values
*   --------------------
*   Error messages to match the status value returned from each function are
*   encoded in the fitshdr_errmsg character array.
d391 1
a391 1
#define FITSHDR_CARD     0x08   /* Alias for backwards compatibility. */
d398 1
a398 1
   typedef WCSLIB_INT64 int64;
d400 1
a400 1
   typedef int int64[3];
d404 1
a404 1
				/* Struct used for indexing the keywords.   */
d406 3
a408 3
   char name[12];		/* Keyword name, null-terminated.           */
   int  count;			/* Number of occurrences of keyword.        */
   int  idx[2];			/* Indices into fitskey array.              */
d411 5
a415 1
				/* Struct used for storing FITS keywords.   */
d417 16
a432 16
   int  keyno;			/* Header keyrecord sequence number (1-rel).*/
   int  keyid;			/* Index into fitskeyid[].                  */
   int  status;			/* Header keyrecord status bit flags.       */
   char keyword[12];		/* Keyword name, null-filled.               */
   int  type;			/* Keyvalue type (see above).               */
   int  dummy;			/* (Dummy for alignment.)                   */
   union {
      int    i;			/* 32-bit integer and logical values.       */
      int64  k;			/* 64-bit integer values.                   */
      int    l[8];		/* Very long signed integer values.         */
      double f;			/* Floating point values.                   */
      double c[2];		/* Complex values.                          */
      char   s[72];		/* String values, null-terminated.          */
   } keyvalue;			/* Keyvalue.                                */
   int  ulen;			/* Length of units string.                  */
   char comment[84];		/* Comment (or keyrecord), null-terminated. */
d435 6
a440 2
int fitshdr(const char [], int, int, struct fitskeyid [], int *,
            struct fitskey **);
@


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.h,v 4.3 2007/12/27 05:41:36 cal103 Exp cal103 $
@


4.3.1.2
log
@Replaced references to text "above" or "below" with "(see ... above|below)"
so that they can be parsed out of the doxygen markup.
@
text
@d31 1
a31 1
    $Id: fitshdr.h,v 4.3.1.1 2007/12/27 13:23:47 cal103 Exp cal103 $
a46 4
*   Summary of the fitshdr routines
*   -------------------------------
*
*
d159 1
a159 1
*          "very long" integer (see below).
d241 1
a241 1
*            8 + 10*n: Continued string (described below and in note 2).
d294 9
a302 9
*            keyvalue.i (int):       Logical, type == 1, and
*                                    32-bit signed integer, type == 2.
*            keyvalue.k (int64):     64-bit signed integer, type == 3 (see
*                                    above).
*            keyvalue.l (int[8]):    Very long integer, type == 4 (see above).
*            keyvalue.f (double):    Floating point, type == 5.
*            keyvalue.c (double[2]): Integer and floating point complex,
*                                    type == 6 || 7.
*            keyvalue.s (char[72]):  String, type == 8, null-terminated.
@


4.3.1.3
log
@Changes required for generation of the manual using doxextr and doxygen,
including naming of arguments in function prototypes.
@
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.h,v 4.3.1.2 2008/04/02 06:17:13 cal103 Exp cal103 $
d34 2
a35 2
* The Flexible Image Transport System (FITS), a data format widely used in
* astronomy for data interchange and archive, is described in
d37 2
a38 2
*   "Definition of The Flexible Image Transport System (FITS)",
*   Hanisch, R.J., Farris, A., Greisen, E.W., et al. 2001, A&A, 376, 359
d40 2
a41 2
* which formalizes NOST 100-2.0, a document produced by the NASA/Science
* Office of Standards and Technology, see http://fits.gsfc.nasa.gov.
d43 286
a328 332
* Refer to the README file provided with WCSLIB for an overview of the
* library.
*
*
* Summary of the fitshdr routines
* -------------------------------
* fitshdr() is a generic FITS header parser provided to handle keyrecords that
* are ignored by the WCS header parsers, wcspih() and wcsbth().  Typically the
* latter may be set to remove WCS keyrecords from a header leaving fitshdr()
* to handle the remainder.
*
*
* fitshdr() - FITS header parser routine
* --------------------------------------
* fitshdr() parses a character array containing a FITS header, extracting
* all keywords and their values into an array of fitskey structs.
*
* Given:
*   header    const char []
*                       Character array containing the (entire) FITS header,
*                       for example, as might be obtained conveniently via the
*                       CFITSIO routine fits_hdr2str().
*
*                       Each header "keyrecord" (formerly "card image")
*                       consists of exactly 80 7-bit ASCII printing characters
*                       in the range 0x20 to 0x7e (which excludes NUL, BS,
*                       TAB, LF, FF and CR) especially noting that the
*                       keyrecords are NOT null-terminated.
*
*   nkeyrec   int       Number of keyrecords in header[].
*   nkeyids   int       Number of entries in keyids[].
*
* Given and returned:
*   keyids    struct fitskeyid []
*                       While all keywords are extracted from the header,
*                       keyids[] provides a convienient way of indexing them.
*                       The fitskeyid struct contains three members;
*                       fitskeyid::name must be set by the user while
*                       fitskeyid::count and fitskeyid::name are returned by
*                       fitshdr().  All matched keywords will have their
*                       fitskey::keyno member negated.
*
* Returned:
*   nreject   int*      Number of header keyrecords rejected for syntax
*                       errors.
*   keys      struct fitskey**
*                       Pointer to an array of nkeyrec fitskey structs
*                       containing all keywords and keyvalues extracted from
*                       the header.
*
*                       Memory for the array is allocated by fitshdr() and
*                       this must be freed by the user by invoking free() on
*                       the array.
*
* Function return value:
*             int       Status return value:
*                         0: Success.
*                         1: Null fitskey pointer passed.
*                         2: Memory allocation failed.
*                         3: Fatal error returned by Flex parser.
*
* Notes:
*   1: Keyword parsing is done in accordance with the syntax defined by
*      NOST 100-2.0, noting the following points in particular:
*
*      a: Sect. 5.1.2.1 specifies that keywords be left-justified in columns
*         1-8, blank-filled with no embedded spaces, composed only of the
*         ASCII characters ABCDEFGHJKLMNOPQRSTUVWXYZ0123456789-_
*
*         fitshdr() accepts any characters in columns 1-8 but flags keywords
*         that do not conform to standard syntax.
*
*      b: Sect. 5.1.2.2 defines the "value indicator" as the characters "= "
*         occurring in columns 9 and 10.  If these are absent then the
*         keyword has no value and columns 9-80 may contain any ASCII text
*         (but see note 2 for CONTINUE keyrecords).  This is copied to the
*         comment member of the fitskey struct.
*
*      c: Sect. 5.1.2.3 states that a keyword may have a null (undefined)
*         value if the value/comment field, columns 11-80, consists entirely
*         of spaces, possibly followed by a comment.
*
*      d: Sect. 5.1.1 states that trailing blanks in a string keyvalue are
*         not significant and the parser always removes them.  A string
*         containing nothing but blanks will be replaced with a single
*         blank.
*
*         Sect. 5.2.1 also states that a quote character (') in a string
*         value is to be represented by two successive quote characters and
*         the parser removes the repeated quote.
*
*      e: The parser recognizes free-format character (NOST 100-2.0,
*         Sect. 5.2.1), integer (Sect. 5.2.3), and floating-point values
*         (Sect. 5.2.4) for all keywords.
*
*      f: Sect. 5.2.3 offers no comment on the size of an integer keyvalue
*         except indirectly in limiting it to 70 digits.  The parser will
*         translates an integer keyvalue to a 32-bit signed integer if it
*         lies in the range -2147483648 to +2147483647, otherwise it
*         interprets it as a 64-bit signed integer if possible, or else a
*         "very long" integer (see fitskey::type).
*
*      g: END not followed by 77 blanks is not considered to be a legitimate
*         end keyrecord.
*
*   2: The parser supports a generalization of the OGIP Long String Keyvalue
*      Convention (v1.0) whereby strings may be continued onto successive
*      header keyrecords.  A keyrecord contains a segment of a continued
*      string if and only if
*
*      a: it contains the pseudo-keyword CONTINUE,
*
*      b: columns 9 and 10 are both blank,
*
*      c: columns 11 to 80 contain what would be considered a valid string
*         keyvalue, including optional keycomment, if column 9 had contained
*         '=',
*
*      d: the previous keyrecord contained either a valid string keyvalue or
*         a valid CONTINUE keyrecord.
*
*      If any of these conditions is violated, the keyrecord is considered in
*      isolation.
*
*      Syntax errors in keycomments in a continued string are treated more
*      permissively than usual; the '/' delimiter may be omitted provided that
*      parsing of the string keyvalue is not compromised.  However, the
*      FITSHDR_COMMENT status bit will be set for the keyrecord (see
*      fitskey::status).
*
*      As for normal strings, trailing blanks in a continued string are not
*      significant.
*
*      In the OGIP convention "the '&' character is used as the last non-blank
*      character of the string to indicate that the string is (probably)
*      continued on the following keyword".  This additional syntax is not
*      required by fitshdr(), but if '&' does occur as the last non-blank
*      character of a continued string keyvalue then it will be removed, along
*      with any trailing blanks.  However, blanks that occur before the '&'
*      will be preserved.
*
*
* fitskeyid struct - Keyword indexing
* -----------------------------------
* fitshdr() uses the fitskeyid struct to return indexing information for
* specified keywords.  The struct contains three members, the first of which,
* fitskeyid::name, must be set by the user with the remainder returned by
* fitshdr().
*
*   char name[12]:
*     (Given) Name of the required keyword.  This is to be set by the user;
*     the '.' character may be used for wildcarding.  Trailing blanks will be
*     replaced with nulls.
*
*   int count:
*     (Returned) The number of matches found for the keyword.
*
*   int idx[2]:
*     (Returned) Indices into keys[], the array of fitskey structs returned by
*     fitshdr().  Note that these are 0-relative array indices, not keyrecord
*     numbers.
*
*     If the keyword is found in the header the first index will be set to the
*     array index of its first occurrence, otherwise it will be set to -1.
*
*     If multiples of the keyword are found, the second index will be set to
*     the array index of its last occurrence, otherwise it will be set to -1.
*
*
* fitskey struct - Keyword/value information
* ------------------------------------------
* fitshdr() returns an array of fitskey structs, each of which contains the
* result of parsing one FITS header keyrecord.  All members of the fitskey
* struct are returned by fitshdr(), none are given by the user.
*
*   int keyno
*     (Returned) Keyrecord number (1-relative) in the array passed as input to
*     fitshdr().  This will be negated if the keyword matched any specified in
*     the keyids[] index.
*
*   int keyid
*     (Returned) Index into the first entry in keyids[] with which the
*     keyrecord matches, else -1.
*
*   int status
*     (Returned) Status flag bit-vector for the header keyrecord employing the
*     following bit masks defined as preprocessor macros:
*
*       - FITSHDR_KEYWORD:    Illegal keyword syntax.
*       - FITSHDR_KEYVALUE:   Illegal keyvalue syntax.
*       - FITSHDR_COMMENT:    Illegal keycomment syntax.
*       - FITSHDR_KEYREC:     Illegal keyrecord, e.g. an END keyrecord with
*                             trailing text.
*       - FITSHDR_TRAILER:    Keyrecord following a valid END keyrecord.
*
*     The header keyrecord is syntactically correct if no bits are set.
*
*   char keyword[12]
*     (Returned) Keyword name, null-filled for keywords of less than eight
*     characters (trailing blanks replaced by nulls).
*
*     Use
*
=       sprintf(dst, "%.8s", keyword)
*
*     to copy it to a character array with null-termination, or
*
=       sprintf(dst, "%8.8s", keyword)
*
*     to blank-fill to eight characters followed by null-termination.
*
*   int type
*     (Returned) Keyvalue data type:
*       - 0: No keyvalue.
*       - 1: Logical, represented as int.
*       - 2: 32-bit signed integer.
*       - 3: 64-bit signed integer (see below).
*       - 4: Very long integer (see below).
*       - 5: Floating point (stored as double).
*       - 6: Integer complex (stored as double[2]).
*       - 7: Floating point complex (stored as double[2]).
*       - 8: String.
*       - 8+10*n: Continued string (described below and in fitshdr() note 2).
*
*     A negative type indicates that a syntax error was encountered when
*     attempting to parse a keyvalue of the particular type.
*
*     Comments on particular data types:
*       - 64-bit signed integers lie in the range
*
=           (-9223372036854775808 <= int64 <  -2147483648) ||
=                    (+2147483647 <  int64 <= +9223372036854775807)
*
*         A native 64-bit data type may be defined via preprocessor macro
*         WCSLIB_INT64 defined in wcsconfig.h, e.g. as 'long long int'; this
*         will be typedef'd to 'int64' here.  If WCSLIB_INT64 is not set, then
*         int64 is typedef'd to int[3] instead and fitskey::keyvalue is to be
*         computed as
*
=           ((keyvalue.k[2]) * 1000000000 +
=             keyvalue.k[1]) * 1000000000 +
=             keyvalue.k[0]
*
*         and may reported via
*
=            if (keyvalue.k[2]) {
=              printf("%d%09d%09d", keyvalue.k[2], abs(keyvalue.k[1]),
=                                   abs(keyvalue.k[0]));
=            } else {
=              printf("%d%09d", keyvalue.k[1], abs(keyvalue.k[0]));
=            }
*
*         where keyvalue.k[0] and keyvalue.k[1] range from -999999999 to
*         +999999999.
*
*       - Very long integers, up to 70 decimal digits in length, are encoded
*         in keyvalue.l as an array of int[8], each of which stores 9 decimal
*         digits.  fitskey::keyvalue is to be computed as
*
=           (((((((keyvalue.l[7]) * 1000000000 +
=                  keyvalue.l[6]) * 1000000000 +
=                  keyvalue.l[5]) * 1000000000 +
=                  keyvalue.l[4]) * 1000000000 +
=                  keyvalue.l[3]) * 1000000000 +
=                  keyvalue.l[2]) * 1000000000 +
=                  keyvalue.l[1]) * 1000000000 +
=                  keyvalue.l[0]
*
*       - Continued strings are not reconstructed, they remain split over
*         successive fitskey structs in the keys[] array returned by
*         fitshdr().  fitskey::keyvalue data type, 8 + 10n, indicates the
*         segment number, n, in the continuation.
*
*   int padding
*     (An unused variable inserted for alignment purposes only.)
*
*   union keyvalue
*     (Returned) A union comprised of
*
*       - fitskey::i,
*       - fitskey::k,
*       - fitskey::l,
*       - fitskey::f,
*       - fitskey::c,
*       - fitskey::s,
*
*     used by the fitskey struct to contain the value associated with a
*     keyword.
*
*   int i
*     (Returned) Logical (fitskey::type == 1) and 32-bit signed integer
*     (fitskey::type == 2) data types in the fitskey::keyvalue union.
*
*   int64 k
*     (Returned) 64-bit signed integer (fitskey::type == 3) data type in the
*     fitskey::keyvalue union.
*
*   int l[8]
*     (Returned) Very long integer (fitskey::type == 4) data type in the
*     fitskey::keyvalue union.
*
*   double f
*     (Returned) Floating point (fitskey::type == 5) data type in the
*     fitskey::keyvalue union.
*
*   double c[2]
*     (Returned) Integer and floating point complex (fitskey::type == 6 || 7)
*     data types in the fitskey::keyvalue union.
*
*   char s[72]
*     (Returned) Null-terminated string (fitskey::type == 8) data type in the
*     fitskey::keyvalue union.
*
*   int ulen
*     (Returned) Where a keycomment contains a units string in the standard
*     form, e.g. [m/s], the ulen member indicates its length, inclusive of
*     square brackets.  Otherwise ulen is zero.
*
*   char comment[84]
*     (Returned) Keycomment, i.e. comment associated with the keyword or, for
*     keyrecords rejected because of syntax errors, the compete keyrecord
*     itself with null-termination.
*
*     Comments are null-terminated with trailing spaces removed.  Leading
*     spaces are also removed from keycomments (i.e. those immediately
*     following the '/' character), but not from COMMENT or HISTORY keyrecords
*     or keyrecords without a value indicator ("= " in columns 9-80).
*
*
* Global variable: const char *fitshdr_errmsg[] - Status return messages
* ----------------------------------------------------------------------
* Error messages to match the status value returned from each function.
d345 1
a345 1
#define FITSHDR_CARD     0x08	/* Alias for backwards compatibility. */
d352 1
a352 1
  typedef WCSLIB_INT64 int64;
d354 1
a354 1
  typedef int int64[3];
d358 1
a358 1
/* Struct used for indexing the keywords. */
d360 3
a362 3
  char name[12];		/* Keyword name, null-terminated.           */
  int  count;			/* Number of occurrences of keyword.        */
  int  idx[2];			/* Indices into fitskey array.              */
d365 1
a365 1
/* Struct used for storing FITS keywords. */
d367 16
a382 16
  int  keyno;			/* Header keyrecord sequence number (1-rel).*/
  int  keyid;			/* Index into fitskeyid[].                  */
  int  status;			/* Header keyrecord status bit flags.       */
  char keyword[12];		/* Keyword name, null-filled.               */
  int  type;			/* Keyvalue type (see above).               */
  int  padding;			/* (Dummy inserted for alignment purposes.) */
  union {
    int    i;			/* 32-bit integer and logical values.       */
    int64  k;			/* 64-bit integer values.                   */
    int    l[8];		/* Very long signed integer values.         */
    double f;			/* Floating point values.                   */
    double c[2];		/* Complex values.                          */
    char   s[72];		/* String values, null-terminated.          */
  } keyvalue;			/* Keyvalue.                                */
  int  ulen;			/* Length of units string.                  */
  char comment[84];		/* Comment (or keyrecord), null-terminated. */
d385 2
a386 3

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


4.3.1.4
log
@Define KEYIDLEN and KEYLEN for use of the Fortran wrappers.
@
text
@d31 1
a31 1
  $Id: fitshdr.h,v 4.3.1.3 2009/07/22 05:10:07 cal103 Exp cal103 $
a410 4
/* Size of the fitskeyid struct in int units, used by the Fortran wrappers. */
#define KEYIDLEN (sizeof(struct fitskeyid)/sizeof(int))


a430 3
/* Size of the fitskey struct in int units, used by the Fortran wrappers. */
#define KEYLEN (sizeof(struct fitskey)/sizeof(int))

@


4.2
log
@WCSLIB 4.2: WCS_INT64 is now defined in config.h.
@
text
@d2 30
a31 29
*
*   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
*   http://www.atnf.csiro.au/~mcalabre/index.html
*   $Id: fitshdr.h,v 4.1 2005/08/25 07:26:29 cal103 Exp cal103 $
d43 3
d58 5
a62 4
*                        Each header "card" consists of exactly 80 7-bit ASCII
*                        printing characters in the range 0x20 to 0x7e (which
*                        excludes NUL, BS, TAB, LF, FF and CR) especially
*                        noting that the cards are NOT null-terminated.
d64 1
a64 1
*      ncards   int      Number of cards in header[].
d88 1
a88 1
*                                         not card numbers.
d98 1
a98 1
*                        All matched keywords will have their fitskey.cardno
d102 2
a103 1
*      nreject  int*     Number of header cards rejected for syntax errors.
d105 1
a105 1
*                        Pointer to an array of ncards fitskey structs (see
d135 2
a136 2
*          (but see note 2 for CONTINUE cards).  This is copied to the comment
*          member of the fitskey struct.
d162 1
a162 1
*          legitimate end card.
d166 2
a167 2
*       header cards.  A card contains a segment of a continued string if and
*       only if
d171 1
a171 1
*             keyvalue, including optional inline comment, if column 9 had
d173 3
a175 3
*          d) the previous card contained either a valid string keyvalue or a
*             valid CONTINUE card.
*       If any of these conditions is violated, the card is considered in
d178 4
a181 5
*       Syntax errors in inline comments in a continued string are treated
*       more permissively than usual; the '/' delimiter may be omitted
*       provided that parsing of the string keyvalue is not compromised.
*       However, the FITSHDR_COMMENT status bit will be set for the card (see
*       below).
d198 1
a198 1
*   result of parsing one FITS header card:
d201 3
a203 3
*         Card number (1-relative) in the array passed as input to fitshdr().
*         This will be negated if the keyword matched any specified in the
*         keyids[] index.
d206 2
a207 2
*         Index into the first entry in keyids[] with which the card matches,
*         else -1.
d210 2
a211 2
*         Status flag bit-vector for the header card employing the following
*         bit masks defined as preprocessor macros:
d215 4
a218 4
*           FITSHDR_COMMENT    Illegal inline comment syntax.
*           FITSHDR_CARD       Illegal card, e.g. an END card with trailing
*                              text.
*           FITSHDR_TRAILER    Card following a valid END card.
d220 1
a220 1
*        The header card is syntactically correct if no bits are set.
d251 4
a254 4
*            WCS_INT64 defined in config.h, e.g. as 'long long int'; this will
*            be typedef'd to 'int64' here.  If WCS_INT64 is not set, then
*            int64 is typedef'd to int[3] instead and the keyvalue is to be
*            computed as
d305 2
a306 2
*         Where an inline comment contains a units string in the standard
*         form, e.g. [m/s], the ulen member indicates its length, inclusive of
d310 3
a312 2
*         Comment associated with the keyword or, for cards rejected because
*         of syntax errors, the compete card itself with null-termination.
d315 4
a318 3
*         spaces are also removed from inline comments (i.e. those immediately
*         following the '/' character), but not from COMMENT or HISTORY cards
*         or cards without a value indicator ("= " in columns 9-80).
d331 1
a331 1
#include "config.h"
d340 2
a341 1
#define FITSHDR_CARD     0x08
d347 2
a348 2
#ifdef WCS_INT64
   typedef WCS_INT64 int64;
d363 1
a363 1
   int  keyno;			/* Header card sequence number (1-rel).     */
d365 1
a365 1
   int  status;			/* Header card status bit flags.            */
d378 1
a378 1
   char comment[84];		/* Comment (or card), null-terminated.      */
d386 1
a386 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.
d30 1
a30 1
*   $Id: fitshdr.h,v 4.2 2005/09/22 09:10:53 cal103 Exp cal103 $
@


4.2.1.2
log
@Removed an extraneous ';' following the closing '}' of the 'extern "C" {'
block provided for use in C++.
@
text
@d4 1
a4 1
*   Copyright (C) 1995-2006, Mark Calabretta
d30 1
a30 1
*   $Id: fitshdr.h,v 4.2.1.1 2005/12/05 02:39:43 cal103 Exp cal103 $
d378 1
a378 1
}
@


4.2.1.3
log
@Replaced use of the obsolete term "card".
@
text
@d4 1
a4 1
*   Copyright (C) 1995-2007, Mark Calabretta
d30 1
a30 1
*   $Id: fitshdr.h,v 4.2.1.2 2006/08/02 00:14:58 cal103 Exp cal103 $
d54 4
a57 5
*                        Each header "keyrecord" (formerly "card image")
*                        consists of exactly 80 7-bit ASCII printing
*                        characters in the range 0x20 to 0x7e (which excludes
*                        NUL, BS, TAB, LF, FF and CR) especially noting that
*                        the keyrecords are NOT null-terminated.
d59 1
a59 1
*      nkeyrec  int      Number of keyrecords in header[].
d83 1
a83 1
*                                         not keyrecord numbers.
d93 1
a93 1
*                        All matched keywords will have their fitskey.keyno
d97 1
a97 2
*      nreject  int*     Number of header keyrecords rejected for syntax
*                        errors.
d99 1
a99 1
*                        Pointer to an array of nkeyrec fitskey structs (see
d129 2
a130 2
*          (but see note 2 for CONTINUE keyrecords).  This is copied to the
*          comment member of the fitskey struct.
d156 1
a156 1
*          legitimate end keyrecord.
d160 2
a161 2
*       header keyrecords.  A keyrecord contains a segment of a continued
*       string if and only if
d167 3
a169 3
*          d) the previous keyrecord contained either a valid string keyvalue
*             or a valid CONTINUE keyrecord.
*       If any of these conditions is violated, the keyrecord is considered in
d175 2
a176 2
*       However, the FITSHDR_COMMENT status bit will be set for the keyrecord
*       (see below).
d193 1
a193 1
*   result of parsing one FITS header keyrecord:
d196 3
a198 3
*         Keyrecord number (1-relative) in the array passed as input to
*         fitshdr().  This will be negated if the keyword matched any
*         specified in the keyids[] index.
d201 2
a202 2
*         Index into the first entry in keyids[] with which the keyrecord
*         matches, else -1.
d205 2
a206 2
*         Status flag bit-vector for the header keyrecord employing the
*         following bit masks defined as preprocessor macros:
d211 3
a213 3
*           FITSHDR_KEYREC     Illegal keyrecord, e.g. an END keyrecord with
*                              trailing text.
*           FITSHDR_TRAILER    Keyrecord following a valid END keyrecord.
d215 1
a215 1
*        The header keyrecord is syntactically correct if no bits are set.
d305 2
a306 3
*         Comment associated with the keyword or, for keyrecords rejected
*         because of syntax errors, the compete keyrecord itself with null-
*         termination.
d310 2
a311 3
*         following the '/' character), but not from COMMENT or HISTORY
*         keyrecords or keyrecords without a value indicator ("= " in columns
*         9-80).
d333 1
a333 2
#define FITSHDR_KEYREC   0x08
#define FITSHDR_CARD     0x08   /* Alias for backwards compatibility. */
d355 1
a355 1
   int  keyno;			/* Header keyrecord sequence number (1-rel).*/
d357 1
a357 1
   int  status;			/* Header keyrecord status bit flags.       */
d370 1
a370 1
   char comment[84];		/* Comment (or keyrecord), null-terminated. */
@


4.2.1.4
log
@Renamed WCS_INT64 -> WCSLIB_INT64.
@
text
@d30 1
a30 1
*   $Id: fitshdr.h,v 4.2.1.3 2007/08/02 05:09:40 cal103 Exp cal103 $
d248 4
a251 4
*            WCSLIB_INT64 defined in config.h, e.g. as 'long long int'; this
*            will be typedef'd to 'int64' here.  If WCSLIB_INT64 is not set,
*            then int64 is typedef'd to int[3] instead and the keyvalue is to
*            be computed as
d344 2
a345 2
#ifdef WCSLIB_INT64
   typedef WCSLIB_INT64 int64;
@


4.2.1.5
log
@Renamed config.h -> wcsconfig.h.
@
text
@d30 1
a30 1
*   $Id: fitshdr.h,v 4.2.1.4 2007/08/08 04:15:53 cal103 Exp cal103 $
d248 4
a251 4
*            WCSLIB_INT64 defined in wcsconfig.h, e.g. as 'long long int';
*            this will be typedef'd to 'int64' here.  If WCSLIB_INT64 is not
*            set, then int64 is typedef'd to int[3] instead and the keyvalue
*            is to be computed as
d328 1
a328 1
#include "wcsconfig.h"
@


4.2.1.6
log
@Referenced the README file for an overview of the library.
@
text
@d30 1
a30 1
*   $Id: fitshdr.h,v 4.2.1.5 2007/08/08 04:33:16 cal103 Exp cal103 $
a41 3
*   Refer to the README file provided with WCSLIB for an overview of the
*   library.
*
@


4.2.1.7
log
@Switched to LGPL 3.0.
@
text
@d2 29
a30 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.h,v 4.2.1.6 2007/08/08 08:42:22 cal103 Exp cal103 $
@


4.2.1.8
log
@"Inline comment" -> "keycomment".
@
text
@d31 1
a31 1
    $Id: fitshdr.h,v 4.2.1.7 2007/12/03 05:02:17 cal103 Exp cal103 $
d171 1
a171 1
*             keyvalue, including optional keycomment, if column 9 had
d178 5
a182 4
*       Syntax errors in keycomments in a continued string are treated more
*       permissively than usual; the '/' delimiter may be omitted provided
*       that parsing of the string keyvalue is not compromised.  However, the
*       FITSHDR_COMMENT status bit will be set for the keyrecord (see below).
d216 1
a216 1
*           FITSHDR_COMMENT    Illegal keycomment syntax.
d306 2
a307 2
*         Where a keycomment contains a units string in the standard form,
*         e.g. [m/s], the ulen member indicates its length, inclusive of
d311 3
a313 3
*         Keycomment, i.e. comment associated with the keyword or, for
*         keyrecords rejected because of syntax errors, the compete keyrecord
*         itself with null-termination.
d316 1
a316 1
*         spaces are also removed from keycomments (i.e. those immediately
@


4.1
log
@WCSLIB 4.1: initial revision.
@
text
@d3 1
a3 1
*   WCSLIB 4.1 - an implementation of the FITS WCS standard.
d30 1
a30 1
*   $Id$
d246 4
a249 4
*            WCS_INT64, e.g. -DWCS_INT64='long long int'; this will be
*            typedef'd to 'int64' here.  If WCS_INT64 is not set, then int64
*            is typedef'd to int[3] instead and the keyvalue is to be computed
*            as
d324 2
a338 3
/* ...this has to be set from a config.h type header file so that someone
*  linking to WCSLIB will get the same definition as when it was compiled.
*/
d340 1
a340 1
  typedef WCS_INT64 int64;
d342 1
a342 1
  typedef int int64[3];
@


0.0
log
@Empty revision
@
text
@d1 382
@
