diff options
Diffstat (limited to 'lib9p/include')
-rw-r--r-- | lib9p/include/lib9p/9p.generated.h | 116 | ||||
-rw-r--r-- | lib9p/include/lib9p/9p.h | 11 |
2 files changed, 63 insertions, 64 deletions
diff --git a/lib9p/include/lib9p/9p.generated.h b/lib9p/include/lib9p/9p.generated.h index a1c9958..f107b1f 100644 --- a/lib9p/include/lib9p/9p.generated.h +++ b/lib9p/include/lib9p/9p.generated.h @@ -176,62 +176,62 @@ struct lib9p_s { /* size = 4 ; max_iov = 1 ; max_copy = 4 */ typedef uint32_t lib9p_dm_t; -#define LIB9P_DM_DIR ((lib9p_dm_t)(1<<31)) -#define LIB9P_DM_APPEND ((lib9p_dm_t)(1<<30)) -#define LIB9P_DM_EXCL ((lib9p_dm_t)(1<<29)) -#define _LIB9P_DM_PLAN9_MOUNT ((lib9p_dm_t)(1<<28)) -#define LIB9P_DM_AUTH ((lib9p_dm_t)(1<<27)) -#define LIB9P_DM_TMP ((lib9p_dm_t)(1<<26)) -/* unused ((lib9p_dm_t)(1<<25)) */ -/* unused ((lib9p_dm_t)(1<<24)) */ +#define LIB9P_DM_DIR ((lib9p_dm_t)(1<<31)) +#define LIB9P_DM_APPEND ((lib9p_dm_t)(1<<30)) +#define LIB9P_DM_EXCL ((lib9p_dm_t)(1<<29)) +#define _LIB9P_DM_RESERVED_PLAN9_MOUNT ((lib9p_dm_t)(1<<28)) +#define LIB9P_DM_AUTH ((lib9p_dm_t)(1<<27)) +#define LIB9P_DM_TMP ((lib9p_dm_t)(1<<26)) +/* unused ((lib9p_dm_t)(1<<25)) */ +/* unused ((lib9p_dm_t)(1<<24)) */ #if CONFIG_9P_ENABLE_9P2000_u -# define LIB9P_DM_DEVICE ((lib9p_dm_t)(1<<23)) +# define LIB9P_DM_DEVICE ((lib9p_dm_t)(1<<23)) #endif /* CONFIG_9P_ENABLE_9P2000_u */ -/* unused ((lib9p_dm_t)(1<<22)) */ +/* unused ((lib9p_dm_t)(1<<22)) */ #if CONFIG_9P_ENABLE_9P2000_u -# define LIB9P_DM_NAMEDPIPE ((lib9p_dm_t)(1<<21)) -# define LIB9P_DM_SOCKET ((lib9p_dm_t)(1<<20)) -# define LIB9P_DM_SETUID ((lib9p_dm_t)(1<<19)) -# define LIB9P_DM_SETGID ((lib9p_dm_t)(1<<18)) +# define LIB9P_DM_NAMEDPIPE ((lib9p_dm_t)(1<<21)) +# define LIB9P_DM_SOCKET ((lib9p_dm_t)(1<<20)) +# define LIB9P_DM_SETUID ((lib9p_dm_t)(1<<19)) +# define LIB9P_DM_SETGID ((lib9p_dm_t)(1<<18)) #endif /* CONFIG_9P_ENABLE_9P2000_u */ -/* unused ((lib9p_dm_t)(1<<17)) */ -/* unused ((lib9p_dm_t)(1<<16)) */ -/* unused ((lib9p_dm_t)(1<<15)) */ -/* unused ((lib9p_dm_t)(1<<14)) */ -/* unused ((lib9p_dm_t)(1<<13)) */ -/* unused ((lib9p_dm_t)(1<<12)) */ -/* unused ((lib9p_dm_t)(1<<11)) */ -/* unused ((lib9p_dm_t)(1<<10)) */ -/* unused ((lib9p_dm_t)(1<<9)) */ -#define LIB9P_DM_OWNER_R ((lib9p_dm_t)(1<<8)) -#define LIB9P_DM_OWNER_W ((lib9p_dm_t)(1<<7)) -#define LIB9P_DM_OWNER_X ((lib9p_dm_t)(1<<6)) -#define LIB9P_DM_GROUP_R ((lib9p_dm_t)(1<<5)) -#define LIB9P_DM_GROUP_W ((lib9p_dm_t)(1<<4)) -#define LIB9P_DM_GROUP_X ((lib9p_dm_t)(1<<3)) -#define LIB9P_DM_OTHER_R ((lib9p_dm_t)(1<<2)) -#define LIB9P_DM_OTHER_W ((lib9p_dm_t)(1<<1)) -#define LIB9P_DM_OTHER_X ((lib9p_dm_t)(1<<0)) - -#define LIB9P_DM_PERM_MASK ((lib9p_dm_t)(0777)) +/* unused ((lib9p_dm_t)(1<<17)) */ +/* unused ((lib9p_dm_t)(1<<16)) */ +/* unused ((lib9p_dm_t)(1<<15)) */ +/* unused ((lib9p_dm_t)(1<<14)) */ +/* unused ((lib9p_dm_t)(1<<13)) */ +/* unused ((lib9p_dm_t)(1<<12)) */ +/* unused ((lib9p_dm_t)(1<<11)) */ +/* unused ((lib9p_dm_t)(1<<10)) */ +/* unused ((lib9p_dm_t)(1<<9)) */ +#define LIB9P_DM_OWNER_R ((lib9p_dm_t)(1<<8)) +#define LIB9P_DM_OWNER_W ((lib9p_dm_t)(1<<7)) +#define LIB9P_DM_OWNER_X ((lib9p_dm_t)(1<<6)) +#define LIB9P_DM_GROUP_R ((lib9p_dm_t)(1<<5)) +#define LIB9P_DM_GROUP_W ((lib9p_dm_t)(1<<4)) +#define LIB9P_DM_GROUP_X ((lib9p_dm_t)(1<<3)) +#define LIB9P_DM_OTHER_R ((lib9p_dm_t)(1<<2)) +#define LIB9P_DM_OTHER_W ((lib9p_dm_t)(1<<1)) +#define LIB9P_DM_OTHER_X ((lib9p_dm_t)(1<<0)) + +#define LIB9P_DM_PERM_MASK ((lib9p_dm_t)(0777)) #endif /* CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_p9p || CONFIG_9P_ENABLE_9P2000_u */ #if CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_p9p || CONFIG_9P_ENABLE_9P2000_u /* size = 1 ; max_iov = 1 ; max_copy = 1 */ typedef uint8_t lib9p_qt_t; -#define LIB9P_QT_DIR ((lib9p_qt_t)(1<<7)) -#define LIB9P_QT_APPEND ((lib9p_qt_t)(1<<6)) -#define LIB9P_QT_EXCL ((lib9p_qt_t)(1<<5)) -#define _LIB9P_QT_PLAN9_MOUNT ((lib9p_qt_t)(1<<4)) -#define LIB9P_QT_AUTH ((lib9p_qt_t)(1<<3)) -#define LIB9P_QT_TMP ((lib9p_qt_t)(1<<2)) +#define LIB9P_QT_DIR ((lib9p_qt_t)(1<<7)) +#define LIB9P_QT_APPEND ((lib9p_qt_t)(1<<6)) +#define LIB9P_QT_EXCL ((lib9p_qt_t)(1<<5)) +#define _LIB9P_QT_RESERVED_PLAN9_MOUNT ((lib9p_qt_t)(1<<4)) +#define LIB9P_QT_AUTH ((lib9p_qt_t)(1<<3)) +#define LIB9P_QT_TMP ((lib9p_qt_t)(1<<2)) #if CONFIG_9P_ENABLE_9P2000_u -# define LIB9P_QT_SYMLINK ((lib9p_qt_t)(1<<1)) +# define LIB9P_QT_SYMLINK ((lib9p_qt_t)(1<<1)) #endif /* CONFIG_9P_ENABLE_9P2000_u */ -/* unused ((lib9p_qt_t)(1<<0)) */ +/* unused ((lib9p_qt_t)(1<<0)) */ -#define LIB9P_QT_FILE ((lib9p_qt_t)(0)) +#define LIB9P_QT_FILE ((lib9p_qt_t)(0)) #endif /* CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_p9p || CONFIG_9P_ENABLE_9P2000_u */ #if CONFIG_9P_ENABLE_9P2000_L || CONFIG_9P_ENABLE_9P2000_u @@ -244,21 +244,21 @@ typedef uint32_t lib9p_nuid_t; /* size = 1 ; max_iov = 1 ; max_copy = 1 */ typedef uint8_t lib9p_o_t; -/* unused ((lib9p_o_t)(1<<7)) */ -#define LIB9P_O_RCLOSE ((lib9p_o_t)(1<<6)) -/* unused ((lib9p_o_t)(1<<5)) */ -#define LIB9P_O_TRUNC ((lib9p_o_t)(1<<4)) -/* unused ((lib9p_o_t)(1<<3)) */ -/* unused ((lib9p_o_t)(1<<2)) */ -#define LIB9P_O_mode_1 ((lib9p_o_t)(1<<1)) -#define LIB9P_O_mode_0 ((lib9p_o_t)(1<<0)) - -#define LIB9P_O_READ ((lib9p_o_t)(0)) -#define LIB9P_O_WRITE ((lib9p_o_t)(1)) -#define LIB9P_O_RDWR ((lib9p_o_t)(2)) -#define LIB9P_O_EXEC ((lib9p_o_t)(3)) -#define LIB9P_O_MODE_MASK ((lib9p_o_t)(0b00000011)) -#define LIB9P_O_FLAG_MASK ((lib9p_o_t)(0b11111100)) +/* unused ((lib9p_o_t)(1<<7)) */ +#define LIB9P_O_RCLOSE ((lib9p_o_t)(1<<6)) +#define _LIB9P_O_RESERVED_CEXEC ((lib9p_o_t)(1<<5)) +#define LIB9P_O_TRUNC ((lib9p_o_t)(1<<4)) +/* unused ((lib9p_o_t)(1<<3)) */ +/* unused ((lib9p_o_t)(1<<2)) */ +#define _LIB9P_O_mode_1 ((lib9p_o_t)(1<<1)) +#define _LIB9P_O_mode_0 ((lib9p_o_t)(1<<0)) + +#define LIB9P_O_READ ((lib9p_o_t)(0)) +#define LIB9P_O_WRITE ((lib9p_o_t)(1)) +#define LIB9P_O_RDWR ((lib9p_o_t)(2)) +#define LIB9P_O_EXEC ((lib9p_o_t)(3)) +#define LIB9P_O_MODE_MASK ((lib9p_o_t)(0b00000011)) +#define LIB9P_O_FLAG_MASK ((lib9p_o_t)(0b11111100)) #endif /* CONFIG_9P_ENABLE_9P2000 || CONFIG_9P_ENABLE_9P2000_e || CONFIG_9P_ENABLE_9P2000_p9p || CONFIG_9P_ENABLE_9P2000_u */ #if CONFIG_9P_ENABLE_9P2000_L diff --git a/lib9p/include/lib9p/9p.h b/lib9p/include/lib9p/9p.h index 44b5410..4ecb172 100644 --- a/lib9p/include/lib9p/9p.h +++ b/lib9p/include/lib9p/9p.h @@ -139,12 +139,11 @@ bool lib9p_Rmsg_marshal(struct lib9p_ctx *ctx, enum lib9p_msg_type typ, void *bo /** Assert that a `struct lib9p_stat` object looks valid. */ static inline void lib9p_stat_assert(struct lib9p_stat stat) { - assert( ((bool)(stat.file_mode & LIB9P_DM_DIR )) == ((bool)(stat.file_qid.type & LIB9P_QT_DIR )) ); - assert( ((bool)(stat.file_mode & LIB9P_DM_APPEND )) == ((bool)(stat.file_qid.type & LIB9P_QT_APPEND )) ); - assert( ((bool)(stat.file_mode & LIB9P_DM_EXCL )) == ((bool)(stat.file_qid.type & LIB9P_QT_EXCL )) ); - assert( ((bool)(stat.file_mode & _LIB9P_DM_PLAN9_MOUNT)) == ((bool)(stat.file_qid.type & _LIB9P_QT_PLAN9_MOUNT)) ); - assert( ((bool)(stat.file_mode & LIB9P_DM_AUTH )) == ((bool)(stat.file_qid.type & LIB9P_QT_AUTH )) ); - assert( ((bool)(stat.file_mode & LIB9P_DM_TMP )) == ((bool)(stat.file_qid.type & LIB9P_QT_TMP )) ); + assert( ((bool)(stat.file_mode & LIB9P_DM_DIR )) == ((bool)(stat.file_qid.type & LIB9P_QT_DIR )) ); + assert( ((bool)(stat.file_mode & LIB9P_DM_APPEND)) == ((bool)(stat.file_qid.type & LIB9P_QT_APPEND)) ); + assert( ((bool)(stat.file_mode & LIB9P_DM_EXCL )) == ((bool)(stat.file_qid.type & LIB9P_QT_EXCL )) ); + assert( ((bool)(stat.file_mode & LIB9P_DM_AUTH )) == ((bool)(stat.file_qid.type & LIB9P_QT_AUTH )) ); + assert( ((bool)(stat.file_mode & LIB9P_DM_TMP )) == ((bool)(stat.file_qid.type & LIB9P_QT_TMP )) ); assert( (stat.file_size == 0) || !(stat.file_mode & LIB9P_DM_DIR) ); } |