3 #include <sys/dirent.h>
7 extern struct fs_info *this_fs;
10 * open dir, return the file structure pointer in _eax_, or NULL if failed
12 void opendir(com32sys_t *regs)
14 char *src = MK_PTR(regs->es, regs->esi.w[0]);
15 char *dst = MK_PTR(regs->ds, regs->edi.w[0]);
18 regs->eax.l = (uint32_t)handle_to_file(regs->esi.w[0]);
22 * Read one dirent at one time.
24 * @input: _esi_ register stores the address of DIR structure
25 * @output: _eax_ register stores the address of newly read dirent structure
27 void readdir(com32sys_t *regs)
29 DIR *dir = (DIR *)regs->esi.l;
30 struct dirent *de = NULL;
33 de = this_fs->fs_ops->readdir(dir->dd_dir);
37 /* Return the newly read de in _eax_ register */
38 regs->eax.l = (uint32_t)de;
41 void closedir(com32sys_t *regs)
43 DIR *dir = (DIR *)regs->esi.l;
44 _close_file(dir->dd_dir);