#ifndef SWIFT_IO_FILE_STREAM_H
#define SWIFT_IO_FILE_STREAM_H

#include <swift/data.h>
#include <swift/stdlib.h>

#include <swift/io/api.h>
#include <swift/io/file.h>
#include <swift/io/stream.h>

typedef struct swift_file_stream_t swift_file_stream_t;

struct swift_file_stream_t {
	swift_stream_t stream;
	swift_file_t *file;
};

#define SWIFT_FILE_STREAM(ptr) \
	(SWIFT_CONTAINER_OF((ptr), swift_file_stream_t, stream))

SWIFT_IO_API swift_stream_t *swift_open_file_stream(const char *path,
	unsigned int flags);

#endif /* SWIFT_IO_FILE_STREAM_H */
