/**---------------------------------------------------------------------------
 ** 
 ** io.h -- 
 ** 
 ** Author          : Pierre Jaccard
 ** Created On      : 1999/07/15 12:39:09
 ** Last Modified By: Pierre Jaccard
 ** Last Modified On: 1999/07/16 21:24:28
 ** Update Count    : 8
 ** Directory       : /home/pego/pcd1/codas3c/gfi/src/libs/misc/
 ** Version         : 0.0
 ** Status          : Unknown
 ** ---------------------------------------------------------------------- ** 
 ** DESCRIPTION: 
 ** 
 **    See associated file io.c
 ** 
 ** ---------------------------------------------------------------------- ** 
 ** REVISIONS: 
 ** ---------------------------------------------------------------------- ** 
 ** CHANGES: 
 **------------------------------------------------------------------------**/

#ifndef gfilib_misc_io_already_included
#define gfilib_misc_io_already_included

/* #include "geninc.h" */
#include "ioserv.h"
#include "msg.h"
#include "file.h"

/* ------------------------------------------------------------------
	The next structure is used to save information about the current data file
  being processed. The file pointer fp should be set to NULL if the data file
  is not open.
	------------------------------------------------------------------ */
typedef struct
{
	FILE_NAME_TYPE name;   /* Name of current data file         */
	char  mode[5];         /* Mode for openning the data file   */
	ULONG list_pos;        /* current position in list of files */
	ULONG data_pos;        /* current position in data file     */
	FILE *fp;              /* pointer to data file              */
} DATA_FILE_INFO_TYPE;

#if PROTOTYPE_ALLOWED

int move_nchar(FILE *fp, char c, int n);
int next_data_file(FILE *fp, DATA_FILE_INFO_TYPE *fi);
int prev_data_file(FILE *fp, DATA_FILE_INFO_TYPE *fi);
int init_file_info(FILE *fp, DATA_FILE_INFO_TYPE *fi, char *format);
int report_file_change(FILE_NAME_TYPE prev, FILE_NAME_TYPE curr);

#else

int move_nchar();
int next_data_file();
int prev_data_file();
int init_file_info();
int report_file_change();

#endif /* PROTOTYPE_ALLOWED */

#endif /* gfilib_misc_io_already_included */
