/*++++++++++++++
.IDENTIFICATION catstd.h
.LANGUAGE       C
.AUTHOR         Francois Ochsenbein [CDS]
.ENVIRONMENT    Unix, CDS Catalogues
.KEYWORDS       Description of a Table
.VERSION  1.0   15-May-1991 (anafile)
.VERSION  4.0	28-Feb-1994: Create larger package
.VERSION  4.1	15-Nov-1994: TABMAP Structures
.VERSION  4.2	19-Oct-1995: posfmt is now a table.
.VERSION  4.3	01-Oct-1996: Added equinox+epoch in FILINFO
.VERSION  4.4	30-Nov-1996: Renaming 
.VERSION  4.5	04-Apr-1997: Signatures in structures
.VERSION  4.6	11-Jul-1997: F_DATE, time ...
.VERSION  4.7	07-Dec-2000: viz_usermacro
.VERSION  4.8	05-Apr-2001: tbf_mpos
.VERSION  4.9	03-Nov-2002: tbf_addcol, cad_tdup
.VERSION  4.91	11-Apr-2004: cad_paste (vertical merge)
.VERSION  5.0 	20-Jul-2005: Data files may contain headlines
.VERSION  5.01	17-Mar-2006: Some definitions moved to strut.h
.VERSION  5.1	25-Nov-2007: add oid in each structure
.VERSION  5.2	09-Sep-2008: Accept sub-elements
.VERSION  5.3	14-Oct-2009: SEC_History added
.VERSION  5.4	20-Jan-2010: SEC_Abstract + SEC_Ack added
.VERSION  5.41	02-Sep-2010: F_refer added
.VERSION  5.42	11-Sep-2010: user_info added (same sizeof(COLINFO))
.VERSION  5.43	20-Jun-2011: Added F_MCMP
.VERSION  5.5	22-Feb-2013: cooframe in TABINFO
.VERSION  5.6	01-Dec-2014: Added MRT
.COMMENTS       Interpretation of the "ReadMe" file of Catalogues
---------------*/
#ifndef CATSTD_DEF	/* To avoid recursive inclusions   */
#define CATSTD_DEF	0

#ifndef __READMETEXT
#define __READMETEXT 1   /* code section to separate readme description and .status (containing LaTeX) */
#endif

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

			/* Definitions related to UNITS -----------   	*/
#ifndef MAXUNIT
#define MAXUNIT		70	/* Max length of expanded Unit        	*/
#endif
#ifndef UNITp 
#define UNITp 		 0	/* 1 to allow () in Units Expressions	*/
#endif

			/* Use special allocation routines (memory.c) */
#ifdef OSM
#define malloc  osmalloc
#define free    osmfree
#define realloc osmexpand
#define strdup	osmdup
#endif
#include <stdlib.h>
#include <unistd.h>
#include <ctype.h>	/* Character classifications */
#include <string.h>	/* Character classifications */
#include <stdio.h>	/* FILE definitions	     */
#include <units.h>	/* SI Units		     */

			/* Further character classification macros	*/
#define iswhite(c)	(((c) == ' ') || ((c) == '\t'))
#define issep(c)	(isspace(c) || ((c) == '|') || ((c) == '!'))
#define issign(c)	(((c) == '+') || ((c) == '-'))
#define isexpo(c)	(((c) == 'E') || ((c) == 'e') || ((c) == 'D'))
#define islim(c)	(((c) == '[') || ((c) == ']'))
#define isnull(c)	(((c) == '?') || ((c) == '!')) /* NULL conventions */

#define NULL4	0x80000000
#define NULL8	0x8000000000000000LL

			/*------File Classification Symbols-------------*/
#define FC_ABULK   	0       	/* ASCII bulk file (no ^J)	*/
#define FC_AFILE   	1       	/* + newlines & Spaces    	*/
#define FC_ACTRL   	2       	/* + acceptable controls 	*/
#define FC_ABIN    	3       	/* + problematic controls 	*/
#define FC_EBCDIC  	4
#define FC_FITS    	5		/* Standard FITS		*/
#define FC_FITS_NL 	6       	/* FITS header + \n     	*/
#define FC_FIH	  	6       	/* FITS header + \n     	*/
#define FC_BINARY  	7
#define FC_DIRECTORY 	8
#define _NL_    	9       	/* NewLine      */

			/*------Options connected to ReadMe Contents----*/
#define FOP_dot	   0x0001		/* Unknown Units 		*/
#define FOP_1	   0x0002		/* Ignore ending bytes 		*/
#define FOP_w	   0x0004		/* Rewrite the ReadMe		*/
#define FOP_std	   0x0008		/* File conforms to standard 	*/
#define FOP_cgi    0x0010		/* For cgi edition, replace {}	*/
#define FOP_1X     0x0020		/* Assume 1-byte separated cols */
#define FOP_tdup   0x0040		/* When set, tabform duplicated */
#define FOP_mrt    0x0080		/* AAS-MRT table (Greg)		*/
#define FOP_ra	   0x0100		/* Compute range		*/
#define FOP_2	   0x0200		/* Errors detected on stderr	*/
#define FOP_v 	   0x8000		/* Verbose option 		*/
#define FOP_quiet  0x4000		/* Quiet mode (only errors)	*/

			/*------Printing Options (in xxx_print)---------*/
#define P_cgi	        1		/* For cgiprint			*/
#define P_a	        2		/* For cgiprint, -a option	*/

/*==================================================================
		Structures
 *==================================================================*/

	/* One section in the ReadMe file is made of a 
	   "section header" (left-adjusted line starting by an uppercase
	   		     letter and containing a colon :)
	   followed by text until another "section header"
   	*/

typedef struct ssection {	/* Descriptor of one Section	*/
    char *signature ;		/* Designates object	*/
    void *oid;			/* Unique Object ID	*/
    struct ssection *next;	/* Linked list		*/
    char *header;		/* Name (title)		*/
    char *abody;		/* Explanations		*/
    char *ebody;		/* End of Explanations	*/
    int lineno;			/* Starting line	*/
    char class;			/* Classification as:	*/
#define SEC_Title	 0	/* Values over SEC_End: */
#define SEC_FileSummary	 1	/* ... are \n separated	*/
#define SEC_BytebyByte	 2
#define SEC_Note	 3
#define SEC_Objects	 4
#define SEC_Keywords	 5
#define SEC_Col    	 6	/* CSV Description 	*/ /*(reserved)*/
#define SEC_End		10
#define SEC_Description	11
#define SEC_Naming 	12	/* Nomenclature (Dic)	*/
#define SEC_SeeAlso     13	/* Related Catalogues  	*/
#define SEC_Abstract    14	/* Abstract */
#define SEC_Data        84	/* 'T' in MRTs only	*/
#define SEC_Ack         86
#define SEC_History     88
#define SEC_References  90
#define SEC_Unknown	99
    short secno ;		/* Section Number 	*/
    short used;			/* For cross-references	*/
#define SECNOTE_used	0x01
#define SECNOTE_edited	0x10
} SECTION;

typedef struct  {      /* Descriptor of Time */
   char   *signature ; /* Designates object (do not free/alloc) */
   char   *system;     /* system name used   */
   double offset;      /* offset in sec      */
   double uncertainty; /* systematical error in sec */
   char   *scale;      /* scale name IAU, UTC, ..   */
   char   *frame;      /* frame name BARYCENTER, TOPOCENTER, ..   */
   char   *rep;        /* format represtation JD, ISO (do not free/alloc) */
   int    flags;       /* flags */
} TIMEINFO;

#define TIMEREL_COLNAME_LEN 64
typedef struct {
    char   *signature ;
    char   name[TIMEREL_COLNAME_LEN];
} TIMEINFO_REL;

	/* A column in a table (file) is completely described by
	   a COLINFO structure; the contents of this structure
	   can be transformed into FITS description
	   TODO: Add the I*8 (64-bit integer)
   	*/
typedef struct {	/* Descriptor of one Column	*/
    char *signature ;		/* Designates object	*/
    void *oid;			/* Unique Object ID	*/
    short b0, b1;	/* Byte Limits (offset 0)	*/
    short rep;		/* Repetition factor 		*/
    char ff;		/* Fortran Format letter     	*/
    char odp;		/* Offset of decimal point 	*/
    short len;
    short elims;	/* Flags to interpret lims------*/
#define F_IMIN	     0x01	/* There is a  lower limit 	*/
#define F_IMAX	     0x02	/* There is an upper limit 	*/
#define F_NULL	     0x04	/* Explicit NULL value	   	*/
#define F_ATRT	     0x08	/* List of allowed characters	*/
#define F_XMIN	     0x10	/* Minimum is Exclusive	   	*/
#define F_XMAX	     0x20	/* Maximum is Exclusive	   	*/
#define F_CHAR	     0x40	/* Limits are character	   	*/
#define F_DBLE	     0x80	/* Limits are double (64bit)   	*/
#define F_SORT	    0x100	/* Must be sorted	   	*/
#define F_SRTD	    0x200	/* Must be decreasing	   	*/
#define F_SRTE	    0x400	/* Allow non-strict sort   	*/
#define F_REQD	    0x800	/* Parameter is Required   	*/
#define F_MCMP	   0x1000	/* Compare with main col (bounds) */
#define F_CCST	   0x2000	/* Constant Column (tbf_addcol)	*/
#define F_TRUNC    0x4000	/* Automatic truncate (vizin)	*/
#define F_NOTE     0x8000	/* dbame evaluated (used vizin)	*/
#define F_NAMEV	   F_NOTE  	/* Numbered note	   	*/
    int flags ;			/* Other flags ---------------	*/
#define F_ACCU     0x0001	/* Column part of Complex Numb. */
#define F_ACCU2    0x0002	/* Column part of Complex Numb. */
#define F_ACCU1    0x0008	/* Complex num: can't just sum	*/
#define F_SIGN     0x0004	/* Contains just a Sign...      */
#define F_DATE	   0x0010	/* Complex date e.g. "Y-M-D"	*/
#define F_TIME	   0x0020	/* Complex time e.g. "h:m:s"	*/
#define F_ANGL	   0x0040	/* Complex angle e.g. "d:m:s"	*/
#define F_SSEP	   0x0080	/* Separator in Complex value	*/
#define F_INDX	   0x0100	/* Column to be indexed		*/
#define F_JOIN	   0x0200	/* Column used in JOIN (paste)	*/
#define F_isPK	   0x0400	/* Column part of Primary Key	*/
#define F_isFK	   0x0800	/* Column is Foreign Key	*/
#define F_LINK     0x1000	/* Column used to generate link	*/
#define F_NODB     0x2000	/* Column useless in DBMS	*/ 
#define F_DISP	   0x4000	/* Displayed Column		*/
#define F_MPOS	   0x8000	/* Column part of Main Position	*/
#define F_HTML    0x10000	/* Column contains HTML-format	*/
#define F_TeX     0x20000	/* Column contains TeX-format	*/
#define F_sofTeX  0x30000	/* Column contains sofTeX-fmt	*/
#define F_CSV     0x40000	/* Column contains comma-sep.	*/
#define F_ZERO    0x80000	/* Column is zero-filled     	*/
#define F_SIMB	 0x100000	/* Column used for SIMBAD call	*/
#define F_CATA	 0x200000	/* Column used for another cat. */
#define F_Lnote	 0x400000	/* Link col. to Associated note */
#define F_refer  0x800000	/* No allocation (reference)    */
#define F_Atext	0x1000000	/* Column "text" was allocated	*/
#define F_Aname	0x2000000	/* Column "name" was allocated	*/
#define F_Aunit	0x4000000	/* Column "unit" was allocated	*/
#define F_Alist	0x8000000	/* All values stored in "values", see vizcat */
#define F_Anew 	  F_Aunit	/* tabform was allocated	*/
#define F_USER 0x10000000	/* Default User Macro Definition*/
#define F_USE2 0x20000000	/* Default User (not yet used)  */
#define F_USE4 0x40000000	/* Default User (not yet used)  */
    int  lineno;		/* Position in ReadMe	   	*/
    int  user_info;		/* Free space ...               */
    SECTION *note;		/* Note (cf F_NOTE) 		*/
    char *lims;			/* Limits (cf elims)+null+val	*/
    char *value;		/* Previous value   		*/
    char *range;		/* Computed range   		*/
    char *unit, *label;
    char *text;			/* (rich)Explanations (before more)*/
    char *more;			/* MORE details (viz_set)	*/
    char *comment ; 		/* Comment (from vizComment)	*/
#if __READMETEXT
    char *readmetext;           /* ReadMe explain               */
#endif
    TIMEINFO *time;             /* Time metadata                */
} COLINFO;

	/* A "Byte-by-Byte Description" described a table (file)
	   includes a number of COLINFO each referring to a column
   	*/
typedef struct {	/* Descriptor of one Table	*/
    char *signature ;		/* Designates object	*/
    void *oid;			/* Unique Object ID	*/
    SECTION *section;		/* To which section	*/
    int lineno;			/* abody Starting line 
				   <0 ==> joined fields	*/
    int nfmt; COLINFO *afmt;	/* COLINFO description 	*/
    short posfmt[8];		/* Position components 	*/
    char *equinox, *epoch;	/* Equinox & Epoch	*/
    char charsep;		/* Column Separator 	*/ /*(reserved)*/
    char headchar;		/* Comment indicator	*/ /*(reserved)*/
    short headlines;		/* Added V5.0  		*/
    char cooframe;		/* Added V5.5 		*/ /*(reserved)*/
    short flags;		/* may contain F_NODB   */
    struct tabMAP *mapping;	/* Linked list of MAPs	*/
} TABINFO;

typedef struct {
    int count;
    int nalloc;
    void **elements;
} LIST_ELEMENTS;

	/* Each file of the "File Summary" section has
	   its description
	   The flags here may take the following values:
	   -- F_Atext (text allocated)
	   -- F_Anew  (tabform created, e.g. paste) 
	   -- F_NODB  (ignore this file)
	   -- F_CATA  (file used in a pasted)
	   -- F_INDX  (file is only generic, number of records not actual)
   	*/
typedef struct {	/* Descriptor of one File	*/
    char *signature ;		/* Designates object	*/
    void *oid;			/* Unique Object ID	*/
    char *dfile;		/* Data file name 	*/
    int reclen;			/* Record length	*/
    long long records;		/* Number of records	*/
    int flags ;			/* Flags; used: 
				   F_MPOS => computed position
				   F_CATA => pasted, 
				   F_isPK => norecno
				   F_isFK => examined   
				   F_LINK = print_recno	*/
    int lineno;			/* Starting line	*/
    SECTION *note;		/* Note related to file */
    TABINFO *tabform;		/* Byte-per-byte desc	*/
    char *equinox, *epoch;	/* Equinox & Epoch	*/
    char *text;			/* (rich) Explanations  */
    char *more ;		/* If needed...		*/
    char *comment ;		/* If needed...		*/
#if __READMETEXT
    char *readmetext;            /* ReadMe explain       */
#endif
} FILINFO;

	/* The complete "ReadMe" file dsecription includes 
	 -> a linked list of the SECTIONs contained in the ReadMe
	 -> the "File Summary" contained in the sfinfo section,
	    and described by a FILINFO  array
	 -> an array of "Byte-by-Byte Description" (atinfo)
 	*/
typedef struct {	/* Descriptor of the ReadMe file	*/
    char *signature ;		/* Designates object	*/
    void *oid;			/* Unique Object ID	*/
    char *ffile;		/* "ReadMe" file name		*/
    char  *fbuf, *ebuf;		/* Contents of ReadMe file 	*/
    int nsec, msec;
    SECTION *section[2];	/* First/last section		*/
    int nfinfo, mfinfo;
    FILINFO *afinfo;		/* File Summary  description 	*/
    SECTION *sfinfo;		/*	  	section @	*/
    int ntinfo, mtinfo;
    TABINFO *atinfo;		/* Byte-per-byte description	*/
    char *filename;		/* Full name of Catalogue	*/
    char *more;			/* Contents of .status		*/
    char *comment ;		/* If needed...			*/
    int credate ;		/* Date file created/modified	*/
    int flags ;			/* ... for future use....	*/
#define CAT_more	1	/* If set, more = .status	*/
#define CAT_obs		2	/* If set, more = =obsolete=	*/
#define CAT_tdup      0x40	/* When set, tabform duplicated */
#define CAT_mrt    FOP_mrt      /* AAS-MRT table (Greg)		*/
} CATINFO;

	/* A "Mapping" of Column Names and Text is described
	  by the TABMAP structure. Each piece of text has
	  a COLINFO structure with a 'X' format.
	  Ascii / Par / CSV / TeX modes
  	*/
typedef struct tabMAP {	/* Descriptor of one Table	*/
    char *signature ;		/* Designates object	*/
    void *oid;			/* Unique Object ID	*/
    TABINFO *tabform;		/* To which BytebyByte	*/
    struct tabMAP  *next ;	/* Linked list 		*/
    char *dfile ;		/* When linked to file	*/
    char mode ;			/* Mode 'a' 'p'	'c' 't'	*/
    char bars;			/* Number of |||	*/
    short flags ;		/* For future use...	*/
#define F_0xMAP        0x100    /* Explanation with data     */
    int nfmt; COLINFO **afmt;	/* COLINFO array descr. */
    char *equinox, *epoch; 	/* The final epoch / equinox */
    char *prefix, *postfix;	/* To add at table top / end */
    char *text;			/* Instruction set	*/
    char *aflags;		/* Individual flags:	*/
#define F_sMAP   	0x02	/* ---Squeeze blanks   	*/
#define F_tMAP   	0x01	/* ---Strip Tail blanks	*/
#define F_zMAP   	0x04	/* ---Remove blanks	*/
#define F_0MAP   	0x08	/* ---Remove if empty	*/
#define F_vMAP   	0x10	/* ---Verbatim add byte	*/
#define F__MAP   	0x20	/* ---Rule each row	*/
#define F_XMAP   	0x80	/* ---eXtract sub-elem  */
    int  *asubs;		/* Subelement eXtract   */
} TABMAP;


/*==================================================================
		Routine declarations
 *==================================================================*/

#include <strut.h>	/* Basic string utilities */

/* from "error.c" */
void     error _ARGS((char *text));
void terminate _ARGS((char *text));	/* Error exit 		*/

/* from "util.c", string & time utilities */
char *getdomain _ARGS((void)) ;
char     *rule _ARGS((int punctation_char));
char   *edchar _ARGS((int byte));
char  **epochs _ARGS((char *text, int option));	/* Interpret equinox/epoch */
double bandGHz _ARGS((char *text));		/* Interpet wavelen/Hz/eV  */
int    isepoch _ARGS((char *text)) ;		/* Check a text = epoch    */
int     strloc _ARGS((char *text, int c));
int    strbloc _ARGS((char *text, int c));
int   strindex _ARGS((char *s1, char *s2));	/* locate substring */
int  strsindex _ARGS((char *s1, char *s2));	/* squeezed index   */
int    studiff _ARGS((char *s1, char *s2));	/* case-insensitive */
int   stundiff _ARGS((char *s1, char *s2, int len));	/* case-insensitive */
int   strnline _ARGS((char *line, int len));	/* Useful length of line */
int    strline _ARGS((char *line));		/* Useful length of line */
int     stkstr _ARGS((char *in));	/*   Find length of a quoted string */
int    setset1 _ARGS((char *in, char *array_256));	/* Flag quoted bytes*/
int   setset1e _ARGS((char *in, char *endof_in, char *array_256));
int match_num  _ARGS((char *in));
int match_rule _ARGS((char *in));
int match_word _ARGS((char *line, char *name, int separator));
char     *date _ARGS((int option));
void   dateset _ARGS((int t)) ;
/* char *strclone _ARGS((char *str)); */

/* from "fits.c", utilities to write FITS ascii tables */
int   fit_getmode _ARGS((void));
int   fit_setmode _ARGS((int imode /*(0=standard blocked, 1=stream)*/ ));
int     fit_flush _ARGS((FILE *fout, long offset));
int      fit_prka _ARGS((FILE *fout, char *kw, char *val, char *com));
int      fit_prkn _ARGS((FILE *fout, char *kw, char *val, char *com));
int      fit_prki _ARGS((FILE *fout, char *kw,  int  val, char *com));
int     fit_prcom _ARGS((FILE *fout, char *kw, char *com));
int       fit_prt _ARGS((FILE *fout, char *kw, char *com, int com_len));
int      fit_copy _ARGS((FILE *fout, char *input_file));
int    fit_prfile _ARGS((FILE *fout, char *input_file));
int     fit_naxis _ARGS((int naxis_number));

/* from "tabutil.c", utilities managing the above structures */
char             *ftype _ARGS((int bintype));
char            *strfmt _ARGS((char *value));	/* Guess the format from text */
char           *seclass _ARGS((int section_class));
char            *fmt_ed _ARGS((COLINFO *format));
char       *fmt_edrange _ARGS((COLINFO *format));
COLINFO    *tbf_findcol _ARGS((void *T, char *colname)); 	/* Or col@tab */
COLINFO  *tbf_findlabel _ARGS((TABINFO *T, char *label)); 	/* Or FILINFO */
TABINFO *cad_findformat _ARGS((CATINFO *T, char *filename));
FILINFO   *cad_findfile _ARGS((CATINFO *T, char *filename));
FILINFO    *cad_addfile _ARGS((CATINFO *T, char *filename));
FILINFO      *cad_paste _ARGS((CATINFO *T, char *list));	/* paste files*/
	      /* Note: pasted files marked by F_CATA, common fields by F_JOIN */
SECTION       *sec_find _ARGS((SECTION *first_section, char *starting_text)) ;
SECTION   *sec_findnote _ARGS((SECTION *first_section, char *name));
int           tbf_text  _ARGS((void *o, char *text));
int           tbf_check _ARGS((TABINFO *T)) ;
char            *sec_id _ARGS((void    *ps)) ;	/* Edit Section */
void	     sec_prefix _ARGS((char *text));
int          sec_prhead _ARGS((SECTION *ps, FILE *fout));  /* Print a section */
void           cad_element_free _ARGS((LIST_ELEMENTS *list));
LIST_ELEMENTS *cad_element_init _ARGS(());
int            cad_element_push _ARGS((LIST_ELEMENTS *list, void *element));
int         cad_element_in_list _ARGS((LIST_ELEMENTS *list, void *element));
LIST_ELEMENTS *cad_table_list _ARGS((CATINFO *catinfo, char *regexp));

/* from "tabform.c"  */
int     tbf_load _ARGS((TABINFO *tbf, int fop, int F_op));
int     tbf_mpos _ARGS((TABINFO *tbf, char *position_list));
void    free_time_info _ARGS((TIMEINFO *info));
void    free_time_struct _ARGS((TIMEINFO *info));
int     tbf_free _ARGS((TABINFO *tbf));
int    tbf_reset _ARGS((TABINFO *tbf));
int    tbf_print _ARGS((TABINFO *tbf, FILE *fout, int P_option));
void     tbf_cpy _ARGS((TABINFO *dest, TABINFO *source)) ;
COLINFO *tbf_addcol _ARGS((TABINFO *tbf, int pos, char *name, char *text, 
			char *value, char *unit));   /* Add a constant column */
int    tbf_order _ARGS((TABINFO *tbf, char *name, char *column_before_after));

/* from "tabout.c" */
char *tbf_edrow _ARGS((FILINFO *table, char *format, char *row)) ;

/* from "catstd.c" */
char *cad_signature _ARGS((char *signature)) ;
void *cad_oid       _ARGS((void)) ;
char *cad_name      _ARGS((CATINFO *cad)) ;
CATINFO *cad_new _ARGS((char *format_file, int option));
		/* Option is a combination of FOP_'s defined above */
int    cad_check _ARGS((CATINFO *cad));
int     cad_kill _ARGS((CATINFO *cad));
int     cad_tdup _ARGS((CATINFO *cad));		/* 1 TABINFO foreach FILINFO */
int    cad_print _ARGS((CATINFO *cad, FILE *fout, int P_option));

#if __READMETEXT
char *ana_original_name _ARGS((char *text));
#endif

/* from "tabmap.c" 
int    tbm_prule _ARGS((TABMAP *tbm, FILE *fout, int dash_or_zero)); 
*/
TABMAP  *tbm_new _ARGS((void *desc, char *options, char *list));
  			/* Option includes 'S' for Simbad-like Definitions */
int    tbm_free  _ARGS((TABMAP *tbm));
int   tbm_prhead _ARGS((TABMAP *tbm, FILE *fout, int P_option)); 
int  tbm_prnotes _ARGS((TABMAP *tbm, FILE *fout, int P_option)); 
int  tbm_prtitle _ARGS((TABMAP *tbm, FILE *fout));
int      tbm_pr1 _ARGS((TABMAP *tbm, FILE *fout, char *record));

/* from "vizcat.c" */
char *cad_keywords _ARGS((CATINFO *cad, char *key_type));
char *viz_getkey   _ARGS((CATINFO *cad, char *key));
char *viz_getmac   _ARGS((CATINFO *cad, char *key));
			/* Table with macro \t \v - separated  */
int      viz_set   _ARGS((CATINFO *cad, int maxlen, int maxcols, int nposcol));
			/* Define the default displayed fields */
int     viz_macro  _ARGS((CATINFO *cad, char *macro));	/* 3 or 4-args macros */
int     viz_usermacro _ARGS((CATINFO *cad, char *macro, int flag));
int     viz_load   _ARGS((CATINFO *cad));		/* additional cols,.. */
int     viz_more3  _ARGS((CATINFO *cad, char *macro, int opt));
int     viz_more   _ARGS((CATINFO *cad, char *macro));
			/* Get into "more" the contents of macro */
int     viz_fmore  _ARGS((CATINFO *cad, char *macro));
			/* Get into "more" macrosrelated to FILEs only */
int     viz_addmore _ARGS((CATINFO *cad, char *text));
int     viz_errors  _ARGS((void));

#endif			/* End of CATSTD_DEF */
