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
c24028b1
Commit
c24028b1
authored
Nov 03, 2010
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Win32: pack vlc_DIR
parent
3a6e6558
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
18 deletions
+20
-18
src/win32/filesystem.c
src/win32/filesystem.c
+20
-18
No files found.
src/win32/filesystem.c
View file @
c24028b1
...
...
@@ -112,9 +112,12 @@ int vlc_mkdir( const char *dirname, mode_t mode )
* when called with an empty argument or just '\'. */
typedef
struct
vlc_DIR
{
_WDIR
*
p_real_dir
;
int
i_drives
;
bool
b_insert_back
;
_WDIR
*
wdir
;
/* MUST be first, see <vlc_fs.h> */
union
{
DWORD
drives
;
bool
insert_dot_dot
;
}
u
;
}
vlc_DIR
;
...
...
@@ -130,26 +133,25 @@ DIR *vlc_opendir (const char *dirname)
||
(
wcscmp
(
wpath
,
L"
\\
"
)
==
0
))
{
/* Special mode to list drive letters */
p_dir
->
p_real_
dir
=
NULL
;
p_dir
->
w
dir
=
NULL
;
#ifdef UNDER_CE
p_dir
->
i_
drives
=
1
;
p_dir
->
u
.
drives
=
1
;
#else
p_dir
->
i_
drives
=
GetLogicalDrives
();
p_dir
->
u
.
drives
=
GetLogicalDrives
();
#endif
return
(
void
*
)
p_dir
;
}
_WDIR
*
p_real_
dir
=
_wopendir
(
wpath
);
if
(
p_real_
dir
==
NULL
)
_WDIR
*
w
dir
=
_wopendir
(
wpath
);
if
(
w
dir
==
NULL
)
{
free
(
p_dir
);
return
NULL
;
}
p_dir
->
p_real_dir
=
p_real_dir
;
p_dir
->
wdir
=
wdir
;
assert
(
wpath
[
0
]);
// wpath[1] is defined
p_dir
->
b_insert_back
=
!
wcscmp
(
wpath
+
1
,
L":
\\
"
);
p_dir
->
u
.
insert_dot_dot
=
!
wcscmp
(
wpath
+
1
,
L":
\\
"
);
return
(
void
*
)
p_dir
;
}
...
...
@@ -157,20 +159,20 @@ char *vlc_readdir (DIR *dir)
{
vlc_DIR
*
p_dir
=
(
vlc_DIR
*
)
dir
;
if
(
p_dir
->
p_real_
dir
==
NULL
)
if
(
p_dir
->
w
dir
==
NULL
)
{
/* Drive letters mode */
DWORD
drives
=
p_dir
->
i_
drives
;
DWORD
drives
=
p_dir
->
u
.
drives
;
if
(
drives
==
0
)
return
NULL
;
/* end */
#ifdef UNDER_CE
p_dir
->
i_
drives
=
0
;
p_dir
->
u
.
drives
=
0
;
return
strdup
(
"
\\
"
);
#else
unsigned
int
i
;
for
(
i
=
0
;
!
(
drives
&
1
);
i
++
)
drives
>>=
1
;
p_dir
->
i_
drives
&=
~
(
1UL
<<
i
);
p_dir
->
u
.
drives
&=
~
(
1UL
<<
i
);
assert
(
i
<
26
);
char
*
ret
;
...
...
@@ -180,14 +182,14 @@ char *vlc_readdir (DIR *dir)
#endif
}
if
(
p_dir
->
b_insert_back
)
if
(
p_dir
->
u
.
insert_dot_dot
)
{
/* Adds "..", gruik! */
p_dir
->
b_insert_back
=
false
;
p_dir
->
u
.
insert_dot_dot
=
false
;
return
strdup
(
".."
);
}
struct
_wdirent
*
ent
=
_wreaddir
(
p_dir
->
p_real_
dir
);
struct
_wdirent
*
ent
=
_wreaddir
(
p_dir
->
w
dir
);
if
(
ent
==
NULL
)
return
NULL
;
return
FromWide
(
ent
->
d_name
);
...
...
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