view src/interface/file.dg @ 159:eda7ea83f4f3

impl file interface
author anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp>
date Tue, 14 Jan 2020 17:03:06 +0900
parents 2fc7ed85e76c
children e0255e66e646
line wrap: on
line source

typedef struct file <Impl> {
    union Data* file;
    int          ref;   // reference count
    char         readable;
    char         writable;
    unsigned int off;
    struct stat* st;
    char* addr;
    int n;
    __code stat(Impl* file, struct stat* st, __code next(...));
    __code read(Impl* file, char* addr, __code next(...));
    __code write(Impl* file, char* addr, int n, __code next(...));
    __code close(Impl* file,__code next(...));
} file;