0
從fuse/examples/fsel.c
struct {.attr = value}語法是什麼意思?
static struct fuse_operations fsel_oper = {
.getattr = fsel_getattr,
.readdir = fsel_readdir,
.open = fsel_open,
.release = fsel_release,
.read = fsel_read,
.poll = fsel_poll,
};
這是definitionof fuse_operations
struct fuse_operations_compat25 {
int (*getattr) (const char *, struct stat *);
int (*readlink) (const char *, char *, size_t);
int (*getdir) (const char *, fuse_dirh_t, fuse_dirfil_t);
int (*mknod) (const char *, mode_t, dev_t);
int (*mkdir) (const char *, mode_t);
int (*unlink) (const char *);
int (*rmdir) (const char *);
.....
};
所以什麼那些.
是什麼意思?這是我第一次看到
http://gcc.gnu.org/onlinedocs/gcc/Designated-Inits.html – Maroun
指定成員的初始化。 – BLUEPIXY