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
e66a4a0f
Commit
e66a4a0f
authored
Aug 04, 2007
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor fixes
parent
6e9aebe3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
26 deletions
+20
-26
modules/control/http/http.h
modules/control/http/http.h
+3
-3
modules/control/http/mvar.c
modules/control/http/mvar.c
+17
-23
No files found.
modules/control/http/http.h
View file @
e66a4a0f
/*****************************************************************************
/*****************************************************************************
* http.h: Headers for the HTTP interface
* http.h: Headers for the HTTP interface
*****************************************************************************
*****************************************************************************
* Copyright (C) 2001-200
5
the VideoLAN team
* Copyright (C) 2001-200
7
the VideoLAN team
* $Id$
* $Id$
*
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
* Authors: Gildas Bazin <gbazin@netcourrier.com>
...
@@ -208,7 +208,7 @@ void E_(mvar_AppendNewVar)( mvar_t *vars, const char *name,
...
@@ -208,7 +208,7 @@ void E_(mvar_AppendNewVar)( mvar_t *vars, const char *name,
mvar_t
*
E_
(
mvar_IntegerSetNew
)(
const
char
*
name
,
const
char
*
arg
);
mvar_t
*
E_
(
mvar_IntegerSetNew
)(
const
char
*
name
,
const
char
*
arg
);
/** This function creates a set variable with a list of VLC objects */
/** This function creates a set variable with a list of VLC objects */
mvar_t
*
E_
(
mvar_ObjectSetNew
)(
intf_thread_t
*
p_intf
,
char
*
name
,
char
*
arg
);
mvar_t
*
E_
(
mvar_ObjectSetNew
)(
intf_thread_t
*
p_intf
,
char
*
name
,
c
onst
c
har
*
arg
);
/** This function creates a set variable with the contents of the playlist */
/** This function creates a set variable with the contents of the playlist */
mvar_t
*
E_
(
mvar_PlaylistSetNew
)(
intf_thread_t
*
p_intf
,
char
*
name
,
mvar_t
*
E_
(
mvar_PlaylistSetNew
)(
intf_thread_t
*
p_intf
,
char
*
name
,
...
@@ -224,7 +224,7 @@ mvar_t *E_(mvar_InputVarSetNew)( intf_thread_t *p_intf, char *name,
...
@@ -224,7 +224,7 @@ mvar_t *E_(mvar_InputVarSetNew)( intf_thread_t *p_intf, char *name,
/** This function creates a set variable representing the files of the psz_dir
/** This function creates a set variable representing the files of the psz_dir
* directory */
* directory */
mvar_t
*
E_
(
mvar_FileSetNew
)(
intf_thread_t
*
p_intf
,
char
*
name
,
mvar_t
*
E_
(
mvar_FileSetNew
)(
intf_thread_t
*
p_intf
,
char
*
name
,
char
*
psz_dir
);
c
onst
c
har
*
psz_dir
);
/** This function creates a set variable representing the VLM streams */
/** This function creates a set variable representing the VLM streams */
mvar_t
*
E_
(
mvar_VlmSetNew
)(
char
*
name
,
vlm_t
*
vlm
);
mvar_t
*
E_
(
mvar_VlmSetNew
)(
char
*
name
,
vlm_t
*
vlm
);
...
...
modules/control/http/mvar.c
View file @
e66a4a0f
/*****************************************************************************
/*****************************************************************************
* mvar.c : Variables handling for the HTTP Interface
* mvar.c : Variables handling for the HTTP Interface
*****************************************************************************
*****************************************************************************
* Copyright (C) 2001-200
6
the VideoLAN team
* Copyright (C) 2001-200
7
the VideoLAN team
* $Id$
* $Id$
*
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
* Authors: Gildas Bazin <gbazin@netcourrier.com>
...
@@ -127,24 +127,25 @@ void E_(mvar_RemoveVar)( mvar_t *v, mvar_t *f )
...
@@ -127,24 +127,25 @@ void E_(mvar_RemoveVar)( mvar_t *v, mvar_t *f )
mvar_t
*
E_
(
mvar_GetVar
)(
mvar_t
*
s
,
const
char
*
name
)
mvar_t
*
E_
(
mvar_GetVar
)(
mvar_t
*
s
,
const
char
*
name
)
{
{
/* format: name[index].field */
/* format: name[index].field */
char
*
field
=
strchr
(
name
,
'.'
);
const
char
*
field
=
strchr
(
name
,
'.'
);
int
i
=
1
+
((
field
!=
NULL
)
?
(
field
-
name
)
:
strlen
(
name
));
char
base
[
1
+
(
field
?
(
size_t
)(
field
-
name
)
:
strlen
(
name
))];
char
base
[
i
];
char
*
p
;
char
*
p
;
int
i_index
;
int
i_index
,
i
;
strlcpy
(
base
,
name
,
i
);
strlcpy
(
base
,
name
,
sizeof
(
base
)
);
if
(
field
!=
NULL
)
if
(
field
!=
NULL
)
field
++
;
field
++
;
if
(
(
p
=
strchr
(
base
,
'['
)
)
!=
NULL
)
if
(
(
p
=
strchr
(
base
,
'['
)
)
!=
NULL
)
{
{
*
p
++
=
'\0'
;
char
*
end
;
sscanf
(
p
,
"%d]"
,
&
i_index
);
unsigned
long
l
=
strtoul
(
p
,
&
end
,
0
);
if
(
i_index
<
0
)
{
if
(
(
l
>
INT_MAX
)
||
strcmp
(
"]"
,
end
)
)
return
NULL
;
return
NULL
;
}
*
p
++
=
'\0'
;
i_index
=
(
int
)
l
;
}
}
else
else
{
{
...
@@ -334,7 +335,7 @@ mvar_t *E_(mvar_InfoSetNew)( intf_thread_t *p_intf, char *name,
...
@@ -334,7 +335,7 @@ mvar_t *E_(mvar_InfoSetNew)( intf_thread_t *p_intf, char *name,
}
}
mvar_t
*
E_
(
mvar_ObjectSetNew
)(
intf_thread_t
*
p_intf
,
char
*
psz_name
,
mvar_t
*
E_
(
mvar_ObjectSetNew
)(
intf_thread_t
*
p_intf
,
char
*
psz_name
,
char
*
psz_capability
)
c
onst
c
har
*
psz_capability
)
{
{
mvar_t
*
s
=
E_
(
mvar_New
)(
psz_name
,
"set"
);
mvar_t
*
s
=
E_
(
mvar_New
)(
psz_name
,
"set"
);
int
i
;
int
i
;
...
@@ -506,7 +507,7 @@ mvar_t *E_(mvar_HttpdInfoSetNew)( char *name, httpd_t *p_httpd, int i_type )
...
@@ -506,7 +507,7 @@ mvar_t *E_(mvar_HttpdInfoSetNew)( char *name, httpd_t *p_httpd, int i_type )
#endif
#endif
mvar_t
*
E_
(
mvar_FileSetNew
)(
intf_thread_t
*
p_intf
,
char
*
name
,
mvar_t
*
E_
(
mvar_FileSetNew
)(
intf_thread_t
*
p_intf
,
char
*
name
,
c
har
*
psz_dir
)
c
onst
char
*
value
)
{
{
mvar_t
*
s
=
E_
(
mvar_New
)(
name
,
"set"
);
mvar_t
*
s
=
E_
(
mvar_New
)(
name
,
"set"
);
#ifdef HAVE_SYS_STAT_H
#ifdef HAVE_SYS_STAT_H
...
@@ -514,14 +515,7 @@ mvar_t *E_(mvar_FileSetNew)( intf_thread_t *p_intf, char *name,
...
@@ -514,14 +515,7 @@ mvar_t *E_(mvar_FileSetNew)( intf_thread_t *p_intf, char *name,
#endif
#endif
char
**
ppsz_dir_content
;
char
**
ppsz_dir_content
;
int
i_dir_content
,
i
;
int
i_dir_content
,
i
;
/* convert all / to native separator */
char
*
psz_dir
=
E_
(
RealPath
)(
p_intf
,
psz_dir
);
#if defined( WIN32 )
const
char
sep
=
'\\'
;
#else
const
char
sep
=
'/'
;
#endif
psz_dir
=
E_
(
RealPath
)(
p_intf
,
psz_dir
);
#ifdef HAVE_SYS_STAT_H
#ifdef HAVE_SYS_STAT_H
if
(
(
utf8_stat
(
psz_dir
,
&
stat_info
)
==
-
1
)
if
(
(
utf8_stat
(
psz_dir
,
&
stat_info
)
==
-
1
)
...
@@ -561,7 +555,7 @@ mvar_t *E_(mvar_FileSetNew)( intf_thread_t *p_intf, char *name,
...
@@ -561,7 +555,7 @@ mvar_t *E_(mvar_FileSetNew)( intf_thread_t *p_intf, char *name,
else
else
#endif
#endif
{
{
sprintf
(
psz_tmp
,
"%s
%c%s"
,
psz_dir
,
sep
,
psz_dir_content
);
sprintf
(
psz_tmp
,
"%s
"
DIR_SEP
"%s"
,
psz_dir
,
psz_dir_content
);
#ifdef HAVE_SYS_STAT_H
#ifdef HAVE_SYS_STAT_H
if
(
utf8_stat
(
psz_tmp
,
&
stat_info
)
==
-
1
)
if
(
utf8_stat
(
psz_tmp
,
&
stat_info
)
==
-
1
)
...
@@ -601,7 +595,7 @@ mvar_t *E_(mvar_FileSetNew)( intf_thread_t *p_intf, char *name,
...
@@ -601,7 +595,7 @@ mvar_t *E_(mvar_FileSetNew)( intf_thread_t *p_intf, char *name,
char
psz_ctime
[
26
];
char
psz_ctime
[
26
];
char
psz_tmp
[
strlen
(
psz_dir
)
+
1
+
strlen
(
psz_name
)
+
1
];
char
psz_tmp
[
strlen
(
psz_dir
)
+
1
+
strlen
(
psz_name
)
+
1
];
sprintf
(
psz_tmp
,
"%s
%c%s"
,
psz_dir
,
sep
,
psz_name
);
sprintf
(
psz_tmp
,
"%s
"
DIR_SEP
"%s"
,
psz_dir
,
psz_name
);
E_
(
mvar_AppendNewVar
)(
f
,
"name"
,
psz_tmp
);
E_
(
mvar_AppendNewVar
)(
f
,
"name"
,
psz_tmp
);
E_
(
mvar_AppendNewVar
)(
f
,
"basename"
,
psz_name
);
E_
(
mvar_AppendNewVar
)(
f
,
"basename"
,
psz_name
);
...
...
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