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
5a477c25
Commit
5a477c25
authored
Mar 06, 2010
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vlc-cache-gen: add --force option
parent
0b220edc
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
12 deletions
+24
-12
bin/cachegen.c
bin/cachegen.c
+24
-12
No files found.
bin/cachegen.c
View file @
5a477c25
...
@@ -25,6 +25,7 @@
...
@@ -25,6 +25,7 @@
#include <vlc/vlc.h>
#include <vlc/vlc.h>
#include <stdio.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdlib.h>
#include <stdbool.h>
#ifdef HAVE_SETLOCALE
#ifdef HAVE_SETLOCALE
# include <locale.h>
# include <locale.h>
...
@@ -41,9 +42,11 @@ static void version (void)
...
@@ -41,9 +42,11 @@ static void version (void)
static
void
usage
(
const
char
*
path
)
static
void
usage
(
const
char
*
path
)
{
{
printf
(
"Usage: %s <path>
\n
"
printf
(
"Generate the LibVLC plugins cache "
"Usage: %s [-f] <path>
\n
"
"for the specified plugins directory.
\n
"
,
path
);
"Generate the LibVLC plugins cache for the specified plugins directory.
\n
"
" -f, --force forcefully reset the plugin cache (if it exists)
\n
"
,
path
);
}
}
/* Explicit HACK */
/* Explicit HACK */
...
@@ -54,6 +57,7 @@ int main (int argc, char *argv[])
...
@@ -54,6 +57,7 @@ int main (int argc, char *argv[])
{
{
static
const
struct
option
opts
[]
=
static
const
struct
option
opts
[]
=
{
{
{
"force"
,
no_argument
,
NULL
,
'f'
},
{
"help"
,
no_argument
,
NULL
,
'h'
},
{
"help"
,
no_argument
,
NULL
,
'h'
},
{
"version"
,
no_argument
,
NULL
,
'V'
},
{
"version"
,
no_argument
,
NULL
,
'V'
},
{
NULL
,
no_argument
,
NULL
,
'\0'
}
{
NULL
,
no_argument
,
NULL
,
'\0'
}
...
@@ -64,9 +68,14 @@ int main (int argc, char *argv[])
...
@@ -64,9 +68,14 @@ int main (int argc, char *argv[])
#endif
#endif
int
c
;
int
c
;
while
((
c
=
getopt_long
(
argc
,
argv
,
"hV"
,
opts
,
NULL
))
!=
-
1
)
bool
force
=
false
;
while
((
c
=
getopt_long
(
argc
,
argv
,
"fhV"
,
opts
,
NULL
))
!=
-
1
)
switch
(
c
)
switch
(
c
)
{
{
case
'f'
:
force
=
true
;
break
;
case
'h'
:
case
'h'
:
usage
(
argv
[
0
]);
usage
(
argv
[
0
]);
return
0
;
return
0
;
...
@@ -87,14 +96,17 @@ int main (int argc, char *argv[])
...
@@ -87,14 +96,17 @@ int main (int argc, char *argv[])
if
(
asprintf
(
&
arg
,
"--plugin-path=%s"
,
path
)
==
-
1
)
if
(
asprintf
(
&
arg
,
"--plugin-path=%s"
,
path
)
==
-
1
)
abort
();
abort
();
const
char
*
const
vlc_argv
[]
=
{
const
char
*
vlc_argv
[
7
];
"--ignore-config"
,
int
vlc_argc
=
0
;
"--quiet"
,
"--no-media-library"
,
vlc_argv
[
vlc_argc
++
]
=
"--ignore-config"
;
arg
,
vlc_argv
[
vlc_argc
++
]
=
"--quiet"
;
NULL
,
vlc_argv
[
vlc_argc
++
]
=
"--no-media-library"
;
};
if
(
force
)
size_t
vlc_argc
=
sizeof
(
vlc_argv
)
/
sizeof
(
vlc_argv
[
0
])
-
1
;
vlc_argv
[
vlc_argc
++
]
=
"--reset-plugins-cache"
;
vlc_argv
[
vlc_argc
++
]
=
arg
;
vlc_argv
[
vlc_argc
++
]
=
"--"
;
/* end of options */
vlc_argv
[
vlc_argc
]
=
NULL
;
libvlc_instance_t
*
vlc
=
libvlc_new
(
vlc_argc
,
vlc_argv
);
libvlc_instance_t
*
vlc
=
libvlc_new
(
vlc_argc
,
vlc_argv
);
if
(
vlc
!=
NULL
)
if
(
vlc
!=
NULL
)
...
...
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