Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
fd976a60
Commit
fd976a60
authored
Aug 17, 2002
by
Jean-Paul Saman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added filetype information.
parent
4eb6d12b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
6 deletions
+34
-6
modules/gui/familiar/callbacks.c
modules/gui/familiar/callbacks.c
+34
-6
No files found.
modules/gui/familiar/callbacks.c
View file @
fd976a60
...
...
@@ -2,7 +2,7 @@
* callbacks.c : Callbacks for the Familiar Linux Gtk+ plugin.
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: callbacks.c,v 1.
4 2002/08/14 21:50:01
jpsaman Exp $
* $Id: callbacks.c,v 1.
5 2002/08/17 13:33:00
jpsaman Exp $
*
* Authors: Jean-Paul Saman <jpsaman@wxs.nl>
*
...
...
@@ -31,9 +31,11 @@
#include <vlc/intf.h>
#include <vlc/vout.h>
#include <
unistd
.h>
#include <
stdio
.h>
#include <string.h>
#include <dirent.h>
#include <sys/stat.h>
#include <unistd.h>
#ifdef HAVE_CONFIG_H
# include <config.h>
...
...
@@ -50,6 +52,7 @@
static
void
MediaURLOpenChanged
(
GtkWidget
*
widget
,
gchar
*
psz_url
);
static
void
PreferencesURLOpenChanged
(
GtkEditable
*
editable
,
gpointer
user_data
);
static
char
*
get_file_type
(
const
char
*
path
);
/*****************************************************************************
* Useful function to retrieve p_intf
...
...
@@ -122,6 +125,7 @@ static void PreferencesURLOpenChanged( GtkEditable *editable, gpointer user_data
****************************************************************/
void
ReadDirectory
(
GtkCList
*
clist
,
char
*
psz_dir
)
{
intf_thread_t
*
p_intf
=
GtkGetIntf
(
clist
);
struct
dirent
**
namelist
;
int
n
,
i
;
...
...
@@ -143,10 +147,9 @@ void ReadDirectory( GtkCList *clist, char *psz_dir)
{
/* This is a list of strings. */
ppsz_text
[
0
]
=
namelist
[
i
]
->
d_name
;
if
(
namelist
[
i
]
->
d_type
)
ppsz_text
[
1
]
=
"dir"
;
else
ppsz_text
[
1
]
=
"file"
;
ppsz_text
[
1
]
=
get_file_type
(
namelist
[
i
]
->
d_name
);
if
(
strcmp
(
ppsz_text
[
1
],
""
)
==
0
)
msg_Err
(
p_intf
->
p_sys
->
p_input
,
"File system error unknown filetype encountered."
);
gtk_clist_insert
(
clist
,
i
,
ppsz_text
);
free
(
namelist
[
i
]);
}
...
...
@@ -155,6 +158,31 @@ void ReadDirectory( GtkCList *clist, char *psz_dir)
}
}
static
char
*
get_file_type
(
const
char
*
path
)
{
struct
stat
st
;
if
(
lstat
(
path
,
&
st
)
==
0
)
{
if
(
S_ISLNK
(
st
.
st_mode
))
return
"link"
;
else
if
(
S_ISDIR
(
st
.
st_mode
))
return
"dir"
;
else
if
(
S_ISCHR
(
st
.
st_mode
))
return
"char device"
;
else
if
(
S_ISBLK
(
st
.
st_mode
))
return
"block device"
;
else
if
(
S_ISFIFO
(
st
.
st_mode
))
return
"fifo"
;
else
if
(
S_ISSOCK
(
st
.
st_mode
))
return
"socket"
;
else
if
(
S_ISREG
(
st
.
st_mode
))
return
"file"
;
else
/* Unknown type is an error */
return
""
;
}
return
""
;
}
/*
* Main interface callbacks
...
...
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