summaryrefslogtreecommitdiffstats
path: root/parser-mpcmd.c
diff options
context:
space:
mode:
authoralex <alex@b3059339-0415-0410-9bf9-f77b7e298cf2>2003-08-03 17:42:43 +0000
committeralex <alex@b3059339-0415-0410-9bf9-f77b7e298cf2>2003-08-03 17:42:43 +0000
commit2124a9a36f23eae68cc12a531947b69136263cb5 (patch)
treebfb75b60d58b0e9a1aa8642a624ef221f97f9828 /parser-mpcmd.c
parent094a5089cb505c9864e96285400e44f2d236f2cc (diff)
downloadmpv-2124a9a36f23eae68cc12a531947b69136263cb5.tar.bz2
mpv-2124a9a36f23eae68cc12a531947b69136263cb5.tar.xz
c vs c++ syntax
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@10514 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'parser-mpcmd.c')
-rw-r--r--parser-mpcmd.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/parser-mpcmd.c b/parser-mpcmd.c
index 729e100768..d6ea2c0519 100644
--- a/parser-mpcmd.c
+++ b/parser-mpcmd.c
@@ -49,6 +49,15 @@ static int is_entry_option(char *opt, char *param, play_tree_t** ret) {
return 0;
}
+static inline void add_entry(play_tree_t *last_parent,
+ play_tree_t *last_entry, play_tree_t *entry) {
+ if(last_entry == NULL)
+ play_tree_set_child(last_parent,entry);
+ else
+ play_tree_append_entry(last_entry,entry);
+ last_entry = entry;
+}
+
play_tree_t*
m_config_parse_mp_command_line(m_config_t *config, int argc, char **argv)
{
@@ -57,13 +66,6 @@ m_config_parse_mp_command_line(m_config_t *config, int argc, char **argv)
char *opt;
int no_more_opts = 0;
play_tree_t *last_parent, *last_entry = NULL, *root;
- void add_entry(play_tree_t *entry) {
- if(last_entry == NULL)
- play_tree_set_child(last_parent,entry);
- else
- play_tree_append_entry(last_entry,entry);
- last_entry = entry;
- }
#ifdef MP_DEBUG
assert(config != NULL);
@@ -160,7 +162,7 @@ m_config_parse_mp_command_line(m_config_t *config, int argc, char **argv)
tmp = is_entry_option(opt,(i+1<argc) ? argv[i + 1] : NULL,&entry);
if(tmp > 0) { // It's an entry
if(entry) {
- add_entry(entry);
+ add_entry(last_parent,last_entry,entry);
if((last_parent->flags & PLAY_TREE_RND) && entry->child)
entry->flags |= PLAY_TREE_RND;
UNSET_GLOBAL;
@@ -201,7 +203,7 @@ m_config_parse_mp_command_line(m_config_t *config, int argc, char **argv)
// Lock stdin if it will be used as input
if(strcasecmp(argv[i],"-") == 0)
m_config_set_option(config,"use-stdin",NULL);
- add_entry(entry);
+ add_entry(last_parent,last_entry,entry);
UNSET_GLOBAL; // We start entry specific options
}