view src/interface/file.dg @ 314:11cd1c607427

rename..
author anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp>
date Thu, 06 Feb 2020 17:40:44 +0900
parents 14aa35b56347
children a7fc5edea925
line wrap: on
line source

typedef struct file <Impl> {
    union Data* file;
    enum { FD_NONE, FD_PIPE, FD_INODE } type;
    int ref;   // reference count
    char readable;
    char writable;
    struct pipe  *pipe;
    struct inode *ip;
    unsigned int off;
    struct stat* st;
    char* addr;
    int n;
    int fd;
    __code read(Impl* file, char* addr, __code next(...));
    __code write(Impl* file, char* addr, int n, __code next(...));
    __code close(Impl* file,int fd, __code next(...));
} file;