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
d550023d
Commit
d550023d
authored
Mar 30, 2009
by
Rafaël Carré
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix zsh completion generation
parent
a3bdb881
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
38 deletions
+40
-38
extras/analyser/zsh.cpp
extras/analyser/zsh.cpp
+28
-37
extras/analyser/zsh_completion.sh
extras/analyser/zsh_completion.sh
+12
-1
No files found.
extras/analyser/zsh.cpp
View file @
d550023d
...
@@ -37,6 +37,7 @@ typedef std::pair<int, std::string> mcpair;
...
@@ -37,6 +37,7 @@ typedef std::pair<int, std::string> mcpair;
# include "config.h"
# include "config.h"
#endif
#endif
#include <vlc_common.h>
#include <vlc/vlc.h>
#include <vlc/vlc.h>
/* evil hack */
/* evil hack */
...
@@ -44,8 +45,8 @@ typedef std::pair<int, std::string> mcpair;
...
@@ -44,8 +45,8 @@ typedef std::pair<int, std::string> mcpair;
#undef __BUILTIN__
#undef __BUILTIN__
#include <../src/modules/modules.h>
#include <../src/modules/modules.h>
void
ParseModules
(
libvlc_int_t
*
p_libvlc
,
mumap
&
mods
,
mcmap
&
mods2
);
void
ParseModules
(
mumap
&
mods
,
mcmap
&
mods2
);
void
PrintModuleList
(
libvlc_int_t
*
p_libvlc
,
mumap
&
mods
,
mcmap
&
mods2
);
void
PrintModuleList
(
mumap
&
mods
,
mcmap
&
mods2
);
void
ParseOption
(
module_config_t
*
p_item
,
mumap
&
mods
,
mcmap
&
mods2
);
void
ParseOption
(
module_config_t
*
p_item
,
mumap
&
mods
,
mcmap
&
mods2
);
void
PrintOption
(
char
*
psz_option
,
char
i_short
,
char
*
psz_exlusive
,
void
PrintOption
(
char
*
psz_option
,
char
i_short
,
char
*
psz_exlusive
,
char
*
psz_text
,
char
*
psz_longtext
,
char
*
psz_args
);
char
*
psz_text
,
char
*
psz_longtext
,
char
*
psz_args
);
...
@@ -55,22 +56,19 @@ int main( int i_argc, const char **ppsz_argv )
...
@@ -55,22 +56,19 @@ int main( int i_argc, const char **ppsz_argv )
mumap
mods
;
mumap
mods
;
mcmap
mods2
;
mcmap
mods2
;
/* Create a libvlc structure */
/* Create a libvlc structure */
int
i_ret
=
VLC_Create
();
libvlc_int_t
*
p_libvlc
;
if
(
i_ret
<
0
)
libvlc_exception_t
ex
;
{
libvlc_exception_init
(
&
ex
);
return
i_ret
;
}
const
char
*
const
argv
[]
=
{
"vlc"
};
libvlc_instance_t
*
p_libvlc_instance
=
libvlc_new
(
1
,
argv
,
&
ex
);
/* Initialize libvlc */
if
(
!
p_libvlc_instance
||
libvlc_exception_raised
(
&
ex
)
)
i_ret
=
VLC_Init
(
0
,
i_argc
,
ppsz_argv
);
if
(
i_ret
<
0
)
{
{
VLC_Destroy
(
0
);
libvlc_exception_clear
(
&
ex
);
return
i_ret
;
return
1
;
}
}
p_libvlc
=
(
libvlc_int_t
*
)
vlc_object_get
(
i_ret
);
printf
(
"#compdef vlc
\n\n
"
printf
(
"#compdef vlc
\n\n
"
"#This file is autogenerated by zsh.cpp
\n
"
"#This file is autogenerated by zsh.cpp
\n
"
...
@@ -78,10 +76,10 @@ int main( int i_argc, const char **ppsz_argv )
...
@@ -78,10 +76,10 @@ int main( int i_argc, const char **ppsz_argv )
"local context state line ret=1
\n
"
"local context state line ret=1
\n
"
"local modules
\n\n
"
);
"local modules
\n\n
"
);
PrintModuleList
(
p_libvlc
,
mods
,
mods2
);
PrintModuleList
(
mods
,
mods2
);
printf
(
"_arguments -S -s
\\\n
"
);
printf
(
"_arguments -S -s
\\\n
"
);
ParseModules
(
p_libvlc
,
mods
,
mods2
);
ParseModules
(
mods
,
mods2
);
printf
(
"
\"
(--module)-p[print help on module]:print help on module:($modules)
\"\\\n
"
);
printf
(
"
\"
(--module)-p[print help on module]:print help on module:($modules)
\"\\\n
"
);
printf
(
"
\"
(-p)--module[print help on module]:print help on module:($modules)
\"\\\n
"
);
printf
(
"
\"
(-p)--module[print help on module]:print help on module:($modules)
\"\\\n
"
);
printf
(
"
\"
(--help)-h[print help]
\"\\\n
"
);
printf
(
"
\"
(--help)-h[print help]
\"\\\n
"
);
...
@@ -105,34 +103,26 @@ int main( int i_argc, const char **ppsz_argv )
...
@@ -105,34 +103,26 @@ int main( int i_argc, const char **ppsz_argv )
printf
(
"return ret
\n
"
);
printf
(
"return ret
\n
"
);
/* Exit early since we did not release all the objects we used,
libvlc_release
(
p_libvlc_instance
);
* but we don't care, our task is over */
return
0
;
/* Finish the threads */
VLC_CleanUp
(
0
);
/* Destroy the libvlc structure */
VLC_Destroy
(
0
);
return
i_ret
;
return
0
;
}
}
void
ParseModules
(
libvlc_int_t
*
p_libvlc
,
mumap
&
mods
,
mcmap
&
mods2
)
void
ParseModules
(
mumap
&
mods
,
mcmap
&
mods2
)
{
{
vlc_list_t
*
p_list
=
NULL
;
;
module_t
**
p_list
;
module_t
*
p_module
;
module_t
*
p_module
;
module_config_t
*
p_item
;
module_config_t
*
p_item
;
int
i_index
;
int
i_index
;
int
i_items
;
int
i_items
;
size_t
i_modules
;
/* List the plugins */
/* List the plugins */
p_list
=
vlc_list_find
(
p_libvlc
,
VLC_OBJECT_MODULE
,
FIND_ANYWHERE
);
p_list
=
module_list_get
(
&
i_modules
);
if
(
!
p_list
)
return
;
if
(
!
p_list
)
return
;
for
(
i_index
=
0
;
i_index
<
p_list
->
i_count
;
i_index
++
)
for
(
i_index
=
0
;
i_index
<
i_modules
;
i_index
++
)
{
{
p_module
=
(
module_t
*
)
p_list
->
p_values
[
i_index
].
p_object
;
p_module
=
p_list
[
i_index
]
;
/* Exclude empty plugins (submodules don't have config options, they
/* Exclude empty plugins (submodules don't have config options, they
* are stored in the parent module) */
* are stored in the parent module) */
...
@@ -163,21 +153,22 @@ void ParseModules( libvlc_int_t *p_libvlc, mumap &mods, mcmap &mods2 )
...
@@ -163,21 +153,22 @@ void ParseModules( libvlc_int_t *p_libvlc, mumap &mods, mcmap &mods2 )
}
}
}
}
void
PrintModuleList
(
libvlc_int_t
*
p_libvlc
,
mumap
&
mods
,
mcmap
&
mods2
)
void
PrintModuleList
(
mumap
&
mods
,
mcmap
&
mods2
)
{
{
vlc_list_t
*
p_list
=
NULL
;
;
module_t
**
p_list
=
NULL
;
module_t
*
p_module
;
module_t
*
p_module
;
int
i_index
;
int
i_index
;
int
i_items
;
int
i_items
;
size_t
i_modules
;
/* List the plugins */
/* List the plugins */
p_list
=
vlc_list_find
(
p_libvlc
,
VLC_OBJECT_MODULE
,
FIND_ANYWHERE
);
p_list
=
module_list_get
(
&
i_modules
);
if
(
!
p_list
)
return
;
if
(
!
p_list
)
return
;
printf
(
"modules=
\"
"
);
printf
(
"modules=
\"
"
);
for
(
i_index
=
0
;
i_index
<
p_list
->
i_count
;
i_index
++
)
for
(
i_index
=
0
;
i_index
<
i_modules
;
i_index
++
)
{
{
p_module
=
(
module_t
*
)
p_list
->
p_values
[
i_index
].
p_object
;
p_module
=
p_list
[
i_index
]
;
/* Exclude empty plugins (submodules don't have config options, they
/* Exclude empty plugins (submodules don't have config options, they
* are stored in the parent module) */
* are stored in the parent module) */
...
...
extras/analyser/zsh_completion.sh
View file @
d550023d
...
@@ -38,6 +38,13 @@ function find_libvlc {
...
@@ -38,6 +38,13 @@ function find_libvlc {
return
1
return
1
}
}
function
find_libvlccore
{
for
i
in
$BUILDDIR
/src/.libs/libvlccore.
$SUFFIX
$BUILDDIR
/src/libvlccore.
$SUFFIX
;
do
test
-e
$i
&&
LIBVLCCORE
=
$i
&&
return
0
done
return
1
}
while
test
-z
"
$LIBVLC
"
;
do
while
test
-z
"
$LIBVLC
"
;
do
if
!
find_libvlc
;
then
if
!
find_libvlc
;
then
/bin/echo
-n
"Please enter the directory where you built vlc: "
/bin/echo
-n
"Please enter the directory where you built vlc: "
...
@@ -47,6 +54,10 @@ done
...
@@ -47,6 +54,10 @@ done
echo
"libvlc found !"
echo
"libvlc found !"
if
!
find_libvlccore
;
then
/bin/echo
-n
"libvlccore not found ! Linking will fail !"
fi
LD_LIBRARY_PATH
=
$BUILDDIR
/src/.libs
LD_LIBRARY_PATH
=
$BUILDDIR
/src/.libs
if
test
-e
../../extras/contrib/config.mak
-a
!
"
`
grep
HOST ../../extras/contrib/config.mak 2>/dev/null|awk
'{print $3}'
`
"
!=
"
$HOST
"
;
then
if
test
-e
../../extras/contrib/config.mak
-a
!
"
`
grep
HOST ../../extras/contrib/config.mak 2>/dev/null|awk
'{print $3}'
`
"
!=
"
$HOST
"
;
then
...
@@ -58,7 +69,7 @@ if test -z "$CXX"; then
...
@@ -58,7 +69,7 @@ if test -z "$CXX"; then
CXX
=
g++
CXX
=
g++
fi
fi
ZSH_BUILD
=
"
$CXX
$CPPFLAGS
$CXXFLAGS
-D__LIBVLC__ -DHAVE_CONFIG_H -I
$BUILDDIR
-I
$BUILDDIR
/include -I../../include zsh.cpp
$LIBVLC
-o zsh_gen"
ZSH_BUILD
=
"
$CXX
$CPPFLAGS
$CXXFLAGS
-D__LIBVLC__ -DHAVE_CONFIG_H -I
$BUILDDIR
-I
$BUILDDIR
/include -I../../include zsh.cpp
$LIBVLC
$LIBVLCCORE
-o zsh_gen"
echo
"Building zsh completion generator ... "
echo
"Building zsh completion generator ... "
echo
$ZSH_BUILD
echo
$ZSH_BUILD
...
...
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