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.17;	author mcalabre;	state Exp;
branches
	8.4.1.1;
next	8.3;

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

8.2
date	2023.11.16.10.00.30;	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.05;	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.49;	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.52;	author mcalabre;	state Exp;
branches
	7.4.1.1;
next	7.3;

7.3
date	2020.06.03.03.37.03;	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.14;	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.05;	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.24;	author mcalabre;	state Exp;
branches
	5.17.1.1;
next	5.16;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

4.12
date	2012.02.29.07.57.57;	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.54;	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.32;	author cal103;	state Exp;
branches
	4.6.1.1;
next	4.5;

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

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

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

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

4.1
date	2005.08.27.01.41.21;	author cal103;	state Exp;
branches;
next	4.0;

4.0
date	2005.02.04.12.39.04;	author cal103;	state Exp;
branches;
next	3.6;

3.6
date	2004.08.25.06.04.07;	author cal103;	state Exp;
branches;
next	3.5;

3.5
date	2004.06.28.05.10.07;	author mcalabre;	state Exp;
branches;
next	3.4;

3.4
date	2004.02.11.00.01.47;	author mcalabre;	state Exp;
branches;
next	3.3;

3.3
date	2003.10.21.08.44.04;	author mcalabre;	state Exp;
branches;
next	3.2;

3.2
date	2003.09.09.05.36.09;	author mcalabre;	state Exp;
branches;
next	3.1;

3.1
date	2003.04.28.08.04.33;	author mcalabre;	state Exp;
branches;
next	3.0;

3.0
date	2003.04.01.05.19.47;	author mcalabre;	state Exp;
branches;
next	;

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

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

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

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

4.2.1.5
date	2007.12.03.05.36.01;	author cal103;	state Exp;
branches;
next	;

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

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

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

4.3.1.4
date	2009.07.22.07.18.23;	author cal103;	state Exp;
branches;
next	;

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

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

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

4.5.1.1
date	2010.07.16.07.05.32;	author cal103;	state Exp;
branches;
next	4.5.1.2;

4.5.1.2
date	2010.11.15.07.19.41;	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.34.01;	author cal103;	state Exp;
branches;
next	;

4.7.1.1
date	2011.02.07.07.04.23;	author cal103;	state Exp;
branches;
next	4.7.1.2;

4.7.1.2
date	2011.08.09.03.00.46;	author cal103;	state Exp;
branches;
next	4.7.1.3;

4.7.1.3
date	2011.08.12.08.38.32;	author cal103;	state Exp;
branches;
next	4.7.1.4;

4.7.1.4
date	2011.08.13.03.16.53;	author cal103;	state Exp;
branches;
next	4.7.1.5;

4.7.1.5
date	2011.08.15.06.08.59;	author cal103;	state Exp;
branches;
next	;

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

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

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

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

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

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

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

4.13.1.2
date	2012.07.13.03.40.02;	author cal103;	state Exp;
branches;
next	;

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

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

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

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

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

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

4.19.1.1
date	2013.09.29.14.20.40;	author mcalabre;	state Exp;
branches;
next	4.19.1.2;

4.19.1.2
date	2013.12.10.23.10.30;	author mcalabre;	state Exp;
branches;
next	;

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

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

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

4.22.1.1
date	2014.04.12.15.06.33;	author mcalabre;	state Exp;
branches;
next	4.22.1.2;

4.22.1.2
date	2014.05.10.14.44.58;	author mcalabre;	state Exp;
branches;
next	;

4.23.1.1
date	2014.05.13.05.53.51;	author mcalabre;	state Exp;
branches;
next	4.23.1.2;

4.23.1.2
date	2014.05.22.11.30.25;	author mcalabre;	state Exp;
branches;
next	;

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

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

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

4.25.1.3
date	2015.03.05.08.23.34;	author mcalabre;	state Exp;
branches;
next	4.25.1.4;

4.25.1.4
date	2015.04.05.06.53.05;	author mcalabre;	state Exp;
branches;
next	;

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

5.1.1.1
date	2015.04.07.11.01.12;	author mcalabre;	state Exp;
branches;
next	5.1.1.2;

5.1.1.2
date	2015.04.13.11.40.57;	author mcalabre;	state Exp;
branches;
next	;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

5.17.1.3
date	2018.01.10.08.26.33;	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.42;	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.04.46.28;	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.02.05.36;	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.14.02.15.29;	author mcalabre;	state Exp;
branches;
next	6.4.1.3;

6.4.1.3
date	2019.12.31.02.42.27;	author mcalabre;	state Exp;
branches;
next	6.4.1.4;

6.4.1.4
date	2019.12.31.03.28.57;	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.11;	author mcalabre;	state Exp;
branches;
next	7.3.1.2;

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

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

7.3.1.4
date	2021.01.28.12.31.46;	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.22.07.49.21;	author mcalabre;	state Exp;
branches;
next	7.4.1.3;

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

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

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

7.5.1.2
date	2021.04.13.08.47.53;	author mcalabre;	state Exp;
branches;
next	;

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

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

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

7.8.1.1
date	2022.03.25.06.14.15;	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.03.06.00.50;	author mcalabre;	state Exp;
branches;
next	7.13.1.3;

7.13.1.3
date	2023.06.03.08.26.19;	author mcalabre;	state Exp;
branches;
next	7.13.1.4;

7.13.1.4
date	2023.06.15.04.00.08;	author mcalabre;	state Exp;
branches;
next	7.13.1.5;

7.13.1.5
date	2023.06.15.04.17.21;	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.01;	author mcalabre;	state Exp;
branches;
next	;

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

8.2.1.2
date	2024.04.02.14.06.11;	author mcalabre;	state Exp;
branches;
next	8.2.1.3;

8.2.1.3
date	2024.05.06.15.15.30;	author mcalabre;	state Exp;
branches;
next	8.2.1.4;

8.2.1.4
date	2024.05.10.15.06.45;	author mcalabre;	state Exp;
branches;
next	;

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

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

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

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

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

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

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


desc
@FORTRAN wrappers for the WCSLIB C routines in wcs.c.
@


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: wcs_f.c,v 8.6.1.2 2026/04/24 07:37:02 mcalabre Exp mcalabre $
*===========================================================================*/

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include <wcserr.h>
#include <wcsmath.h>
#include <wcsutil.h>
#include <wcs.h>

// Fortran name mangling.
#include <wcsconfig_f77.h>
#define wcsput_  F77_FUNC(wcsput,  WCSPUT)
#define wcsptc_  F77_FUNC(wcsptc,  WCSPTC)
#define wcsptd_  F77_FUNC(wcsptd,  WCSPTD)
#define wcspti_  F77_FUNC(wcspti,  WCSPTI)
#define wcsget_  F77_FUNC(wcsget,  WCSGET)
#define wcsgtc_  F77_FUNC(wcsgtc,  WCSGTC)
#define wcsgtd_  F77_FUNC(wcsgtd,  WCSGTD)
#define wcsgti_  F77_FUNC(wcsgti,  WCSGTI)

#define wcsnpv_  F77_FUNC(wcsnpv,  WCSNPV)
#define wcsnps_  F77_FUNC(wcsnps,  WCSNPS)
#define wcsini_  F77_FUNC(wcsini,  WCSINI)
#define wcsinit_ F77_FUNC(wcsinit, WCSINIT)
#define wcssub_  F77_FUNC(wcssub,  WCSSUB)
#define wcscompare_  F77_FUNC(wcscompare,  WCSCOMPARE)
#define wcsfree_ F77_FUNC(wcsfree, WCSFREE)
#define wcstrim_ F77_FUNC(wcstrim, WCSTRIM)
#define wcssize_ F77_FUNC(wcssize, WCSSIZE)
#define auxsize_ F77_FUNC(auxsize, AUXSIZE)
#define wcsenq_  F77_FUNC(wcsenq,  WCSENQ)
#define wcsprt_  F77_FUNC(wcsprt,  WCSPRT)
#define wcsperr_ F77_FUNC(wcsperr, WCSPERR)
#define wcsbchk_ F77_FUNC(wcsbchk, WCSBCHK)
#define wcsset_  F77_FUNC(wcsset,  WCSSET)
#define wcsp2s_  F77_FUNC(wcsp2s,  WCSP2S)
#define wcss2p_  F77_FUNC(wcss2p,  WCSS2P)
#define wcsmix_  F77_FUNC(wcsmix,  WCSMIX)
#define wcsccs_  F77_FUNC(wcsccs,  WCSCCS)
#define wcssptr_ F77_FUNC(wcssptr, WCSSPTR)
#define wcscopy_ F77_FUNC(wcscopy, WCSCOPY)
#define wcslib_version_ F77_FUNC(wcslib_version, WCSLIB_VERSION)

#ifdef BINDC
  #undef  wcsptc_
  #define wcsptc_ wcsptc_c

  #undef  wcsgtc_
  #define wcsgtc_ wcsgtc_c

  #undef  wcsperr_
  #define wcsperr_ wcsperr_c

  #undef  wcsccs_
  #define wcsccs_ wcsccs_c

  #undef  wcssptr_
  #define wcssptr_ wcssptr_c

  #undef  wcslib_version_
  #define wcslib_version_ wcslib_version_c
#endif

// Must match the value set in wcs.inc.
#define WCS_FLAG     100
#define WCS_NAXIS    101
#define WCS_CRPIX    102
#define WCS_PC       103
#define WCS_CDELT    104
#define WCS_CRVAL    105
#define WCS_CUNIT    106
#define WCS_CTYPE    107
#define WCS_LONPOLE  108
#define WCS_LATPOLE  109
#define WCS_RESTFRQ  110
#define WCS_RESTWAV  111
#define WCS_NPV      112
#define WCS_NPVMAX   113
#define WCS_PV       114
#define WCS_NPS      115
#define WCS_NPSMAX   116
#define WCS_PS       117
#define WCS_CD       118
#define WCS_CROTA    119
#define WCS_ALTLIN   120
#define WCS_VELREF   121

#define WCS_ALT      122
#define WCS_COLNUM   123
#define WCS_COLAX    124

#define WCS_CNAME    125
#define WCS_CRDER    126
#define WCS_CSYER    127
#define WCS_CZPHS    128
#define WCS_CPERI    129

#define WCS_WCSNAME  130

#define WCS_TIMESYS  131
#define WCS_TREFPOS  132
#define WCS_TREFDIR  133
#define WCS_PLEPHEM  134
#define WCS_TIMEUNIT 135
#define WCS_DATEREF  136
#define WCS_MJDREF   137
#define WCS_TIMEOFFS 138

#define WCS_DATEOBS  139
#define WCS_DATEBEG  140
#define WCS_DATEAVG  141
#define WCS_DATEEND  142
#define WCS_MJDOBS   143
#define WCS_MJDBEG   144
#define WCS_MJDAVG   145
#define WCS_MJDEND   146
#define WCS_JEPOCH   147
#define WCS_BEPOCH   148
#define WCS_TSTART   149
#define WCS_TSTOP    150
#define WCS_XPOSURE  151
#define WCS_TELAPSE  152

#define WCS_TIMSYER  153
#define WCS_TIMRDER  154
#define WCS_TIMEDEL  155
#define WCS_TIMEPIXR 156

#define WCS_OBSGEO   157
#define WCS_OBSORBIT 158
#define WCS_RADESYS  159
#define WCS_EQUINOX  160
#define WCS_SPECSYS  161
#define WCS_SSYSOBS  162
#define WCS_VELOSYS  163
#define WCS_ZSOURCE  164
#define WCS_SSYSSRC  165
#define WCS_VELANGL  166

#define WCS_RSUN_REF 167
#define WCS_DSUN_OBS 168
#define WCS_CRLN_OBS 169
#define WCS_HGLN_OBS 170
#define WCS_HGLT_OBS 171
#define WCS_A_RADIUS 172
#define WCS_B_RADIUS 173
#define WCS_C_RADIUS 174
#define WCS_BLON_OBS 175
#define WCS_BLAT_OBS 176
#define WCS_BDIS_OBS 177

#define WCS_NTAB     200
#define WCS_NWTB     201
#define WCS_TAB      202
#define WCS_WTB      203
#define WCS_LNGTYP   204
#define WCS_LATTYP   205
#define WCS_LNG      206
#define WCS_LAT      207
#define WCS_SPEC     208
#define WCS_TIME     209
#define WCS_CUBEFACE 210
#define WCS_TYPES    211
#define WCS_LIN      212
#define WCS_CEL      213
#define WCS_SPC      214
#define WCS_ERR      215

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

int wcsput_(
  int *wcs,
  const int *what,
  const void *value,
  const int *i,
  const int *j)

{
  int k;
  const char *cvalp;
  const int  *ivalp;
  const double *dvalp;
  struct wcsprm *wcsp;

  // Cast pointers.
  wcsp  = (struct wcsprm *)wcs;
  cvalp = (const char *)value;
  ivalp = (const int *)value;
  dvalp = (const double *)value;

  // Preserve bypass mode.
  int flag = 0;
  if (wcsp->flag == 1 || wcsp->flag < 0) flag = 1;

  // Convert 1-relative FITS axis numbers to 0-relative C array indices.
  int i0 = *i - 1;
  int j0 = *j - 1;

  switch (*what) {
  case WCS_FLAG:
    wcsp->flag = *ivalp;
    break;
  case WCS_NAXIS:
    wcsp->naxis = *ivalp;
    wcsp->flag = flag;
    break;
  case WCS_CRPIX:
    wcsp->crpix[i0] = *dvalp;
    wcsp->flag = flag;
    break;
  case WCS_PC:
    k = (i0)*(wcsp->naxis) + (j0);
    *(wcsp->pc+k) = *dvalp;
    wcsp->flag = flag;
    break;
  case WCS_CDELT:
    wcsp->cdelt[i0] = *dvalp;
    wcsp->flag = flag;
    break;
  case WCS_CRVAL:
    wcsp->crval[i0] = *dvalp;
    wcsp->flag = flag;
    break;
  case WCS_CUNIT:
    wcsutil_strcvt(72, '\0', 0, cvalp, wcsp->cunit[i0]);
    wcsp->flag = flag;
    break;
  case WCS_CTYPE:
    wcsutil_strcvt(72, '\0', 0, cvalp, wcsp->ctype[i0]);
    wcsp->flag = flag;
    break;
  case WCS_LONPOLE:
    wcsp->lonpole = *dvalp;
    wcsp->flag = flag;
    break;
  case WCS_LATPOLE:
    wcsp->latpole = *dvalp;
    wcsp->flag = flag;
    break;
  case WCS_RESTFRQ:
    wcsp->restfrq = *dvalp;
    wcsp->flag = flag;
    break;
  case WCS_RESTWAV:
    wcsp->restwav = *dvalp;
    wcsp->flag = flag;
    break;
  case WCS_NPV:
  case WCS_NPVMAX:
    return 1;
    break;
  case WCS_PV:
    (wcsp->pv + wcsp->npv)->i = *i;
    (wcsp->pv + wcsp->npv)->m = *j;
    (wcsp->pv + wcsp->npv)->value = *dvalp;
    (wcsp->npv)++;
    wcsp->flag = flag;
    break;
  case WCS_NPS:
  case WCS_NPSMAX:
    return 1;
    break;
  case WCS_PS:
    (wcsp->ps + wcsp->nps)->i = *i;
    (wcsp->ps + wcsp->nps)->m = *j;
    wcsutil_strcvt(72, '\0', 0, cvalp, (wcsp->ps + wcsp->nps)->value);
    (wcsp->nps)++;
    wcsp->flag = flag;
    break;
  case WCS_CD:
    k = (i0)*(wcsp->naxis) + (j0);
    *(wcsp->cd+k) = *dvalp;
    wcsp->flag = flag;
    break;
  case WCS_CROTA:
    wcsp->crota[i0] = *dvalp;
    wcsp->flag = flag;
    break;
  case WCS_ALTLIN:
    wcsp->altlin = *ivalp;
    wcsp->flag = flag;
    break;
  case WCS_VELREF:
    wcsp->velref = *ivalp;
    break;

  case WCS_ALT:
    wcsp->alt[0] = cvalp[0];
    memset((wcsp->alt)+1, '\0', 3);
    break;
  case WCS_COLNUM:
    wcsp->colnum = *ivalp;
    break;
  case WCS_COLAX:
    wcsp->colax[i0] = *ivalp;
    break;

  case WCS_CNAME:
    wcsutil_strcvt(72, '\0', 0, cvalp, wcsp->cname[i0]);
    break;
  case WCS_CRDER:
    wcsp->crder[i0] = *dvalp;
    break;
  case WCS_CSYER:
    wcsp->csyer[i0] = *dvalp;
    break;
  case WCS_CZPHS:
    wcsp->czphs[i0] = *dvalp;
    break;
  case WCS_CPERI:
    wcsp->cperi[i0] = *dvalp;
    break;

  case WCS_WCSNAME:
    wcsutil_strcvt(72, '\0', 0, cvalp, wcsp->wcsname);
    break;

  case WCS_TIMESYS:
    wcsutil_strcvt(72, '\0', 0, cvalp, wcsp->timesys);
    break;
  case WCS_TREFPOS:
    wcsutil_strcvt(72, '\0', 0, cvalp, wcsp->trefpos);
    break;
  case WCS_TREFDIR:
    wcsutil_strcvt(72, '\0', 0, cvalp, wcsp->trefdir);
    break;
  case WCS_PLEPHEM:
    wcsutil_strcvt(72, '\0', 0, cvalp, wcsp->plephem);
    break;
  case WCS_TIMEUNIT:
    wcsutil_strcvt(72, '\0', 0, cvalp, wcsp->timeunit);
    break;
  case WCS_DATEREF:
    wcsutil_strcvt(72, '\0', 0, cvalp, wcsp->dateref);
    break;
  case WCS_MJDREF:
    wcsp->mjdref[i0] = *dvalp;
    break;
  case WCS_TIMEOFFS:
    wcsp->timeoffs = *dvalp;
    break;

  case WCS_DATEOBS:
    wcsutil_strcvt(72, '\0', 0, cvalp, wcsp->dateobs);
    break;
  case WCS_DATEBEG:
    wcsutil_strcvt(72, '\0', 0, cvalp, wcsp->datebeg);
    break;
  case WCS_DATEAVG:
    wcsutil_strcvt(72, '\0', 0, cvalp, wcsp->dateavg);
    break;
  case WCS_DATEEND:
    wcsutil_strcvt(72, '\0', 0, cvalp, wcsp->dateend);
    break;
  case WCS_MJDOBS:
    wcsp->mjdobs = *dvalp;
    break;
  case WCS_MJDBEG:
    wcsp->mjdbeg = *dvalp;
    break;
  case WCS_MJDAVG:
    wcsp->mjdavg = *dvalp;
    break;
  case WCS_MJDEND:
    wcsp->mjdend = *dvalp;
    break;
  case WCS_JEPOCH:
    wcsp->jepoch = *dvalp;
    break;
  case WCS_BEPOCH:
    wcsp->bepoch = *dvalp;
    break;
  case WCS_TSTART:
    wcsp->tstart = *dvalp;
    break;
  case WCS_TSTOP:
    wcsp->tstop = *dvalp;
    break;
  case WCS_XPOSURE:
    wcsp->xposure = *dvalp;
    break;
  case WCS_TELAPSE:
    wcsp->telapse = *dvalp;
    break;

  case WCS_TIMSYER:
    wcsp->timsyer = *dvalp;
    break;
  case WCS_TIMRDER:
    wcsp->timrder = *dvalp;
    break;
  case WCS_TIMEDEL:
    wcsp->timedel = *dvalp;
    break;
  case WCS_TIMEPIXR:
    wcsp->timepixr = *dvalp;
    break;

  case WCS_OBSGEO:
    wcsp->obsgeo[i0] = *dvalp;
    break;
  case WCS_OBSORBIT:
    wcsutil_strcvt(72, '\0', 0, cvalp, wcsp->obsorbit);
    break;
  case WCS_RADESYS:
    wcsutil_strcvt(72, '\0', 0, cvalp, wcsp->radesys);
    break;
  case WCS_EQUINOX:
    wcsp->equinox = *dvalp;
    break;
  case WCS_SPECSYS:
    wcsutil_strcvt(72, '\0', 0, cvalp, wcsp->specsys);
    break;
  case WCS_SSYSOBS:
    wcsutil_strcvt(72, '\0', 0, cvalp, wcsp->ssysobs);
    break;
  case WCS_VELOSYS:
    wcsp->velosys = *dvalp;
    break;
  case WCS_ZSOURCE:
    wcsp->zsource = *dvalp;
    break;
  case WCS_SSYSSRC:
    wcsutil_strcvt(72, '\0', 0, cvalp, wcsp->ssyssrc);
    break;
  case WCS_VELANGL:
    wcsp->velangl = *dvalp;
    break;

  case WCS_RSUN_REF:
  case WCS_DSUN_OBS:
  case WCS_CRLN_OBS:
  case WCS_HGLN_OBS:
  case WCS_HGLT_OBS:
  case WCS_A_RADIUS:
  case WCS_B_RADIUS:
  case WCS_C_RADIUS:
  case WCS_BLON_OBS:
  case WCS_BLAT_OBS:
  case WCS_BDIS_OBS:
    if (wcsp->aux == 0x0) {
      if (wcsauxi(1, wcsp)) {
        return 2;
      }
    }

    switch (*what) {
    case WCS_RSUN_REF:
      wcsp->aux->rsun_ref = *dvalp;
      break;
    case WCS_DSUN_OBS:
      wcsp->aux->dsun_obs = *dvalp;
      break;
    case WCS_CRLN_OBS:
      wcsp->aux->crln_obs = *dvalp;
      break;
    case WCS_HGLN_OBS:
      wcsp->aux->hgln_obs = *dvalp;
      break;
    case WCS_HGLT_OBS:
      wcsp->aux->hglt_obs = *dvalp;
      break;
    case WCS_A_RADIUS:
      wcsp->aux->a_radius = *dvalp;
      break;
    case WCS_B_RADIUS:
      wcsp->aux->b_radius = *dvalp;
      break;
    case WCS_C_RADIUS:
      wcsp->aux->c_radius = *dvalp;
      break;
    case WCS_BLON_OBS:
      wcsp->aux->blon_obs = *dvalp;
      break;
    case WCS_BLAT_OBS:
      wcsp->aux->blat_obs = *dvalp;
      break;
    case WCS_BDIS_OBS:
      wcsp->aux->bdis_obs = *dvalp;
      break;
    default:
      return 1;
    }

    break;
  default:
    return 1;
  }

  return 0;
}

int wcsptc_(int *wcs, const int *what, const char *value, const int *i,
  const int *j)
{
  return wcsput_(wcs, what, value, i, j);
}

int wcsptd_(int *wcs, const int *what, const double *value, const int *i,
  const int *j)
{
  return wcsput_(wcs, what, value, i, j);
}

int wcspti_(int *wcs, const int *what, const int *value, const int *i,
  const int *j)
{
  return wcsput_(wcs, what, value, i, j);
}

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

int wcsget_(const int *wcs, const int *what, void *value)

{
  // Cast pointers.
  const struct wcsprm *wcsp = (const struct wcsprm *)wcs;
  char   *cvalp = (char *)value;
  int    *ivalp = (int *)value;
  double *dvalp = (double *)value;

  int naxis = wcsp->naxis;

  const int *iwcsp;
  switch (*what) {
  case WCS_FLAG:
    *ivalp = wcsp->flag;
    break;
  case WCS_NAXIS:
    *ivalp = naxis;
    break;
  case WCS_CRPIX:
    for (int i = 0; i < naxis; i++) {
      *(dvalp++) = wcsp->crpix[i];
    }
    break;
  case WCS_PC:
    // C row-major to FORTRAN column-major.
    for (int j = 0; j < naxis; j++) {
      const double *dwcsp = wcsp->pc + j;
      for (int i = 0; i < naxis; i++) {
        *(dvalp++) = *dwcsp;
        dwcsp += naxis;
      }
    }
    break;
  case WCS_CDELT:
    for (int i = 0; i < naxis; i++) {
      *(dvalp++) = wcsp->cdelt[i];
    }
    break;
  case WCS_CRVAL:
    for (int i = 0; i < naxis; i++) {
      *(dvalp++) = wcsp->crval[i];
    }
    break;
  case WCS_CUNIT:
    for (int i = 0; i < naxis; i++) {
      wcsutil_strcvt(72, ' ', 0, wcsp->cunit[i], cvalp);
      cvalp += 72;
    }
    break;
  case WCS_CTYPE:
    for (int i = 0; i < naxis; i++) {
      wcsutil_strcvt(72, ' ', 0, wcsp->ctype[i], cvalp);
      cvalp += 72;
    }
    break;
  case WCS_LONPOLE:
    *dvalp = wcsp->lonpole;
    break;
  case WCS_LATPOLE:
    *dvalp = wcsp->latpole;
    break;
  case WCS_RESTFRQ:
    *dvalp = wcsp->restfrq;
    break;
  case WCS_RESTWAV:
    *dvalp = wcsp->restwav;
    break;
  case WCS_NPV:
    *ivalp = wcsp->npv;
    break;
  case WCS_NPVMAX:
    *ivalp = wcsp->npvmax;
    break;
  case WCS_PV:
    for (int k = 0; k < wcsp->npv; k++) {
      *(dvalp++) = (wcsp->pv + k)->i;
      *(dvalp++) = (wcsp->pv + k)->m;
      *(dvalp++) = (wcsp->pv + k)->value;
    }
    break;
  case WCS_NPS:
    *ivalp = wcsp->nps;
    break;
  case WCS_NPSMAX:
    *ivalp = wcsp->npsmax;
    break;
  case WCS_PS:
    for (int k = 0; k < wcsp->nps; k++) {
      *(dvalp++) = (wcsp->ps + k)->i;
      *(dvalp++) = (wcsp->ps + k)->m;
      cvalp += 2*sizeof(double);
      wcsutil_strcvt(72, ' ', 0, (wcsp->ps + k)->value, cvalp);
      cvalp += 72;
    }
    break;
  case WCS_CD:
    // C row-major to FORTRAN column-major.
    for (int j = 0; j < naxis; j++) {
      const double *dwcsp = wcsp->cd + j;
      for (int i = 0; i < naxis; i++) {
        *(dvalp++) = *dwcsp;
        dwcsp += naxis;
      }
    }
    break;
  case WCS_CROTA:
    for (int i = 0; i < naxis; i++) {
      *(dvalp++) = wcsp->crota[i];
    }
    break;
  case WCS_ALTLIN:
    *ivalp = wcsp->altlin;
    break;
  case WCS_VELREF:
    *ivalp = wcsp->velref;
    break;

  case WCS_ALT:
    wcsutil_strcvt(4, ' ', 0, wcsp->alt, cvalp);
    break;
  case WCS_COLNUM:
    *ivalp = wcsp->colnum;
    break;
  case WCS_COLAX:
    for (int i = 0; i < naxis; i++) {
      *(ivalp++) = wcsp->colax[i];
    }
    break;

  case WCS_CNAME:
    for (int i = 0; i < naxis; i++) {
      wcsutil_strcvt(72, ' ', 0, wcsp->cname[i], cvalp);
      cvalp += 72;
    }
    break;
  case WCS_CRDER:
    for (int i = 0; i < naxis; i++) {
      *(dvalp++) = wcsp->crder[i];
    }
    break;
  case WCS_CSYER:
    for (int i = 0; i < naxis; i++) {
      *(dvalp++) = wcsp->csyer[i];
    }
    break;
  case WCS_CZPHS:
    for (int i = 0; i < naxis; i++) {
      *(dvalp++) = wcsp->czphs[i];
    }
    break;
  case WCS_CPERI:
    for (int i = 0; i < naxis; i++) {
      *(dvalp++) = wcsp->cperi[i];
    }
    break;

  case WCS_WCSNAME:
    wcsutil_strcvt(72, ' ', 0, wcsp->wcsname, cvalp);
    break;

  case WCS_TIMESYS:
    wcsutil_strcvt(72, ' ', 0, wcsp->timesys, cvalp);
    break;
  case WCS_TREFPOS:
    wcsutil_strcvt(72, ' ', 0, wcsp->trefpos, cvalp);
    break;
  case WCS_TREFDIR:
    wcsutil_strcvt(72, ' ', 0, wcsp->trefdir, cvalp);
    break;
  case WCS_PLEPHEM:
    wcsutil_strcvt(72, ' ', 0, wcsp->plephem, cvalp);
    break;
  case WCS_TIMEUNIT:
    wcsutil_strcvt(72, ' ', 0, wcsp->timeunit, cvalp);
    break;
  case WCS_DATEREF:
    wcsutil_strcvt(72, ' ', 0, wcsp->dateref, cvalp);
    break;
  case WCS_MJDREF:
    *(dvalp++) = wcsp->mjdref[0];
    *(dvalp++) = wcsp->mjdref[1];
    break;
  case WCS_TIMEOFFS:
    *dvalp = wcsp->timeoffs;
    break;

  case WCS_DATEOBS:
    wcsutil_strcvt(72, ' ', 0, wcsp->dateobs, cvalp);
    break;
  case WCS_DATEBEG:
    wcsutil_strcvt(72, ' ', 0, wcsp->datebeg, cvalp);
    break;
  case WCS_DATEAVG:
    wcsutil_strcvt(72, ' ', 0, wcsp->dateavg, cvalp);
    break;
  case WCS_DATEEND:
    wcsutil_strcvt(72, ' ', 0, wcsp->dateend, cvalp);
    break;
  case WCS_MJDOBS:
    *dvalp = wcsp->mjdobs;
    break;
  case WCS_MJDBEG:
    *dvalp = wcsp->mjdbeg;
    break;
  case WCS_MJDAVG:
    *dvalp = wcsp->mjdavg;
    break;
  case WCS_MJDEND:
    *dvalp = wcsp->mjdend;
    break;
  case WCS_JEPOCH:
    *dvalp = wcsp->jepoch;
    break;
  case WCS_BEPOCH:
    *dvalp = wcsp->bepoch;
    break;
  case WCS_TSTART:
    *dvalp = wcsp->tstart;
    break;
  case WCS_TSTOP:
    *dvalp = wcsp->tstop;
    break;
  case WCS_XPOSURE:
    *dvalp = wcsp->xposure;
    break;
  case WCS_TELAPSE:
    *dvalp = wcsp->telapse;
    break;

  case WCS_TIMSYER:
    *dvalp = wcsp->timsyer;
    break;
  case WCS_TIMRDER:
    *dvalp = wcsp->timrder;
    break;
  case WCS_TIMEDEL:
    *dvalp = wcsp->timedel;
    break;
  case WCS_TIMEPIXR:
    *dvalp = wcsp->timepixr;
    break;

  case WCS_OBSGEO:
    for (int i = 0; i < 6; i++) {
      *(dvalp++) = wcsp->obsgeo[i];
    }
    break;
  case WCS_OBSORBIT:
    wcsutil_strcvt(72, ' ', 0, wcsp->obsorbit, cvalp);
    break;
  case WCS_RADESYS:
    wcsutil_strcvt(72, ' ', 0, wcsp->radesys, cvalp);
    break;
  case WCS_EQUINOX:
    *dvalp = wcsp->equinox;
    break;
  case WCS_SPECSYS:
    wcsutil_strcvt(72, ' ', 0, wcsp->specsys, cvalp);
    break;
  case WCS_SSYSOBS:
    wcsutil_strcvt(72, ' ', 0, wcsp->ssysobs, cvalp);
    break;
  case WCS_VELOSYS:
    *dvalp = wcsp->velosys;
    break;
  case WCS_ZSOURCE:
    *dvalp = wcsp->zsource;
    break;
  case WCS_SSYSSRC:
    wcsutil_strcvt(72, ' ', 0, wcsp->ssyssrc, cvalp);
    break;
  case WCS_VELANGL:
    *dvalp = wcsp->velangl;
    break;

  case WCS_RSUN_REF:
    *dvalp = wcsp->aux ? wcsp->aux->rsun_ref : UNDEFINED;
    break;
  case WCS_DSUN_OBS:
    *dvalp = wcsp->aux ? wcsp->aux->dsun_obs : UNDEFINED;
    break;
  case WCS_CRLN_OBS:
    *dvalp = wcsp->aux ? wcsp->aux->crln_obs : UNDEFINED;
    break;
  case WCS_HGLN_OBS:
    *dvalp = wcsp->aux ? wcsp->aux->hgln_obs : UNDEFINED;
    break;
  case WCS_HGLT_OBS:
    *dvalp = wcsp->aux ? wcsp->aux->hglt_obs : UNDEFINED;
    break;
  case WCS_A_RADIUS:
    *dvalp = wcsp->aux ? wcsp->aux->a_radius : UNDEFINED;
    break;
  case WCS_B_RADIUS:
    *dvalp = wcsp->aux ? wcsp->aux->b_radius : UNDEFINED;
    break;
  case WCS_C_RADIUS:
    *dvalp = wcsp->aux ? wcsp->aux->c_radius : UNDEFINED;
    break;
  case WCS_BLON_OBS:
    *dvalp = wcsp->aux ? wcsp->aux->blon_obs : UNDEFINED;
    break;
  case WCS_BLAT_OBS:
    *dvalp = wcsp->aux ? wcsp->aux->blat_obs : UNDEFINED;
    break;
  case WCS_BDIS_OBS:
    *dvalp = wcsp->aux ? wcsp->aux->bdis_obs : UNDEFINED;
    break;

  case WCS_NTAB:
    *ivalp = wcsp->ntab;
    break;
  case WCS_NWTB:
    *ivalp = wcsp->nwtb;
    break;
  case WCS_TAB:
    *(void **)value = wcsp->tab;
    break;
  case WCS_WTB:
    *(void **)value = wcsp->wtb;
    break;
  case WCS_LNGTYP:
    wcsutil_strcvt(4, ' ', 0, wcsp->lngtyp, cvalp);
    break;
  case WCS_LATTYP:
    wcsutil_strcvt(4, ' ', 0, wcsp->lattyp, cvalp);
    break;
  case WCS_LNG:
    *ivalp = wcsp->lng + 1;
    break;
  case WCS_LAT:
    *ivalp = wcsp->lat + 1;
    break;
  case WCS_SPEC:
    *ivalp = wcsp->spec + 1;
    break;
  case WCS_TIME:
    *ivalp = wcsp->time + 1;
    break;
  case WCS_CUBEFACE:
    *ivalp = wcsp->cubeface;
    break;
  case WCS_TYPES:
    for (int i = 0; i < naxis; i++) {
      *(ivalp++) = wcsp->types[i];
    }
    break;
  case WCS_LIN:
    // Copy the contents of the linprm struct.
    iwcsp = (int *)(&(wcsp->lin));
    for (size_t l = 0; l < LINLEN; l++) {
      *(ivalp++) = *(iwcsp++);
    }
    break;
  case WCS_CEL:
    // Copy the contents of the celprm struct.
    iwcsp = (int *)(&(wcsp->cel));
    for (size_t l = 0; l < CELLEN; l++) {
      *(ivalp++) = *(iwcsp++);
    }
    break;
  case WCS_SPC:
    // Copy the contents of the spcprm struct.
    iwcsp = (int *)(&(wcsp->spc));
    for (size_t l = 0; l < SPCLEN; l++) {
      *(ivalp++) = *(iwcsp++);
    }
    break;
  case WCS_ERR:
    // Copy the contents of the wcserr struct.
    if (wcsp->err) {
    iwcsp = (int *)(wcsp->err);
      for (size_t l = 0; l < ERRLEN; l++) {
        *(ivalp++) = *(iwcsp++);
      }
    } else {
      for (size_t l = 0; l < ERRLEN; l++) {
        *(ivalp++) = 0;
      }
    }
    break;
  default:
    return 1;
  }

  return 0;
}

int wcsgtc_(const int *wcs, const int *what, char *value)
{
  return wcsget_(wcs, what, value);
}

int wcsgtd_(const int *wcs, const int *what, double *value)
{
  return wcsget_(wcs, what, value);
}

int wcsgti_(const int *wcs, const int *what, int *value)
{
  return wcsget_(wcs, what, value);
}

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

int wcsnpv_(int *npvmax) { return wcsnpv(*npvmax); }
int wcsnps_(int *npsmax) { return wcsnps(*npsmax); }

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

int wcsini_(const int *naxis, int *wcs)

{
  return wcsini(1, *naxis, (struct wcsprm *)wcs);
}

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

int wcsinit_(
  const int *naxis,
  int *wcs,
  int *npvmax,
  int *npsmax,
  int *ndpmax)

{
  return wcsinit(1, *naxis, (struct wcsprm *)wcs, *npvmax, *npsmax, *ndpmax);
}

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

int wcssub_(const int *wcssrc, int *nsub, int axes[], int *wcsdst)

{
  if (*nsub == -1 && *axes == -1) {
    // Interpreted as a signal that a deep copy is required.
    return wcssub(1, (const struct wcsprm *)wcssrc, 0x0, 0x0,
                  (struct wcsprm *)wcsdst);
  } else {
    // Beware that if *nsub == 0 it will be set on return so cannot be a
    // constant argument.
    return wcssub(1, (const struct wcsprm *)wcssrc, nsub, axes,
                  (struct wcsprm *)wcsdst);
  }
}

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

int wcscompare_(
  const int *cmp,
  const double *tol,
  const int *wcs1,
  const int *wcs2,
  int *equal)

{
  return wcscompare(*cmp, *tol, (const struct wcsprm *)wcs1,
                    (const struct wcsprm *)wcs2, equal);
}

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

int wcsfree_(int *wcs)

{
  return wcsfree((struct wcsprm *)wcs);
}

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

int wcstrim_(int *wcs)

{
  return wcstrim((struct wcsprm *)wcs);
}

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

int wcssize_(const int *wcs, int sizes[2])

{
  return wcssize((const struct wcsprm *)wcs, sizes);
}

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

int auxsize_(const int *aux, int sizes[2])

{
  return auxsize((const struct auxprm *)aux, sizes);
}

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

int wcsenq_(const int *wcs, int *enquiry)

{
  return wcsenq((const struct wcsprm *)wcs, *enquiry);
}

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

int wcsprt_(const int *wcs)

{
  // This may or may not force the Fortran I/O buffers to be flushed.  If
  // not, try CALL FLUSH(6) before calling WCSPRT in the Fortran code.
  fflush(NULL);

  return wcsprt((const struct wcsprm *)wcs);
}

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

// If null-terminated (using the Fortran CHAR(0) intrinsic), prefix may be of
// length less than but not exceeding 72 and trailing blanks are preserved.
// Otherwise, it must be of length 72 and trailing blanks are stripped off.

int wcsperr_(int *wcs, const char prefix[72])

{
  char prefix_[73];
  wcsutil_strcvt(72, '\0', 1, prefix, prefix_);

  // This may or may not force the Fortran I/O buffers to be flushed.
  // If not, try CALL FLUSH(6) before calling WCSPERR in the Fortran code.
  fflush(NULL);

  return wcsperr((struct wcsprm *)wcs, prefix_);
}

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

int wcsbchk_(int *wcs, int *bounds)

{
  return wcsbchk((struct wcsprm *)wcs, *bounds);
}

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

int wcsset_(int *wcs)

{
  return wcsset((struct wcsprm *)wcs);
}

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

int wcsp2s_(
  int *wcs,
  const int *ncoord,
  const int *nelem,
  const double pixcrd[],
  double imgcrd[],
  double phi[],
  double theta[],
  double world[],
  int stat[])

{
  return wcsp2s((struct wcsprm *)wcs, *ncoord, *nelem, pixcrd, imgcrd, phi,
                theta, world, stat);
}

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

int wcss2p_(
  int* wcs,
  const int *ncoord,
  const int *nelem,
  const double world[],
  double phi[],
  double theta[],
  double imgcrd[],
  double pixcrd[],
  int stat[])

{
  return wcss2p((struct wcsprm *)wcs, *ncoord, *nelem, world, phi, theta,
                imgcrd, pixcrd, stat);
}

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

int wcsmix_(
  int *wcs,
  const int *mixpix,
  const int *mixcel,
  const double vspan[2],
  const double *vstep,
  int *viter,
  double world[],
  double phi[],
  double theta[],
  double imgcrd[],
  double pixcrd[])

{
  return wcsmix((struct wcsprm *)wcs, *mixpix-1, *mixcel, vspan, *vstep,
                *viter, world, phi, theta, imgcrd, pixcrd);
}

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

int wcsccs_(
  int *wcs,
  const double *lng2p1,
  const double *lat2p1,
  const double *lng1p2,
  const char clng[4],
  const char clat[4],
  const char radesys[71],
  const double *equinox,
  const char alt[1])

{
  char clng_[5], clat_[5], radesys_[72];
  wcsutil_strcvt(4,  '\0', 1, clng, clng_);
  wcsutil_strcvt(4,  '\0', 1, clat, clat_);
  wcsutil_strcvt(71, '\0', 1, radesys, radesys_);

  int status = wcsccs((struct wcsprm *)wcs, *lng2p1, *lat2p1, *lng1p2, clng_,
                      clat_, radesys_, *equinox, alt);

  return status;
}

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

int wcssptr_(
  int *wcs,
  int *i,
  char ctype[8])

{
  char ctype_[9];
  wcsutil_strcvt(8, ' ', 1, ctype, ctype_);

  int status = wcssptr((struct wcsprm *)wcs, i, ctype_);

  wcsutil_strcvt(8, ' ', 0, ctype_, ctype);

  return status;
}

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

int wcscopy_(
  const int *wcssrc,
  int *wcsdst)

{
  return wcscopy(1, (const struct wcsprm *)wcssrc, (struct wcsprm *)wcsdst);
}

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

void wcslib_version_(
  char *wcsver,
  int  *nchr)

{
  wcsutil_strcvt(*nchr, ' ', 0, wcslib_version(0x0), wcsver);
}
@


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: wcs_f.c,v 8.5.1.2 2026/03/29 13:36:19 mcalabre Exp mcalabre $
d505 2
@


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


8.6.1.2
log
@Inconsequential change prompted by clang-tidy:
 - Added (empty) default case to a switch statement in wcsput_()
   (bugprone-switch-missing-default-case).
@
text
@d22 1
a22 1
  $Id: wcs_f.c,v 8.6.1.1 2026/03/29 14:19:27 mcalabre Exp mcalabre $
a504 2
    default:
      return 1;
@


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: wcs_f.c,v 8.4.1.2 2025/12/06 13:37:18 mcalabre Exp mcalabre $
@


8.5.1.1
log
@WCSLIB 8.5 development branch.
@
text
@d22 1
a22 1
  $Id: wcs_f.c,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: wcs_f.c,v 8.5.1.1 2025/12/06 14:05:16 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: wcs_f.c,v 8.3.1.1 2024/05/13 16:35:40 mcalabre Exp mcalabre $
@


8.4.1.1
log
@WCSLIB 8.4 development branch.
@
text
@d22 1
a22 1
  $Id: wcs_f.c,v 8.4 2024/10/28 13:56:17 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: wcs_f.c,v 8.4.1.1 2024/10/28 13:58:42 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: wcs_f.c,v 8.2.1.4 2024/05/10 15:06:45 mcalabre Exp mcalabre $
@


8.3.1.1
log
@WCSLIB 8.3 development branch.
@
text
@d22 1
a22 1
  $Id: wcs_f.c,v 8.3 2024/05/13 16:33:01 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: wcs_f.c,v 8.1.1.1 2023/07/05 17:15:01 mcalabre Exp mcalabre $
d55 1
d68 20
d203 1
a203 1
  int i0, j0, k;
d215 4
d220 2
a221 2
  i0 = *i - 1;
  j0 = *j - 1;
d229 1
a229 1
    wcsp->flag = 0;
d233 1
a233 1
    wcsp->flag = 0;
d238 1
a238 1
    wcsp->flag = 0;
d242 1
a242 1
    wcsp->flag = 0;
d246 1
a246 1
    wcsp->flag = 0;
d250 1
a250 1
    wcsp->flag = 0;
d254 1
a254 1
    wcsp->flag = 0;
d258 1
a258 1
    wcsp->flag = 0;
d262 1
a262 1
    wcsp->flag = 0;
d266 1
a266 1
    wcsp->flag = 0;
d270 1
a270 1
    wcsp->flag = 0;
d281 1
a281 1
    wcsp->flag = 0;
d292 1
a292 1
    wcsp->flag = 0;
d297 1
a297 1
    wcsp->flag = 0;
d301 1
a301 1
    wcsp->flag = 0;
d305 1
a305 1
    wcsp->flag = 0;
a537 9
  unsigned int l;
  int i, j, k, naxis;
  char   *cvalp;
  int    *ivalp;
  double *dvalp;
  const int    *iwcsp;
  const double *dwcsp;
  const struct wcsprm *wcsp;

d539 4
a542 4
  wcsp  = (const struct wcsprm *)wcs;
  cvalp = (char *)value;
  ivalp = (int *)value;
  dvalp = (double *)value;
d544 1
a544 1
  naxis = wcsp->naxis;
d546 1
d555 1
a555 1
    for (i = 0; i < naxis; i++) {
d561 3
a563 3
    for (j = 0; j < naxis; j++) {
      dwcsp = wcsp->pc + j;
      for (i = 0; i < naxis; i++) {
d570 1
a570 1
    for (i = 0; i < naxis; i++) {
d575 1
a575 1
    for (i = 0; i < naxis; i++) {
d580 1
a580 1
    for (i = 0; i < naxis; i++) {
d586 1
a586 1
    for (i = 0; i < naxis; i++) {
d610 1
a610 1
    for (k = 0; k < wcsp->npv; k++) {
d623 1
a623 1
    for (k = 0; k < wcsp->nps; k++) {
d633 3
a635 3
    for (j = 0; j < naxis; j++) {
      dwcsp = wcsp->cd + j;
      for (i = 0; i < naxis; i++) {
d642 1
a642 1
    for (i = 0; i < naxis; i++) {
d660 1
a660 1
    for (i = 0; i < naxis; i++) {
d666 1
a666 1
    for (i = 0; i < naxis; i++) {
d672 1
a672 1
    for (i = 0; i < naxis; i++) {
d677 1
a677 1
    for (i = 0; i < naxis; i++) {
d682 1
a682 1
    for (i = 0; i < naxis; i++) {
d687 1
a687 1
    for (i = 0; i < naxis; i++) {
d779 1
a779 1
    for (i = 0; i < 6; i++) {
d879 1
a879 1
    for (i = 0; i < naxis; i++) {
d886 1
a886 1
    for (l = 0; l < LINLEN; l++) {
d893 1
a893 1
    for (l = 0; l < CELLEN; l++) {
d900 1
a900 1
    for (l = 0; l < SPCLEN; l++) {
d907 2
a908 2
      iwcsp = (int *)(wcsp->err);
      for (l = 0; l < ERRLEN; l++) {
d912 1
a912 1
      for (l = 0; l < ERRLEN; l++) {
d1030 8
d1142 1
a1142 1
  struct wcsprm *wcs,
d1158 2
a1159 2
  int status = wcsccs(wcs, *lng2p1, *lat2p1, *lng1p2, clng_, clat_,
                      radesys_, *equinox, alt);
d1167 1
a1167 1
  struct wcsprm *wcs,
d1175 1
a1175 1
  int status = wcssptr(wcs, i, ctype_);
d1196 1
a1196 1
  int  nchr)
d1199 1
a1199 1
  wcsutil_strcvt(nchr, ' ', 0, wcslib_version(0x0), wcsver);
@


8.2.1.1
log
@WCSLIB 8.2 development branch.
@
text
@d22 1
a22 1
  $Id: wcs_f.c,v 8.2 2023/11/16 10:00:30 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: wcs_f.c,v 8.2.1.1 2023/11/16 10:05:58 mcalabre Exp mcalabre $
@


8.2.1.3
log
@Changes required to support the new Fortran 2003 BIND(C) wrappers.
Fixes to the argument lists of wcsccs_(), wcssptr_(), and wcslib_version_().
@
text
@d22 1
a22 1
  $Id: wcs_f.c,v 8.2.1.2 2024/04/02 14:06:11 mcalabre Exp mcalabre $
a66 20
#ifdef BINDC
  #undef  wcsptc_
  #define wcsptc_ wcsptc_c

  #undef  wcsgtc_
  #define wcsgtc_ wcsgtc_c

  #undef  wcsperr_
  #define wcsperr_ wcsperr_c

  #undef  wcsccs_
  #define wcsccs_ wcsccs_c

  #undef  wcssptr_
  #define wcssptr_ wcssptr_c

  #undef  wcslib_version_
  #define wcslib_version_ wcslib_version_c
#endif

d1117 1
a1117 1
  int *wcs,
d1133 2
a1134 2
  int status = wcsccs((struct wcsprm *)wcs, *lng2p1, *lat2p1, *lng1p2, clng_,
                      clat_, radesys_, *equinox, alt);
d1142 1
a1142 1
  int *wcs,
d1150 1
a1150 1
  int status = wcssptr((struct wcsprm *)wcs, i, ctype_);
d1171 1
a1171 1
  int  *nchr)
d1174 1
a1174 1
  wcsutil_strcvt(*nchr, ' ', 0, wcslib_version(0x0), wcsver);
@


8.2.1.4
log
@Changes in wcsput_() to support bypass mode in wcsset().
Added wcsenq_().
Converted to C99-style intermingled variable declarations.
@
text
@d22 1
a22 1
  $Id: wcs_f.c,v 8.2.1.3 2024/05/06 15:15:30 mcalabre Exp mcalabre $
a54 1
#define wcsenq_  F77_FUNC(wcsenq,  WCSENQ)
d202 1
a202 1
  int k;
a213 4
  // Preserve bypass mode.
  int flag = 0;
  if (wcsp->flag == 1 || wcsp->flag < 0) flag = 1;

d215 2
a216 2
  int i0 = *i - 1;
  int j0 = *j - 1;
d224 1
a224 1
    wcsp->flag = flag;
d228 1
a228 1
    wcsp->flag = flag;
d233 1
a233 1
    wcsp->flag = flag;
d237 1
a237 1
    wcsp->flag = flag;
d241 1
a241 1
    wcsp->flag = flag;
d245 1
a245 1
    wcsp->flag = flag;
d249 1
a249 1
    wcsp->flag = flag;
d253 1
a253 1
    wcsp->flag = flag;
d257 1
a257 1
    wcsp->flag = flag;
d261 1
a261 1
    wcsp->flag = flag;
d265 1
a265 1
    wcsp->flag = flag;
d276 1
a276 1
    wcsp->flag = flag;
d287 1
a287 1
    wcsp->flag = flag;
d292 1
a292 1
    wcsp->flag = flag;
d296 1
a296 1
    wcsp->flag = flag;
d300 1
a300 1
    wcsp->flag = flag;
d533 9
d543 4
a546 4
  const struct wcsprm *wcsp = (const struct wcsprm *)wcs;
  char   *cvalp = (char *)value;
  int    *ivalp = (int *)value;
  double *dvalp = (double *)value;
d548 1
a548 1
  int naxis = wcsp->naxis;
a549 1
  const int *iwcsp;
d558 1
a558 1
    for (int i = 0; i < naxis; i++) {
d564 3
a566 3
    for (int j = 0; j < naxis; j++) {
      const double *dwcsp = wcsp->pc + j;
      for (int i = 0; i < naxis; i++) {
d573 1
a573 1
    for (int i = 0; i < naxis; i++) {
d578 1
a578 1
    for (int i = 0; i < naxis; i++) {
d583 1
a583 1
    for (int i = 0; i < naxis; i++) {
d589 1
a589 1
    for (int i = 0; i < naxis; i++) {
d613 1
a613 1
    for (int k = 0; k < wcsp->npv; k++) {
d626 1
a626 1
    for (int k = 0; k < wcsp->nps; k++) {
d636 3
a638 3
    for (int j = 0; j < naxis; j++) {
      const double *dwcsp = wcsp->cd + j;
      for (int i = 0; i < naxis; i++) {
d645 1
a645 1
    for (int i = 0; i < naxis; i++) {
d663 1
a663 1
    for (int i = 0; i < naxis; i++) {
d669 1
a669 1
    for (int i = 0; i < naxis; i++) {
d675 1
a675 1
    for (int i = 0; i < naxis; i++) {
d680 1
a680 1
    for (int i = 0; i < naxis; i++) {
d685 1
a685 1
    for (int i = 0; i < naxis; i++) {
d690 1
a690 1
    for (int i = 0; i < naxis; i++) {
d782 1
a782 1
    for (int i = 0; i < 6; i++) {
d882 1
a882 1
    for (int i = 0; i < naxis; i++) {
d889 1
a889 1
    for (size_t l = 0; l < LINLEN; l++) {
d896 1
a896 1
    for (size_t l = 0; l < CELLEN; l++) {
d903 1
a903 1
    for (size_t l = 0; l < SPCLEN; l++) {
d910 2
a911 2
    iwcsp = (int *)(wcsp->err);
      for (size_t l = 0; l < ERRLEN; l++) {
d915 1
a915 1
      for (size_t l = 0; l < ERRLEN; l++) {
a1028 8
}

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

int wcsenq_(const int *wcs, int *enquiry)

{
  return wcsenq((const struct wcsprm *)wcs, *enquiry);
@


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: wcs_f.c,v 8.0.1.1 2023/07/01 06:22:44 mcalabre Exp mcalabre $
@


8.1.1.1
log
@WCSLIB 8.1 development branch.
@
text
@d22 1
a22 1
  $Id: wcs_f.c,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: wcs_f.c,v 7.13.1.5 2023/06/15 04:17:21 mcalabre Exp mcalabre $
@


8.0.1.1
log
@WCSLIB 8.0 development branch.
@
text
@d22 1
a22 1
  $Id: wcs_f.c,v 8.0 2023/07/01 06:15:05 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: wcs_f.c,v 7.12.1.1 2022/09/09 05:00:36 mcalabre Exp mcalabre $
d148 6
d164 7
a170 6
#define WCS_CUBEFACE 209
#define WCS_TYPES    210
#define WCS_LIN      211
#define WCS_CEL      212
#define WCS_SPC      213
#define WCS_ERR      214
d434 6
d462 18
d809 18
d854 3
@


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


7.13.1.2
log
@Track the addition of wcsprm::time to the wcsprm struct.
@
text
@d22 1
a22 1
  $Id: wcs_f.c,v 7.13.1.1 2022/10/07 03:45:47 mcalabre Exp mcalabre $
d158 6
a163 7
#define WCS_TIME     209
#define WCS_CUBEFACE 210
#define WCS_TYPES    211
#define WCS_LIN      212
#define WCS_CEL      213
#define WCS_SPC      214
#define WCS_ERR      215
a804 3
    break;
  case WCS_TIME:
    *ivalp = wcsp->time + 1;
@


7.13.1.3
log
@Support planetary keywords A_RADIUS, B_RADIUS, C_RADIUS, PLON_OBS, PLAT_OBS,
and PDIS_OBS in auxprm.
@
text
@d22 1
a22 1
  $Id: wcs_f.c,v 7.13.1.2 2023/06/03 06:00:50 mcalabre Exp mcalabre $
a147 6
#define WCS_A_RADIUS 172
#define WCS_B_RADIUS 173
#define WCS_C_RADIUS 174
#define WCS_PLON_OBS 175
#define WCS_PLAT_OBS 176
#define WCS_PDIS_OBS 177
a427 6
  case WCS_A_RADIUS:
  case WCS_B_RADIUS:
  case WCS_C_RADIUS:
  case WCS_PLON_OBS:
  case WCS_PLAT_OBS:
  case WCS_PDIS_OBS:
a449 18
    case WCS_A_RADIUS:
      wcsp->aux->a_radius = *dvalp;
      break;
    case WCS_B_RADIUS:
      wcsp->aux->b_radius = *dvalp;
      break;
    case WCS_C_RADIUS:
      wcsp->aux->c_radius = *dvalp;
      break;
    case WCS_PLON_OBS:
      wcsp->aux->plon_obs = *dvalp;
      break;
    case WCS_PLAT_OBS:
      wcsp->aux->plat_obs = *dvalp;
      break;
    case WCS_PDIS_OBS:
      wcsp->aux->pdis_obs = *dvalp;
      break;
a777 18
    break;
  case WCS_A_RADIUS:
    *dvalp = wcsp->aux ? wcsp->aux->a_radius : UNDEFINED;
    break;
  case WCS_B_RADIUS:
    *dvalp = wcsp->aux ? wcsp->aux->b_radius : UNDEFINED;
    break;
  case WCS_C_RADIUS:
    *dvalp = wcsp->aux ? wcsp->aux->c_radius : UNDEFINED;
    break;
  case WCS_PLON_OBS:
    *dvalp = wcsp->aux ? wcsp->aux->plon_obs : UNDEFINED;
    break;
  case WCS_PLAT_OBS:
    *dvalp = wcsp->aux ? wcsp->aux->plat_obs : UNDEFINED;
    break;
  case WCS_PDIS_OBS:
    *dvalp = wcsp->aux ? wcsp->aux->pdis_obs : UNDEFINED;
@


7.13.1.4
log
@(PLON_OBS, PLAT_OBS, PDIS_OBS) -> (BLON_OBS, BLAT_OBS, BDIS_OBS).
@
text
@d22 1
a22 1
  $Id: wcs_f.c,v 7.13.1.3 2023/06/03 08:26:19 mcalabre Exp mcalabre $
d151 3
a153 3
#define WCS_BLON_OBS 175
#define WCS_BLAT_OBS 176
#define WCS_BDIS_OBS 177
d437 3
a439 3
  case WCS_BLON_OBS:
  case WCS_BLAT_OBS:
  case WCS_BDIS_OBS:
d471 2
a472 2
    case WCS_BLON_OBS:
      wcsp->aux->blon_obs = *dvalp;
d474 2
a475 2
    case WCS_BLAT_OBS:
      wcsp->aux->blat_obs = *dvalp;
d477 2
a478 2
    case WCS_BDIS_OBS:
      wcsp->aux->bdis_obs = *dvalp;
d818 2
a819 2
  case WCS_BLON_OBS:
    *dvalp = wcsp->aux ? wcsp->aux->blon_obs : UNDEFINED;
d821 2
a822 2
  case WCS_BLAT_OBS:
    *dvalp = wcsp->aux ? wcsp->aux->blat_obs : UNDEFINED;
d824 2
a825 2
  case WCS_BDIS_OBS:
    *dvalp = wcsp->aux ? wcsp->aux->bdis_obs : UNDEFINED;
@


7.13.1.5
log
@Updated date in copyright notice.
@
text
@d3 1
a3 1
  Copyright (C) 1995-2023, Mark Calabretta
d22 1
a22 1
  $Id: wcs_f.c,v 7.13.1.4 2023/06/15 04:00:08 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: wcs_f.c,v 7.11.1.1 2022/04/26 06:15:32 mcalabre Exp mcalabre $
@


7.12.1.1
log
@WCSLIB 7.12 development branch.
@
text
@d22 1
a22 1
  $Id: wcs_f.c,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: wcs_f.c,v 7.10.1.1 2022/04/23 14:26:54 mcalabre Exp mcalabre $
@


7.11.1.1
log
@WCSLIB 7.11 development branch.
@
text
@d22 1
a22 1
  $Id: wcs_f.c,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: wcs_f.c,v 7.9.1.1 2022/03/25 15:16:40 mcalabre Exp mcalabre $
@


7.10.1.1
log
@WCSLIB 7.10 development branch.
@
text
@d22 1
a22 1
  $Id: wcs_f.c,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: wcs_f.c,v 7.8.1.1 2022/03/25 06:14:15 mcalabre Exp mcalabre $
@


7.9.1.1
log
@WCSLIB 7.9 development branch.
@
text
@d22 1
a22 1
  $Id: wcs_f.c,v 7.9 2022/03/25 15:14:49 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: wcs_f.c,v 7.7.1.2 2022/03/25 06:06:00 mcalabre Exp mcalabre $
@


7.8.1.1
log
@WCSLIB 7.8 development branch.
@
text
@d22 1
a22 1
  $Id: wcs_f.c,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: wcs_f.c,v 7.6.1.1 2021/04/13 13:00:36 mcalabre Exp mcalabre $
@


7.7.1.1
log
@WCSLIB 7.7 development branch.
@
text
@d22 1
a22 1
  $Id: wcs_f.c,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: wcs_f.c,v 7.7.1.1 2021/07/12 06:38:28 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: wcs_f.c,v 7.5.1.2 2021/04/13 08:47:53 mcalabre Exp mcalabre $
@


7.6.1.1
log
@WCSLIB 7.6 development branch.
@
text
@d22 1
a22 1
  $Id: wcs_f.c,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: wcs_f.c,v 7.4.1.4 2021/02/22 07:56:29 mcalabre Exp mcalabre $
d52 3
d933 24
@


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


7.5.1.2
log
@Wrappers for wcstrim(), wcssize(), and auxsize().
@
text
@d22 1
a22 1
  $Id: wcs_f.c,v 7.5.1.1 2021/03/20 05:56:42 mcalabre Exp mcalabre $
a51 3
#define wcstrim_ F77_FUNC(wcstrim, WCSTRIM)
#define wcssize_ F77_FUNC(wcssize, WCSSIZE)
#define auxsize_ F77_FUNC(auxsize, AUXSIZE)
a929 24
}

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

int wcstrim_(int *wcs)

{
  return wcstrim((struct wcsprm *)wcs);
}

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

int wcssize_(const int *wcs, int sizes[2])

{
  return wcssize((const struct wcsprm *)wcs, sizes);
}

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

int auxsize_(const int *aux, int sizes[2])

{
  return auxsize((const struct auxprm *)aux, sizes);
@


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: wcs_f.c,v 7.3.1.4 2021/01/28 12:31:46 mcalabre Exp mcalabre $
d59 1
d214 1
a214 1
    wcsutil_strcvt(72, '\0', cvalp, wcsp->cunit[i0]);
d218 1
a218 1
    wcsutil_strcvt(72, '\0', cvalp, wcsp->ctype[i0]);
d255 1
a255 1
    wcsutil_strcvt(72, '\0', cvalp, (wcsp->ps + wcsp->nps)->value);
d288 1
a288 1
    wcsutil_strcvt(72, '\0', cvalp, wcsp->cname[i0]);
d304 1
a304 1
    wcsutil_strcvt(72, '\0', cvalp, wcsp->wcsname);
d308 1
a308 1
    wcsutil_strcvt(72, '\0', cvalp, wcsp->timesys);
d311 1
a311 1
    wcsutil_strcvt(72, '\0', cvalp, wcsp->trefpos);
d314 1
a314 1
    wcsutil_strcvt(72, '\0', cvalp, wcsp->trefdir);
d317 1
a317 1
    wcsutil_strcvt(72, '\0', cvalp, wcsp->plephem);
d320 1
a320 1
    wcsutil_strcvt(72, '\0', cvalp, wcsp->timeunit);
d323 1
a323 1
    wcsutil_strcvt(72, '\0', cvalp, wcsp->dateref);
d333 1
a333 1
    wcsutil_strcvt(72, '\0', cvalp, wcsp->dateobs);
d336 1
a336 1
    wcsutil_strcvt(72, '\0', cvalp, wcsp->datebeg);
d339 1
a339 1
    wcsutil_strcvt(72, '\0', cvalp, wcsp->dateavg);
d342 1
a342 1
    wcsutil_strcvt(72, '\0', cvalp, wcsp->dateend);
d392 1
a392 1
    wcsutil_strcvt(72, '\0', cvalp, wcsp->obsorbit);
d395 1
a395 1
    wcsutil_strcvt(72, '\0', cvalp, wcsp->radesys);
d401 1
a401 1
    wcsutil_strcvt(72, '\0', cvalp, wcsp->specsys);
d404 1
a404 1
    wcsutil_strcvt(72, '\0', cvalp, wcsp->ssysobs);
d413 1
a413 1
    wcsutil_strcvt(72, '\0', cvalp, wcsp->ssyssrc);
d530 1
a530 1
      wcsutil_strcvt(72, ' ', wcsp->cunit[i], cvalp);
d536 1
a536 1
      wcsutil_strcvt(72, ' ', wcsp->ctype[i], cvalp);
d576 1
a576 1
      wcsutil_strcvt(72, ' ', (wcsp->ps + k)->value, cvalp);
d603 1
a603 1
    wcsutil_strcvt(4, ' ', wcsp->alt, cvalp);
d616 1
a616 1
      wcsutil_strcvt(72, ' ', wcsp->cname[i], cvalp);
d642 1
a642 1
    wcsutil_strcvt(72, ' ', wcsp->wcsname, cvalp);
d646 1
a646 1
    wcsutil_strcvt(72, ' ', wcsp->timesys, cvalp);
d649 1
a649 1
    wcsutil_strcvt(72, ' ', wcsp->trefpos, cvalp);
d652 1
a652 1
    wcsutil_strcvt(72, ' ', wcsp->trefdir, cvalp);
d655 1
a655 1
    wcsutil_strcvt(72, ' ', wcsp->plephem, cvalp);
d658 1
a658 1
    wcsutil_strcvt(72, ' ', wcsp->timeunit, cvalp);
d661 1
a661 1
    wcsutil_strcvt(72, ' ', wcsp->dateref, cvalp);
d672 1
a672 1
    wcsutil_strcvt(72, ' ', wcsp->dateobs, cvalp);
d675 1
a675 1
    wcsutil_strcvt(72, ' ', wcsp->datebeg, cvalp);
d678 1
a678 1
    wcsutil_strcvt(72, ' ', wcsp->dateavg, cvalp);
d681 1
a681 1
    wcsutil_strcvt(72, ' ', wcsp->dateend, cvalp);
d733 1
a733 1
    wcsutil_strcvt(72, ' ', wcsp->obsorbit, cvalp);
d736 1
a736 1
    wcsutil_strcvt(72, ' ', wcsp->radesys, cvalp);
d742 1
a742 1
    wcsutil_strcvt(72, ' ', wcsp->specsys, cvalp);
d745 1
a745 1
    wcsutil_strcvt(72, ' ', wcsp->ssysobs, cvalp);
d754 1
a754 1
    wcsutil_strcvt(72, ' ', wcsp->ssyssrc, cvalp);
d789 1
a789 1
    wcsutil_strcvt(4, ' ', wcsp->lngtyp, cvalp);
d792 1
a792 1
    wcsutil_strcvt(4, ' ', wcsp->lattyp, cvalp);
d898 10
a907 2
  return wcssub(1, (const struct wcsprm *)wcssrc, nsub, axes,
                (struct wcsprm *)wcsdst);
d954 1
a954 3

  wcsutil_strcvt(72, '\0', prefix, prefix_);
  prefix_[72] = '\0';
d1037 25
d1069 1
a1069 3

  wcsutil_strcvt(8, ' ', ctype, ctype_);
  ctype_[8] = '\0';
d1073 1
a1073 1
  wcsutil_strcvt(8, ' ', ctype_, ctype);
d1095 1
a1095 1
  wcsutil_strcvt(nchr, ' ', wcslib_version(0x0), wcsver);
@


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


7.4.1.2
log
@Revised API to wcsutil_strcvt().
@
text
@d22 1
a22 1
  $Id: wcs_f.c,v 7.4.1.1 2021/01/31 02:26:24 mcalabre Exp mcalabre $
d213 1
a213 1
    wcsutil_strcvt(72, '\0', 0, cvalp, wcsp->cunit[i0]);
d217 1
a217 1
    wcsutil_strcvt(72, '\0', 0, cvalp, wcsp->ctype[i0]);
d254 1
a254 1
    wcsutil_strcvt(72, '\0', 0, cvalp, (wcsp->ps + wcsp->nps)->value);
d287 1
a287 1
    wcsutil_strcvt(72, '\0', 0, cvalp, wcsp->cname[i0]);
d303 1
a303 1
    wcsutil_strcvt(72, '\0', 0, cvalp, wcsp->wcsname);
d307 1
a307 1
    wcsutil_strcvt(72, '\0', 0, cvalp, wcsp->timesys);
d310 1
a310 1
    wcsutil_strcvt(72, '\0', 0, cvalp, wcsp->trefpos);
d313 1
a313 1
    wcsutil_strcvt(72, '\0', 0, cvalp, wcsp->trefdir);
d316 1
a316 1
    wcsutil_strcvt(72, '\0', 0, cvalp, wcsp->plephem);
d319 1
a319 1
    wcsutil_strcvt(72, '\0', 0, cvalp, wcsp->timeunit);
d322 1
a322 1
    wcsutil_strcvt(72, '\0', 0, cvalp, wcsp->dateref);
d332 1
a332 1
    wcsutil_strcvt(72, '\0', 0, cvalp, wcsp->dateobs);
d335 1
a335 1
    wcsutil_strcvt(72, '\0', 0, cvalp, wcsp->datebeg);
d338 1
a338 1
    wcsutil_strcvt(72, '\0', 0, cvalp, wcsp->dateavg);
d341 1
a341 1
    wcsutil_strcvt(72, '\0', 0, cvalp, wcsp->dateend);
d391 1
a391 1
    wcsutil_strcvt(72, '\0', 0, cvalp, wcsp->obsorbit);
d394 1
a394 1
    wcsutil_strcvt(72, '\0', 0, cvalp, wcsp->radesys);
d400 1
a400 1
    wcsutil_strcvt(72, '\0', 0, cvalp, wcsp->specsys);
d403 1
a403 1
    wcsutil_strcvt(72, '\0', 0, cvalp, wcsp->ssysobs);
d412 1
a412 1
    wcsutil_strcvt(72, '\0', 0, cvalp, wcsp->ssyssrc);
d529 1
a529 1
      wcsutil_strcvt(72, ' ', 0, wcsp->cunit[i], cvalp);
d535 1
a535 1
      wcsutil_strcvt(72, ' ', 0, wcsp->ctype[i], cvalp);
d575 1
a575 1
      wcsutil_strcvt(72, ' ', 0, (wcsp->ps + k)->value, cvalp);
d602 1
a602 1
    wcsutil_strcvt(4, ' ', 0, wcsp->alt, cvalp);
d615 1
a615 1
      wcsutil_strcvt(72, ' ', 0, wcsp->cname[i], cvalp);
d641 1
a641 1
    wcsutil_strcvt(72, ' ', 0, wcsp->wcsname, cvalp);
d645 1
a645 1
    wcsutil_strcvt(72, ' ', 0, wcsp->timesys, cvalp);
d648 1
a648 1
    wcsutil_strcvt(72, ' ', 0, wcsp->trefpos, cvalp);
d651 1
a651 1
    wcsutil_strcvt(72, ' ', 0, wcsp->trefdir, cvalp);
d654 1
a654 1
    wcsutil_strcvt(72, ' ', 0, wcsp->plephem, cvalp);
d657 1
a657 1
    wcsutil_strcvt(72, ' ', 0, wcsp->timeunit, cvalp);
d660 1
a660 1
    wcsutil_strcvt(72, ' ', 0, wcsp->dateref, cvalp);
d671 1
a671 1
    wcsutil_strcvt(72, ' ', 0, wcsp->dateobs, cvalp);
d674 1
a674 1
    wcsutil_strcvt(72, ' ', 0, wcsp->datebeg, cvalp);
d677 1
a677 1
    wcsutil_strcvt(72, ' ', 0, wcsp->dateavg, cvalp);
d680 1
a680 1
    wcsutil_strcvt(72, ' ', 0, wcsp->dateend, cvalp);
d732 1
a732 1
    wcsutil_strcvt(72, ' ', 0, wcsp->obsorbit, cvalp);
d735 1
a735 1
    wcsutil_strcvt(72, ' ', 0, wcsp->radesys, cvalp);
d741 1
a741 1
    wcsutil_strcvt(72, ' ', 0, wcsp->specsys, cvalp);
d744 1
a744 1
    wcsutil_strcvt(72, ' ', 0, wcsp->ssysobs, cvalp);
d753 1
a753 1
    wcsutil_strcvt(72, ' ', 0, wcsp->ssyssrc, cvalp);
d788 1
a788 1
    wcsutil_strcvt(4, ' ', 0, wcsp->lngtyp, cvalp);
d791 1
a791 1
    wcsutil_strcvt(4, ' ', 0, wcsp->lattyp, cvalp);
d945 3
a947 1
  wcsutil_strcvt(72, '\0', 1, prefix, prefix_);
d1037 3
a1039 1
  wcsutil_strcvt(8, ' ', 1, ctype, ctype_);
d1043 1
a1043 1
  wcsutil_strcvt(8, ' ', 0, ctype_, ctype);
d1065 1
a1065 1
  wcsutil_strcvt(nchr, ' ', 0, wcslib_version(0x0), wcsver);
@


7.4.1.3
log
@Because null addresses cannot be passed to functions in Fortran, wcssub_()
now interprets *nsub == -1 && *axes == -1 as a signal to do a deep copy of
one wcsprm struct to another.
@
text
@d22 1
a22 1
  $Id: wcs_f.c,v 7.4.1.2 2021/02/22 07:49:21 mcalabre Exp mcalabre $
d897 2
a898 10
  if (*nsub == -1 && *axes == -1) {
    // Interpreted as a signal that a deep copy is required.
    return wcssub(1, (const struct wcsprm *)wcssrc, 0x0, 0x0,
                  (struct wcsprm *)wcsdst);
  } else {
    // Beware that if *nsub == 0 it will be set on return so cannot be a
    // constant argument.
    return wcssub(1, (const struct wcsprm *)wcssrc, nsub, axes,
                  (struct wcsprm *)wcsdst);
  }
@


7.4.1.4
log
@Wrapper for wcsccs().
@
text
@d22 1
a22 1
  $Id: wcs_f.c,v 7.4.1.3 2021/02/22 07:51:44 mcalabre Exp mcalabre $
a58 1
#define wcsccs_  F77_FUNC(wcsccs,  WCSCCS)
a1031 25
}

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

int wcsccs_(
  struct wcsprm *wcs,
  const double *lng2p1,
  const double *lat2p1,
  const double *lng1p2,
  const char clng[4],
  const char clat[4],
  const char radesys[71],
  const double *equinox,
  const char alt[1])

{
  char clng_[5], clat_[5], radesys_[72];
  wcsutil_strcvt(4,  '\0', 1, clng, clng_);
  wcsutil_strcvt(4,  '\0', 1, clat, clat_);
  wcsutil_strcvt(71, '\0', 1, radesys, radesys_);

  int status = wcsccs(wcs, *lng2p1, *lat2p1, *lng1p2, clng_, clat_,
                      radesys_, *equinox, alt);

  return status;
@


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: wcs_f.c,v 7.2.1.1 2020/03/09 07:34:50 mcalabre Exp mcalabre $
d34 1
a34 1
/* Fortran name mangling. */
d63 1
a63 1
/* Must match the value set in wcs.inc. */
d161 1
a161 1
/*--------------------------------------------------------------------------*/
d177 1
a177 1
  /* Cast pointers. */
d183 1
a183 1
  /* Convert 1-relative FITS axis numbers to 0-relative C array indices. */
d473 1
a473 1
/*--------------------------------------------------------------------------*/
d487 1
a487 1
  /* Cast pointers. */
d508 1
a508 1
    /* C row-major to FORTRAN column-major. */
d580 1
a580 1
    /* C row-major to FORTRAN column-major. */
d811 1
a811 1
    /* Copy the contents of the linprm struct. */
d818 1
a818 1
    /* Copy the contents of the celprm struct. */
d825 1
a825 1
    /* Copy the contents of the spcprm struct. */
d832 1
a832 1
    /* Copy the contents of the wcserr struct. */
d866 1
a866 1
/*--------------------------------------------------------------------------*/
d871 1
a871 1
/*--------------------------------------------------------------------------*/
d879 1
a879 1
/*--------------------------------------------------------------------------*/
d892 1
a892 1
/*--------------------------------------------------------------------------*/
d901 1
a901 1
/*--------------------------------------------------------------------------*/
d915 1
a915 1
/*--------------------------------------------------------------------------*/
d923 1
a923 1
/*--------------------------------------------------------------------------*/
d928 2
a929 2
  /* This may or may not force the Fortran I/O buffers to be flushed.  If
   * not, try CALL FLUSH(6) before calling WCSPRT in the Fortran code. */
d935 1
a935 1
/*--------------------------------------------------------------------------*/
d937 3
a939 3
/* If null-terminated (using the Fortran CHAR(0) intrinsic), prefix may be of
 * length less than but not exceeding 72 and trailing blanks are preserved.
 * Otherwise, it must be of length 72 and trailing blanks are stripped off. */
d949 2
a950 2
  /* This may or may not force the Fortran I/O buffers to be flushed. */
  /* If not, try CALL FLUSH(6) before calling WCSPERR in the Fortran code. */
d956 1
a956 1
/*--------------------------------------------------------------------------*/
d964 1
a964 1
/*--------------------------------------------------------------------------*/
d972 1
a972 1
/*--------------------------------------------------------------------------*/
d990 1
a990 1
/*--------------------------------------------------------------------------*/
d1008 1
a1008 1
/*--------------------------------------------------------------------------*/
d1028 1
a1028 1
/*--------------------------------------------------------------------------*/
d1048 1
a1048 1
/*--------------------------------------------------------------------------*/
d1058 1
a1058 1
/*--------------------------------------------------------------------------*/
@


7.3.1.1
log
@WCSLIB 7.3 development branch.
@
text
@d25 1
a25 1
  $Id: wcs_f.c,v 7.3 2020/06/03 03:37:03 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: wcs_f.c,v 7.3.1.1 2020/06/03 03:38:11 mcalabre Exp mcalabre $
d37 1
a37 1
// Fortran name mangling.
d66 1
a66 1
// Must match the value set in wcs.inc.
d164 1
a164 1
//----------------------------------------------------------------------------
d180 1
a180 1
  // Cast pointers.
d186 1
a186 1
  // Convert 1-relative FITS axis numbers to 0-relative C array indices.
d476 1
a476 1
//----------------------------------------------------------------------------
d490 1
a490 1
  // Cast pointers.
d511 1
a511 1
    // C row-major to FORTRAN column-major.
d583 1
a583 1
    // C row-major to FORTRAN column-major.
d814 1
a814 1
    // Copy the contents of the linprm struct.
d821 1
a821 1
    // Copy the contents of the celprm struct.
d828 1
a828 1
    // Copy the contents of the spcprm struct.
d835 1
a835 1
    // Copy the contents of the wcserr struct.
d869 1
a869 1
//----------------------------------------------------------------------------
d874 1
a874 1
//----------------------------------------------------------------------------
d882 1
a882 1
//----------------------------------------------------------------------------
d895 1
a895 1
//----------------------------------------------------------------------------
d904 1
a904 1
//----------------------------------------------------------------------------
d918 1
a918 1
//----------------------------------------------------------------------------
d926 1
a926 1
//----------------------------------------------------------------------------
d931 2
a932 2
  // This may or may not force the Fortran I/O buffers to be flushed.  If
  // not, try CALL FLUSH(6) before calling WCSPRT in the Fortran code.
d938 1
a938 1
//----------------------------------------------------------------------------
d940 3
a942 3
// If null-terminated (using the Fortran CHAR(0) intrinsic), prefix may be of
// length less than but not exceeding 72 and trailing blanks are preserved.
// Otherwise, it must be of length 72 and trailing blanks are stripped off.
d952 2
a953 2
  // This may or may not force the Fortran I/O buffers to be flushed.
  // If not, try CALL FLUSH(6) before calling WCSPERR in the Fortran code.
d959 1
a959 1
//----------------------------------------------------------------------------
d967 1
a967 1
//----------------------------------------------------------------------------
d975 1
a975 1
//----------------------------------------------------------------------------
d993 1
a993 1
//----------------------------------------------------------------------------
d1011 1
a1011 1
//----------------------------------------------------------------------------
d1031 1
a1031 1
//----------------------------------------------------------------------------
d1051 1
a1051 1
//----------------------------------------------------------------------------
d1061 1
a1061 1
//----------------------------------------------------------------------------
@


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: wcs_f.c,v 7.3.1.2 2020/08/17 11:21:34 mcalabre Exp mcalabre $
@


7.3.1.4
log
@Removed my email address from the copyright notice.
@
text
@d20 2
d24 1
a24 1
  $Id: wcs_f.c,v 7.3.1.3 2021/01/19 14:10:41 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: wcs_f.c,v 7.1.1.1 2019/12/31 13:28:19 mcalabre Exp mcalabre $
@


7.2.1.1
log
@WCSLIB 7.2 development branch.
@
text
@d25 1
a25 1
  $Id: wcs_f.c,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: wcs_f.c,v 6.4.1.4 2019/12/31 03:28:57 mcalabre Exp mcalabre $
@


7.1.1.1
log
@WCSLIB 7.1 development branch.
@
text
@d25 1
a25 1
  $Id: wcs_f.c,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: wcs_f.c,v 6.3.1.1 2019/07/12 07:34:37 mcalabre Exp mcalabre $
d29 1
d33 1
d142 6
d216 1
a216 2
    strncpy(wcsp->cunit[i0], cvalp, 72);
    wcsutil_null_fill(72, wcsp->cunit[i0]);
d220 1
a220 2
    strncpy(wcsp->ctype[i0], cvalp, 72);
    wcsutil_null_fill(72, wcsp->ctype[i0]);
d257 1
a257 2
    strncpy((wcsp->ps + wcsp->nps)->value, cvalp, 72);
    wcsutil_null_fill(72, (wcsp->ps + wcsp->nps)->value);
d280 1
a280 1
    wcsutil_null_fill(4, wcsp->alt);
d290 1
a290 2
    strncpy(wcsp->cname[i0], cvalp, 72);
    wcsutil_null_fill(72, wcsp->cname[i0]);
d306 1
a306 2
    strncpy(wcsp->wcsname, cvalp, 72);
    wcsutil_null_fill(72, wcsp->wcsname);
d310 1
a310 2
    strncpy(wcsp->timesys, cvalp, 72);
    wcsutil_null_fill(72, wcsp->timesys);
d313 1
a313 2
    strncpy(wcsp->trefpos, cvalp, 72);
    wcsutil_null_fill(72, wcsp->trefpos);
d316 1
a316 2
    strncpy(wcsp->trefdir, cvalp, 72);
    wcsutil_null_fill(72, wcsp->trefdir);
d319 1
a319 2
    strncpy(wcsp->plephem, cvalp, 72);
    wcsutil_null_fill(72, wcsp->plephem);
d322 1
a322 2
    strncpy(wcsp->timeunit, cvalp, 72);
    wcsutil_null_fill(72, wcsp->timeunit);
d325 1
a325 2
    strncpy(wcsp->dateref, cvalp, 72);
    wcsutil_null_fill(72, wcsp->dateref);
d335 1
a335 2
    strncpy(wcsp->dateobs, cvalp, 72);
    wcsutil_null_fill(72, wcsp->dateobs);
d338 1
a338 2
    strncpy(wcsp->datebeg, cvalp, 72);
    wcsutil_null_fill(72, wcsp->datebeg);
d341 1
a341 2
    strncpy(wcsp->dateavg, cvalp, 72);
    wcsutil_null_fill(72, wcsp->dateavg);
d344 1
a344 2
    strncpy(wcsp->dateend, cvalp, 72);
    wcsutil_null_fill(72, wcsp->dateend);
d394 1
a394 2
    strncpy(wcsp->obsorbit, cvalp, 72);
    wcsutil_null_fill(72, wcsp->obsorbit);
d397 1
a397 2
    strncpy(wcsp->radesys, cvalp, 72);
    wcsutil_null_fill(72, wcsp->radesys);
d403 1
a403 2
    strncpy(wcsp->specsys, cvalp, 72);
    wcsutil_null_fill(72, wcsp->specsys);
d406 1
a406 2
    strncpy(wcsp->ssysobs, cvalp, 72);
    wcsutil_null_fill(72, wcsp->ssysobs);
d415 1
a415 2
    strncpy(wcsp->ssyssrc, cvalp, 72);
    wcsutil_null_fill(72, wcsp->ssyssrc);
d420 31
d532 1
a532 2
      strncpy(cvalp, wcsp->cunit[i], 72);
      wcsutil_blank_fill(72, cvalp);
d538 1
a538 2
      strncpy(cvalp, wcsp->ctype[i], 72);
      wcsutil_blank_fill(72, cvalp);
d578 1
a578 2
      strncpy(cvalp, (wcsp->ps + k)->value, 72);
      wcsutil_blank_fill(72, cvalp);
d605 1
a605 2
    strncpy(cvalp, wcsp->alt, 4);
    wcsutil_blank_fill(4, cvalp);
d618 1
a618 2
      strncpy(cvalp, wcsp->cname[i], 72);
      wcsutil_blank_fill(72, cvalp);
d644 1
a644 2
    strncpy(cvalp, wcsp->wcsname, 72);
    wcsutil_blank_fill(72, cvalp);
d648 1
a648 2
    strncpy(cvalp, wcsp->timesys, 72);
    wcsutil_blank_fill(72, cvalp);
d651 1
a651 2
    strncpy(cvalp, wcsp->trefpos, 72);
    wcsutil_blank_fill(72, cvalp);
d654 1
a654 2
    strncpy(cvalp, wcsp->trefdir, 72);
    wcsutil_blank_fill(72, cvalp);
d657 1
a657 2
    strncpy(cvalp, wcsp->plephem, 72);
    wcsutil_blank_fill(72, cvalp);
d660 1
a660 2
    strncpy(cvalp, wcsp->timeunit, 72);
    wcsutil_blank_fill(72, cvalp);
d663 1
a663 2
    strncpy(cvalp, wcsp->dateref, 72);
    wcsutil_blank_fill(72, cvalp);
d674 1
a674 2
    strncpy(cvalp, wcsp->dateobs, 72);
    wcsutil_blank_fill(72, cvalp);
d677 1
a677 2
    strncpy(cvalp, wcsp->datebeg, 72);
    wcsutil_blank_fill(72, cvalp);
d680 1
a680 2
    strncpy(cvalp, wcsp->dateavg, 72);
    wcsutil_blank_fill(72, cvalp);
d683 1
a683 2
    strncpy(cvalp, wcsp->dateend, 72);
    wcsutil_blank_fill(72, cvalp);
d735 1
a735 2
    strncpy(cvalp, wcsp->obsorbit, 72);
    wcsutil_blank_fill(72, cvalp);
d738 1
a738 2
    strncpy(cvalp, wcsp->radesys, 72);
    wcsutil_blank_fill(72, cvalp);
d744 1
a744 2
    strncpy(cvalp, wcsp->specsys, 72);
    wcsutil_blank_fill(72, cvalp);
d747 1
a747 2
    strncpy(cvalp, wcsp->ssysobs, 72);
    wcsutil_blank_fill(72, cvalp);
d756 1
a756 2
    strncpy(cvalp, wcsp->ssyssrc, 72);
    wcsutil_blank_fill(72, cvalp);
d762 16
d791 1
a791 2
    strncpy(cvalp, wcsp->lngtyp, 4);
    wcsutil_blank_fill(4, cvalp);
d794 1
a794 2
    strncpy(cvalp, wcsp->lattyp, 4);
    wcsutil_blank_fill(4, cvalp);
d940 3
a942 2
/* prefix should be null-terminated, or else of length 72 in which case
 * trailing blanks are not significant. */
d947 1
a947 1
  char prefix_[72];
d949 2
a950 2
  strncpy(prefix_, prefix, 72);
  wcsutil_null_fill(72, prefix_);
d1033 4
a1036 1
int wcssptr_(struct wcsprm *wcs, int *i, char ctype[9])
d1039 8
a1046 2
  int status = wcssptr(wcs, i, ctype);
  wcsutil_blank_fill(9, ctype);
d1053 3
a1055 1
int wcscopy_(const int *wcssrc, int *wcsdst)
d1063 3
a1065 1
void wcslib_version_(char *wcsver, int nchr)
d1068 1
a1068 2
  strncpy(wcsver, wcslib_version(0x0), nchr);
  wcsutil_blank_fill(nchr, wcsver);
@


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


6.4.1.2
log
@Reworked Fortran <-> C string translation using wcsutil_strcvt().
@
text
@d25 1
a25 1
  $Id: wcs_f.c,v 6.4.1.2 2019/12/12 03:19:41 mcalabre Exp mcalabre $
d208 2
a209 1
    wcsutil_strcvt(72, '\0', cvalp, wcsp->cunit[i0]);
d213 2
a214 1
    wcsutil_strcvt(72, '\0', cvalp, wcsp->ctype[i0]);
d251 2
a252 1
    wcsutil_strcvt(72, '\0', cvalp, (wcsp->ps + wcsp->nps)->value);
d275 1
a275 1
    memset((wcsp->alt)+1, '\0', 3);
d285 2
a286 1
    wcsutil_strcvt(72, '\0', cvalp, wcsp->cname[i0]);
d302 2
a303 1
    wcsutil_strcvt(72, '\0', cvalp, wcsp->wcsname);
d307 2
a308 1
    wcsutil_strcvt(72, '\0', cvalp, wcsp->timesys);
d311 2
a312 1
    wcsutil_strcvt(72, '\0', cvalp, wcsp->trefpos);
d315 2
a316 1
    wcsutil_strcvt(72, '\0', cvalp, wcsp->trefdir);
d319 2
a320 1
    wcsutil_strcvt(72, '\0', cvalp, wcsp->plephem);
d323 2
a324 1
    wcsutil_strcvt(72, '\0', cvalp, wcsp->timeunit);
d327 2
a328 1
    wcsutil_strcvt(72, '\0', cvalp, wcsp->dateref);
d338 2
a339 1
    wcsutil_strcvt(72, '\0', cvalp, wcsp->dateobs);
d342 2
a343 1
    wcsutil_strcvt(72, '\0', cvalp, wcsp->datebeg);
d346 2
a347 1
    wcsutil_strcvt(72, '\0', cvalp, wcsp->dateavg);
d350 2
a351 1
    wcsutil_strcvt(72, '\0', cvalp, wcsp->dateend);
d401 2
a402 1
    wcsutil_strcvt(72, '\0', cvalp, wcsp->obsorbit);
d405 2
a406 1
    wcsutil_strcvt(72, '\0', cvalp, wcsp->radesys);
d412 2
a413 1
    wcsutil_strcvt(72, '\0', cvalp, wcsp->specsys);
d416 2
a417 1
    wcsutil_strcvt(72, '\0', cvalp, wcsp->ssysobs);
d426 2
a427 1
    wcsutil_strcvt(72, '\0', cvalp, wcsp->ssyssrc);
d513 2
a514 1
      wcsutil_strcvt(72, ' ', wcsp->cunit[i], cvalp);
d520 2
a521 1
      wcsutil_strcvt(72, ' ', wcsp->ctype[i], cvalp);
d561 2
a562 1
      wcsutil_strcvt(72, ' ', (wcsp->ps + k)->value, cvalp);
d589 2
a590 1
    wcsutil_strcvt(4, ' ', wcsp->alt, cvalp);
d603 2
a604 1
      wcsutil_strcvt(72, ' ', wcsp->cname[i], cvalp);
d630 2
a631 1
    wcsutil_strcvt(72, ' ', wcsp->wcsname, cvalp);
d635 2
a636 1
    wcsutil_strcvt(72, ' ', wcsp->timesys, cvalp);
d639 2
a640 1
    wcsutil_strcvt(72, ' ', wcsp->trefpos, cvalp);
d643 2
a644 1
    wcsutil_strcvt(72, ' ', wcsp->trefdir, cvalp);
d647 2
a648 1
    wcsutil_strcvt(72, ' ', wcsp->plephem, cvalp);
d651 2
a652 1
    wcsutil_strcvt(72, ' ', wcsp->timeunit, cvalp);
d655 2
a656 1
    wcsutil_strcvt(72, ' ', wcsp->dateref, cvalp);
d667 2
a668 1
    wcsutil_strcvt(72, ' ', wcsp->dateobs, cvalp);
d671 2
a672 1
    wcsutil_strcvt(72, ' ', wcsp->datebeg, cvalp);
d675 2
a676 1
    wcsutil_strcvt(72, ' ', wcsp->dateavg, cvalp);
d679 2
a680 1
    wcsutil_strcvt(72, ' ', wcsp->dateend, cvalp);
d732 2
a733 1
    wcsutil_strcvt(72, ' ', wcsp->obsorbit, cvalp);
d736 2
a737 1
    wcsutil_strcvt(72, ' ', wcsp->radesys, cvalp);
d743 2
a744 1
    wcsutil_strcvt(72, ' ', wcsp->specsys, cvalp);
d747 2
a748 1
    wcsutil_strcvt(72, ' ', wcsp->ssysobs, cvalp);
d757 2
a758 1
    wcsutil_strcvt(72, ' ', wcsp->ssyssrc, cvalp);
d777 2
a778 1
    wcsutil_strcvt(4, ' ', wcsp->lngtyp, cvalp);
d781 2
a782 1
    wcsutil_strcvt(4, ' ', wcsp->lattyp, cvalp);
d928 2
a929 3
/* If null-terminated (using the Fortran CHAR(0) intrinsic), prefix may be of
 * length less than but not exceeding 72 and trailing blanks are preserved.
 * Otherwise, it must be of length 72 and trailing blanks are stripped off. */
d934 1
a934 1
  char prefix_[73];
d936 2
a937 2
  wcsutil_strcvt(72, '\0', prefix, prefix_);
  prefix_[72] = '\0';
d1020 1
a1020 4
int wcssptr_(
  struct wcsprm *wcs,
  int *i,
  char ctype[8])
d1023 2
a1024 8
  char ctype_[9];

  wcsutil_strcvt(8, ' ', ctype, ctype_);
  ctype_[8] = '\0';

  int status = wcssptr(wcs, i, ctype_);

  wcsutil_strcvt(8, ' ', ctype_, ctype);
d1031 1
a1031 3
int wcscopy_(
  const int *wcssrc,
  int *wcsdst)
d1039 1
a1039 3
void wcslib_version_(
  char *wcsver,
  int  nchr)
d1042 2
a1043 1
  wcsutil_strcvt(nchr, ' ', wcslib_version(0x0), wcsver);
@


6.4.1.3
log
@Updated wcsput_() and wcsget_() to handle the new Solar-related members of
the auxprm struct within wcsprm.
@
text
@a28 1
#include <stdlib.h>
a31 1
#include <wcsmath.h>
a139 6
#define WCS_RSUN_REF 167
#define WCS_DSUN_OBS 168
#define WCS_CRLN_OBS 169
#define WCS_HGLN_OBS 170
#define WCS_HGLT_OBS 171

a411 31

  case WCS_RSUN_REF:
  case WCS_DSUN_OBS:
  case WCS_CRLN_OBS:
  case WCS_HGLN_OBS:
  case WCS_HGLT_OBS:
    if (wcsp->aux == 0x0) {
      if (wcsauxi(1, wcsp)) {
        return 2;
      }
    }

    switch (*what) {
    case WCS_RSUN_REF:
      wcsp->aux->rsun_ref = *dvalp;
      break;
    case WCS_DSUN_OBS:
      wcsp->aux->dsun_obs = *dvalp;
      break;
    case WCS_CRLN_OBS:
      wcsp->aux->crln_obs = *dvalp;
      break;
    case WCS_HGLN_OBS:
      wcsp->aux->hgln_obs = *dvalp;
      break;
    case WCS_HGLT_OBS:
      wcsp->aux->hglt_obs = *dvalp;
      break;
    }

    break;
a720 16
    break;

  case WCS_RSUN_REF:
    *dvalp = wcsp->aux ? wcsp->aux->rsun_ref : UNDEFINED;
    break;
  case WCS_DSUN_OBS:
    *dvalp = wcsp->aux ? wcsp->aux->dsun_obs : UNDEFINED;
    break;
  case WCS_CRLN_OBS:
    *dvalp = wcsp->aux ? wcsp->aux->crln_obs : UNDEFINED;
    break;
  case WCS_HGLN_OBS:
    *dvalp = wcsp->aux ? wcsp->aux->hgln_obs : UNDEFINED;
    break;
  case WCS_HGLT_OBS:
    *dvalp = wcsp->aux ? wcsp->aux->hglt_obs : UNDEFINED;
@


6.4.1.4
log
@Updated date in copyright notice.
@
text
@d4 1
a4 1
  Copyright (C) 1995-2020, Mark Calabretta
d25 1
a25 1
  $Id: wcs_f.c,v 6.4.1.3 2019/12/31 02:42:27 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: wcs_f.c,v 6.2.1.2 2019/05/10 02:05:36 mcalabre Exp mcalabre $
@


6.3.1.1
log
@WCSLIB 6.3 development branch.
@
text
@d25 1
a25 1
  $Id: wcs_f.c,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: wcs_f.c,v 6.1.1.1 2018/10/19 08:36:15 mcalabre Exp mcalabre $
@


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


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: wcs_f.c,v 5.20.1.2 2018/10/19 04:46:28 mcalabre Exp mcalabre $
@


6.1.1.1
log
@WCSLIB 6.1 development branch.
@
text
@d25 1
a25 1
  $Id: wcs_f.c,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: wcs_f.c,v 5.19.1.1 2018/07/26 15:41:42 mcalabre Exp mcalabre $
d64 1
d95 44
a138 14
#define WCS_DATEAVG  128
#define WCS_DATEOBS  129
#define WCS_EQUINOX  130
#define WCS_MJDAVG   131
#define WCS_MJDOBS   132
#define WCS_OBSGEO   133
#define WCS_RADESYS  134
#define WCS_SPECSYS  135
#define WCS_SSYSOBS  136
#define WCS_VELOSYS  137
#define WCS_ZSOURCE  138
#define WCS_SSYSSRC  139
#define WCS_VELANGL  140
#define WCS_WCSNAME  141
d294 51
d349 6
a354 3
  case WCS_DATEOBS:
    strncpy(wcsp->dateobs, cvalp, 72);
    wcsutil_null_fill(72, wcsp->dateobs);
d356 2
a357 2
  case WCS_EQUINOX:
    wcsp->equinox = *dvalp;
d362 33
a394 2
  case WCS_MJDOBS:
    wcsp->mjdobs = *dvalp;
d396 1
d400 4
d408 3
a431 4
  case WCS_WCSNAME:
    strncpy(wcsp->wcsname, cvalp, 72);
    wcsutil_null_fill(72, wcsp->wcsname);
    break;
d618 56
d678 2
a679 2
  case WCS_DATEOBS:
    strncpy(cvalp, wcsp->dateobs, 72);
d682 5
a686 2
  case WCS_EQUINOX:
    *dvalp = wcsp->equinox;
d691 33
a723 2
  case WCS_MJDOBS:
    *dvalp = wcsp->mjdobs;
d725 1
d727 1
a727 1
    for (i = 0; i < 3; i++) {
d731 4
d739 3
a761 4
    break;
  case WCS_WCSNAME:
    strncpy(cvalp, wcsp->wcsname, 72);
    wcsutil_blank_fill(72, cvalp);
@


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


5.20.1.2
log
@Updated wcsput_() and wcsget_() to handle the new time-related members of the
wcsprm struct.
@
text
@d25 1
a25 1
  $Id: wcs_f.c,v 5.20.1.1 2018/10/05 05:33:33 mcalabre Exp mcalabre $
a63 1
/* Must match the value set in wcs.inc. */
d94 14
a107 44
#define WCS_CZPHS    128
#define WCS_CPERI    129

#define WCS_WCSNAME  130

#define WCS_TIMESYS  131
#define WCS_TREFPOS  132
#define WCS_TREFDIR  133
#define WCS_PLEPHEM  134
#define WCS_TIMEUNIT 135
#define WCS_DATEREF  136
#define WCS_MJDREF   137
#define WCS_TIMEOFFS 138

#define WCS_DATEOBS  139
#define WCS_DATEBEG  140
#define WCS_DATEAVG  141
#define WCS_DATEEND  142
#define WCS_MJDOBS   143
#define WCS_MJDBEG   144
#define WCS_MJDAVG   145
#define WCS_MJDEND   146
#define WCS_JEPOCH   147
#define WCS_BEPOCH   148
#define WCS_TSTART   149
#define WCS_TSTOP    150
#define WCS_XPOSURE  151
#define WCS_TELAPSE  152

#define WCS_TIMSYER  153
#define WCS_TIMRDER  154
#define WCS_TIMEDEL  155
#define WCS_TIMEPIXR 156

#define WCS_OBSGEO   157
#define WCS_OBSORBIT 158
#define WCS_RADESYS  159
#define WCS_EQUINOX  160
#define WCS_SPECSYS  161
#define WCS_SSYSOBS  162
#define WCS_VELOSYS  163
#define WCS_ZSOURCE  164
#define WCS_SSYSSRC  165
#define WCS_VELANGL  166
d263 3
a265 38
  case WCS_CZPHS:
    wcsp->czphs[i0] = *dvalp;
    break;
  case WCS_CPERI:
    wcsp->cperi[i0] = *dvalp;
    break;

  case WCS_WCSNAME:
    strncpy(wcsp->wcsname, cvalp, 72);
    wcsutil_null_fill(72, wcsp->wcsname);
    break;

  case WCS_TIMESYS:
    strncpy(wcsp->timesys, cvalp, 72);
    wcsutil_null_fill(72, wcsp->timesys);
    break;
  case WCS_TREFPOS:
    strncpy(wcsp->trefpos, cvalp, 72);
    wcsutil_null_fill(72, wcsp->trefpos);
    break;
  case WCS_TREFDIR:
    strncpy(wcsp->trefdir, cvalp, 72);
    wcsutil_null_fill(72, wcsp->trefdir);
    break;
  case WCS_PLEPHEM:
    strncpy(wcsp->plephem, cvalp, 72);
    wcsutil_null_fill(72, wcsp->plephem);
    break;
  case WCS_TIMEUNIT:
    strncpy(wcsp->timeunit, cvalp, 72);
    wcsutil_null_fill(72, wcsp->timeunit);
    break;
  case WCS_DATEREF:
    strncpy(wcsp->dateref, cvalp, 72);
    wcsutil_null_fill(72, wcsp->dateref);
    break;
  case WCS_MJDREF:
    wcsp->mjdref[i0] = *dvalp;
a266 4
  case WCS_TIMEOFFS:
    wcsp->timeoffs = *dvalp;
    break;

d271 2
a272 3
  case WCS_DATEBEG:
    strncpy(wcsp->datebeg, cvalp, 72);
    wcsutil_null_fill(72, wcsp->datebeg);
d274 2
a275 7
  case WCS_DATEAVG:
    strncpy(wcsp->dateavg, cvalp, 72);
    wcsutil_null_fill(72, wcsp->dateavg);
    break;
  case WCS_DATEEND:
    strncpy(wcsp->dateend, cvalp, 72);
    wcsutil_null_fill(72, wcsp->dateend);
a279 41
  case WCS_MJDBEG:
    wcsp->mjdbeg = *dvalp;
    break;
  case WCS_MJDAVG:
    wcsp->mjdavg = *dvalp;
    break;
  case WCS_MJDEND:
    wcsp->mjdend = *dvalp;
    break;
  case WCS_JEPOCH:
    wcsp->jepoch = *dvalp;
    break;
  case WCS_BEPOCH:
    wcsp->bepoch = *dvalp;
    break;
  case WCS_TSTART:
    wcsp->tstart = *dvalp;
    break;
  case WCS_TSTOP:
    wcsp->tstop = *dvalp;
    break;
  case WCS_XPOSURE:
    wcsp->xposure = *dvalp;
    break;
  case WCS_TELAPSE:
    wcsp->telapse = *dvalp;
    break;

  case WCS_TIMSYER:
    wcsp->timsyer = *dvalp;
    break;
  case WCS_TIMRDER:
    wcsp->timrder = *dvalp;
    break;
  case WCS_TIMEDEL:
    wcsp->timedel = *dvalp;
    break;
  case WCS_TIMEPIXR:
    wcsp->timepixr = *dvalp;
    break;

a282 4
  case WCS_OBSORBIT:
    strncpy(wcsp->obsorbit, cvalp, 72);
    wcsutil_null_fill(72, wcsp->obsorbit);
    break;
a286 3
  case WCS_EQUINOX:
    wcsp->equinox = *dvalp;
    break;
d308 4
d498 2
a499 38
  case WCS_CZPHS:
    for (i = 0; i < naxis; i++) {
      *(dvalp++) = wcsp->czphs[i];
    }
    break;
  case WCS_CPERI:
    for (i = 0; i < naxis; i++) {
      *(dvalp++) = wcsp->cperi[i];
    }
    break;

  case WCS_WCSNAME:
    strncpy(cvalp, wcsp->wcsname, 72);
    wcsutil_blank_fill(72, cvalp);
    break;

  case WCS_TIMESYS:
    strncpy(cvalp, wcsp->timesys, 72);
    wcsutil_blank_fill(72, cvalp);
    break;
  case WCS_TREFPOS:
    strncpy(cvalp, wcsp->trefpos, 72);
    wcsutil_blank_fill(72, cvalp);
    break;
  case WCS_TREFDIR:
    strncpy(cvalp, wcsp->trefdir, 72);
    wcsutil_blank_fill(72, cvalp);
    break;
  case WCS_PLEPHEM:
    strncpy(cvalp, wcsp->plephem, 72);
    wcsutil_blank_fill(72, cvalp);
    break;
  case WCS_TIMEUNIT:
    strncpy(cvalp, wcsp->timeunit, 72);
    wcsutil_blank_fill(72, cvalp);
    break;
  case WCS_DATEREF:
    strncpy(cvalp, wcsp->dateref, 72);
a501 8
  case WCS_MJDREF:
    *(dvalp++) = wcsp->mjdref[0];
    *(dvalp++) = wcsp->mjdref[1];
    break;
  case WCS_TIMEOFFS:
    *dvalp = wcsp->timeoffs;
    break;

d506 2
a507 3
  case WCS_DATEBEG:
    strncpy(cvalp, wcsp->datebeg, 72);
    wcsutil_blank_fill(72, cvalp);
d509 2
a510 7
  case WCS_DATEAVG:
    strncpy(cvalp, wcsp->dateavg, 72);
    wcsutil_blank_fill(72, cvalp);
    break;
  case WCS_DATEEND:
    strncpy(cvalp, wcsp->dateend, 72);
    wcsutil_blank_fill(72, cvalp);
a514 41
  case WCS_MJDBEG:
    *dvalp = wcsp->mjdbeg;
    break;
  case WCS_MJDAVG:
    *dvalp = wcsp->mjdavg;
    break;
  case WCS_MJDEND:
    *dvalp = wcsp->mjdend;
    break;
  case WCS_JEPOCH:
    *dvalp = wcsp->jepoch;
    break;
  case WCS_BEPOCH:
    *dvalp = wcsp->bepoch;
    break;
  case WCS_TSTART:
    *dvalp = wcsp->tstart;
    break;
  case WCS_TSTOP:
    *dvalp = wcsp->tstop;
    break;
  case WCS_XPOSURE:
    *dvalp = wcsp->xposure;
    break;
  case WCS_TELAPSE:
    *dvalp = wcsp->telapse;
    break;

  case WCS_TIMSYER:
    *dvalp = wcsp->timsyer;
    break;
  case WCS_TIMRDER:
    *dvalp = wcsp->timrder;
    break;
  case WCS_TIMEDEL:
    *dvalp = wcsp->timedel;
    break;
  case WCS_TIMEPIXR:
    *dvalp = wcsp->timepixr;
    break;

d516 1
a516 1
    for (i = 0; i < 6; i++) {
a519 4
  case WCS_OBSORBIT:
    strncpy(cvalp, wcsp->obsorbit, 72);
    wcsutil_blank_fill(72, cvalp);
    break;
a523 3
  case WCS_EQUINOX:
    *dvalp = wcsp->equinox;
    break;
d544 4
@


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: wcs_f.c,v 5.18.1.1 2018/01/10 08:33:04 mcalabre Exp mcalabre $
@


5.19.1.1
log
@WCSLIB 5.19 development branch.
@
text
@d25 1
a25 1
  $Id: wcs_f.c,v 5.19 2018/07/26 15:37:05 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: wcs_f.c,v 5.17.1.3 2018/01/10 08:26:33 mcalabre Exp mcalabre $
@


5.18.1.1
log
@WCSLIB 5.18 development branch.
@
text
@d25 1
a25 1
  $Id: wcs_f.c,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: wcs_f.c,v 5.16.1.2 2017/09/13 00:26:00 mcalabre Exp mcalabre $
d49 1
d654 13
@


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


5.17.1.2
log
@Wrapper for wcsinit().
@
text
@d25 1
a25 1
  $Id: wcs_f.c,v 5.17.1.1 2017/09/18 08:46:00 mcalabre Exp mcalabre $
a48 1
#define wcsinit_ F77_FUNC(wcsinit, WCSINIT)
a652 13
}

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

int wcsinit_(
  const int *naxis,
  int *wcs,
  int *npvmax,
  int *npsmax,
  int *ndpmax)

{
  return wcsinit(1, *naxis, (struct wcsprm *)wcs, *npvmax, *npsmax, *ndpmax);
@


5.17.1.3
log
@Updated date in copyright notice.
@
text
@d4 1
a4 1
  Copyright (C) 1995-2018, Mark Calabretta
d25 1
a25 1
  $Id: wcs_f.c,v 5.17.1.2 2017/12/05 07:20:52 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: wcs_f.c,v 5.15.1.2 2017/01/15 04:08:22 mcalabre Exp mcalabre $
d341 1
d589 1
a589 1
    for (k = 0; k < LINLEN; k++) {
d596 1
a596 1
    for (k = 0; k < CELLEN; k++) {
d603 1
a603 1
    for (k = 0; k < SPCLEN; k++) {
d611 1
a611 1
      for (k = 0; k < ERRLEN; k++) {
d615 1
a615 1
      for (k = 0; k < ERRLEN; k++) {
@


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


5.16.1.2
log
@Fixed compiler warnings about comparison between signed and unsigned ints.
@
text
@d25 1
a25 1
  $Id: wcs_f.c,v 5.16.1.1 2017/01/15 04:29:02 mcalabre Exp mcalabre $
a340 1
  unsigned int l;
d588 1
a588 1
    for (l = 0; l < LINLEN; l++) {
d595 1
a595 1
    for (l = 0; l < CELLEN; l++) {
d602 1
a602 1
    for (l = 0; l < SPCLEN; l++) {
d610 1
a610 1
      for (l = 0; l < ERRLEN; l++) {
d614 1
a614 1
      for (l = 0; l < ERRLEN; l++) {
@


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: wcs_f.c,v 5.14.1.1 2016/02/07 10:52:47 mcalabre Exp mcalabre $
@


5.15.1.1
log
@WCSLIB 5.15 development branch.
@
text
@d25 1
a25 1
  $Id: wcs_f.c,v 5.15 2016/04/05 12:55:12 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: wcs_f.c,v 5.15.1.1 2016/04/05 12:58:37 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: wcs_f.c,v 5.13.1.1 2016/01/26 08:54:35 mcalabre Exp mcalabre $
@


5.14.1.1
log
@WCSLIB 5.14 development branch.
@
text
@d25 1
a25 1
  $Id: wcs_f.c,v 5.14 2016/02/07 10:49:32 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: wcs_f.c,v 5.12.1.2 2016/01/25 05:21:06 mcalabre Exp mcalabre $
@


5.13.1.1
log
@WCSLIB 5.13 development branch.
@
text
@d25 1
a25 1
  $Id: wcs_f.c,v 5.13 2016/01/26 08:51:15 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: wcs_f.c,v 5.11.1.1 2015/10/18 09:16:29 mcalabre Exp mcalabre $
@


5.12.1.1
log
@WCSLIB 5.12 development branch.
@
text
@d25 1
a25 1
  $Id: wcs_f.c,v 5.12 2015/11/15 02:13:02 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: wcs_f.c,v 5.12.1.1 2015/11/15 02:16:17 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: wcs_f.c,v 5.10.1.1 2015/10/09 08:22:38 mcalabre Exp mcalabre $
@


5.11.1.1
log
@WCSLIB 5.11 development branch.
@
text
@d25 1
a25 1
  $Id: wcs_f.c,v 5.11 2015/10/18 09:13:07 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: wcs_f.c,v 5.9.1.1 2015/07/21 09:28:10 mcalabre Exp mcalabre $
@


5.10.1.1
log
@WCSLIB 5.10 development branch.
@
text
@d25 1
a25 1
  $Id: wcs_f.c,v 5.10 2015/10/09 08:19:17 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: wcs_f.c,v 5.8.1.1 2015/07/08 11:07:21 mcalabre Exp mcalabre $
@


5.9.1.1
log
@WCSLIB 5.9 development branch.
@
text
@d25 1
a25 1
  $Id: wcs_f.c,v 5.9 2015/07/21 09:20:03 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: wcs_f.c,v 5.7.1.1 2015/06/29 02:47:26 mcalabre Exp mcalabre $
@


5.8.1.1
log
@WCSLIB 5.8 development branch.
@
text
@d25 1
a25 1
  $Id: wcs_f.c,v 5.8 2015/07/08 11:04:01 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: wcs_f.c,v 5.6.1.1 2015/06/14 07:14:47 mcalabre Exp mcalabre $
@


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


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


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


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


5.5.1.1
log
@WCSLIB 5.5 development branch.
@
text
@d25 1
a25 1
  $Id: wcs_f.c,v 5.5 2015/05/05 13:16:33 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: wcs_f.c,v 5.3.1.1 2015/04/21 02:54:04 mcalabre Exp mcalabre $
@


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


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


5.3.1.1
log
@WCSLIB 5.3 development branch.
@
text
@d25 1
a25 1
  $Id: wcs_f.c,v 5.3 2015/04/21 02:50:53 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: wcs_f.c,v 5.1.1.2 2015/04/13 11:40:57 mcalabre Exp mcalabre $
@


5.2.1.1
log
@WCSLIB 5.2 development branch.
@
text
@d25 1
a25 1
  $Id: wcs_f.c,v 5.2 2015/04/15 12:35:08 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: wcs_f.c,v 5.0.1.1 2015/04/05 12:28:03 mcalabre Exp mcalabre $
a705 1
  int  i;
d708 1
a708 8
  if (prefix_[71] == ' ') {
    for (i = 70; i >= 0; i--) {
      if (prefix_[i] != ' ') break;
      prefix_[i] = '\0';
    }
  } else {
    prefix_[71] = '\0';
  }
@


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


5.1.1.2
log
@In wcsperr_(), use wcsutuil_null_fill().
@
text
@d25 1
a25 1
  $Id: wcs_f.c,v 5.1.1.1 2015/04/07 11:01:12 mcalabre Exp mcalabre $
d706 1
d709 8
a716 1
  wcsutil_null_fill(72, prefix_);
@


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: wcs_f.c,v 4.25.1.4 2015/04/05 06:53:05 mcalabre Exp mcalabre $
@


5.0.1.1
log
@WCSLIB 5.0 development branch.
@
text
@d25 1
a25 1
  $Id: wcs_f.c,v 5.0 2015/04/05 12:25:02 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: wcs_f.c,v 4.24.1.1 2014/09/18 15:28:11 mcalabre Exp mcalabre $
d31 1
d37 9
a45 1
#define wcsini_  F77_FUNC(wcsini,  WCSINI)
d48 1
a50 3
#define wcscopy_ F77_FUNC(wcscopy, WCSCOPY)
#define wcsput_  F77_FUNC(wcsput,  WCSPUT)
#define wcsget_  F77_FUNC(wcsget,  WCSGET)
d60 2
a61 7

#define wcsptc_  F77_FUNC(wcsptc,  WCSPTC)
#define wcsptd_  F77_FUNC(wcsptd,  WCSPTD)
#define wcspti_  F77_FUNC(wcspti,  WCSPTI)
#define wcsgtc_  F77_FUNC(wcsgtc,  WCSGTC)
#define wcsgtd_  F77_FUNC(wcsgtd,  WCSGTD)
#define wcsgti_  F77_FUNC(wcsgti,  WCSGTI)
a125 44
int wcsini_(const int *naxis, int *wcs)

{
  return wcsini(1, *naxis, (struct wcsprm *)wcs);
}

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

int wcsnpv_(int *npvmax) { return wcsnpv(*npvmax); }
int wcsnps_(int *npsmax) { return wcsnps(*npsmax); }

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

int wcssub_(const int *wcssrc, int *nsub, int axes[], int *wcsdst)

{
  return wcssub(1, (const struct wcsprm *)wcssrc, nsub, axes,
                (struct wcsprm *)wcsdst);
}

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

int wcscompare_(
  const int *cmp,
  const double *tol,
  const int *wcs1,
  const int *wcs2,
  int *equal)

{
  return wcscompare(*cmp, *tol, (const struct wcsprm *)wcs1,
                    (const struct wcsprm *)wcs2, equal);
}

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

int wcscopy_(const int *wcssrc, int *wcsdst)

{
  return wcscopy(1, (const struct wcsprm *)wcssrc, (struct wcsprm *)wcsdst);
}

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

a149 2
  wcsp->flag = 0;

d156 1
d160 1
d165 1
d169 1
d173 1
d178 1
d183 1
d187 1
d191 1
d195 1
d199 1
d210 1
d222 1
d227 1
d231 1
d235 1
d643 36
d687 1
a687 1
int wcsprt_(int *wcs)
d694 1
a694 1
  return wcsprt((struct wcsprm *)wcs);
d806 17
@


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


4.25.1.3
log
@Added a wrapper for wcslib_version().
@
text
@d25 1
a25 1
  $Id: wcs_f.c,v 4.25.1.2 2015/01/06 01:02:17 mcalabre Exp mcalabre $
a52 1
#define wcslib_version_ F77_FUNC(wcslib_version, WCSLIB_VERSION)
a797 9
}

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

void wcslib_version_(char *wcsver, int nchr)

{
  strncpy(wcsver, wcslib_version(0x0), nchr);
  wcsutil_blank_fill(nchr, wcsver);
@


4.25.1.4
log
@In wcsput_(), don't reset wcsprm::flag unnecessarily.  Changed the order of
function definitions to put wcsprm manipulation routines first.
@
text
@d25 1
a25 1
  $Id: wcs_f.c,v 4.25.1.3 2015/03/05 08:23:34 mcalabre Exp mcalabre $
a30 1
#include <wcserr.h>
d36 1
a36 9
#define wcsput_  F77_FUNC(wcsput,  WCSPUT)
#define wcsptc_  F77_FUNC(wcsptc,  WCSPTC)
#define wcsptd_  F77_FUNC(wcsptd,  WCSPTD)
#define wcspti_  F77_FUNC(wcspti,  WCSPTI)
#define wcsget_  F77_FUNC(wcsget,  WCSGET)
#define wcsgtc_  F77_FUNC(wcsgtc,  WCSGTC)
#define wcsgtd_  F77_FUNC(wcsgtd,  WCSGTD)
#define wcsgti_  F77_FUNC(wcsgti,  WCSGTI)

a38 1
#define wcsini_  F77_FUNC(wcsini,  WCSINI)
d41 3
a52 1
#define wcscopy_ F77_FUNC(wcscopy, WCSCOPY)
d55 7
d125 44
d193 2
a200 1
    wcsp->flag = 0;
a203 1
    wcsp->flag = 0;
a207 1
    wcsp->flag = 0;
a210 1
    wcsp->flag = 0;
a213 1
    wcsp->flag = 0;
a217 1
    wcsp->flag = 0;
a221 1
    wcsp->flag = 0;
a224 1
    wcsp->flag = 0;
a227 1
    wcsp->flag = 0;
a230 1
    wcsp->flag = 0;
a233 1
    wcsp->flag = 0;
a243 1
    wcsp->flag = 0;
a254 1
    wcsp->flag = 0;
a258 1
    wcsp->flag = 0;
a261 1
    wcsp->flag = 0;
a264 1
    wcsp->flag = 0;
a671 36
int wcsnpv_(int *npvmax) { return wcsnpv(*npvmax); }
int wcsnps_(int *npsmax) { return wcsnps(*npsmax); }

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

int wcsini_(const int *naxis, int *wcs)

{
  return wcsini(1, *naxis, (struct wcsprm *)wcs);
}

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

int wcssub_(const int *wcssrc, int *nsub, int axes[], int *wcsdst)

{
  return wcssub(1, (const struct wcsprm *)wcssrc, nsub, axes,
                (struct wcsprm *)wcsdst);
}

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

int wcscompare_(
  const int *cmp,
  const double *tol,
  const int *wcs1,
  const int *wcs2,
  int *equal)

{
  return wcscompare(*cmp, *tol, (const struct wcsprm *)wcs1,
                    (const struct wcsprm *)wcs2, equal);
}

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

d680 1
a680 1
int wcsprt_(const int *wcs)
d687 1
a687 1
  return wcsprt((const struct wcsprm *)wcs);
a798 8
}

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

int wcscopy_(const int *wcssrc, int *wcsdst)

{
  return wcscopy(1, (const struct wcsprm *)wcssrc, (struct wcsprm *)wcsdst);
@


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: wcs_f.c,v 4.23.1.2 2014/05/22 11:30:25 mcalabre Exp mcalabre $
@


4.24.1.1
log
@WCSLIB 4.24 development branch.
@
text
@d25 1
a25 1
  $Id: wcs_f.c,v 4.24 2014/09/18 15:25:01 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: wcs_f.c,v 4.22.1.2 2014/05/10 14:44:58 mcalabre Exp mcalabre $
d146 6
a151 1
int wcscompare_(const int *cmp, const int *wcs1, const int *wcs2, int *equal)
d154 2
a155 2
  return wcscompare(*cmp, (const struct wcsprm *)wcs1,
                          (const struct wcsprm *)wcs2, equal);
@


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


4.23.1.2
log
@Changed API to wcscompare() to allow a tolerance to be specified for
floating-point comparisons.
@
text
@d25 1
a25 1
  $Id: wcs_f.c,v 4.23.1.1 2014/05/13 05:53:51 mcalabre Exp mcalabre $
d146 1
a146 6
int wcscompare_(
  const int *cmp,
  const double *tol,
  const int *wcs1,
  const int *wcs2,
  int *equal)
d149 2
a150 2
  return wcscompare(*cmp, *tol, (const struct wcsprm *)wcs1,
                    (const struct wcsprm *)wcs2, equal);
@


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: wcs_f.c,v 4.21.1.1 2014/03/24 05:15:30 mcalabre Exp mcalabre $
d36 1
a38 1
#define wcsini_  F77_FUNC(wcsini,  WCSINI)
d40 1
d124 8
d137 1
a137 1
int wcsini_(const int *naxis, int *wcs)
d140 2
a141 1
  return wcsini(1, *naxis, (struct wcsprm *)wcs);
d146 1
a146 1
int wcssub_(const int *wcssrc, int *nsub, int axes[], int *wcsdst)
d149 2
a150 2
  return wcssub(1, (const struct wcsprm *)wcssrc, nsub, axes,
                (struct wcsprm *)wcsdst);
@


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


4.22.1.2
log
@Added a wrapper for wcscompare().
@
text
@d25 1
a25 1
  $Id: wcs_f.c,v 4.22.1.1 2014/04/12 15:06:33 mcalabre Exp mcalabre $
a35 1
#define wcsini_  F77_FUNC(wcsini,  WCSINI)
d38 1
a39 1
#define wcscompare_  F77_FUNC(wcscompare,  WCSCOMPARE)
d123 5
a135 5
int wcsnpv_(int *npvmax) { return wcsnpv(*npvmax); }
int wcsnps_(int *npsmax) { return wcsnps(*npsmax); }

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

a140 9
}

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

int wcscompare_(const int *cmp, const int *wcs1, const int *wcs2, int *equal)

{
  return wcscompare(*cmp, (const struct wcsprm *)wcs1,
                          (const struct wcsprm *)wcs2, equal);
@


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: wcs_f.c,v 4.20.1.2 2014/03/21 06:39:02 mcalabre Exp mcalabre $
@


4.21.1.1
log
@WCSLIB 4.21 development branch.
@
text
@d25 1
a25 1
  $Id: wcs_f.c,v 4.21 2014/03/24 05:12:28 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: wcs_f.c,v 4.19.1.2 2013/12/10 23:10:30 mcalabre Exp mcalabre $
@


4.20.1.1
log
@WCSLIB 4.20 development branch.
@
text
@d25 1
a25 1
  $Id: wcs_f.c,v 4.20 2013/12/18 05:42:50 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: wcs_f.c,v 4.20.1.1 2013/12/18 05:46:56 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: wcs_f.c,v 4.18.1.1 2013/07/13 10:02:39 mcalabre Exp mcalabre $
d46 1
d700 8
@


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


4.19.1.2
log
@Added a wrapper for wcsbchk().
@
text
@d25 1
a25 1
  $Id: wcs_f.c,v 4.19.1.1 2013/09/29 14:20:40 mcalabre Exp mcalabre $
a45 1
#define wcsbchk_ F77_FUNC(wcsbchk, WCSBCHK)
a698 8
}

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

int wcsbchk_(int *wcs, int *bounds)

{
  return wcsbchk((struct wcsprm *)wcs, *bounds);
@


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: wcs_f.c,v 4.17.1.1 2013/01/29 05:32:33 cal103 Exp cal103 $
@


4.18.1.1
log
@WCSLIB 4.18 development branch.
@
text
@d25 1
a25 1
  $Id: wcs_f.c,v 4.18 2013/07/13 10:00:05 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: wcs_f.c,v 4.16.1.2 2013/01/29 05:10:59 cal103 Exp cal103 $
@


4.17.1.1
log
@WCSLIB 4.17 development branch.
@
text
@d25 1
a25 1
  $Id: wcs_f.c,v 4.17 2013/01/29 05:29:21 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: wcs_f.c,v 4.15.1.1 2012/09/26 14:27:52 cal103 Exp cal103 $
@


4.16.1.1
log
@WCSLIB 4.16 development branch.
@
text
@d25 1
a25 1
  $Id: wcs_f.c,v 4.16 2012/11/07 04:42:45 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: wcs_f.c,v 4.16.1.1 2012/11/07 04:45:57 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: wcs_f.c,v 4.14.1.1 2012/07/13 10:04:54 cal103 Exp cal103 $
@


4.15.1.1
log
@WCSLIB 4.15 development branch.
@
text
@d25 1
a25 1
  $Id: wcs_f.c,v 4.15 2012/09/26 14:26:06 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: wcs_f.c,v 4.13.1.2 2012/07/13 03:40:02 cal103 Exp cal103 $
@


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


4.13.1.1
log
@WCSLIB 4.13 development branch.
@
text
@d31 1
a31 1
  $Id: wcs_f.c,v 4.13 2012/03/14 07:39:31 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: wcs_f.c,v 4.13.1.1 2012/03/14 07:40:38 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: wcs_f.c,v 4.11.1.1 2012/02/20 23:31:14 cal103 Exp cal103 $
@


4.12.1.1
log
@WCSLIB 4.12 development branch.
@
text
@d31 1
a31 1
  $Id: wcs_f.c,v 4.12 2012/02/29 07:57:57 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: wcs_f.c,v 4.10.1.1 2012/02/05 23:42:47 cal103 Exp cal103 $
@


4.11.1.1
log
@WCSLIB 4.11 development branch.
@
text
@d31 1
a31 1
  $Id: wcs_f.c,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: wcs_f.c,v 4.9.1.1 2012/01/24 05:41:46 cal103 Exp cal103 $
@


4.10.1.1
log
@WCSLIB 4.10 development branch.
@
text
@d31 1
a31 1
  $Id: wcs_f.c,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: wcs_f.c,v 4.8.1.2 2012/01/24 05:23:50 cal103 Exp cal103 $
@


4.9.1.1
log
@WCSLIB 4.9 development branch.
@
text
@d31 1
a31 1
  $Id: wcs_f.c,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: wcs_f.c,v 4.7.1.5 2011/08/15 06:08:59 cal103 Exp cal103 $
@


4.8.1.1
log
@WCSLIB 4.8 development branch.
@
text
@d31 1
a31 1
  $Id: wcs_f.c,v 4.8 2011/08/15 08:05:54 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: wcs_f.c,v 4.8.1.1 2011/08/15 08:07:07 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: wcs_f.c,v 4.6.1.2 2011/01/14 06:34:01 cal103 Exp cal103 $
d34 1
d51 1
d114 7
a120 7
#define WCS_TYPES    204
#define WCS_LNGTYP   205
#define WCS_LATTYP   206
#define WCS_LNG      207
#define WCS_LAT      208
#define WCS_SPEC     209
#define WCS_CUBEFACE 210
d124 1
d201 3
a211 3
  case WCS_CRVAL:
    wcsp->crval[i0] = *dvalp;
    break;
a244 3
  case WCS_ALTLIN:
    wcsp->altlin = *ivalp;
    break;
d252 6
d312 6
a324 3
  case WCS_VELOSYS:
    wcsp->velosys = *dvalp;
    break;
a328 3
  case WCS_ZSOURCE:
    wcsp->zsource = *dvalp;
    break;
d402 5
a420 5
  case WCS_CRVAL:
    for (i = 0; i < naxis; i++) {
      *(dvalp++) = wcsp->crval[i];
    }
    break;
a461 3
  case WCS_ALTLIN:
    *ivalp = wcsp->altlin;
    break;
d477 6
d548 6
a560 3
  case WCS_VELOSYS:
    *dvalp = wcsp->velosys;
    break;
d565 3
a567 2
  case WCS_ZSOURCE:
    *dvalp = wcsp->zsource;
a568 1

a571 6
  case WCS_WTB:
    *(void **)value = wcsp->wtb;
    break;
  case WCS_NTAB:
    *ivalp = wcsp->ntab;
    break;
d575 2
a576 4
  case WCS_TYPES:
    for (i = 0; i < naxis; i++) {
      *(ivalp++) = wcsp->types[i];
    }
d598 5
d604 2
a605 2
    k = (int *)(&(wcsp->lin)) - (int *)wcsp;
    iwcsp = wcs + k;
d611 2
a612 2
    k = (int *)(&(wcsp->cel)) - (int *)wcsp;
    iwcsp = wcs + k;
d618 2
a619 2
    k = (int *)(&(wcsp->spc)) - (int *)wcsp;
    iwcsp = wcs + k;
d624 13
d672 4
d681 28
@


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


4.7.1.2
log
@Added support for the new error messaging system based on wcserr.
@
text
@d31 1
a31 1
  $Id: wcs_f.c,v 4.7.1.1 2011/02/07 07:04:23 cal103 Exp cal103 $
a49 1
#define wcsperr_ F77_FUNC(wcsperr, WCSPERR)
a121 1
#define WCS_ERR      214
a197 3
  case WCS_CRVAL:
    wcsp->crval[i0] = *dvalp;
    break;
d206 3
d242 3
a251 6
  case WCS_ALTLIN:
    wcsp->altlin = *ivalp;
    break;
  case WCS_VELREF:
    wcsp->velref = *ivalp;
    break;
a305 6
  case WCS_VELOSYS:
    wcsp->velosys = *dvalp;
    break;
  case WCS_ZSOURCE:
    wcsp->zsource = *dvalp;
    break;
d313 3
d320 3
a395 5
  case WCS_CRVAL:
    for (i = 0; i < naxis; i++) {
      *(dvalp++) = wcsp->crval[i];
    }
    break;
d410 5
d456 3
a473 6
  case WCS_ALTLIN:
    *ivalp = wcsp->altlin;
    break;
  case WCS_VELREF:
    *ivalp = wcsp->velref;
    break;
a538 6
  case WCS_VELOSYS:
    *dvalp = wcsp->velosys;
    break;
  case WCS_ZSOURCE:
    *dvalp = wcsp->zsource;
    break;
d546 3
d553 3
d557 6
a565 3
  case WCS_NWTB:
    *ivalp = wcsp->nwtb;
    break;
a568 3
  case WCS_WTB:
    *(void **)value = wcsp->wtb;
    break;
a594 1
    /* Copy the contents of the linprm struct. */
a601 1
    /* Copy the contents of the celprm struct. */
a608 1
    /* Copy the contents of the spcprm struct. */
a614 14
  case WCS_ERR:
    /* Copy the contents of the wcserr struct. */
    if (wcsp->err) {
      k = (int *)(wcsp->err) - (int *)wcsp;
      iwcsp = wcs + k;
      for (k = 0; k < ERRLEN; k++) {
        *(ivalp++) = *(iwcsp++);
      }
    } else {
      for (k = 0; k < ERRLEN; k++) {
        *(ivalp++) = 0;
      }
    }
    break;
a654 24
/* prefix should be null-terminated, or else of length 72 in which case
 * trailing blanks are not significant. */

int wcsperr_(int *wcs, const char prefix[72])

{
  char prefix_[72];
  int  i;

  strncpy(prefix_, prefix, 72);
  if (prefix_[71] == ' ') {
    for (i = 70; i >= 0; i--) {
      if (prefix_[i] != ' ') break;
      prefix_[i] = '\0';
    }
  } else {
    prefix_[71] = '\0';
  }

  return wcsperr((struct wcsprm *)wcs, prefix_);
}

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

@


4.7.1.3
log
@In wcsprt_() and wcsperr_(), try calling fflush() to flush the Fortran I/O
buffers before calling wcsprt() and wcsperr().
@
text
@d31 1
a31 1
  $Id: wcs_f.c,v 4.7.1.2 2011/08/09 03:00:46 cal103 Exp cal103 $
a33 1
#include <stdio.h>
a674 4
  /* This may or may not force the Fortran I/O buffers to be flushed.  If
   * not, try CALL FLUSH(6) before calling WCSPRT in the Fortran code. */
  fflush(NULL);

a698 4
  /* This may or may not force the Fortran I/O buffers to be flushed. */
  /* If not, try CALL FLUSH(6) before calling WCSPERR in the Fortran code. */
  fflush(NULL);

@


4.7.1.4
log
@In wcsget_(): simplified the address calculation WCS_LIN, WCS_CEL, WCS_SPC,
and WCS_ERR.
@
text
@d31 1
a31 1
  $Id: wcs_f.c,v 4.7.1.3 2011/08/12 08:38:32 cal103 Exp cal103 $
d605 2
a606 1
    iwcsp = (int *)(&(wcsp->lin));
d613 2
a614 1
    iwcsp = (int *)(&(wcsp->cel));
d621 2
a622 1
    iwcsp = (int *)(&(wcsp->spc));
d630 2
a631 1
      iwcsp = (int *)(wcsp->err);
@


4.7.1.5
log
@Changed codes to reflect changes to the wcsprm struct.
@
text
@d31 1
a31 1
  $Id: wcs_f.c,v 4.7.1.4 2011/08/13 03:16:53 cal103 Exp cal103 $
d114 7
a120 7
#define WCS_LNGTYP   204
#define WCS_LATTYP   205
#define WCS_LNG      206
#define WCS_LAT      207
#define WCS_SPEC     208
#define WCS_CUBEFACE 209
#define WCS_TYPES    210
d578 5
a602 5
  case WCS_TYPES:
    for (i = 0; i < naxis; i++) {
      *(ivalp++) = wcsp->types[i];
    }
    break;
@


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: wcs_f.c,v 4.5.1.2 2010/11/15 07:19:41 cal103 Exp cal103 $
@


4.6.1.1
log
@WCSLIB 4.6 development branch.
@
text
@d31 1
a31 1
  $Id: wcs_f.c,v 4.6 2010/11/16 06:15:32 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: wcs_f.c,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: wcs_f.c,v 4.4.1.3 2010/07/07 07:16:11 cal103 Exp cal103 $
d56 7
d330 18
d622 15
@


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


4.5.1.2
log
@Added new type-specific variants of WCSPUT and WCSGET.
@
text
@d31 1
a31 1
  $Id: wcs_f.c,v 4.5.1.1 2010/07/16 07:05:32 cal103 Exp cal103 $
a55 7
#define wcsptc_  F77_FUNC(wcsptc,  WCSPTC)
#define wcsptd_  F77_FUNC(wcsptd,  WCSPTD)
#define wcspti_  F77_FUNC(wcspti,  WCSPTI)
#define wcsgtc_  F77_FUNC(wcsgtc,  WCSGTC)
#define wcsgtd_  F77_FUNC(wcsgtd,  WCSGTD)
#define wcsgti_  F77_FUNC(wcsgti,  WCSGTI)

a322 18
int wcsptc_(int *wcs, const int *what, const char *value, const int *i,
  const int *j)
{
  return wcsput_(wcs, what, value, i, j);
}

int wcsptd_(int *wcs, const int *what, const double *value, const int *i,
  const int *j)
{
  return wcsput_(wcs, what, value, i, j);
}

int wcspti_(int *wcs, const int *what, const int *value, const int *i,
  const int *j)
{
  return wcsput_(wcs, what, value, i, j);
}

a596 15
int wcsgtc_(const int *wcs, const int *what, char *value)
{
  return wcsget_(wcs, what, value);
}

int wcsgtd_(const int *wcs, const int *what, double *value)
{
  return wcsget_(wcs, what, value);
}

int wcsgti_(const int *wcs, const int *what, int *value)
{
  return wcsget_(wcs, what, value);
}

@


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: wcs_f.c,v 4.3.1.4 2009/07/22 07:18:23 cal103 Exp cal103 $
d74 26
a99 25
#define WCS_ALTLIN   118
#define WCS_CD       119
#define WCS_CROTA    120

#define WCS_ALT      121
#define WCS_COLNUM   122
#define WCS_COLAX    123

#define WCS_CNAME    124
#define WCS_CRDER    125
#define WCS_CSYER    126
#define WCS_DATEAVG  127
#define WCS_DATEOBS  128
#define WCS_EQUINOX  129
#define WCS_MJDAVG   130
#define WCS_MJDOBS   131
#define WCS_OBSGEO   132
#define WCS_RADESYS  133
#define WCS_SPECSYS  134
#define WCS_SSYSOBS  135
#define WCS_SSYSSRC  136
#define WCS_VELANGL  137
#define WCS_VELOSYS  138
#define WCS_WCSNAME  139
#define WCS_ZSOURCE  140
d102 2
a103 2
#define WCS_TAB      201
#define WCS_NWTB     202
@


4.4.1.1
log
@WCSLIB 4.4 development branch.
@
text
@d31 1
a31 1
  $Id: wcs_f.c,v 4.4 2009/08/06 07:51:45 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: wcs_f.c,v 4.4.1.1 2009/08/10 08:54:51 cal103 Exp cal103 $
@


4.4.1.3
log
@Added WCS_VELREF and revised code numbering to match wcs.inc.
@
text
@d31 1
a31 1
  $Id: wcs_f.c,v 4.4.1.2 2010/01/19 03:44:35 cal103 Exp cal103 $
d74 25
a98 26
#define WCS_CD       118
#define WCS_CROTA    119
#define WCS_ALTLIN   120
#define WCS_VELREF   121

#define WCS_ALT      122
#define WCS_COLNUM   123
#define WCS_COLAX    124

#define WCS_CNAME    125
#define WCS_CRDER    126
#define WCS_CSYER    127
#define WCS_DATEAVG  128
#define WCS_DATEOBS  129
#define WCS_EQUINOX  130
#define WCS_MJDAVG   131
#define WCS_MJDOBS   132
#define WCS_OBSGEO   133
#define WCS_RADESYS  134
#define WCS_SPECSYS  135
#define WCS_SSYSOBS  136
#define WCS_VELOSYS  137
#define WCS_ZSOURCE  138
#define WCS_SSYSSRC  139
#define WCS_VELANGL  140
#define WCS_WCSNAME  141
d101 2
a102 2
#define WCS_NWTB     201
#define WCS_TAB      202
@


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: wcs_f.c,v 4.2.1.5 2007/12/03 05:36:01 cal103 Exp cal103 $
d77 1
d80 2
a81 1
#define WCS_WCSNAME  123
d85 14
a98 12
#define WCS_RADESYS  127
#define WCS_EQUINOX  128
#define WCS_SPECSYS  129
#define WCS_SSYSOBS  130
#define WCS_VELOSYS  131
#define WCS_SSYSSRC  132
#define WCS_ZSOURCE  133
#define WCS_OBSGEO   134
#define WCS_DATEOBS  135
#define WCS_DATEAVG  136
#define WCS_MJDOBS   137
#define WCS_MJDAVG   138
d125 1
a125 1
   return wcsini(1, *naxis, (struct wcsprm *)wcs);
d133 2
a134 2
   return wcssub(1, (const struct wcsprm *)wcssrc, nsub, axes,
                 (struct wcsprm *)wcsdst);
d142 1
a142 1
   return wcscopy(1, (const struct wcsprm *)wcssrc, (struct wcsprm *)wcsdst);
d148 170
a317 162
   int *wcs,
   const int *what,
   const void *value,
   const int *i,
   const int *j)

{
   int i0, j0, k;
   const char *cvalp;
   const int  *ivalp;
   const double *dvalp;
   struct wcsprm *wcsp;

   /* Cast pointers. */
   wcsp  = (struct wcsprm *)wcs;
   cvalp = (const char *)value;
   ivalp = (const int *)value;
   dvalp = (const double *)value;

   /* Convert 1-relative FITS axis numbers to 0-relative C array indices. */
   i0 = *i - 1;
   j0 = *j - 1;

   wcsp->flag = 0;

   switch (*what) {
   case WCS_FLAG:
      wcsp->flag = *ivalp;
      break;
   case WCS_NAXIS:
      wcsp->naxis = *ivalp;
      break;
   case WCS_CRPIX:
      wcsp->crpix[i0] = *dvalp;
      break;
   case WCS_PC:
      k = (i0)*(wcsp->naxis) + (j0);
      *(wcsp->pc+k) = *dvalp;
      break;
   case WCS_CDELT:
      wcsp->cdelt[i0] = *dvalp;
      break;
   case WCS_CUNIT:
      strncpy(wcsp->cunit[i0], cvalp, 72);
      wcsutil_null_fill(72, wcsp->cunit[i0]);
      break;
   case WCS_CTYPE:
      strncpy(wcsp->ctype[i0], cvalp, 72);
      wcsutil_null_fill(72, wcsp->ctype[i0]);
      break;
   case WCS_CRVAL:
      wcsp->crval[i0] = *dvalp;
      break;
   case WCS_LONPOLE:
      wcsp->lonpole = *dvalp;
      break;
   case WCS_LATPOLE:
      wcsp->latpole = *dvalp;
      break;
   case WCS_RESTFRQ:
      wcsp->restfrq = *dvalp;
      break;
   case WCS_RESTWAV:
      wcsp->restwav = *dvalp;
      break;
   case WCS_NPV:
   case WCS_NPVMAX:
      return 1;
      break;
   case WCS_PV:
      (wcsp->pv + wcsp->npv)->i = *i;
      (wcsp->pv + wcsp->npv)->m = *j;
      (wcsp->pv + wcsp->npv)->value = *dvalp;
      (wcsp->npv)++;
      break;
   case WCS_NPS:
   case WCS_NPSMAX:
      return 1;
      break;
   case WCS_PS:
      (wcsp->ps + wcsp->nps)->i = *i;
      (wcsp->ps + wcsp->nps)->m = *j;
      strncpy((wcsp->ps + wcsp->nps)->value, cvalp, 72);
      wcsutil_null_fill(72, (wcsp->ps + wcsp->nps)->value);
      (wcsp->nps)++;
      break;
   case WCS_ALTLIN:
      wcsp->altlin = *ivalp;
      break;
   case WCS_CD:
      k = (i0)*(wcsp->naxis) + (j0);
      *(wcsp->cd+k) = *dvalp;
      break;
   case WCS_CROTA:
      wcsp->crota[i0] = *dvalp;
      break;
   case WCS_ALT:
      wcsp->alt[0] = cvalp[0];
      wcsutil_null_fill(4, wcsp->alt);
      break;
   case WCS_COLNUM:
      wcsp->colnum = *ivalp;
      break;
   case WCS_WCSNAME:
      strncpy(wcsp->wcsname, cvalp, 72);
      wcsutil_null_fill(72, wcsp->wcsname);
      break;
   case WCS_CNAME:
      strncpy(wcsp->cname[i0], cvalp, 72);
      wcsutil_null_fill(72, wcsp->cname[i0]);
      break;
   case WCS_CRDER:
      wcsp->crder[i0] = *dvalp;
      break;
   case WCS_CSYER:
      wcsp->csyer[i0] = *dvalp;
      break;
   case WCS_RADESYS:
      strncpy(wcsp->radesys, cvalp, 72);
      wcsutil_null_fill(72, wcsp->radesys);
      break;
   case WCS_EQUINOX:
      wcsp->equinox = *dvalp;
      break;
   case WCS_SPECSYS:
      strncpy(wcsp->specsys, cvalp, 72);
      wcsutil_null_fill(72, wcsp->specsys);
      break;
   case WCS_SSYSOBS:
      strncpy(wcsp->ssysobs, cvalp, 72);
      wcsutil_null_fill(72, wcsp->ssysobs);
      break;
   case WCS_VELOSYS:
      wcsp->velosys = *dvalp;
      break;
   case WCS_SSYSSRC:
      strncpy(wcsp->ssyssrc, cvalp, 72);
      wcsutil_null_fill(72, wcsp->ssyssrc);
      break;
   case WCS_ZSOURCE:
      wcsp->zsource = *dvalp;
      break;
   case WCS_OBSGEO:
      wcsp->obsgeo[i0] = *dvalp;
      break;
   case WCS_DATEOBS:
      strncpy(wcsp->dateobs, cvalp, 72);
      wcsutil_null_fill(72, wcsp->dateobs);
      break;
   case WCS_DATEAVG:
      strncpy(wcsp->dateavg, cvalp, 72);
      wcsutil_null_fill(72, wcsp->dateavg);
      break;
   case WCS_MJDOBS:
      wcsp->mjdobs = *dvalp;
      break;
   case WCS_MJDAVG:
      wcsp->mjdavg = *dvalp;
      break;
   default:
      return 1;
   }
d319 1
a319 1
   return 0;
d327 32
a358 117
   int i, j, k, naxis;
   char   *cvalp;
   int    *ivalp;
   double *dvalp;
   const int    *iwcsp;
   const double *dwcsp;
   const struct wcsprm *wcsp;

   /* Cast pointers. */
   wcsp  = (const struct wcsprm *)wcs;
   cvalp = (char *)value;
   ivalp = (int *)value;
   dvalp = (double *)value;

   naxis = wcsp->naxis;

   switch (*what) {
   case WCS_FLAG:
      *ivalp = wcsp->flag;
      break;
   case WCS_NAXIS:
      *ivalp = naxis;
      break;
   case WCS_CRPIX:
      for (i = 0; i < naxis; i++) {
         *(dvalp++) = wcsp->crpix[i];
      }
      break;
   case WCS_PC:
      /* C row-major to FORTRAN column-major. */
      for (j = 0; j < naxis; j++) {
         dwcsp = wcsp->pc + j;
         for (i = 0; i < naxis; i++) {
            *(dvalp++) = *dwcsp;
            dwcsp += naxis;
         }
      }
      break;
   case WCS_CDELT:
      for (i = 0; i < naxis; i++) {
         *(dvalp++) = wcsp->cdelt[i];
      }
      break;
   case WCS_CUNIT:
      for (i = 0; i < naxis; i++) {
         strncpy(cvalp, wcsp->cunit[i], 72);
         wcsutil_blank_fill(72, cvalp);
         cvalp += 72;
      }
      break;
   case WCS_CTYPE:
      for (i = 0; i < naxis; i++) {
         strncpy(cvalp, wcsp->ctype[i], 72);
         wcsutil_blank_fill(72, cvalp);
         cvalp += 72;
      }
      break;
   case WCS_CRVAL:
      for (i = 0; i < naxis; i++) {
         *(dvalp++) = wcsp->crval[i];
      }
      break;
   case WCS_LONPOLE:
      *dvalp = wcsp->lonpole;
      break;
   case WCS_LATPOLE:
      *dvalp = wcsp->latpole;
      break;
   case WCS_RESTFRQ:
      *dvalp = wcsp->restfrq;
      break;
   case WCS_RESTWAV:
      *dvalp = wcsp->restwav;
      break;
   case WCS_NPV:
      *ivalp = wcsp->npv;
      break;
   case WCS_NPVMAX:
      *ivalp = wcsp->npvmax;
      break;
   case WCS_PV:
      for (k = 0; k < wcsp->npv; k++) {
         *(dvalp++) = (wcsp->pv + k)->i;
         *(dvalp++) = (wcsp->pv + k)->m;
         *(dvalp++) = (wcsp->pv + k)->value;
      }
      break;
   case WCS_NPS:
      *ivalp = wcsp->nps;
      break;
   case WCS_NPSMAX:
      *ivalp = wcsp->npsmax;
      break;
   case WCS_PS:
      for (k = 0; k < wcsp->nps; k++) {
         *(dvalp++) = (wcsp->ps + k)->i;
         *(dvalp++) = (wcsp->ps + k)->m;
         cvalp += 2*sizeof(double);
         strncpy(cvalp, (wcsp->ps + k)->value, 72);
         wcsutil_blank_fill(72, cvalp);
         cvalp += 72;
      }
      break;
   case WCS_ALTLIN:
      *ivalp = wcsp->altlin;
      break;
   case WCS_CD:
      /* C row-major to FORTRAN column-major. */
      for (j = 0; j < naxis; j++) {
         dwcsp = wcsp->cd + j;
         for (i = 0; i < naxis; i++) {
            *(dvalp++) = *dwcsp;
            dwcsp += naxis;
         }
      }
      break;
   case WCS_CROTA:
d360 2
a361 1
         *(dvalp++) = wcsp->crota[i];
d363 10
a372 10
      break;
   case WCS_ALT:
      strncpy(cvalp, wcsp->alt, 4);
      wcsutil_blank_fill(4, cvalp);
      break;
   case WCS_COLNUM:
      *ivalp = wcsp->colnum;
      break;
   case WCS_WCSNAME:
      strncpy(cvalp, wcsp->wcsname, 72);
d374 6
a379 20
      break;
   case WCS_CNAME:
      for (i = 0; i < naxis; i++) {
         strncpy(cvalp, wcsp->cname[i], 72);
         wcsutil_blank_fill(72, cvalp);
         cvalp += 72;
      }
      break;
   case WCS_CRDER:
      for (i = 0; i < naxis; i++) {
         *(dvalp++) = wcsp->crder[i];
      }
      break;
   case WCS_CSYER:
      for (i = 0; i < naxis; i++) {
         *(dvalp++) = wcsp->csyer[i];
      }
      break;
   case WCS_RADESYS:
      strncpy(cvalp, wcsp->radesys, 72);
d381 45
a425 6
      break;
   case WCS_EQUINOX:
      *dvalp = wcsp->equinox;
      break;
   case WCS_SPECSYS:
      strncpy(cvalp, wcsp->specsys, 72);
d427 13
a439 18
      break;
   case WCS_SSYSOBS:
      strncpy(cvalp, wcsp->ssysobs, 72);
      wcsutil_blank_fill(72, cvalp);
      break;
   case WCS_VELOSYS:
      *dvalp = wcsp->velosys;
      break;
   case WCS_SSYSSRC:
      strncpy(cvalp, wcsp->ssyssrc, 72);
      wcsutil_blank_fill(72, cvalp);
      break;
   case WCS_ZSOURCE:
      *dvalp = wcsp->zsource;
      break;
   case WCS_OBSGEO:
      for (i = 0; i < 3; i++) {
         *(dvalp++) = wcsp->obsgeo[i];
d441 24
a464 3
      break;
   case WCS_DATEOBS:
      strncpy(cvalp, wcsp->dateobs, 72);
d466 126
a591 68
      break;
   case WCS_MJDOBS:
      *dvalp = wcsp->mjdobs;
      break;
   case WCS_MJDAVG:
      *dvalp = wcsp->mjdavg;
      break;
   case WCS_NWTB:
      *ivalp = wcsp->nwtb;
      break;
   case WCS_WTB:
      *(void **)value = wcsp->wtb;
      break;
   case WCS_NTAB:
      *ivalp = wcsp->ntab;
      break;
   case WCS_TAB:
      *(void **)value = wcsp->tab;
      break;
   case WCS_TYPES:
      for (i = 0; i < naxis; i++) {
         *(ivalp++) = wcsp->types[i];
      }
      break;
   case WCS_LNGTYP:
      strncpy(cvalp, wcsp->lngtyp, 4);
      wcsutil_blank_fill(4, cvalp);
      break;
   case WCS_LATTYP:
      strncpy(cvalp, wcsp->lattyp, 4);
      wcsutil_blank_fill(4, cvalp);
      break;
   case WCS_LNG:
      *ivalp = wcsp->lng + 1;
      break;
   case WCS_LAT:
      *ivalp = wcsp->lat + 1;
      break;
   case WCS_SPEC:
      *ivalp = wcsp->spec + 1;
      break;
   case WCS_CUBEFACE:
      *ivalp = wcsp->cubeface;
      break;
   case WCS_LIN:
      k = (int *)(&(wcsp->lin)) - (int *)wcsp;
      iwcsp = wcs + k;
      for (k = 0; k < LINLEN; k++) {
         *(ivalp++) = *(iwcsp++);
      }
      break;
   case WCS_CEL:
      k = (int *)(&(wcsp->cel)) - (int *)wcsp;
      iwcsp = wcs + k;
      for (k = 0; k < CELLEN; k++) {
         *(ivalp++) = *(iwcsp++);
      }
      break;
   case WCS_SPC:
      k = (int *)(&(wcsp->spc)) - (int *)wcsp;
      iwcsp = wcs + k;
      for (k = 0; k < SPCLEN; k++) {
         *(ivalp++) = *(iwcsp++);
      }
      break;
   default:
      return 1;
   }
d593 1
a593 1
   return 0;
d601 1
a601 1
   return wcsfree((struct wcsprm *)wcs);
d609 1
a609 1
   return wcsprt((struct wcsprm *)wcs);
d617 1
a617 1
   return wcsset((struct wcsprm *)wcs);
d623 9
a631 9
   int *wcs,
   const int *ncoord,
   const int *nelem,
   const double pixcrd[],
   double imgcrd[],
   double phi[],
   double theta[],
   double world[],
   int stat[])
d634 2
a635 2
   return wcsp2s((struct wcsprm *)wcs, *ncoord, *nelem, pixcrd, imgcrd, phi,
                  theta, world, stat);
d641 9
a649 9
   int* wcs,
   const int *ncoord,
   const int *nelem,
   const double world[],
   double phi[],
   double theta[],
   double imgcrd[],
   double pixcrd[],
   int stat[])
d652 2
a653 2
   return wcss2p((struct wcsprm *)wcs, *ncoord, *nelem, world, phi, theta,
                  imgcrd, pixcrd, stat);
d659 11
a669 11
   int *wcs,
   const int *mixpix,
   const int *mixcel,
   const double vspan[2],
   const double *vstep,
   int *viter,
   double world[],
   double phi[],
   double theta[],
   double imgcrd[],
   double pixcrd[])
d672 2
a673 2
   return wcsmix((struct wcsprm *)wcs, *mixpix-1, *mixcel, vspan, *vstep,
                 *viter, world, phi, theta, imgcrd, pixcrd);
d681 2
a682 2
   int status = wcssptr(wcs, i, ctype);
   wcsutil_blank_fill(9, ctype);
d684 1
a684 1
   return status;
@


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: wcs_f.c,v 4.3 2007/12/27 05:48:07 cal103 Exp cal103 $
@


4.3.1.2
log
@Updated for changes to wcsprm made in WCSLIB 4.3.
@
text
@d31 1
a31 1
    $Id: wcs_f.c,v 4.3.1.1 2007/12/27 13:25:03 cal103 Exp cal103 $
a76 1

d79 1
a79 2
#define WCS_COLAX    123

d83 12
a94 14
#define WCS_DATEAVG  127
#define WCS_DATEOBS  128
#define WCS_EQUINOX  129
#define WCS_MJDAVG   130
#define WCS_MJDOBS   131
#define WCS_OBSGEO   132
#define WCS_RADESYS  133
#define WCS_SPECSYS  134
#define WCS_SSYSOBS  135
#define WCS_SSYSSRC  136
#define WCS_VELANGL  137
#define WCS_VELOSYS  138
#define WCS_WCSNAME  139
#define WCS_ZSOURCE  140
a239 1

d247 3
a249 2
   case WCS_COLAX:
      wcsp->colax = *ivalp;
a250 1

d261 3
a263 7
   case WCS_DATEAVG:
      strncpy(wcsp->dateavg, cvalp, 72);
      wcsutil_null_fill(72, wcsp->dateavg);
      break;
   case WCS_DATEOBS:
      strncpy(wcsp->dateobs, cvalp, 72);
      wcsutil_null_fill(72, wcsp->dateobs);
a267 13
   case WCS_MJDAVG:
      wcsp->mjdavg = *dvalp;
      break;
   case WCS_MJDOBS:
      wcsp->mjdobs = *dvalp;
      break;
   case WCS_OBSGEO:
      wcsp->obsgeo[i0] = *dvalp;
      break;
   case WCS_RADESYS:
      strncpy(wcsp->radesys, cvalp, 72);
      wcsutil_null_fill(72, wcsp->radesys);
      break;
d276 3
d283 9
a291 2
   case WCS_VELANGL:
      wcsp->velangl = *dvalp;
d293 3
a295 2
   case WCS_VELOSYS:
      wcsp->velosys = *dvalp;
d297 2
a298 3
   case WCS_WCSNAME:
      strncpy(wcsp->wcsname, cvalp, 72);
      wcsutil_null_fill(72, wcsp->wcsname);
d300 2
a301 2
   case WCS_ZSOURCE:
      wcsp->zsource = *dvalp;
a435 1

d443 3
a445 2
   case WCS_COLAX:
      *ivalp = wcsp->colax;
a446 1

d464 2
a465 6
   case WCS_DATEAVG:
      strncpy(cvalp, wcsp->dateavg, 72);
      wcsutil_blank_fill(72, cvalp);
      break;
   case WCS_DATEOBS:
      strncpy(cvalp, wcsp->dateobs, 72);
a470 15
   case WCS_MJDAVG:
      *dvalp = wcsp->mjdavg;
      break;
   case WCS_MJDOBS:
      *dvalp = wcsp->mjdobs;
      break;
   case WCS_OBSGEO:
      for (i = 0; i < 3; i++) {
         *(dvalp++) = wcsp->obsgeo[i];
      }
      break;
   case WCS_RADESYS:
      strncpy(cvalp, wcsp->radesys, 72);
      wcsutil_blank_fill(72, cvalp);
      break;
d479 3
d486 2
a487 2
   case WCS_VELANGL:
      *dvalp = wcsp->velangl;
d489 4
a492 2
   case WCS_VELOSYS:
      *dvalp = wcsp->velosys;
d494 2
a495 2
   case WCS_WCSNAME:
      strncpy(cvalp, wcsp->wcsname, 72);
d498 5
a502 2
   case WCS_ZSOURCE:
      *dvalp = wcsp->zsource;
a503 1

@


4.3.1.3
log
@Continuation of previous change.
@
text
@d31 1
a31 1
    $Id: wcs_f.c,v 4.3.1.2 2008/04/21 06:47:56 cal103 Exp cal103 $
d253 1
a253 1
      wcsp->colax[i0] = *ivalp;
d457 1
a457 3
      for (i = 0; i < naxis; i++) {
        *(ivalp++) = wcsp->colax[i];
      }
@


4.3.1.4
log
@Changed indentation.
@
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: wcs_f.c,v 4.3.1.3 2008/05/29 01:28:02 cal103 Exp cal103 $
d125 1
a125 1
  return wcsini(1, *naxis, (struct wcsprm *)wcs);
d133 2
a134 2
  return wcssub(1, (const struct wcsprm *)wcssrc, nsub, axes,
                (struct wcsprm *)wcsdst);
d142 1
a142 1
  return wcscopy(1, (const struct wcsprm *)wcssrc, (struct wcsprm *)wcsdst);
d148 170
a317 170
  int *wcs,
  const int *what,
  const void *value,
  const int *i,
  const int *j)

{
  int i0, j0, k;
  const char *cvalp;
  const int  *ivalp;
  const double *dvalp;
  struct wcsprm *wcsp;

  /* Cast pointers. */
  wcsp  = (struct wcsprm *)wcs;
  cvalp = (const char *)value;
  ivalp = (const int *)value;
  dvalp = (const double *)value;

  /* Convert 1-relative FITS axis numbers to 0-relative C array indices. */
  i0 = *i - 1;
  j0 = *j - 1;

  wcsp->flag = 0;

  switch (*what) {
  case WCS_FLAG:
    wcsp->flag = *ivalp;
    break;
  case WCS_NAXIS:
    wcsp->naxis = *ivalp;
    break;
  case WCS_CRPIX:
    wcsp->crpix[i0] = *dvalp;
    break;
  case WCS_PC:
    k = (i0)*(wcsp->naxis) + (j0);
    *(wcsp->pc+k) = *dvalp;
    break;
  case WCS_CDELT:
    wcsp->cdelt[i0] = *dvalp;
    break;
  case WCS_CUNIT:
    strncpy(wcsp->cunit[i0], cvalp, 72);
    wcsutil_null_fill(72, wcsp->cunit[i0]);
    break;
  case WCS_CTYPE:
    strncpy(wcsp->ctype[i0], cvalp, 72);
    wcsutil_null_fill(72, wcsp->ctype[i0]);
    break;
  case WCS_CRVAL:
    wcsp->crval[i0] = *dvalp;
    break;
  case WCS_LONPOLE:
    wcsp->lonpole = *dvalp;
    break;
  case WCS_LATPOLE:
    wcsp->latpole = *dvalp;
    break;
  case WCS_RESTFRQ:
    wcsp->restfrq = *dvalp;
    break;
  case WCS_RESTWAV:
    wcsp->restwav = *dvalp;
    break;
  case WCS_NPV:
  case WCS_NPVMAX:
    return 1;
    break;
  case WCS_PV:
    (wcsp->pv + wcsp->npv)->i = *i;
    (wcsp->pv + wcsp->npv)->m = *j;
    (wcsp->pv + wcsp->npv)->value = *dvalp;
    (wcsp->npv)++;
    break;
  case WCS_NPS:
  case WCS_NPSMAX:
    return 1;
    break;
  case WCS_PS:
    (wcsp->ps + wcsp->nps)->i = *i;
    (wcsp->ps + wcsp->nps)->m = *j;
    strncpy((wcsp->ps + wcsp->nps)->value, cvalp, 72);
    wcsutil_null_fill(72, (wcsp->ps + wcsp->nps)->value);
    (wcsp->nps)++;
    break;
  case WCS_ALTLIN:
    wcsp->altlin = *ivalp;
    break;
  case WCS_CD:
    k = (i0)*(wcsp->naxis) + (j0);
    *(wcsp->cd+k) = *dvalp;
    break;
  case WCS_CROTA:
    wcsp->crota[i0] = *dvalp;
    break;

  case WCS_ALT:
    wcsp->alt[0] = cvalp[0];
    wcsutil_null_fill(4, wcsp->alt);
    break;
  case WCS_COLNUM:
    wcsp->colnum = *ivalp;
    break;
  case WCS_COLAX:
    wcsp->colax[i0] = *ivalp;
    break;

  case WCS_CNAME:
    strncpy(wcsp->cname[i0], cvalp, 72);
    wcsutil_null_fill(72, wcsp->cname[i0]);
    break;
  case WCS_CRDER:
    wcsp->crder[i0] = *dvalp;
    break;
  case WCS_CSYER:
    wcsp->csyer[i0] = *dvalp;
    break;
  case WCS_DATEAVG:
    strncpy(wcsp->dateavg, cvalp, 72);
    wcsutil_null_fill(72, wcsp->dateavg);
    break;
  case WCS_DATEOBS:
    strncpy(wcsp->dateobs, cvalp, 72);
    wcsutil_null_fill(72, wcsp->dateobs);
    break;
  case WCS_EQUINOX:
    wcsp->equinox = *dvalp;
    break;
  case WCS_MJDAVG:
    wcsp->mjdavg = *dvalp;
    break;
  case WCS_MJDOBS:
    wcsp->mjdobs = *dvalp;
    break;
  case WCS_OBSGEO:
    wcsp->obsgeo[i0] = *dvalp;
    break;
  case WCS_RADESYS:
    strncpy(wcsp->radesys, cvalp, 72);
    wcsutil_null_fill(72, wcsp->radesys);
    break;
  case WCS_SPECSYS:
    strncpy(wcsp->specsys, cvalp, 72);
    wcsutil_null_fill(72, wcsp->specsys);
    break;
  case WCS_SSYSOBS:
    strncpy(wcsp->ssysobs, cvalp, 72);
    wcsutil_null_fill(72, wcsp->ssysobs);
    break;
  case WCS_SSYSSRC:
    strncpy(wcsp->ssyssrc, cvalp, 72);
    wcsutil_null_fill(72, wcsp->ssyssrc);
    break;
  case WCS_VELANGL:
    wcsp->velangl = *dvalp;
    break;
  case WCS_VELOSYS:
    wcsp->velosys = *dvalp;
    break;
  case WCS_WCSNAME:
    strncpy(wcsp->wcsname, cvalp, 72);
    wcsutil_null_fill(72, wcsp->wcsname);
    break;
  case WCS_ZSOURCE:
    wcsp->zsource = *dvalp;
    break;
  default:
    return 1;
  }
d319 1
a319 1
  return 0;
d327 154
a480 46
  int i, j, k, naxis;
  char   *cvalp;
  int    *ivalp;
  double *dvalp;
  const int    *iwcsp;
  const double *dwcsp;
  const struct wcsprm *wcsp;

  /* Cast pointers. */
  wcsp  = (const struct wcsprm *)wcs;
  cvalp = (char *)value;
  ivalp = (int *)value;
  dvalp = (double *)value;

  naxis = wcsp->naxis;

  switch (*what) {
  case WCS_FLAG:
    *ivalp = wcsp->flag;
    break;
  case WCS_NAXIS:
    *ivalp = naxis;
    break;
  case WCS_CRPIX:
    for (i = 0; i < naxis; i++) {
      *(dvalp++) = wcsp->crpix[i];
    }
    break;
  case WCS_PC:
    /* C row-major to FORTRAN column-major. */
    for (j = 0; j < naxis; j++) {
      dwcsp = wcsp->pc + j;
      for (i = 0; i < naxis; i++) {
        *(dvalp++) = *dwcsp;
        dwcsp += naxis;
      }
    }
    break;
  case WCS_CDELT:
    for (i = 0; i < naxis; i++) {
      *(dvalp++) = wcsp->cdelt[i];
    }
    break;
  case WCS_CUNIT:
    for (i = 0; i < naxis; i++) {
      strncpy(cvalp, wcsp->cunit[i], 72);
d482 3
a484 6
      cvalp += 72;
    }
    break;
  case WCS_CTYPE:
    for (i = 0; i < naxis; i++) {
      strncpy(cvalp, wcsp->ctype[i], 72);
d486 17
a502 45
      cvalp += 72;
    }
    break;
  case WCS_CRVAL:
    for (i = 0; i < naxis; i++) {
      *(dvalp++) = wcsp->crval[i];
    }
    break;
  case WCS_LONPOLE:
    *dvalp = wcsp->lonpole;
    break;
  case WCS_LATPOLE:
    *dvalp = wcsp->latpole;
    break;
  case WCS_RESTFRQ:
    *dvalp = wcsp->restfrq;
    break;
  case WCS_RESTWAV:
    *dvalp = wcsp->restwav;
    break;
  case WCS_NPV:
    *ivalp = wcsp->npv;
    break;
  case WCS_NPVMAX:
    *ivalp = wcsp->npvmax;
    break;
  case WCS_PV:
    for (k = 0; k < wcsp->npv; k++) {
      *(dvalp++) = (wcsp->pv + k)->i;
      *(dvalp++) = (wcsp->pv + k)->m;
      *(dvalp++) = (wcsp->pv + k)->value;
    }
    break;
  case WCS_NPS:
    *ivalp = wcsp->nps;
    break;
  case WCS_NPSMAX:
    *ivalp = wcsp->npsmax;
    break;
  case WCS_PS:
    for (k = 0; k < wcsp->nps; k++) {
      *(dvalp++) = (wcsp->ps + k)->i;
      *(dvalp++) = (wcsp->ps + k)->m;
      cvalp += 2*sizeof(double);
      strncpy(cvalp, (wcsp->ps + k)->value, 72);
d504 3
a506 38
      cvalp += 72;
    }
    break;
  case WCS_ALTLIN:
    *ivalp = wcsp->altlin;
    break;
  case WCS_CD:
    /* C row-major to FORTRAN column-major. */
    for (j = 0; j < naxis; j++) {
      dwcsp = wcsp->cd + j;
      for (i = 0; i < naxis; i++) {
        *(dvalp++) = *dwcsp;
        dwcsp += naxis;
      }
    }
    break;
  case WCS_CROTA:
    for (i = 0; i < naxis; i++) {
      *(dvalp++) = wcsp->crota[i];
    }
    break;

  case WCS_ALT:
    strncpy(cvalp, wcsp->alt, 4);
    wcsutil_blank_fill(4, cvalp);
    break;
  case WCS_COLNUM:
    *ivalp = wcsp->colnum;
    break;
  case WCS_COLAX:
    for (i = 0; i < naxis; i++) {
      *(ivalp++) = wcsp->colax[i];
    }
    break;

  case WCS_CNAME:
    for (i = 0; i < naxis; i++) {
      strncpy(cvalp, wcsp->cname[i], 72);
d508 84
a591 126
      cvalp += 72;
    }
    break;
  case WCS_CRDER:
    for (i = 0; i < naxis; i++) {
      *(dvalp++) = wcsp->crder[i];
    }
    break;
  case WCS_CSYER:
    for (i = 0; i < naxis; i++) {
      *(dvalp++) = wcsp->csyer[i];
    }
    break;
  case WCS_DATEAVG:
    strncpy(cvalp, wcsp->dateavg, 72);
    wcsutil_blank_fill(72, cvalp);
    break;
  case WCS_DATEOBS:
    strncpy(cvalp, wcsp->dateobs, 72);
    wcsutil_blank_fill(72, cvalp);
    break;
  case WCS_EQUINOX:
    *dvalp = wcsp->equinox;
    break;
  case WCS_MJDAVG:
    *dvalp = wcsp->mjdavg;
    break;
  case WCS_MJDOBS:
    *dvalp = wcsp->mjdobs;
    break;
  case WCS_OBSGEO:
    for (i = 0; i < 3; i++) {
      *(dvalp++) = wcsp->obsgeo[i];
    }
    break;
  case WCS_RADESYS:
    strncpy(cvalp, wcsp->radesys, 72);
    wcsutil_blank_fill(72, cvalp);
    break;
  case WCS_SPECSYS:
    strncpy(cvalp, wcsp->specsys, 72);
    wcsutil_blank_fill(72, cvalp);
    break;
  case WCS_SSYSOBS:
    strncpy(cvalp, wcsp->ssysobs, 72);
    wcsutil_blank_fill(72, cvalp);
    break;
  case WCS_SSYSSRC:
    strncpy(cvalp, wcsp->ssyssrc, 72);
    wcsutil_blank_fill(72, cvalp);
    break;
  case WCS_VELANGL:
    *dvalp = wcsp->velangl;
    break;
  case WCS_VELOSYS:
    *dvalp = wcsp->velosys;
    break;
  case WCS_WCSNAME:
    strncpy(cvalp, wcsp->wcsname, 72);
    wcsutil_blank_fill(72, cvalp);
    break;
  case WCS_ZSOURCE:
    *dvalp = wcsp->zsource;
    break;

  case WCS_NWTB:
    *ivalp = wcsp->nwtb;
    break;
  case WCS_WTB:
    *(void **)value = wcsp->wtb;
    break;
  case WCS_NTAB:
    *ivalp = wcsp->ntab;
    break;
  case WCS_TAB:
    *(void **)value = wcsp->tab;
    break;
  case WCS_TYPES:
    for (i = 0; i < naxis; i++) {
      *(ivalp++) = wcsp->types[i];
    }
    break;
  case WCS_LNGTYP:
    strncpy(cvalp, wcsp->lngtyp, 4);
    wcsutil_blank_fill(4, cvalp);
    break;
  case WCS_LATTYP:
    strncpy(cvalp, wcsp->lattyp, 4);
    wcsutil_blank_fill(4, cvalp);
    break;
  case WCS_LNG:
    *ivalp = wcsp->lng + 1;
    break;
  case WCS_LAT:
    *ivalp = wcsp->lat + 1;
    break;
  case WCS_SPEC:
    *ivalp = wcsp->spec + 1;
    break;
  case WCS_CUBEFACE:
    *ivalp = wcsp->cubeface;
    break;
  case WCS_LIN:
    k = (int *)(&(wcsp->lin)) - (int *)wcsp;
    iwcsp = wcs + k;
    for (k = 0; k < LINLEN; k++) {
      *(ivalp++) = *(iwcsp++);
    }
    break;
  case WCS_CEL:
    k = (int *)(&(wcsp->cel)) - (int *)wcsp;
    iwcsp = wcs + k;
    for (k = 0; k < CELLEN; k++) {
      *(ivalp++) = *(iwcsp++);
    }
    break;
  case WCS_SPC:
    k = (int *)(&(wcsp->spc)) - (int *)wcsp;
    iwcsp = wcs + k;
    for (k = 0; k < SPCLEN; k++) {
      *(ivalp++) = *(iwcsp++);
    }
    break;
  default:
    return 1;
  }
d593 1
a593 1
  return 0;
d601 1
a601 1
  return wcsfree((struct wcsprm *)wcs);
d609 1
a609 1
  return wcsprt((struct wcsprm *)wcs);
d617 1
a617 1
  return wcsset((struct wcsprm *)wcs);
d623 9
a631 9
  int *wcs,
  const int *ncoord,
  const int *nelem,
  const double pixcrd[],
  double imgcrd[],
  double phi[],
  double theta[],
  double world[],
  int stat[])
d634 2
a635 2
  return wcsp2s((struct wcsprm *)wcs, *ncoord, *nelem, pixcrd, imgcrd, phi,
                theta, world, stat);
d641 9
a649 9
  int* wcs,
  const int *ncoord,
  const int *nelem,
  const double world[],
  double phi[],
  double theta[],
  double imgcrd[],
  double pixcrd[],
  int stat[])
d652 2
a653 2
  return wcss2p((struct wcsprm *)wcs, *ncoord, *nelem, world, phi, theta,
                imgcrd, pixcrd, stat);
d659 11
a669 11
  int *wcs,
  const int *mixpix,
  const int *mixcel,
  const double vspan[2],
  const double *vstep,
  int *viter,
  double world[],
  double phi[],
  double theta[],
  double imgcrd[],
  double pixcrd[])
d672 2
a673 2
  return wcsmix((struct wcsprm *)wcs, *mixpix-1, *mixcel, vspan, *vstep,
                *viter, world, phi, theta, imgcrd, pixcrd);
d681 2
a682 2
  int status = wcssptr(wcs, i, ctype);
  wcsutil_blank_fill(9, ctype);
d684 1
a684 1
  return status;
@


4.2
log
@WCSLIB 4.2
@
text
@d2 30
a31 29
*
*   WCSLIB 4.2 - an implementation of the FITS WCS convention.
*   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: wcs_f.c,v 4.1 2005/08/27 01:41:21 cal103 Exp cal103 $
d39 17
@


4.2.1.1
log
@WCSLIB 4.2 development branch.
@
text
@d3 1
a3 1
*   WCSLIB 4.3 - an implementation of the FITS WCS convention.
d30 1
a30 1
*   $Id: wcs_f.c,v 4.2 2005/09/21 13:25:32 cal103 Exp cal103 $
@


4.2.1.2
log
@Do Fortran name mangling using the F77_FUNC(name, NAME) macro defined in
config.h by 'configure'.
@
text
@d4 1
a4 1
*   Copyright (C) 1995-2007, Mark Calabretta
d30 1
a30 1
*   $Id: wcs_f.c,v 4.2.1.1 2005/12/05 01:43:47 cal103 Exp cal103 $
a37 17
/* Fortran name mangling. */
#include <config.h>
#define wcsnpv_  F77_FUNC(wcsnpv,  WCSNPV)
#define wcsnps_  F77_FUNC(wcsnps,  WCSNPS)
#define wcsini_  F77_FUNC(wcsini,  WCSINI)
#define wcssub_  F77_FUNC(wcssub,  WCSSUB)
#define wcscopy_ F77_FUNC(wcscopy, WCSCOPY)
#define wcsput_  F77_FUNC(wcsput,  WCSPUT)
#define wcsget_  F77_FUNC(wcsget,  WCSGET)
#define wcsfree_ F77_FUNC(wcsfree, WCSFREE)
#define wcsprt_  F77_FUNC(wcsprt,  WCSPRT)
#define wcsset_  F77_FUNC(wcsset,  WCSSET)
#define wcsp2s_  F77_FUNC(wcsp2s,  WCSP2S)
#define wcss2p_  F77_FUNC(wcss2p,  WCSS2P)
#define wcsmix_  F77_FUNC(wcsmix,  WCSMIX)
#define wcssptr_ F77_FUNC(wcssptr, WCSSPTR)

@


4.2.1.3
log
@Include config_f77.h (which itself includes config.h) rather than config.h.
@
text
@d30 1
a30 1
*   $Id: wcs_f.c,v 4.2.1.2 2007/07/09 08:48:47 cal103 Exp cal103 $
d39 1
a39 1
#include <config_f77.h>
@


4.2.1.4
log
@Renamed config_f77.h -> wcsconfig_f77.h.
@
text
@d30 1
a30 1
*   $Id: wcs_f.c,v 4.2.1.3 2007/07/12 01:41:04 cal103 Exp cal103 $
d39 1
a39 1
#include <wcsconfig_f77.h>
@


4.2.1.5
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: wcs_f.c,v 4.2.1.4 2007/08/08 04:41:08 cal103 Exp cal103 $
@


4.1
log
@WCSLIB 4.1: support new members and changes to the wcsprm struct; added a
wrapper for wcssptr(); use the wcsutil functions; removed support for K&R C.
@
text
@d3 1
a3 1
*   WCSLIB 4.1 - an implementation of the FITS WCS convention.
d30 1
a30 1
*   $Id: wcs_f.c,v 4.0 2005/02/04 12:39:04 cal103 Exp cal103 $
@


4.0
log
@WCSLIB 4.0: changed from LGPL to GPL.
@
text
@d3 1
a3 1
*   WCSLIB 4.0 - an implementation of the FITS WCS convention.
d30 1
a30 1
*   $Id: wcs_f.c,v 3.6 2004/08/25 06:04:07 cal103 Exp cal103 $
d34 2
d43 3
a45 3
#define WCS_CUNIT    105
#define WCS_CTYPE    106
#define WCS_CRVAL    107
d74 3
a76 2
#define WCS_MJDOBS   136
#define WCS_MJDAVG   137
d78 14
a91 9
#define WCS_LNGTYP   200
#define WCS_LATTYP   201
#define WCS_LNG      202
#define WCS_LAT      203
#define WCS_SPEC     204
#define WCS_CUBEFACE 205
#define WCS_LIN      206
#define WCS_CEL      207
#define WCS_SPC      208
d95 2
a96 17
int wcsnpv_(npvmax)

int npvmax;

{
   return wcsnpv(npvmax);
}



int wcsnps_(npsmax)

int npsmax;

{
   return wcsnps(npsmax);
}
d100 1
a100 4
int wcsini_(naxis, wcs)

const int *naxis;
int *wcs;
d108 1
a108 5
int wcssub_(wcssrc, nsub, axes, wcsdst)

const int *wcssrc;
int *nsub, axes[];
int *wcsdst;
d117 1
a117 4
int wcscopy_(wcssrc, wcsdst)

const int *wcssrc;
int *wcsdst;
d125 6
a130 26
void wcsnfill(n, c)

int n;
char *c;

{
   char *d;

   d = c + (n-1);
   *d = '\0';
   while (--d > c) {
      if (*d == ' ') *d = '\0';
      if (*d != '\0') break;
   }

   return;
}


int wcsput_(wcs, what, value, i, j)

int *wcs;
const int *what;
const void *value;
const int *i;
const int *j;
d170 1
a170 1
      wcsnfill(72, wcsp->cunit[i0]);
d174 1
a174 1
      wcsnfill(72, wcsp->ctype[i0]);
d209 1
a209 1
      wcsnfill(72, (wcsp->ps + wcsp->nps)->value);
d224 1
a224 1
      wcsnfill(4, wcsp->alt);
d231 1
a231 1
      wcsnfill(72, wcsp->wcsname);
d235 1
a235 1
      wcsnfill(72, wcsp->cname[i0]);
d245 1
a245 1
      wcsnfill(72, wcsp->radesys);
d252 1
a252 1
      wcsnfill(72, wcsp->specsys);
d256 1
a256 1
      wcsnfill(72, wcsp->ssysobs);
d263 1
a263 1
      wcsnfill(72, wcsp->ssyssrc);
d273 5
a277 1
      wcsnfill(72, wcsp->dateobs);
d294 1
a294 20
void wcsbfill(n, c)

int n;
char *c;

{
   int k;

   for (k = strlen(c); k < n; k++) {
      c[k] = ' ';
   }

   return;
}


int wcsget_(wcs, what, value)

const int *wcs, *what;
void *value;
d343 1
a343 1
         wcsbfill(72, cvalp);
d350 1
a350 1
         wcsbfill(72, cvalp);
d396 1
a396 1
         wcsbfill(72, cvalp);
d420 1
a420 1
      wcsbfill(4, cvalp);
d427 1
a427 1
      wcsbfill(72, cvalp);
d432 1
a432 1
         wcsbfill(72, cvalp);
d448 1
a448 1
      wcsbfill(72, cvalp);
d455 1
a455 1
      wcsbfill(72, cvalp);
d459 1
a459 1
      wcsbfill(72, cvalp);
d466 1
a466 1
      wcsbfill(72, cvalp);
d478 1
a478 1
      wcsbfill(72, cvalp);
d486 17
d505 1
a505 1
      wcsbfill(4, cvalp);
d509 1
a509 1
      wcsbfill(4, cvalp);
d553 1
a553 3
int wcsfree_(wcs)

int *wcs;
d561 1
a561 3
int wcsprt_(wcs)

int *wcs;
d569 1
a569 3
int wcsset_(wcs)

int *wcs;
d577 10
a586 9
int wcsp2s_(wcs, ncoord, nelem, pixcrd, imgcrd, phi, theta, world, stat)

int *wcs;
const int *ncoord, *nelem;
const double pixcrd[];
double imgcrd[];
double phi[], theta[];
double world[];
int stat[];
d595 10
a604 9
int wcss2p_(wcs, ncoord, nelem, world, phi, theta, imgcrd, pixcrd, stat)

int* wcs;
const int *ncoord, *nelem;
const double world[];
double phi[], theta[];
double imgcrd[];
double pixcrd[];
int stat[];
d613 12
a624 11
int wcsmix_(wcs, mixpix, mixcel, vspan, vstep, viter, world, phi, theta,
            imgcrd, pixcrd)

int *wcs;
const int *mixpix, *mixcel;
const double vspan[2], *vstep;
int *viter;
double world[];
double phi[], theta[];
double imgcrd[];
double pixcrd[];
d629 11
@


3.6
log
@WCSLIB 3.6: removed WCS_VSOURCE and added WCS_SSYSSRC; added a wrapper for
wcssub(); reworked wcsnfill().
@
text
@d3 2
a4 2
*   WCSLIB 3.6 - an implementation of the FITS WCS convention.
*   Copyright (C) 1995-2004, Mark Calabretta
d6 4
a9 4
*   This library is free software; you can redistribute it and/or modify it
*   under the terms of the GNU Library General Public License as published
*   by the Free Software Foundation; either version 2 of the License, or (at
*   your option) any later version.
d11 4
a14 4
*   This library 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 Library
*   General Public License for more details.
d16 3
a18 3
*   You should have received a copy of the GNU Library General Public License
*   along with this library; if not, write to the Free Software Foundation,
*   Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
d30 1
a30 1
*   $Id: wcs_f.c,v 3.5 2004/06/28 05:10:07 mcalabre Exp mcalabre $
@


3.5
log
@WCSLIB 3.5: added new codes for auxiliary WCS cards in the WCSPRM "struct"
and modified WCSPUT/GET to support them; added wrappers for wcsnpv() and
wcsnps(); null-fill string values inserted into the WCSPRM struct, and
blank-fill those extracted from it.
@
text
@d3 1
a3 1
*   WCSLIB 3.5 - an implementation of the FITS WCS convention.
d30 1
a30 1
*   $Id: wcs_f.c,v 3.4 2004/02/11 00:01:47 mcalabre Exp mcalabre $
d68 1
a68 1
#define WCS_VSOURCE  132
d118 13
d148 7
a154 4
   c[--n] = '\0';
   for (; n >= 0; n--) {
      if (c[n] != ' ') break;
      c[n] = '\0';
d298 3
a300 2
   case WCS_VSOURCE:
      wcsp->vsource = *dvalp;
d516 3
a518 2
   case WCS_VSOURCE:
      *dvalp = wcsp->vsource;
@


3.4
log
@WCSLIB 3.4
@
text
@d3 1
a3 1
*   WCSLIB 3.4 - an implementation of the FITS WCS convention.
d29 2
a30 1
*   $Id: wcs_f.c,v 3.3 2003/10/21 08:44:04 mcalabre Exp mcalabre $
d41 2
a42 2
#define WCS_CTYPE    105
#define WCS_CUNIT    106
d49 25
a73 4
#define WCS_PV       113
#define WCS_ALTLIN   114
#define WCS_CD       115
#define WCS_CROTA    116
d87 20
d129 16
d150 2
a151 1
const int *i, *j;
d189 4
d195 1
a195 5
      wcsp->ctype[i0][71] = '\0';
      break;
   case WCS_CUNIT:
      strncpy(wcsp->cunit[i0], cvalp, 72);
      wcsp->cunit[i0][71] = '\0';
d213 1
d222 11
d243 58
d310 16
d328 1
a328 2
const int *wcs;
const int *what;
d375 1
a375 1
   case WCS_CTYPE:
d377 2
a378 1
         strncpy(cvalp, wcsp->ctype[i], 72);
d382 1
a382 1
   case WCS_CUNIT:
d384 2
a385 1
         strncpy(cvalp, wcsp->cunit[i], 72);
d409 3
d419 16
d453 67
d522 1
d526 1
@


3.3
log
@WCSLIB 3.3
@
text
@d3 2
a4 2
*   WCSLIB 3.3 - an implementation of the FITS WCS convention.
*   Copyright (C) 1995-2003, Mark Calabretta
d29 1
a29 1
*   $Id: wcs_f.c,v 3.2 2003/09/09 05:36:09 mcalabre Exp mcalabre $
@


3.2
log
@WCSLIB 3.2: renamed wcscpy_() to wcscopy_().
@
text
@d3 1
a3 1
*   WCSLIB 3.2 - an implementation of the FITS WCS convention.
d29 1
a29 1
*   $Id: wcs_f.c,v 3.1 2003/04/28 08:04:33 mcalabre Exp mcalabre $
@


3.1
log
@WCSLIB 3.1
In wcsput_(), set wcs.flag = 0; revised handling of wcs.lin, wcs.cel, and
wcs.spc in wcsget_(); amended codes for wcsput_() and wcsget_() for
wcs.cunit.
@
text
@d3 1
a3 1
*   WCSLIB 3.1 - an implementation of the FITS WCS convention.
d29 1
a29 1
*   $Id: wcs_f.c,v 3.1 2003/04/28 04:37:01 mcalabre Exp $
d76 1
a76 1
int wcscpy_(wcssrc, wcsdst)
d82 1
a82 1
   return wcscpy(1, (const struct wcsprm *)wcssrc, (struct wcsprm *)wcsdst);
@


3.0
log
@WCSLIB 3.0
@
text
@d3 1
a3 1
*   WCSLIB 3.0 - an implementation of the FITS WCS convention.
d29 1
a29 1
*   $Id$
d41 11
a51 10
#define WCS_CRVAL    106
#define WCS_LONPOLE  107
#define WCS_LATPOLE  108
#define WCS_RESTFRQ  109
#define WCS_RESTWAV  110
#define WCS_NPV      111
#define WCS_PV       112
#define WCS_ALTLIN   113
#define WCS_CD       114
#define WCS_CROTA    115
d111 2
d132 5
a136 1
      wcsp->ctype[i0][72] = '\0';
d189 2
a190 2
   char *cvalp;
   int  *ivalp;
d192 1
d237 6
d307 4
a310 2
      for (k = 30; k < 44; k++) {
         *(ivalp++) = wcs[k];
d314 4
a317 2
      for (k = 44; k < 182; k++) {
         *(ivalp++) = wcs[k];
d321 4
a324 2
      for (k = 182; k < 224; k++) {
         *(ivalp++) = wcs[k];
d361 1
a361 6
   int status;
   if (status = wcsset((struct wcsprm *)wcs)) {
     return status;
   }

   return 0;
@
