来自 fuse/examples/fsel.c
static struct fuse_operations fsel_oper = {
.getattr = fsel_getattr,
.readdir = fsel_readdir,
.open = fsel_open,
.release = fsel_release,
.read = fsel_read,
.poll = fsel_poll,
};
这是 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 *);
.....
};
那么那些 .
是做什么用的?意思是?我还是第一次见到
最佳答案
这意味着以 .
命名的字段将具有该值。
例如,gettr
函数指针将指向fsel_getattr
函数。
关于c - struct { .attr = value } 语法是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16654513/