lambda-calculus/parse/wcistream/file/new.c
2025-01-13 20:36:07 -06:00

40 lines
549 B
C

#include <assert.h>
#include <fcntl.h>
#include <debug.h>
#include "../new.h"
#include "inheritance.h"
#include "struct.h"
#include "new.h"
struct wcistream* new_file_wcistream(
const char* input_file)
{
ENTER;
struct file_wcistream* this = (void*) new_wcistream(
&file_wcistream_inheritance,
sizeof(*this));
int fd = open(input_file, O_RDONLY);
if (fd < 0)
{
TODO;
}
this->fd = fd;
this->i = 0;
this->n = 0;
EXIT;
return (void*) this;
}