* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
#include "http.h"
#include "macros.h"
#include "vlc_url.h"
-int E_(MacroParse)( macro_t *m, char *psz_src )
+static int MacroParse( macro_t *m, char *psz_src )
{
char *dup = strdup( (char *)psz_src );
char *src = dup;
#undef EXTRACT
}
-void E_(MacroClean)( macro_t *m )
+static void MacroClean( macro_t *m )
{
free( m->id );
free( m->param1 );
free( m->param2 );
}
-int E_(StrToMacroType)( char *name )
+static int StrToMacroType( const char *name )
{
int i;
return MVLC_UNKNOWN;
}
-void E_(MacroDo)( httpd_file_sys_t *p_args,
+static void MacroDo( httpd_file_sys_t *p_args,
macro_t *m,
char *p_request, int i_request,
char **pp_data, int *pi_data,
} \
}
- switch( E_(StrToMacroType)( m->id ) )
+ switch( StrToMacroType( m->id ) )
{
case MVLC_CONTROL:
if( i_request <= 0 )
msg_Warn( p_intf, "unauthorized control=%s", control );
break;
}
- switch( E_(StrToMacroType)( control ) )
+ switch( StrToMacroType( control ) )
{
case MVLC_PLAY:
{
playlist_AddInput( p_sys->p_playlist, p_input,
PLAYLIST_APPEND, PLAYLIST_END, VLC_TRUE,
VLC_FALSE);
+ vlc_gc_decref( p_input );
msg_Dbg( p_intf, "requested mrl add: %s", mrl );
}
free( psz_uri );
if( p_intf->p_sys->p_vlm == NULL ) break;
E_(ExtractURIValue)( p_request, "name", name, 512 );
- if( E_(StrToMacroType)( control ) == MVLC_VLM_NEW )
+ if( StrToMacroType( control ) == MVLC_VLM_NEW )
{
char type[20];
E_(ExtractURIValue)( p_request, "type", type, 20 );
if( p_intf->p_sys->p_vlm == NULL ) break;
E_(ExtractURIValue)( p_request, "name", name, 512 );
- if( E_(StrToMacroType)( control ) == MVLC_VLM_PLAY )
+ if( StrToMacroType( control ) == MVLC_VLM_PLAY )
sprintf( psz, "control %s play", name );
- else if( E_(StrToMacroType)( control ) == MVLC_VLM_PAUSE )
+ else if( StrToMacroType( control ) == MVLC_VLM_PAUSE )
sprintf( psz, "control %s pause", name );
- else if( E_(StrToMacroType)( control ) == MVLC_VLM_STOP )
+ else if( StrToMacroType( control ) == MVLC_VLM_STOP )
sprintf( psz, "control %s stop", name );
- else if( E_(StrToMacroType)( control ) == MVLC_VLM_SEEK )
+ else if( StrToMacroType( control ) == MVLC_VLM_SEEK )
{
char percent[20];
E_(ExtractURIValue)( p_request, "percent", percent, 512 );
E_(ExtractURIValue)( p_request, "file", file, 512 );
decode_URI( file );
- if( E_(StrToMacroType)( control ) == MVLC_VLM_LOAD )
+ if( StrToMacroType( control ) == MVLC_VLM_LOAD )
sprintf( psz, "load %s", file );
else
sprintf( psz, "save %s", file );
E_(ExtractURIValue)( p_request, m->param1, value, 512 );
decode_URI( value );
- switch( E_(StrToMacroType)( m->param2 ) )
+ switch( StrToMacroType( m->param2 ) )
{
case MVLC_INT:
i = atoi( value );
break;
}
- switch( E_(StrToMacroType)( m->param2 ) )
+ switch( StrToMacroType( m->param2 ) )
{
case MVLC_INT:
i = config_GetInt( p_intf, m->param1 );
#undef ALLOC
}
-char *E_(MacroSearch)( char *src, char *end, int i_mvlc, vlc_bool_t b_after )
+static
+char *MacroSearch( char *src, char *end, int i_mvlc, vlc_bool_t b_after )
{
int i_id;
int i_level = 0;
int i_skip;
macro_t m;
- i_skip = E_(MacroParse)( &m, src );
+ i_skip = MacroParse( &m, src );
- i_id = E_(StrToMacroType)( m.id );
+ i_id = StrToMacroType( m.id );
switch( i_id )
{
break;
}
- E_(MacroClean)( &m );
+ MacroClean( &m );
if( ( i_mvlc == MVLC_END && i_level == -1 ) ||
( i_mvlc != MVLC_END && i_level == 0 && i_mvlc == i_id ) )
{
macro_t m;
- src += E_(MacroParse)( &m, src );
+ src += MacroParse( &m, src );
//msg_Dbg( p_intf, "macro_id=%s", m.id );
- switch( E_(StrToMacroType)( m.id ) )
+ switch( StrToMacroType( m.id ) )
{
case MVLC_INCLUDE:
{
if( ( f = fopen( psz_file, "r" ) ) == NULL )
{
msg_Warn( p_args->p_intf,
- "unable to include file %s (%s)",
- psz_file, strerror(errno) );
+ "unable to include file %s (%m)",
+ psz_file );
break;
}
{
i_test = 0;
}
- endif = E_(MacroSearch)( src, end, MVLC_END, VLC_TRUE );
+ endif = MacroSearch( src, end, MVLC_END, VLC_TRUE );
if( i_test == 0 )
{
- char *start = E_(MacroSearch)( src, endif, MVLC_ELSE, VLC_TRUE );
+ char *start = MacroSearch( src, endif, MVLC_ELSE, VLC_TRUE );
if( start )
{
- char *stop = E_(MacroSearch)( start, endif, MVLC_END, VLC_FALSE );
+ char *stop = MacroSearch( start, endif, MVLC_END, VLC_FALSE );
if( stop )
{
E_(Execute)( p_args, p_request, i_request,
else if( i_test == 1 )
{
char *stop;
- if( ( stop = E_(MacroSearch)( src, endif, MVLC_ELSE, VLC_FALSE ) ) == NULL )
+ if( ( stop = MacroSearch( src, endif, MVLC_ELSE, VLC_FALSE ) ) == NULL )
{
- stop = E_(MacroSearch)( src, endif, MVLC_END, VLC_FALSE );
+ stop = MacroSearch( src, endif, MVLC_END, VLC_FALSE );
}
if( stop )
{
}
case MVLC_FOREACH:
{
- char *endfor = E_(MacroSearch)( src, end, MVLC_END, VLC_TRUE );
+ char *endfor = MacroSearch( src, end, MVLC_END, VLC_TRUE );
char *start = src;
- char *stop = E_(MacroSearch)( src, end, MVLC_END, VLC_FALSE );
+ char *stop = MacroSearch( src, end, MVLC_END, VLC_FALSE );
if( stop )
{
break;
}
default:
- E_(MacroDo)( p_args, &m, p_request, i_request,
- pp_data, pi_data, &dst );
+ MacroDo( p_args, &m, p_request, i_request,
+ pp_data, pi_data, &dst );
break;
}
- E_(MacroClean)( &m );
+ MacroClean( &m );
continue;
}