Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
d9bb7326
Commit
d9bb7326
authored
Dec 12, 2004
by
Eric Petit
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
access/directory.c: BeOS doesn't have scandir(), added a quick emulation
parent
9de73f42
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
54 additions
and
3 deletions
+54
-3
modules/access/directory.c
modules/access/directory.c
+54
-3
No files found.
modules/access/directory.c
View file @
d9bb7326
...
...
@@ -338,7 +338,58 @@ static int DemuxControl( demux_t *p_demux, int i_query, va_list args )
i_query
,
args
);
}
static
int
Filter
(
struct
direct
*
foo
)
#ifdef SYS_BEOS
/* BeOS doesn't have scandir/alphasort/versionsort */
static
int
alphasort
(
const
struct
dirent
**
a
,
const
struct
dirent
**
b
)
{
return
strcoll
(
(
*
a
)
->
d_name
,
(
*
b
)
->
d_name
);
}
static
int
scandir
(
const
char
*
name
,
struct
dirent
***
namelist
,
int
(
*
filter
)
(
const
struct
dirent
*
),
int
(
*
compar
)
(
const
struct
dirent
**
,
const
struct
dirent
**
)
)
{
DIR
*
p_dir
;
struct
dirent
*
p_content
;
struct
dirent
**
pp_list
;
int
ret
,
size
;
if
(
!
namelist
||
!
(
p_dir
=
opendir
(
name
)
)
)
{
return
-
1
;
}
ret
=
0
;
pp_list
=
NULL
;
while
(
(
p_content
=
readdir
(
p_dir
)
)
)
{
if
(
filter
&&
!
filter
(
p_content
)
)
{
continue
;
}
pp_list
=
realloc
(
pp_list
,
(
ret
+
1
)
*
sizeof
(
struct
dirent
*
)
);
size
=
sizeof
(
struct
dirent
)
+
strlen
(
p_content
->
d_name
)
+
1
;
pp_list
[
ret
]
=
malloc
(
size
);
memcpy
(
pp_list
[
ret
],
p_content
,
size
);
ret
++
;
}
closedir
(
p_dir
);
if
(
compar
)
{
qsort
(
pp_list
,
ret
,
sizeof
(
struct
dirent
*
),
(
int
(
*
)(
const
void
*
,
const
void
*
))
compar
);
}
*
namelist
=
pp_list
;
return
ret
;
}
#endif
static
int
Filter
(
const
struct
dirent
*
foo
)
{
return
VLC_TRUE
;
}
...
...
@@ -349,7 +400,6 @@ static int ReadDir( playlist_t *p_playlist,
char
*
psz_name
,
int
i_mode
,
int
*
pi_position
,
playlist_item_t
*
p_parent
)
{
DIR
*
p_current_dir
;
struct
dirent
*
p_dir_content
;
struct
dirent
**
pp_dir_content
;
int
i_dir_content
;
...
...
@@ -396,7 +446,8 @@ static int ReadDir( playlist_t *p_playlist,
if
(
i_mode
==
MODE_NONE
)
{
msg_Dbg
(
p_playlist
,
"Skipping subdirectory %s"
,
psz_uri
);
p_dir_content
=
readdir
(
p_current_dir
);
i
++
;
p_dir_content
=
pp_dir_content
[
i
];
continue
;
}
else
if
(
i_mode
==
MODE_EXPAND
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment