diff options
Diffstat (limited to 'lib9p/srv_include')
-rw-r--r-- | lib9p/srv_include/lib9p/srv.h | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/lib9p/srv_include/lib9p/srv.h b/lib9p/srv_include/lib9p/srv.h index 0ef674a..1c534e9 100644 --- a/lib9p/srv_include/lib9p/srv.h +++ b/lib9p/srv_include/lib9p/srv.h @@ -71,6 +71,11 @@ void lib9p_srv_acknowledge_flush(struct lib9p_srv_ctx *ctx); /* interface definitions ******************************************************/ +struct lib9p_srv_dirent { + struct lib9p_qid qid; + struct lib9p_s name; +}; + lo_interface lib9p_srv_fio; lo_interface lib9p_srv_dio; @@ -146,20 +151,16 @@ LO_INTERFACE(lib9p_srv_file); uint64_t byte_offset) LO_INTERFACE(lib9p_srv_fio); -/* FIXME: The dio interface just feels clunky. I'm not in a rush to - * change it because util9p_static_dir is already implemented and I - * don't anticipate the sbc-harness needing another dio - * implementation. But if I wanted lib9p to be used outside of - * sbc-harness, this is one of the first things that I'd want to - * change. - */ #define lib9p_srv_dio_LO_IFACE \ LO_FUNC(struct lib9p_qid , qid ) \ LO_FUNC(void , iofree ) \ - LO_FUNC(size_t /* <- obj cnt */ , dread , struct lib9p_srv_ctx *, \ - uint8_t *buf, \ - /* num bytes -> */ uint32_t byte_count, \ - /* starting at this object -> */ size_t obj_offset) + /** \ + * Return the idx-th dirent. idx will always be either 0 or \ + * prev_idx+1. A dirrent with an empty name signals EOF. The string + * must remain valid until the next dread() call or iofree(). \ + */ \ + LO_FUNC(struct lib9p_srv_dirent , dread , struct lib9p_srv_ctx *, \ + size_t idx) LO_INTERFACE(lib9p_srv_dio); #define LIB9P_SRV_NOTDIR(TYP, NAM) \ |