Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
6cdc9671
Commit
6cdc9671
authored
May 29, 2004
by
Gildas Bazin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* src/misc/modules.c: small cleanup.
parent
e7abe37c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
62 deletions
+37
-62
src/misc/modules.c
src/misc/modules.c
+37
-62
No files found.
src/misc/modules.c
View file @
6cdc9671
...
@@ -1457,44 +1457,31 @@ static char * GetWindowsError( void )
...
@@ -1457,44 +1457,31 @@ static char * GetWindowsError( void )
*****************************************************************************/
*****************************************************************************/
static
void
CacheLoad
(
vlc_object_t
*
p_this
)
static
void
CacheLoad
(
vlc_object_t
*
p_this
)
{
{
char
*
psz_filename
,
*
psz_homedir
,
*
psz_cachefile
;
char
*
psz_filename
,
*
psz_homedir
;
FILE
*
file
;
FILE
*
file
;
int
i
,
j
,
i_size
,
i_read
;
int
i
,
j
,
i_size
,
i_read
;
char
p_cachestring
[
sizeof
(
PLUGINSCACHE_FILE
COPYRIGHT_MESSAGE
)];
char
p_cachestring
[
sizeof
(
PLUGINSCACHE_FILE
COPYRIGHT_MESSAGE
)];
int
*
pi_cache
;
int
*
pi_cache
;
module_cache_t
**
pp_cache
=
0
;
module_cache_t
**
pp_cache
=
0
;
psz_
cachefile
=
0
;
// FIXME
psz_
homedir
=
p_this
->
p_vlc
->
psz_homedir
;
if
(
!
psz_
cachefile
||
!
psz_cachefile
)
if
(
!
psz_
homedir
)
{
{
psz_homedir
=
p_this
->
p_vlc
->
psz_homedir
;
msg_Err
(
p_this
,
"psz_homedir is null"
);
if
(
!
psz_homedir
)
return
;
{
}
msg_Err
(
p_this
,
"psz_homedir is null"
);
psz_filename
=
return
;
(
char
*
)
malloc
(
sizeof
(
"/"
CONFIG_DIR
"/"
PLUGINSCACHE_FILE
)
+
}
strlen
(
psz_homedir
)
);
psz_filename
=
(
char
*
)
malloc
(
sizeof
(
"/"
CONFIG_DIR
"/"
PLUGINSCACHE_FILE
)
+
strlen
(
psz_homedir
)
);
if
(
psz_filename
)
if
(
psz_filename
)
sprintf
(
psz_filename
,
"%s/"
CONFIG_DIR
"/"
PLUGINSCACHE_FILE
,
sprintf
(
psz_filename
,
"%s/"
CONFIG_DIR
"/"
PLUGINSCACHE_FILE
,
psz_homedir
);
psz_homedir
);
if
(
!
psz_filename
)
if
(
!
psz_filename
)
{
msg_Err
(
p_this
,
"out of memory"
);
return
;
}
}
else
{
{
psz_filename
=
strdup
(
psz_cachefile
);
msg_Err
(
p_this
,
"out of memory"
);
if
(
!
psz_filename
)
return
;
{
msg_Err
(
p_this
,
"out of memory"
);
return
;
}
}
}
if
(
p_this
->
p_libvlc
->
p_module_bank
->
b_cache_delete
)
if
(
p_this
->
p_libvlc
->
p_module_bank
->
b_cache_delete
)
...
@@ -1533,6 +1520,7 @@ static void CacheLoad( vlc_object_t *p_this )
...
@@ -1533,6 +1520,7 @@ static void CacheLoad( vlc_object_t *p_this )
for
(
i
=
0
;
i
<
*
pi_cache
;
i
++
)
for
(
i
=
0
;
i
<
*
pi_cache
;
i
++
)
{
{
int32_t
i_size
;
int32_t
i_size
;
int
i_submodules
;
#define LOAD_IMMEDIATE(a) \
#define LOAD_IMMEDIATE(a) \
fread( &a, sizeof(char), sizeof(a), file )
fread( &a, sizeof(char), sizeof(a), file )
...
@@ -1577,7 +1565,6 @@ static void CacheLoad( vlc_object_t *p_this )
...
@@ -1577,7 +1565,6 @@ static void CacheLoad( vlc_object_t *p_this )
LOAD_STRING
(
pp_cache
[
i
]
->
p_module
->
psz_filename
);
LOAD_STRING
(
pp_cache
[
i
]
->
p_module
->
psz_filename
);
int
i_submodules
;
LOAD_IMMEDIATE
(
i_submodules
);
LOAD_IMMEDIATE
(
i_submodules
);
while
(
i_submodules
--
)
while
(
i_submodules
--
)
...
@@ -1707,47 +1694,34 @@ void CacheLoadConfig( module_t *p_module, FILE *file )
...
@@ -1707,47 +1694,34 @@ void CacheLoadConfig( module_t *p_module, FILE *file )
*****************************************************************************/
*****************************************************************************/
static
void
CacheSave
(
vlc_object_t
*
p_this
)
static
void
CacheSave
(
vlc_object_t
*
p_this
)
{
{
char
*
psz_filename
,
*
psz_homedir
,
*
psz_cachefile
;
char
*
psz_filename
,
*
psz_homedir
;
FILE
*
file
;
FILE
*
file
;
int
i
,
j
,
i_cache
;
int
i
,
j
,
i_cache
;
module_cache_t
**
pp_cache
;
module_cache_t
**
pp_cache
;
psz_
cachefile
=
0
;
// FIXME
psz_
homedir
=
p_this
->
p_vlc
->
psz_homedir
;
if
(
!
psz_
cachefile
||
!
psz_cachefile
)
if
(
!
psz_
homedir
)
{
{
psz_homedir
=
p_this
->
p_vlc
->
psz_homedir
;
msg_Err
(
p_this
,
"psz_homedir is null"
);
if
(
!
psz_homedir
)
return
;
{
}
msg_Err
(
p_this
,
"psz_homedir is null"
);
psz_filename
=
return
;
(
char
*
)
malloc
(
sizeof
(
"/"
CONFIG_DIR
"/"
PLUGINSCACHE_FILE
)
+
}
strlen
(
psz_homedir
)
);
psz_filename
=
(
char
*
)
malloc
(
sizeof
(
"/"
CONFIG_DIR
"/"
PLUGINSCACHE_FILE
)
+
strlen
(
psz_homedir
)
);
if
(
psz_filename
)
sprintf
(
psz_filename
,
"%s/"
CONFIG_DIR
,
psz_homedir
);
if
(
!
psz_filename
)
{
msg_Err
(
p_this
,
"out of memory"
);
return
;
}
config_CreateDir
(
p_this
,
psz_filename
);
if
(
psz_filename
)
sprintf
(
psz_filename
,
"%s/"
CONFIG_DIR
,
psz_homedir
);
strcat
(
psz_filename
,
"/"
PLUGINSCACHE_FILE
);
if
(
!
psz_filename
)
}
else
{
{
psz_filename
=
strdup
(
psz_cachefile
);
msg_Err
(
p_this
,
"out of memory"
);
if
(
!
psz_filename
)
return
;
{
msg_Err
(
p_this
,
"out of memory"
);
return
;
}
}
}
config_CreateDir
(
p_this
,
psz_filename
);
strcat
(
psz_filename
,
"/"
PLUGINSCACHE_FILE
);
msg_Dbg
(
p_this
,
"saving plugins cache file %s"
,
psz_filename
);
msg_Dbg
(
p_this
,
"saving plugins cache file %s"
,
psz_filename
);
file
=
fopen
(
psz_filename
,
"w"
);
file
=
fopen
(
psz_filename
,
"w"
);
...
@@ -1771,6 +1745,7 @@ static void CacheSave( vlc_object_t *p_this )
...
@@ -1771,6 +1745,7 @@ static void CacheSave( vlc_object_t *p_this )
for
(
i
=
0
;
i
<
i_cache
;
i
++
)
for
(
i
=
0
;
i
<
i_cache
;
i
++
)
{
{
int32_t
i_size
;
int32_t
i_size
;
int32_t
i_submodule
;
#define SAVE_IMMEDIATE(a) \
#define SAVE_IMMEDIATE(a) \
fwrite( &a, sizeof(char), sizeof(a), file )
fwrite( &a, sizeof(char), sizeof(a), file )
...
@@ -1809,8 +1784,8 @@ static void CacheSave( vlc_object_t *p_this )
...
@@ -1809,8 +1784,8 @@ static void CacheSave( vlc_object_t *p_this )
SAVE_STRING
(
pp_cache
[
i
]
->
p_module
->
psz_filename
);
SAVE_STRING
(
pp_cache
[
i
]
->
p_module
->
psz_filename
);
i
nt
i_submodule
;
i
_submodule
=
pp_cache
[
i
]
->
p_module
->
i_children
;
SAVE_IMMEDIATE
(
pp_cache
[
i
]
->
p_module
->
i_children
);
SAVE_IMMEDIATE
(
i_submodule
);
for
(
i_submodule
=
0
;
i_submodule
<
pp_cache
[
i
]
->
p_module
->
i_children
;
for
(
i_submodule
=
0
;
i_submodule
<
pp_cache
[
i
]
->
p_module
->
i_children
;
i_submodule
++
)
i_submodule
++
)
{
{
...
...
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