/**---------------------------------------------------------------------------
 ** 
 ** xoption.h -- 
 ** 
 ** Author          : Pierre Jaccard
 ** Created On      : 1999/07/15 21:03:41
 ** Last Modified By: Pierre Jaccard
 ** Last Modified On: 1999/08/02 12:10:15
 ** Update Count    : 14
 ** Directory       : /home/pego/pcd1/codas3c/gfi/src/libs/misc/
 ** Version         : 0.0
 ** Status          : Unknown
 ** ---------------------------------------------------------------------- ** 
 ** DESCRIPTION: 
 ** 
 **    Undocumented.
 ** 
 ** ---------------------------------------------------------------------- ** 
 ** REVISIONS: 
 ** ---------------------------------------------------------------------- ** 
 ** CHANGES: 
 **------------------------------------------------------------------------**/

#ifndef xoption_already_included
#define xoption_already_included

#include "geninc.h"
#include "ioserv.h"
#include "use_db.h"
#include "time.h"
#include "pos.h"

/*
#include <stdlib.h>
#include <ioserv.h>
#include <use_db.h>
#include <pos_nbr.h>
#include <time_nbr.h>
*/

/*
  This structure is used to create a another list of options which can be
  parsed by function op_get_keyword() and result in other option
  list. Although it might seem somehow complicated, this feature can be used
  to created quite complicated control files.
*/
typedef struct
{
	int  index_code;                 /* Code number to identify element in list */
	char *variable;                  /* Pointer to variable                     */
	char *(*function)();             /* Function to apply to keyword code       */
	int  type_code;                  /* Type code of variable                   */
	NAME_LIST_ENTRY_TYPE *name_list; /* Pointer to name list entry              */
	char *arg;                       /* Argument sent to fucntion               */
} XOPTION_TYPE;

#if PROTOTYPE_ALLOWED

int op_get_keyword(FILE *fp, char *arg, int code);
int op_get_range(FILE *fp, char *arg, int code);
int op_get_time_range(FILE *fp, char *arg, int code);
int op_get_position_range(FILE *fp, char *arg, int code);
int op_get_dmsh_position(FILE *fp, char *arg, int code);

#else

int op_get_keyword();
int op_get_range();
int op_get_time_range();
int op_get_position_range();
int op_get_dmsh_position();

#endif  /* PROTOTYPE_ALLOWED */


#endif /* xoption_already_included */
