Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
751d2f1a
Commit
751d2f1a
authored
Feb 07, 2008
by
Christophe Mutricy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Distribute include/vlc_plugin.h and src/config/intf.c
Remove code duplication
parent
e3421975
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
141 deletions
+2
-141
src/Makefile.am
src/Makefile.am
+2
-0
src/config/core.c
src/config/core.c
+0
-141
No files found.
src/Makefile.am
View file @
751d2f1a
...
...
@@ -71,6 +71,7 @@ HEADERS_include = \
../include/vlc_osd.h
\
../include/vlc_pgpkey.h
\
../include/vlc_playlist.h
\
../include/vlc_plugin.h
\
../include/vlc_rand.h
\
../include/vlc_services_discovery.h
\
../include/vlc_sout.h
\
...
...
@@ -307,6 +308,7 @@ SOURCES_libvlc_common = \
config/core.c
\
config/chain.c
\
config/file.c
\
config/intf.c
\
config/cmdline.c
\
misc/events.c
\
misc/image.c
\
...
...
src/config/core.c
View file @
751d2f1a
...
...
@@ -822,144 +822,3 @@ char *config_GetCacheDir( libvlc_int_t *p_libvlc )
return
psz_dir
;
#endif
}
/* Adds an extra interface to the configuration */
void
__config_AddIntf
(
vlc_object_t
*
p_this
,
const
char
*
psz_intf
)
{
assert
(
psz_intf
);
char
*
psz_config
,
*
psz_parser
;
size_t
i_len
=
strlen
(
psz_intf
);
psz_config
=
psz_parser
=
config_GetPsz
(
p_this
->
p_libvlc
,
"control"
);
while
(
psz_parser
)
{
if
(
!
strncmp
(
psz_intf
,
psz_parser
,
i_len
)
)
{
free
(
psz_config
);
return
;
}
psz_parser
=
strchr
(
psz_parser
,
':'
);
if
(
psz_parser
)
psz_parser
++
;
/* skip the ':' */
}
free
(
psz_config
);
psz_config
=
psz_parser
=
config_GetPsz
(
p_this
->
p_libvlc
,
"extraintf"
);
while
(
psz_parser
)
{
if
(
!
strncmp
(
psz_intf
,
psz_parser
,
i_len
)
)
{
free
(
psz_config
);
return
;
}
psz_parser
=
strchr
(
psz_parser
,
':'
);
if
(
psz_parser
)
psz_parser
++
;
/* skip the ':' */
}
/* interface not found in the config, let's add it */
if
(
psz_config
&&
strlen
(
psz_config
)
>
0
)
{
char
*
psz_newconfig
;
if
(
asprintf
(
&
psz_newconfig
,
"%s:%s"
,
psz_config
,
psz_intf
)
!=
-
1
)
{
config_PutPsz
(
p_this
->
p_libvlc
,
"extraintf"
,
psz_newconfig
);
free
(
psz_newconfig
);
}
}
else
config_PutPsz
(
p_this
->
p_libvlc
,
"extraintf"
,
psz_intf
);
free
(
psz_config
);
}
/* Removes an extra interface from the configuration */
void
__config_RemoveIntf
(
vlc_object_t
*
p_this
,
const
char
*
psz_intf
)
{
assert
(
psz_intf
);
char
*
psz_config
,
*
psz_parser
;
size_t
i_len
=
strlen
(
psz_intf
);
psz_config
=
psz_parser
=
config_GetPsz
(
p_this
->
p_libvlc
,
"extraintf"
);
while
(
psz_parser
)
{
if
(
!
strncmp
(
psz_intf
,
psz_parser
,
i_len
)
)
{
char
*
psz_newconfig
;
char
*
psz_end
=
psz_parser
+
i_len
;
if
(
*
psz_end
==
':'
)
psz_end
++
;
*
psz_parser
=
'\0'
;
if
(
asprintf
(
&
psz_newconfig
,
"%s%s"
,
psz_config
,
psz_end
)
!=
-
1
)
{
config_PutPsz
(
p_this
->
p_libvlc
,
"extraintf"
,
psz_newconfig
);
free
(
psz_newconfig
);
}
break
;
}
psz_parser
=
strchr
(
psz_parser
,
':'
);
if
(
psz_parser
)
psz_parser
++
;
/* skip the ':' */
}
free
(
psz_config
);
psz_config
=
psz_parser
=
config_GetPsz
(
p_this
->
p_libvlc
,
"control"
);
while
(
psz_parser
)
{
if
(
!
strncmp
(
psz_intf
,
psz_parser
,
i_len
)
)
{
char
*
psz_newconfig
;
char
*
psz_end
=
psz_parser
+
i_len
;
if
(
*
psz_end
==
':'
)
psz_end
++
;
*
psz_parser
=
'\0'
;
if
(
asprintf
(
&
psz_newconfig
,
"%s%s"
,
psz_config
,
psz_end
)
!=
-
1
)
{
config_PutPsz
(
p_this
->
p_libvlc
,
"control"
,
psz_newconfig
);
free
(
psz_newconfig
);
}
break
;
}
psz_parser
=
strchr
(
psz_parser
,
':'
);
if
(
psz_parser
)
psz_parser
++
;
/* skip the ':' */
}
free
(
psz_config
);
}
/*
* Returns VLC_TRUE if the specified extra interface is present in the
* configuration, VLC_FALSE if not
*/
vlc_bool_t
__config_ExistIntf
(
vlc_object_t
*
p_this
,
const
char
*
psz_intf
)
{
assert
(
psz_intf
);
char
*
psz_config
,
*
psz_parser
;
size_t
i_len
=
strlen
(
psz_intf
);
psz_config
=
psz_parser
=
config_GetPsz
(
p_this
->
p_libvlc
,
"extraintf"
);
while
(
psz_parser
)
{
if
(
!
strncmp
(
psz_parser
,
psz_intf
,
i_len
)
)
{
free
(
psz_config
);
return
VLC_TRUE
;
}
psz_parser
=
strchr
(
psz_parser
,
':'
);
if
(
psz_parser
)
psz_parser
++
;
/* skip the ':' */
}
free
(
psz_config
);
psz_config
=
psz_parser
=
config_GetPsz
(
p_this
->
p_libvlc
,
"control"
);
while
(
psz_parser
)
{
if
(
!
strncmp
(
psz_parser
,
psz_intf
,
i_len
)
)
{
free
(
psz_config
);
return
VLC_TRUE
;
}
psz_parser
=
strchr
(
psz_parser
,
':'
);
if
(
psz_parser
)
psz_parser
++
;
/* skip the ':' */
}
free
(
psz_config
);
return
VLC_FALSE
;
}
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