Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
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
Show 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 )
...
@@ -112,9 +112,12 @@ int vlc_mkdir( const char *dirname, mode_t mode )
* when called with an empty argument or just '\'. */
* when called with an empty argument or just '\'. */
typedef
struct
vlc_DIR
typedef
struct
vlc_DIR
{
{
_WDIR
*
p_real_dir
;
_WDIR
*
wdir
;
/* MUST be first, see <vlc_fs.h> */
int
i_drives
;
union
bool
b_insert_back
;
{
DWORD
drives
;
bool
insert_dot_dot
;
}
u
;
}
vlc_DIR
;
}
vlc_DIR
;
...
@@ -130,26 +133,25 @@ DIR *vlc_opendir (const char *dirname)
...
@@ -130,26 +133,25 @@ DIR *vlc_opendir (const char *dirname)
||
(
wcscmp
(
wpath
,
L"
\\
"
)
==
0
))
||
(
wcscmp
(
wpath
,
L"
\\
"
)
==
0
))
{
{
/* Special mode to list drive letters */
/* Special mode to list drive letters */
p_dir
->
p_real_
dir
=
NULL
;
p_dir
->
w
dir
=
NULL
;
#ifdef UNDER_CE
#ifdef UNDER_CE
p_dir
->
i_
drives
=
1
;
p_dir
->
u
.
drives
=
1
;
#else
#else
p_dir
->
i_
drives
=
GetLogicalDrives
();
p_dir
->
u
.
drives
=
GetLogicalDrives
();
#endif
#endif
return
(
void
*
)
p_dir
;
return
(
void
*
)
p_dir
;
}
}
_WDIR
*
p_real_
dir
=
_wopendir
(
wpath
);
_WDIR
*
w
dir
=
_wopendir
(
wpath
);
if
(
p_real_
dir
==
NULL
)
if
(
w
dir
==
NULL
)
{
{
free
(
p_dir
);
free
(
p_dir
);
return
NULL
;
return
NULL
;
}
}
p_dir
->
p_real_dir
=
p_real_dir
;
p_dir
->
wdir
=
wdir
;
assert
(
wpath
[
0
]);
// wpath[1] is defined
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
;
return
(
void
*
)
p_dir
;
}
}
...
@@ -157,20 +159,20 @@ char *vlc_readdir (DIR *dir)
...
@@ -157,20 +159,20 @@ char *vlc_readdir (DIR *dir)
{
{
vlc_DIR
*
p_dir
=
(
vlc_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 */
/* Drive letters mode */
DWORD
drives
=
p_dir
->
i_
drives
;
DWORD
drives
=
p_dir
->
u
.
drives
;
if
(
drives
==
0
)
if
(
drives
==
0
)
return
NULL
;
/* end */
return
NULL
;
/* end */
#ifdef UNDER_CE
#ifdef UNDER_CE
p_dir
->
i_
drives
=
0
;
p_dir
->
u
.
drives
=
0
;
return
strdup
(
"
\\
"
);
return
strdup
(
"
\\
"
);
#else
#else
unsigned
int
i
;
unsigned
int
i
;
for
(
i
=
0
;
!
(
drives
&
1
);
i
++
)
for
(
i
=
0
;
!
(
drives
&
1
);
i
++
)
drives
>>=
1
;
drives
>>=
1
;
p_dir
->
i_
drives
&=
~
(
1UL
<<
i
);
p_dir
->
u
.
drives
&=
~
(
1UL
<<
i
);
assert
(
i
<
26
);
assert
(
i
<
26
);
char
*
ret
;
char
*
ret
;
...
@@ -180,14 +182,14 @@ char *vlc_readdir (DIR *dir)
...
@@ -180,14 +182,14 @@ char *vlc_readdir (DIR *dir)
#endif
#endif
}
}
if
(
p_dir
->
b_insert_back
)
if
(
p_dir
->
u
.
insert_dot_dot
)
{
{
/* Adds "..", gruik! */
/* Adds "..", gruik! */
p_dir
->
b_insert_back
=
false
;
p_dir
->
u
.
insert_dot_dot
=
false
;
return
strdup
(
".."
);
return
strdup
(
".."
);
}
}
struct
_wdirent
*
ent
=
_wreaddir
(
p_dir
->
p_real_
dir
);
struct
_wdirent
*
ent
=
_wreaddir
(
p_dir
->
w
dir
);
if
(
ent
==
NULL
)
if
(
ent
==
NULL
)
return
NULL
;
return
NULL
;
return
FromWide
(
ent
->
d_name
);
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