/* %Z%%M% %I% %E% */

/*
 * Copyright (c) 1990, 1991, 1995 by Wayne C. Gramlich.
 * All rights reserved.
 *
 * Permission to use, copy, modify, distribute, and sell this software
 * for any purpose is hereby granted without fee provided that the above
 * copyright notice and this permission are retained.  The author makes
 * no representations about the suitability of this software for any purpose.
 * It is provided "as is" without express or implied warranty.
 */

/* File object implementation definitions: */

#ifndef FILE_DEFS_H
#define FILE_DEFS_H

#ifndef FILE_EXPORTS_H
#include "file_exports.h"
#endif

#define	FILE_ARGUMENT_NONE	((File_argument)0)
#define FILE_NONE		((File)0)
#define FILE_NO_CHR		(-1)
#define FILE_INTEGER_NONE	((File_integer *)0)
#define FILE_STRING_NONE	((File_string *)0)
#define FILE_SYMBOL_NONE	((File_symbol *)0)
#define FILE_BUFFER_SIZE	8192			/* 2**13 */

/* This is a file object: */
struct File_struct {
	Str		buffer;		/* Input buffer */
	int		fd;		/* File descriptor */
	Str		file_name;	/* File name */
	int		line_number;	/* Line number */
	int		line_column;	/* Line column (starting at 0 */
	Heap		heap;		/* Heap allocated from */
	Str		pointer;	/* Current character pointer */
	int		position;	/* File postion */
	int		previous;	/* Previous char. or FILE_NO_CHR */
	int		remaining;	/* Bytes remaining in buffer */
	int		size;		/* Buffer size */
};

#endif /* FILE_DEFS_H */
