1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-22 22:04:08 +03:00

build: Remove SMB_STRUCT_DIRENT define

This commit is contained in:
Andrew Bartlett 2012-03-28 13:18:14 +11:00
parent 6edd8e95f1
commit 2320b2144f
22 changed files with 54 additions and 62 deletions

View File

@ -99,7 +99,7 @@ static SMB_STRUCT_DIR *skel_fdopendir(vfs_handle_struct *handle, files_struct *f
return NULL;
}
static SMB_STRUCT_DIRENT *skel_readdir(vfs_handle_struct *handle,
static struct dirent *skel_readdir(vfs_handle_struct *handle,
SMB_STRUCT_DIR *dirp,
SMB_STRUCT_STAT *sbuf)
{

View File

@ -96,7 +96,7 @@ static SMB_STRUCT_DIR *skel_fdopendir(vfs_handle_struct *handle, files_struct *f
return SMB_VFS_NEXT_FDOPENDIR(handle, fsp, mask, attr);
}
static SMB_STRUCT_DIRENT *skel_readdir(vfs_handle_struct *handle,
static struct dirent *skel_readdir(vfs_handle_struct *handle,
SMB_STRUCT_DIR *dirp,
SMB_STRUCT_STAT *sbuf)
{

View File

@ -488,7 +488,7 @@ static NTSTATUS gp_glob_ext_list(TALLOC_CTX *mem_ctx,
size_t *ext_list_len)
{
SMB_STRUCT_DIR *dir = NULL;
SMB_STRUCT_DIRENT *dirent = NULL;
struct dirent *dirent = NULL;
dir = opendir(modules_path(talloc_tos(),
SAMBA_SUBSYSTEM_GPEXT));

View File

@ -367,14 +367,6 @@ struct stat_ex {
typedef struct stat_ex SMB_STRUCT_STAT;
/*
* Type for dirent structure.
*/
#ifndef SMB_STRUCT_DIRENT
# define SMB_STRUCT_DIRENT struct dirent
#endif
/*
* Type for DIR structure.
*/

View File

@ -206,7 +206,7 @@ struct vfs_fn_pointers {
SMB_STRUCT_DIR *(*opendir_fn)(struct vfs_handle_struct *handle, const char *fname, const char *mask, uint32 attributes);
SMB_STRUCT_DIR *(*fdopendir_fn)(struct vfs_handle_struct *handle, files_struct *fsp, const char *mask, uint32 attributes);
SMB_STRUCT_DIRENT *(*readdir_fn)(struct vfs_handle_struct *handle,
struct dirent *(*readdir_fn)(struct vfs_handle_struct *handle,
SMB_STRUCT_DIR *dirp,
SMB_STRUCT_STAT *sbuf);
void (*seekdir_fn)(struct vfs_handle_struct *handle, SMB_STRUCT_DIR *dirp, long offset);
@ -560,7 +560,7 @@ SMB_STRUCT_DIR *smb_vfs_call_fdopendir(struct vfs_handle_struct *handle,
struct files_struct *fsp,
const char *mask,
uint32 attributes);
SMB_STRUCT_DIRENT *smb_vfs_call_readdir(struct vfs_handle_struct *handle,
struct dirent *smb_vfs_call_readdir(struct vfs_handle_struct *handle,
SMB_STRUCT_DIR *dirp,
SMB_STRUCT_STAT *sbuf);
void smb_vfs_call_seekdir(struct vfs_handle_struct *handle,

View File

@ -1031,13 +1031,13 @@ libunwind_failed:
const char *readdirname(SMB_STRUCT_DIR *p)
{
SMB_STRUCT_DIRENT *ptr;
struct dirent *ptr;
char *dname;
if (!p)
return(NULL);
ptr = (SMB_STRUCT_DIRENT *)readdir(p);
ptr = (struct dirent *)readdir(p);
if (!ptr)
return(NULL);

View File

@ -28,7 +28,7 @@ SMB_STRUCT_DIR *onefs_opendir(struct vfs_handle_struct *handle,
const char *fname, const char *mask,
uint32 attributes);
SMB_STRUCT_DIRENT *onefs_readdir(struct vfs_handle_struct *handle,
struct dirent *onefs_readdir(struct vfs_handle_struct *handle,
SMB_STRUCT_DIR *dirp, SMB_STRUCT_STAT *sbuf);
void onefs_seekdir(struct vfs_handle_struct *handle, SMB_STRUCT_DIR *dirp,

View File

@ -296,12 +296,12 @@ onefs_opendir(vfs_handle_struct *handle, const char *fname, const char *mask,
*
* @return dirent structure, NULL if at the end of the directory, NULL on error
*/
SMB_STRUCT_DIRENT *
struct dirent *
onefs_readdir(vfs_handle_struct *handle, SMB_STRUCT_DIR *dirp,
SMB_STRUCT_STAT *sbuf)
{
struct rdp_dir_state *dsp = NULL;
SMB_STRUCT_DIRENT *ret_direntp;
struct dirent *ret_direntp;
bool same_as_last, filled_cache = false;
int ret = -1;
@ -355,7 +355,7 @@ onefs_readdir(vfs_handle_struct *handle, SMB_STRUCT_DIR *dirp,
* our cursor, then return the next entry */
if (!filled_cache) {
dsp->direntries_cursor +=
((SMB_STRUCT_DIRENT *)dsp->direntries_cursor)->d_reclen;
((struct dirent *)dsp->direntries_cursor)->d_reclen;
dsp->stat_cursor++;
}
@ -366,7 +366,7 @@ onefs_readdir(vfs_handle_struct *handle, SMB_STRUCT_DIR *dirp,
dsp->resume_cookie = rdp_cookies[dsp->stat_cursor];
/* Return an entry from cache */
ret_direntp = ((SMB_STRUCT_DIRENT *)dsp->direntries_cursor);
ret_direntp = ((struct dirent *)dsp->direntries_cursor);
if (sbuf) {
struct stat onefs_sbuf;

View File

@ -584,7 +584,7 @@ static NTSTATUS walk_onefs_streams(connection_struct *conn, files_struct *fsp,
int stream_fd = -1;
int ret;
SMB_STRUCT_DIR *dirp = NULL;
SMB_STRUCT_DIRENT *dp = NULL;
struct dirent *dp = NULL;
files_struct fake_fs;
struct fd_handle fake_fh;
SMB_STRUCT_STAT stream_sbuf;

View File

@ -54,12 +54,12 @@ static SMB_STRUCT_DIR *cap_opendir(vfs_handle_struct *handle, const char *fname,
return SMB_VFS_NEXT_OPENDIR(handle, capname, mask, attr);
}
static SMB_STRUCT_DIRENT *cap_readdir(vfs_handle_struct *handle,
static struct dirent *cap_readdir(vfs_handle_struct *handle,
SMB_STRUCT_DIR *dirp,
SMB_STRUCT_STAT *sbuf)
{
SMB_STRUCT_DIRENT *result;
SMB_STRUCT_DIRENT *newdirent;
struct dirent *result;
struct dirent *newdirent;
char *newname;
size_t newnamelen;
DEBUG(3,("cap: cap_readdir\n"));
@ -75,14 +75,14 @@ static SMB_STRUCT_DIRENT *cap_readdir(vfs_handle_struct *handle,
}
DEBUG(3,("cap: cap_readdir: %s\n", newname));
newnamelen = strlen(newname)+1;
newdirent = (SMB_STRUCT_DIRENT *)talloc_array(talloc_tos(),
newdirent = (struct dirent *)talloc_array(talloc_tos(),
char,
sizeof(SMB_STRUCT_DIRENT)+
sizeof(struct dirent)+
newnamelen);
if (!newdirent) {
return NULL;
}
memcpy(newdirent, result, sizeof(SMB_STRUCT_DIRENT));
memcpy(newdirent, result, sizeof(struct dirent));
memcpy(&newdirent->d_name, newname, newnamelen);
return newdirent;
}

View File

@ -367,11 +367,11 @@ static SMB_STRUCT_DIR *vfswrap_fdopendir(vfs_handle_struct *handle,
}
static SMB_STRUCT_DIRENT *vfswrap_readdir(vfs_handle_struct *handle,
static struct dirent *vfswrap_readdir(vfs_handle_struct *handle,
SMB_STRUCT_DIR *dirp,
SMB_STRUCT_STAT *sbuf)
{
SMB_STRUCT_DIRENT *result;
struct dirent *result;
START_PROFILE(syscall_readdir);
result = readdir(dirp);

View File

@ -22,14 +22,14 @@
#include "smbd/smbd.h"
#include "system/filesys.h"
static int compare_dirent (const SMB_STRUCT_DIRENT *da, const SMB_STRUCT_DIRENT *db)
static int compare_dirent (const struct dirent *da, const struct dirent *db)
{
return strcasecmp_m(da->d_name, db->d_name);
}
struct dirsort_privates {
long pos;
SMB_STRUCT_DIRENT *directory_list;
struct dirent *directory_list;
long number_of_entries;
time_t mtime;
SMB_STRUCT_DIR *source_directory;
@ -47,7 +47,7 @@ static void free_dirsort_privates(void **datap) {
static bool open_and_sort_dir (vfs_handle_struct *handle)
{
SMB_STRUCT_DIRENT *dp;
struct dirent *dp;
struct stat dir_stat;
long current_pos;
struct dirsort_privates *data = NULL;
@ -72,8 +72,8 @@ static bool open_and_sort_dir (vfs_handle_struct *handle)
/* Set up an array and read the directory entries into it */
SAFE_FREE(data->directory_list); /* destroy previous cache if needed */
data->directory_list = (SMB_STRUCT_DIRENT *)SMB_MALLOC(
data->number_of_entries * sizeof(SMB_STRUCT_DIRENT));
data->directory_list = (struct dirent *)SMB_MALLOC(
data->number_of_entries * sizeof(struct dirent));
if (!data->directory_list) {
return false;
}
@ -166,7 +166,7 @@ static SMB_STRUCT_DIR *dirsort_fdopendir(vfs_handle_struct *handle,
return data->source_directory;
}
static SMB_STRUCT_DIRENT *dirsort_readdir(vfs_handle_struct *handle,
static struct dirent *dirsort_readdir(vfs_handle_struct *handle,
SMB_STRUCT_DIR *dirp,
SMB_STRUCT_STAT *sbuf)
{

View File

@ -760,10 +760,10 @@ static SMB_STRUCT_DIR *smb_full_audit_fdopendir(vfs_handle_struct *handle,
return result;
}
static SMB_STRUCT_DIRENT *smb_full_audit_readdir(vfs_handle_struct *handle,
static struct dirent *smb_full_audit_readdir(vfs_handle_struct *handle,
SMB_STRUCT_DIR *dirp, SMB_STRUCT_STAT *sbuf)
{
SMB_STRUCT_DIRENT *result;
struct dirent *result;
result = SMB_VFS_NEXT_READDIR(handle, dirp, sbuf);

View File

@ -152,7 +152,7 @@ static void atalk_add_to_list(name_compare_entry **list)
static void atalk_rrmdir(TALLOC_CTX *ctx, char *path)
{
char *dpath;
SMB_STRUCT_DIRENT *dent = 0;
struct dirent *dent = 0;
SMB_STRUCT_DIR *dir;
if (!path) return;

View File

@ -446,7 +446,7 @@ static bool scannedonly_allow_access(vfs_handle_struct * handle,
/* check the rest of the directory and notify the
scanner if some file needs scanning */
long offset;
SMB_STRUCT_DIRENT *dire;
struct dirent *dire;
offset = SMB_VFS_NEXT_TELLDIR(handle, sDIR->DIR);
dire = SMB_VFS_NEXT_READDIR(handle, sDIR->DIR, NULL);
@ -560,17 +560,17 @@ static SMB_STRUCT_DIR *scannedonly_fdopendir(vfs_handle_struct * handle,
}
static SMB_STRUCT_DIRENT *scannedonly_readdir(vfs_handle_struct *handle,
static struct dirent *scannedonly_readdir(vfs_handle_struct *handle,
SMB_STRUCT_DIR * dirp,
SMB_STRUCT_STAT *sbuf)
{
SMB_STRUCT_DIRENT *result;
struct dirent *result;
int allowed = 0;
char *tmp;
struct smb_filename *smb_fname;
char *notify_name;
int namelen;
SMB_STRUCT_DIRENT *newdirent;
struct dirent *newdirent;
TALLOC_CTX *ctx=talloc_tos();
struct scannedonly_DIR *sDIR = (struct scannedonly_DIR *)dirp;
@ -634,12 +634,12 @@ static SMB_STRUCT_DIRENT *scannedonly_readdir(vfs_handle_struct *handle,
ctx,"%s %s",result->d_name,
STRUCTSCANO(handle->data)->scanning_message);
namelen = strlen(notify_name);
newdirent = (SMB_STRUCT_DIRENT *)talloc_array(
ctx, char, sizeof(SMB_STRUCT_DIRENT) + namelen + 1);
newdirent = (struct dirent *)talloc_array(
ctx, char, sizeof(struct dirent) + namelen + 1);
if (!newdirent) {
return NULL;
}
memcpy(newdirent, result, sizeof(SMB_STRUCT_DIRENT));
memcpy(newdirent, result, sizeof(struct dirent));
memcpy(&newdirent->d_name, notify_name, namelen + 1);
DEBUG(SCANNEDONLY_DEBUG,
("scannedonly_readdir, return newdirent at %p with "
@ -860,7 +860,7 @@ static int scannedonly_rmdir(vfs_handle_struct * handle, const char *path)
/* if there are only .scanned: .virus: or .failed: files, we delete
those, because the client cannot see them */
DIR *dirp;
SMB_STRUCT_DIRENT *dire;
struct dirent *dire;
TALLOC_CTX *ctx = talloc_tos();
bool only_deletable_files = true, have_files = false;
char *path_w_slash;

View File

@ -60,7 +60,7 @@ static int vfs_shadow_copy_debug_level = DBGC_VFS;
typedef struct {
int pos;
int num;
SMB_STRUCT_DIRENT *dirs;
struct dirent *dirs;
} shadow_copy_Dir;
static bool shadow_copy_match_name(const char *name)
@ -93,7 +93,7 @@ static SMB_STRUCT_DIR *shadow_copy_opendir(vfs_handle_struct *handle, const char
ZERO_STRUCTP(dirp);
while (True) {
SMB_STRUCT_DIRENT *d;
struct dirent *d;
d = SMB_VFS_NEXT_READDIR(handle, p, NULL);
if (d == NULL) {
@ -107,7 +107,7 @@ static SMB_STRUCT_DIR *shadow_copy_opendir(vfs_handle_struct *handle, const char
DEBUG(10,("shadow_copy_opendir: not hide [%s]\n",d->d_name));
dirp->dirs = SMB_REALLOC_ARRAY(dirp->dirs,SMB_STRUCT_DIRENT, dirp->num+1);
dirp->dirs = SMB_REALLOC_ARRAY(dirp->dirs,struct dirent, dirp->num+1);
if (!dirp->dirs) {
DEBUG(0,("shadow_copy_opendir: Out of memory\n"));
break;
@ -143,7 +143,7 @@ static SMB_STRUCT_DIR *shadow_copy_fdopendir(vfs_handle_struct *handle, files_st
ZERO_STRUCTP(dirp);
while (True) {
SMB_STRUCT_DIRENT *d;
struct dirent *d;
d = SMB_VFS_NEXT_READDIR(handle, p, NULL);
if (d == NULL) {
@ -157,7 +157,7 @@ static SMB_STRUCT_DIR *shadow_copy_fdopendir(vfs_handle_struct *handle, files_st
DEBUG(10,("shadow_copy_fdopendir: not hide [%s]\n",d->d_name));
dirp->dirs = SMB_REALLOC_ARRAY(dirp->dirs,SMB_STRUCT_DIRENT, dirp->num+1);
dirp->dirs = SMB_REALLOC_ARRAY(dirp->dirs,struct dirent, dirp->num+1);
if (!dirp->dirs) {
DEBUG(0,("shadow_copy_fdopendir: Out of memory\n"));
break;
@ -172,7 +172,7 @@ static SMB_STRUCT_DIR *shadow_copy_fdopendir(vfs_handle_struct *handle, files_st
return((SMB_STRUCT_DIR *)dirp);
}
static SMB_STRUCT_DIRENT *shadow_copy_readdir(vfs_handle_struct *handle,
static struct dirent *shadow_copy_readdir(vfs_handle_struct *handle,
SMB_STRUCT_DIR *_dirp,
SMB_STRUCT_STAT *sbuf)
{
@ -233,7 +233,7 @@ static int shadow_copy_get_shadow_copy_data(vfs_handle_struct *handle,
while (True) {
SHADOW_COPY_LABEL *tlabels;
SMB_STRUCT_DIRENT *d;
struct dirent *d;
d = SMB_VFS_NEXT_READDIR(handle, p, NULL);
if (d == NULL) {

View File

@ -1078,7 +1078,7 @@ static int shadow_copy2_get_shadow_copy_data(
{
SMB_STRUCT_DIR *p;
const char *snapdir;
SMB_STRUCT_DIRENT *d;
struct dirent *d;
TALLOC_CTX *tmp_ctx = talloc_stackframe();
snapdir = shadow_copy2_find_snapdir(tmp_ctx, handle, fsp->fsp_name);

View File

@ -243,11 +243,11 @@ static SMB_STRUCT_DIR *smb_time_audit_fdopendir(vfs_handle_struct *handle,
return result;
}
static SMB_STRUCT_DIRENT *smb_time_audit_readdir(vfs_handle_struct *handle,
static struct dirent *smb_time_audit_readdir(vfs_handle_struct *handle,
SMB_STRUCT_DIR *dirp,
SMB_STRUCT_STAT *sbuf)
{
SMB_STRUCT_DIRENT *result;
struct dirent *result;
struct timespec ts1,ts2;
double timediff;

View File

@ -8734,7 +8734,7 @@ int load_usershare_shares(struct smbd_server_connection *sconn,
{
SMB_STRUCT_DIR *dp;
SMB_STRUCT_STAT sbuf;
SMB_STRUCT_DIRENT *de;
struct dirent *de;
int num_usershares = 0;
int max_user_shares = Globals.iUsershareMaxShares;
unsigned int num_dir_entries, num_bad_dir_entries, num_tmp_dir_entries;

View File

@ -721,7 +721,7 @@ SMB_OFF_T vfs_transfer_file(files_struct *in, files_struct *out, SMB_OFF_T n)
const char *vfs_readdirname(connection_struct *conn, void *p,
SMB_STRUCT_STAT *sbuf, char **talloced)
{
SMB_STRUCT_DIRENT *ptr= NULL;
struct dirent *ptr= NULL;
const char *dname;
char *translated;
NTSTATUS status;
@ -1405,7 +1405,7 @@ SMB_STRUCT_DIR *smb_vfs_call_fdopendir(struct vfs_handle_struct *handle,
return handle->fns->fdopendir_fn(handle, fsp, mask, attributes);
}
SMB_STRUCT_DIRENT *smb_vfs_call_readdir(struct vfs_handle_struct *handle,
struct dirent *smb_vfs_call_readdir(struct vfs_handle_struct *handle,
SMB_STRUCT_DIR *dirp,
SMB_STRUCT_STAT *sbuf)
{

View File

@ -146,7 +146,7 @@ static NTSTATUS cmd_opendir(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc
static NTSTATUS cmd_readdir(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc, const char **argv)
{
SMB_STRUCT_STAT st;
SMB_STRUCT_DIRENT *dent = NULL;
struct dirent *dent = NULL;
if (vfs->currentdir == NULL) {
printf("readdir: error=-1 (no open directory)\n");

View File

@ -209,7 +209,7 @@ static struct file_list *flist;
static int get_share_list(TALLOC_CTX *ctx, const char *wcard, bool only_ours)
{
SMB_STRUCT_DIR *dp;
SMB_STRUCT_DIRENT *de;
struct dirent *de;
uid_t myuid = geteuid();
struct file_list *fl = NULL;
char *basepath = get_basepath(ctx);
@ -547,7 +547,7 @@ static int net_usershare_info(struct net_context *c, int argc, const char **argv
static int count_num_usershares(void)
{
SMB_STRUCT_DIR *dp;
SMB_STRUCT_DIRENT *de;
struct dirent *de;
int num_usershares = 0;
TALLOC_CTX *ctx = talloc_tos();
char *basepath = get_basepath(ctx);