Package list libmawk / 70499808-c2b9-4be2-ae11-0ab4b3a1a115/main scconfig / src / tmpasm / openfiles.h
70499808-c2b9-4be2-ae11-0ab4b3a1a115/main

Tree @70499808-c2b9-4be2-ae11-0ab4b3a1a115/main (Download .tar.gz)

openfiles.h @70499808-c2b9-4be2-ae11-0ab4b3a1a115/mainraw · history · blame

#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>

typedef struct openfile_s {
	FILE *f;

	/* identify the file: */
	dev_t dev;
	ino_t ino;

	char *mode;
} openfile_t;

typedef struct openfiles_s {
	int alloced, used;
	openfile_t *files;
} openfiles_t;

FILE *openfile_open(openfiles_t *of, const char *fn, const char *mode);
void openfile_closeall(openfiles_t *of);
void openfile_free(openfiles_t *of);