diff options
author | Andrew Tridgell <tridge@samba.org> | 2004-10-26 11:11:16 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:04:47 -0500 |
commit | e767d8d1b2c1e86e48d827f10f1773b0dab8e565 (patch) | |
tree | 7881983a13760cfb7e429af2a79cb033d1f88733 /source4/ntvfs/posix/pvfs_dirlist.c | |
parent | 991588e70cf717fb1e9267defb9b14e949a70230 (diff) | |
download | samba-e767d8d1b2c1e86e48d827f10f1773b0dab8e565.tar.gz samba-e767d8d1b2c1e86e48d827f10f1773b0dab8e565.tar.bz2 samba-e767d8d1b2c1e86e48d827f10f1773b0dab8e565.zip |
r3260: redid the pvfs_dirlist() interface in preparation for a "keep
directory open" implementation, as opposed to the "load the whole
directory" interface used now. This will be needed to pass RAW-SEARCH
(This used to be commit 692623c6c0a2c6817fddfa77cd1c2525c27145c4)
Diffstat (limited to 'source4/ntvfs/posix/pvfs_dirlist.c')
-rw-r--r-- | source4/ntvfs/posix/pvfs_dirlist.c | 40 |
1 files changed, 37 insertions, 3 deletions
diff --git a/source4/ntvfs/posix/pvfs_dirlist.c b/source4/ntvfs/posix/pvfs_dirlist.c index 0482cda808..59e755d6ff 100644 --- a/source4/ntvfs/posix/pvfs_dirlist.c +++ b/source4/ntvfs/posix/pvfs_dirlist.c @@ -57,12 +57,11 @@ static NTSTATUS pvfs_list_no_wildcard(struct pvfs_state *pvfs, struct pvfs_filen } /* - read a directory and find all matching file names, returning them in - the structure *dir. The returned names are relative to the directory + start to read a directory if the pattern matches no files then we return NT_STATUS_OK, with dir->count = 0 */ -NTSTATUS pvfs_list(struct pvfs_state *pvfs, struct pvfs_filename *name, struct pvfs_dir *dir) +NTSTATUS pvfs_list_start(struct pvfs_state *pvfs, struct pvfs_filename *name, struct pvfs_dir *dir) { DIR *odir; struct dirent *dent; @@ -134,3 +133,38 @@ NTSTATUS pvfs_list(struct pvfs_state *pvfs, struct pvfs_filename *name, struct p return NT_STATUS_OK; } + +/* + return unix directory of an open search +*/ +const char *pvfs_list_unix_path(struct pvfs_dir *dir) +{ + return dir->unix_path; +} + +/* + return True if end of search has been reached +*/ +BOOL pvfs_list_eos(struct pvfs_dir *dir, uint_t ofs) +{ + return ofs >= dir->count; +} + +/* + return the next entry +*/ +const char *pvfs_list_next(struct pvfs_dir *dir, uint_t ofs) +{ + if (ofs >= dir->count) return NULL; + return dir->names[ofs]; +} + +/* + seek to the given name +*/ +uint_t pvfs_list_seek(struct pvfs_dir *dir, const char *name, uint_t ofs) +{ + /* not correct, needs to be replaced with real search when + DIR* implementation is done */ + return ofs; +} |