/* $Revision Header *** Header built automatically - do not edit! ***********
 *
 *	(C) Copyright 1991 by Torsten Jürgeleit
 *
 *	Name .....: files.h
 *	Created ..: Thursday 19-Dec-91 20:00:56
 *	Revision .: 0
 *
 *	Date        Author                 Comment
 *	=========   ====================   ====================
 *	19-Dec-91   Torsten Jürgeleit      Created this file!
 *
 ****************************************************************************
 *
 *	Defines, structures, prototypes and pragmas for text file functions
 *
 * $Revision Header ********************************************************/

#ifndef	ISUP_TEXT_FILES_H
#define	ISUP_TEXT_FILES_H

	/* Defines for text file */

#define TEXT_FILE_FLAG_TRIM_LINE		(1 << 0)	/* strip leading and trailing white space */
#define TEXT_FILE_FLAG_SKIP_COMMENTS		(1 << 1)	/* skip C style comments */
#define TEXT_FILE_FLAG_SKIP_EMPTY_LINES		(1 << 2)	/* skip empty lines */
#define TEXT_FILE_FLAG_LINE_CONTINUATION	(1 << 3)	/* continue line with last character '\' in next line */

#define TEXT_FILE_STATUS_NORMAL			0
#define TEXT_FILE_STATUS_EOF			1

#define TEXT_FILE_ERROR_NO_FILE_DATA		-1
#define TEXT_FILE_ERROR_LINE_TOO_LONG		-2
#define TEXT_FILE_ERROR_NO_COMMENT_END		-3
#define TEXT_FILE_ERROR_READ_FAILED		-4

	/* Structures for text file */

struct FileData {

	/* Public data */
	BYTE	*fd_Line;
	USHORT	fd_LineLen;
	USHORT	fd_LineNum;

	/* Internal data */
	LONG	fd_ID;		/* id = 'ISUP' */
	BYTE	*fd_Name;
	USHORT	fd_ReadBufferSize;
	USHORT	fd_LineBufferSize;
	ULONG	fd_Flags;
	BPTR	fd_FileHandle;
	BYTE	*fd_ReadBuffer;
	BYTE	*fd_CurrentPtr;
	BYTE	*fd_EndPtr;
	BYTE	*fd_LineBuffer;
};
	/* Global prototypes */

struct FileData  *open_text_file(BYTE *name, USHORT read_buffer_size,
				     USHORT line_buffer_size, USHORT flags);
SHORT read_text_line(struct FileData  *fd);
VOID  close_text_file(struct FileData  *fd);

	/* Global pragmas (Aztec C v5.2a) */

#pragma intfunc(open_text_file(a0,d0,d1,d2))
#pragma intfunc(read_text_line(a0))
#pragma intfunc(close_text_file(a0))

#endif   /* ISUP_TEXT_FILES_H */
