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
f7ee3edc
Commit
f7ee3edc
authored
Mar 11, 2012
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move vlc.misc.*dir to vlc.config.*dir
parent
8d37aa9a
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
86 additions
and
85 deletions
+86
-85
modules/lua/libs/configuration.c
modules/lua/libs/configuration.c
+69
-0
modules/lua/libs/misc.c
modules/lua/libs/misc.c
+0
-69
share/lua/README.txt
share/lua/README.txt
+8
-9
share/lua/intf/http.lua
share/lua/intf/http.lua
+1
-1
share/lua/intf/modules/httprequests.lua
share/lua/intf/modules/httprequests.lua
+1
-1
share/lua/intf/test.lua
share/lua/intf/test.lua
+7
-5
No files found.
modules/lua/libs/configuration.c
View file @
f7ee3edc
...
...
@@ -102,12 +102,81 @@ static int vlclua_config_set( lua_State *L )
return
0
;
}
/*****************************************************************************
* Directories configuration
*****************************************************************************/
static
int
vlclua_datadir
(
lua_State
*
L
)
{
char
*
psz_data
=
config_GetDataDir
(
vlclua_get_this
(
L
)
);
lua_pushstring
(
L
,
psz_data
);
free
(
psz_data
);
return
1
;
}
static
int
vlclua_userdatadir
(
lua_State
*
L
)
{
char
*
dir
=
config_GetUserDir
(
VLC_DATA_DIR
);
lua_pushstring
(
L
,
dir
);
free
(
dir
);
return
1
;
}
static
int
vlclua_homedir
(
lua_State
*
L
)
{
char
*
home
=
config_GetUserDir
(
VLC_HOME_DIR
);
lua_pushstring
(
L
,
home
);
free
(
home
);
return
1
;
}
static
int
vlclua_configdir
(
lua_State
*
L
)
{
char
*
dir
=
config_GetUserDir
(
VLC_CONFIG_DIR
);
lua_pushstring
(
L
,
dir
);
free
(
dir
);
return
1
;
}
static
int
vlclua_cachedir
(
lua_State
*
L
)
{
char
*
dir
=
config_GetUserDir
(
VLC_CACHE_DIR
);
lua_pushstring
(
L
,
dir
);
free
(
dir
);
return
1
;
}
static
int
vlclua_datadir_list
(
lua_State
*
L
)
{
const
char
*
psz_dirname
=
luaL_checkstring
(
L
,
1
);
char
**
ppsz_dir_list
=
NULL
;
int
i
=
1
;
if
(
vlclua_dir_list
(
vlclua_get_this
(
L
),
psz_dirname
,
&
ppsz_dir_list
)
!=
VLC_SUCCESS
)
return
0
;
lua_newtable
(
L
);
for
(
char
**
ppsz_dir
=
ppsz_dir_list
;
*
ppsz_dir
;
ppsz_dir
++
)
{
lua_pushstring
(
L
,
*
ppsz_dir
);
lua_rawseti
(
L
,
-
2
,
i
);
i
++
;
}
vlclua_dir_list_free
(
ppsz_dir_list
);
return
1
;
}
/*****************************************************************************
*
*****************************************************************************/
static
const
luaL_Reg
vlclua_config_reg
[]
=
{
{
"get"
,
vlclua_config_get
},
{
"set"
,
vlclua_config_set
},
{
"datadir"
,
vlclua_datadir
},
{
"userdatadir"
,
vlclua_userdatadir
},
{
"homedir"
,
vlclua_homedir
},
{
"configdir"
,
vlclua_configdir
},
{
"cachedir"
,
vlclua_cachedir
},
{
"datadir_list"
,
vlclua_datadir_list
},
{
NULL
,
NULL
}
};
...
...
modules/lua/libs/misc.c
View file @
f7ee3edc
...
...
@@ -132,68 +132,6 @@ static int vlclua_quit( lua_State *L )
return
0
;
}
/*****************************************************************************
* Global properties getters
*****************************************************************************/
static
int
vlclua_datadir
(
lua_State
*
L
)
{
char
*
psz_data
=
config_GetDataDir
(
vlclua_get_this
(
L
)
);
lua_pushstring
(
L
,
psz_data
);
free
(
psz_data
);
return
1
;
}
static
int
vlclua_userdatadir
(
lua_State
*
L
)
{
char
*
dir
=
config_GetUserDir
(
VLC_DATA_DIR
);
lua_pushstring
(
L
,
dir
);
free
(
dir
);
return
1
;
}
static
int
vlclua_homedir
(
lua_State
*
L
)
{
char
*
home
=
config_GetUserDir
(
VLC_HOME_DIR
);
lua_pushstring
(
L
,
home
);
free
(
home
);
return
1
;
}
static
int
vlclua_configdir
(
lua_State
*
L
)
{
char
*
dir
=
config_GetUserDir
(
VLC_CONFIG_DIR
);
lua_pushstring
(
L
,
dir
);
free
(
dir
);
return
1
;
}
static
int
vlclua_cachedir
(
lua_State
*
L
)
{
char
*
dir
=
config_GetUserDir
(
VLC_CACHE_DIR
);
lua_pushstring
(
L
,
dir
);
free
(
dir
);
return
1
;
}
static
int
vlclua_datadir_list
(
lua_State
*
L
)
{
const
char
*
psz_dirname
=
luaL_checkstring
(
L
,
1
);
char
**
ppsz_dir_list
=
NULL
;
int
i
=
1
;
if
(
vlclua_dir_list
(
vlclua_get_this
(
L
),
psz_dirname
,
&
ppsz_dir_list
)
!=
VLC_SUCCESS
)
return
0
;
lua_newtable
(
L
);
for
(
char
**
ppsz_dir
=
ppsz_dir_list
;
*
ppsz_dir
;
ppsz_dir
++
)
{
lua_pushstring
(
L
,
*
ppsz_dir
);
lua_rawseti
(
L
,
-
2
,
i
);
i
++
;
}
vlclua_dir_list_free
(
ppsz_dir_list
);
return
1
;
}
/*****************************************************************************
*
*****************************************************************************/
...
...
@@ -348,13 +286,6 @@ static const luaL_Reg vlclua_misc_reg[] = {
{
"copyright"
,
vlclua_copyright
},
{
"license"
,
vlclua_license
},
{
"datadir"
,
vlclua_datadir
},
{
"userdatadir"
,
vlclua_userdatadir
},
{
"homedir"
,
vlclua_homedir
},
{
"configdir"
,
vlclua_configdir
},
{
"cachedir"
,
vlclua_cachedir
},
{
"datadir_list"
,
vlclua_datadir_list
},
{
"action_id"
,
vlclua_action_id
},
{
"mdate"
,
vlclua_mdate
},
...
...
share/lua/README.txt
View file @
f7ee3edc
...
...
@@ -48,6 +48,14 @@ Configuration
-------------
config.get( name ): Get the VLC configuration option "name"'s value.
config.set( name, value ): Set the VLC configuration option "name"'s value.
config.datadir(): Get the VLC data directory.
config.userdatadir(): Get the user's VLC data directory.
config.homedir(): Get the user's home directory.
config.configdir(): Get the user's VLC config directory.
config.cachedir(): Get the user's VLC cache directory.
config.datadir_list( name ): FIXME: write description ... or ditch function
if it isn't useful anymore, we have datadir and userdatadir :)
Dialog
------
...
...
@@ -146,15 +154,6 @@ misc.version(): Get the VLC version string.
misc.copyright(): Get the VLC copyright statement.
misc.license(): Get the VLC license.
misc.datadir(): Get the VLC data directory.
misc.userdatadir(): Get the user's VLC data directory.
misc.homedir(): Get the user's home directory.
misc.configdir(): Get the user's VLC config directory.
misc.cachedir(): Get the user's VLC cache directory.
misc.datadir_list( name ): FIXME: write description ... or ditch function
if it isn't useful anymore, we have datadir and userdatadir :)
misc.action_id( name ): get the id of the given action.
misc.mdate(): Get the current date (in microseconds).
...
...
share/lua/intf/http.lua
View file @
f7ee3edc
...
...
@@ -243,7 +243,7 @@ function parse_url_request(request)
end
local
function
find_datadir
(
name
)
local
list
=
vlc
.
misc
.
datadir_list
(
name
)
local
list
=
vlc
.
config
.
datadir_list
(
name
)
for
_
,
l
in
ipairs
(
list
)
do
local
s
=
vlc
.
net
.
stat
(
l
)
if
s
then
...
...
share/lua/intf/modules/httprequests.lua
View file @
f7ee3edc
...
...
@@ -380,7 +380,7 @@ getbrowsetable = function ()
result
.
element
.
_array
=
{}
if
dir
then
if
dir
==
"~"
or
dir
==
"file://~"
then
dir
=
vlc
.
misc
.
homedir
()
end
if
dir
==
"~"
or
dir
==
"file://~"
then
dir
=
vlc
.
config
.
homedir
()
end
-- FIXME: hack for Win32 drive list
if
dir
~=
""
then
dir
=
common
.
realpath
(
dir
..
"/"
)
...
...
share/lua/intf/test.lua
View file @
f7ee3edc
...
...
@@ -16,11 +16,6 @@ vlc.msg.info('---- Testing misc functions ----')
vlc
.
msg
.
info
(
'version: '
..
vlc
.
misc
.
version
())
vlc
.
msg
.
info
(
'copyright: '
..
vlc
.
misc
.
copyright
())
vlc
.
msg
.
info
(
'license: '
..
vlc
.
misc
.
license
())
vlc
.
msg
.
info
(
'datadir: '
..
vlc
.
misc
.
datadir
())
vlc
.
msg
.
info
(
'userdatadir: '
..
vlc
.
misc
.
userdatadir
())
vlc
.
msg
.
info
(
'homedir: '
..
vlc
.
misc
.
homedir
())
vlc
.
msg
.
info
(
'configdir: '
..
vlc
.
misc
.
configdir
())
vlc
.
msg
.
info
(
'cachedir: '
..
vlc
.
misc
.
cachedir
())
vlc
.
msg
.
info
(
'mdate: '
..
vlc
.
misc
.
mdate
())
vlc
.
msg
.
info
(
' * Testing the timer'
)
...
...
@@ -30,6 +25,13 @@ vlc.misc.mwait(vlc.misc.mdate()+1000000)
assert
(
timer_count
==
1
)
vlc
.
msg
.
info
(
' [done]'
)
vlc
.
msg
.
info
(
'---- Testing config functions ----'
)
vlc
.
msg
.
info
(
'datadir: '
..
vlc
.
config
.
datadir
())
vlc
.
msg
.
info
(
'userdatadir: '
..
vlc
.
config
.
userdatadir
())
vlc
.
msg
.
info
(
'homedir: '
..
vlc
.
config
.
homedir
())
vlc
.
msg
.
info
(
'configdir: '
..
vlc
.
config
.
configdir
())
vlc
.
msg
.
info
(
'cachedir: '
..
vlc
.
config
.
cachedir
())
vlc
.
msg
.
info
(
'---- Testing net functions ----'
)
vlc
.
msg
.
info
(
' * testing vlc.net.url_parse'
)
vlc
.
msg
.
info
(
' "filename.ext"'
)
...
...
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