#ifndef DONE_LFILE
#define DONE_LFILE
#include <stdlib.h>
#include <stdio.h>
#include "rwlock.h"
#include "defines.h"
#include "solfile.h"

typedef struct LFILEX {
	char fname[BFSZ];
	int isopen;
	SOLFILE *f;
	int isread;
	int at;
	int len;
	Rwlock *lock;
} LFILE;

LFILE *lfile_fopen(char *fname,char *mode, int wait, char *reason, int line);
int lfile_fclose(LFILE **pl, int line);
int lfile_feof(LFILE *pl);
int lfile_fread(void *bf, size_t size, size_t count, LFILE *f);
int lfile_fwrite(void *bf, size_t size, size_t count, LFILE *f);
char * lfile_fgets(char *str, int n, LFILE *f);
int lfile_fseek(LFILE *f, long to, int mode);
int lfile_ftell(LFILE *f);
int lfile_fprintf(LFILE *f, char *format, ...);
LFILE *lfile_fopen_create(char *fname,char *mode, int wait, char *reason);
LFILE *lfile_fopen_ext(char *fname,char *mode, int wait, char *reason, int line, int nolock);
int lfile_handle_dump(void);
int lfile_fileno(LFILE *f);
int lfile_osize(LFILE *f);

#endif

