view src/impl/file_impl_inode.cbc @ 323:f0b337cb6024 default tip

use goto err->panic
author anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp>
date Sat, 08 Feb 2020 20:37:42 +0900
parents a7fc5edea925
children
line wrap: on
line source

#include "../../context.h"
#interface "file.dg"


// ----
// typedef struct inode_impl<Impl, Isa> impl file {
//
// } inode_impl;
// ----

file* createinode(struct Context* cbc_context) {
    struct file* file  = new file();
    struct inode_impl* inode_impl = new inode_impl();
    file->file = (union Data*)inode_impl;
    inode_impl->st = NULL;
    inode_impl->ip = NULL;
    file->stat = C_statinode;
    inode_impl->cbc_statinode = C_cbc_statinode_impl;
    file->read = C_readinode;
    file->write = C_writeinode;
    file->close = C_closeinode;
    return file;
}
__code statinode(struct inode* ip, struct stat* st, __code next(int ret, ...)) { //:skip

    goto cbc_statinode(ip, st, next(ret, ...));
}

__code cbc_statinode_impl(struct inode* ip, struct stat* st, __code next(int ret, ...)){

    goto next(...);
}

__code readinode(struct inode* file, char* addr, __code next(...)) {

    goto next(...);
}

__code writeinode(struct inode* file, char* addr, int n, __code next(...)) {

    goto next(...);
}

__code closeinode(struct inode* file,int fd, __code next(...)) {

    goto next(...);
}