/*+++++++++
.Header		tranum.h
.LANGUAGE	C
.AUTHOR		Francois Ochsenbein [ESO-IPG]
.KEYWORDS	Trigonometric mathematical functions
.COMMENTS	This header contains declarations for mathematical functions
		and macros for spherical/hyperbolic transformations.

.VERSION 1.0	21-Oct-1985: Creation
.VERSION 1.1	05-Dec-1988: Transformed some macros to functions
.VERSION 1.2	15-Feb-1995: ANSI-compatible
----------------*/

#ifndef  TRANUM_DEF
#define  TRANUM_DEF	0
#include <stdio.h>

#ifndef _ARGS
#ifdef __STDC__
#define _ARGS(A)	A       /* ANSI */
#else
#define _ARGS(A)	()      /* Traditional */
#define const
#endif
#endif

/* 32-bit and 64-bit */
#ifndef int4
#define int4 int
#endif
#ifndef int8
#define int8 long long
#endif


/*=========================================================================
		Interpretation of ascii test
 *=========================================================================*/

		/* Returns number of bytes until stopped for a number */
int 	tr_al 	_ARGS((char *text, int length, int4 *value));
		/* Array of numbers, returns #elements */
int	tr_al1	_ARGS((char *text, int length, int4 *value, int value_size));
		/* Array of numbers, returns nelems */
int	tr_aln	_ARGS((char *text, int length, int4 *value, int nelems));
		/* Returns number of significant digits of a number */

		/* Returns number of bytes until stopped for a number */
int 	tr_all 	_ARGS((char *text, int length, int8 *value));
		/* Array of numbers, returns #elements */
int	tr_all1	_ARGS((char *text, int length, int8 *value, int value_size));
		/* Array of numbers, returns nelems */
int	tr_alln	_ARGS((char *text, int length, int8 *value, int nelems));
		/* Returns number of significant digits of a number */

int 	tr_af 	_ARGS((char *text, int length, double *value));
		/* Array of numbers, returns #elements */
int	tr_af1	_ARGS((char *text, int length, double *value, int value_size));
		/* Array of numbers, returns nelems */
int	tr_afn	_ARGS((char *text, int length, double *value, int nelems));

		/* Morphological class, returns 0=complete, 1=incomplete */
int	tr_akm	_ARGS((char *text, int length, int *morph_type));

char   *tr_error _ARGS((FILE *f));

/*=========================================================================
		Edition (conversion to ascii), see ednum.c
 *=========================================================================*/
		/* Returns length edited; precision = 0(deg)..10(mas) */
int 	ed2_o	_ARGS((char *buf, int size, double *value, int precision));
		/* Returns length edited; precision = 0(deg)..10(mas) */
int 	ed2_q	_ARGS((char *buf, int size, double *value, int precision));

		/* Standard name of a position */
char   *cooname _ARGS((int type, double equinox));

#endif
