Commit d80b925e authored by Christophe Massiot's avatar Christophe Massiot

* src/extras/libc.c: Implemented a vlc_readdir_wrapper under Win32. This

   allows to call vlc_readdir_wrapper("\\") and get a list of Windows drives.
   This is a bit kludgy but so convenient to change drives under Windows.
 * modules/control/http: Adapted to use vlc_readdir_wrapper in foreach
   directory. Thou shalt escape all exported functions with E_() to avoid
   potential namespace collisions !
 * po: Re-run make update-po since POTFILES.in has changed.
parent de875432
......@@ -932,6 +932,16 @@ static inline void _SetQWBE( uint8_t *p, uint64_t i_qw )
# endif
#endif
#if defined(WIN32) || defined(UNDER_CE)
VLC_EXPORT( void *, vlc_opendir_wrapper, ( const char * ) );
VLC_EXPORT( struct dirent *, vlc_readdir_wrapper, ( void * ) );
VLC_EXPORT( int, vlc_closedir_wrapper, ( void * ) );
#else
# define vlc_opendir_wrapper opendir
# define vlc_readdir_wrapper readdir
# define vlc_closedir_wrapper closedir
#endif
/* Format type specifiers for 64 bits numbers */
#if defined(__CYGWIN32__) || (!defined(WIN32) && !defined(UNDER_CE))
# if defined(__WORDSIZE) && __WORDSIZE == 64
......
......@@ -10,7 +10,7 @@
/*
* In an ideal world, plugins would include all the headers they need.
* But of course, many, if not all, of them don't, so we have to make sure
* the while libvlc API is defined here in any case when included from a
* the whole libvlc API is defined here in any case when included from a
* plugin.
*/
# ifdef __PLUGIN__
......@@ -193,9 +193,11 @@ void __msg_Warn (vlc_object_t *, const char *, ... ) ATTRIBUTE_FORMAT( 2, 3);
httpd_host_t * httpd_TLSHostNew (vlc_object_t *, const char *, int, const char *, const char *, const char *, const char *);
int vlc_scandir (const char *name, struct dirent ***namelist, int (*filter) ( const struct dirent * ), int (*compar) ( const struct dirent **, const struct dirent ** ));
int sout_AccessOutWrite (sout_access_out_t *, block_t *);
struct dirent * vlc_readdir_wrapper (void *);
void config_UnsetCallbacks (module_config_t *);
void vout_SynchroRelease (vout_synchro_t *);
void __msg_Generic (vlc_object_t *, int, const char *, const char *, ... ) ATTRIBUTE_FORMAT( 4, 5);
int vlc_closedir_wrapper (void *);
int playlist_ServicesDiscoveryAdd (playlist_t *, const char *);
char * vlc_strndup (const char *s, size_t n);
void vout_PlacePicture (vout_thread_t *, unsigned int, unsigned int, unsigned int *, unsigned int *, unsigned int *, unsigned int *);
......@@ -336,6 +338,7 @@ void block_FifoEmpty (block_fifo_t *);
int playlist_ItemAddOption (playlist_item_t *, const char *);
void aout_VolumeNoneInit (aout_instance_t *);
void aout_DateInit (audio_date_t *, uint32_t);
void * vlc_opendir_wrapper (const char *);
void vlc_list_release (vlc_list_t *);
subpicture_t * spu_SortSubpictures (spu_t *, mtime_t);
playlist_item_t * playlist_LockItemGetByInput (playlist_t *,input_item_t *);
......@@ -830,6 +833,9 @@ struct module_symbols_t
const char * (*VLC_Version_inner) (void);
const char * (*VLC_CompileTime_inner) (void);
int (*playlist_PreparseEnqueueItem_inner) (playlist_t *, playlist_item_t *);
struct dirent * (*vlc_readdir_wrapper_inner) (void *);
int (*vlc_closedir_wrapper_inner) (void *);
void * (*vlc_opendir_wrapper_inner) (const char *);
};
# if defined (__PLUGIN__)
# define aout_FiltersCreatePipeline (p_symbols)->aout_FiltersCreatePipeline_inner
......@@ -1229,6 +1235,9 @@ struct module_symbols_t
# define VLC_Version (p_symbols)->VLC_Version_inner
# define VLC_CompileTime (p_symbols)->VLC_CompileTime_inner
# define playlist_PreparseEnqueueItem (p_symbols)->playlist_PreparseEnqueueItem_inner
# define vlc_readdir_wrapper (p_symbols)->vlc_readdir_wrapper_inner
# define vlc_closedir_wrapper (p_symbols)->vlc_closedir_wrapper_inner
# define vlc_opendir_wrapper (p_symbols)->vlc_opendir_wrapper_inner
# elif defined (HAVE_DYNAMIC_PLUGINS) && !defined (__BUILTIN__)
/******************************************************************
* STORE_SYMBOLS: store VLC APIs into p_symbols for plugin access.
......@@ -1631,6 +1640,9 @@ struct module_symbols_t
((p_symbols)->VLC_Version_inner) = VLC_Version; \
((p_symbols)->VLC_CompileTime_inner) = VLC_CompileTime; \
((p_symbols)->playlist_PreparseEnqueueItem_inner) = playlist_PreparseEnqueueItem; \
((p_symbols)->vlc_readdir_wrapper_inner) = vlc_readdir_wrapper; \
((p_symbols)->vlc_closedir_wrapper_inner) = vlc_closedir_wrapper; \
((p_symbols)->vlc_opendir_wrapper_inner) = vlc_opendir_wrapper; \
(p_symbols)->net_ConvertIPv4_deprecated = NULL; \
(p_symbols)->vlc_fix_readdir_charset_deprecated = NULL; \
(p_symbols)->__osd_VolumeDown_deprecated = NULL; \
......
......@@ -473,28 +473,28 @@ int E_(HttpCallback)( httpd_file_sys_t *p_args,
aout_VolumeGet( p_args->p_intf , &i_volume );
sprintf( volume , "%d" , (int)i_volume );
p_args->vars = mvar_New( "variables", "" );
mvar_AppendNewVar( p_args->vars, "url_param",
p_args->vars = E_(mvar_New)( "variables", "" );
E_(mvar_AppendNewVar)( p_args->vars, "url_param",
i_request > 0 ? "1" : "0" );
mvar_AppendNewVar( p_args->vars, "url_value", p_request );
mvar_AppendNewVar( p_args->vars, "version", VLC_Version() );
mvar_AppendNewVar( p_args->vars, "copyright", COPYRIGHT_MESSAGE );
mvar_AppendNewVar( p_args->vars, "vlc_compile_time",
E_(mvar_AppendNewVar)( p_args->vars, "url_value", p_request );
E_(mvar_AppendNewVar)( p_args->vars, "version", VLC_Version() );
E_(mvar_AppendNewVar)( p_args->vars, "copyright", COPYRIGHT_MESSAGE );
E_(mvar_AppendNewVar)( p_args->vars, "vlc_compile_time",
VLC_CompileTime() );
mvar_AppendNewVar( p_args->vars, "vlc_compile_by", VLC_CompileBy() );
mvar_AppendNewVar( p_args->vars, "vlc_compile_host",
E_(mvar_AppendNewVar)( p_args->vars, "vlc_compile_by", VLC_CompileBy() );
E_(mvar_AppendNewVar)( p_args->vars, "vlc_compile_host",
VLC_CompileHost() );
mvar_AppendNewVar( p_args->vars, "vlc_compile_domain",
E_(mvar_AppendNewVar)( p_args->vars, "vlc_compile_domain",
VLC_CompileDomain() );
mvar_AppendNewVar( p_args->vars, "vlc_compiler", VLC_Compiler() );
mvar_AppendNewVar( p_args->vars, "vlc_changeset", VLC_Changeset() );
mvar_AppendNewVar( p_args->vars, "stream_position", position );
mvar_AppendNewVar( p_args->vars, "stream_time", time );
mvar_AppendNewVar( p_args->vars, "stream_length", length );
mvar_AppendNewVar( p_args->vars, "volume", volume );
mvar_AppendNewVar( p_args->vars, "stream_state", state );
E_(mvar_AppendNewVar)( p_args->vars, "vlc_compiler", VLC_Compiler() );
E_(mvar_AppendNewVar)( p_args->vars, "vlc_changeset", VLC_Changeset() );
E_(mvar_AppendNewVar)( p_args->vars, "stream_position", position );
E_(mvar_AppendNewVar)( p_args->vars, "stream_time", time );
E_(mvar_AppendNewVar)( p_args->vars, "stream_length", length );
E_(mvar_AppendNewVar)( p_args->vars, "volume", volume );
E_(mvar_AppendNewVar)( p_args->vars, "stream_state", state );
SSInit( &p_args->stack );
E_(SSInit)( &p_args->stack );
/* first we load in a temporary buffer */
E_(FileLoad)( f, &p_buffer, &i_buffer );
......@@ -510,8 +510,8 @@ int E_(HttpCallback)( httpd_file_sys_t *p_args,
*dst = '\0';
*pi_data = dst - *pp_data;
SSClean( &p_args->stack );
mvar_Delete( p_args->vars );
E_(SSClean)( &p_args->stack );
E_(mvar_Delete)( p_args->vars );
free( p_buffer );
}
......
......@@ -167,29 +167,29 @@ typedef struct mvar_s
/** This function creates a new variable */
mvar_t *mvar_New( const char *name, const char *value );
mvar_t *E_(mvar_New)( const char *name, const char *value );
/** This function deletes a variable */
void mvar_Delete( mvar_t *v );
void E_(mvar_Delete)( mvar_t *v );
/** This function adds f to the children variables of v, at last position */
void mvar_AppendVar( mvar_t *v, mvar_t *f );
void E_(mvar_AppendVar)( mvar_t *v, mvar_t *f );
/** This function duplicates a variable */
mvar_t *mvar_Duplicate( const mvar_t *v );
mvar_t *E_(mvar_Duplicate)( const mvar_t *v );
/** This function adds f to the children variables of v, at fist position */
void mvar_PushVar( mvar_t *v, mvar_t *f );
void E_(mvar_PushVar)( mvar_t *v, mvar_t *f );
/** This function removes f from the children variables of v */
void mvar_RemoveVar( mvar_t *v, mvar_t *f );
void E_(mvar_RemoveVar)( mvar_t *v, mvar_t *f );
/** This function retrieves the child variable named "name" */
mvar_t *mvar_GetVar( mvar_t *s, const char *name );
mvar_t *E_(mvar_GetVar)( mvar_t *s, const char *name );
/** This function retrieves the value of the child variable named "field" */
char *mvar_GetValue( mvar_t *v, char *field );
char *E_(mvar_GetValue)( mvar_t *v, char *field );
/** This function creates a variable with the given name and value and
* adds it as first child of vars */
void mvar_PushNewVar( mvar_t *vars, const char *name,
const char *value );
void E_(mvar_PushNewVar)( mvar_t *vars, const char *name,
const char *value );
/** This function creates a variable with the given name and value and
* adds it as last child of vars */
void mvar_AppendNewVar( mvar_t *vars, const char *name,
const char *value );
void E_(mvar_AppendNewVar)( mvar_t *vars, const char *name,
const char *value );
/** @} */
/** \defgroup http_sets Sets *
......@@ -202,25 +202,25 @@ void mvar_AppendNewVar( mvar_t *vars, const char *name,
/** This function creates a set variable which represents a series of integer
* The arg parameter must be of the form "start[:stop[:step]]" */
mvar_t *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 the contents of the playlist */
mvar_t *mvar_PlaylistSetNew( intf_thread_t *p_intf, char *name,
playlist_t *p_pl );
mvar_t *E_(mvar_PlaylistSetNew)( intf_thread_t *p_intf, char *name,
playlist_t *p_pl );
/** This function creates a set variable with the contents of the Stream
* and media info box */
mvar_t *mvar_InfoSetNew( intf_thread_t *p_intf, char *name,
input_thread_t *p_input );
mvar_t *E_(mvar_InfoSetNew)( intf_thread_t *p_intf, char *name,
input_thread_t *p_input );
/** This function creates a set variable with the input parameters */
mvar_t *mvar_InputVarSetNew( intf_thread_t *p_intf, char *name,
input_thread_t *p_input,
const char *psz_variable );
mvar_t *E_(mvar_InputVarSetNew)( intf_thread_t *p_intf, char *name,
input_thread_t *p_input,
const char *psz_variable );
/** This function creates a set variable representing the files of the psz_dir
* directory */
mvar_t *mvar_FileSetNew( intf_thread_t *p_intf, char *name,
char *psz_dir );
mvar_t *E_(mvar_FileSetNew)( intf_thread_t *p_intf, char *name,
char *psz_dir );
/** This function creates a set variable representing the VLM streams */
mvar_t *mvar_VlmSetNew( char *name, vlm_t *vlm );
mvar_t *E_(mvar_VlmSetNew)( char *name, vlm_t *vlm );
/** This function converts the listing of a playlist node into a mvar set */
void E_(PlaylistListNode)( intf_thread_t *p_intf, playlist_t *p_pl,
......@@ -250,21 +250,21 @@ typedef struct
} rpn_stack_t;
/** This function creates the RPN evaluator stack */
void SSInit( rpn_stack_t * );
void E_(SSInit)( rpn_stack_t * );
/** This function cleans the evaluator stack */
void SSClean( rpn_stack_t * );
void E_(SSClean)( rpn_stack_t * );
/* Evaluate and execute the RPN Stack */
void EvaluateRPN( intf_thread_t *p_intf, mvar_t *vars,
rpn_stack_t *st, char *exp );
void E_(EvaluateRPN)( intf_thread_t *p_intf, mvar_t *vars,
rpn_stack_t *st, char *exp );
/* Push an operand on top of the RPN stack */
void SSPush ( rpn_stack_t *, const char * );
void E_(SSPush) ( rpn_stack_t *, const char * );
/* Remove the first operand from the RPN Stack */
char *SSPop ( rpn_stack_t * );
char *E_(SSPop) ( rpn_stack_t * );
/* Pushes an operand at a given position in the stack */
void SSPushN ( rpn_stack_t *, int );
void E_(SSPushN) ( rpn_stack_t *, int );
/* Removes an operand at the given position in the stack */
int SSPopN ( rpn_stack_t *, mvar_t * );
int E_(SSPopN) ( rpn_stack_t *, mvar_t * );
/**@}*/
......@@ -294,19 +294,19 @@ typedef struct
} macro_t;
/** This function creates a macro from a <vlc ....> tag */
int MacroParse( macro_t *m, char *psz_src );
int E_(MacroParse)( macro_t *m, char *psz_src );
/** This function cleans a macro */
void MacroClean( macro_t *m );
void E_(MacroClean)( macro_t *m );
/** This function returns the macro type identifier from its id= string value
* It uses the StrToMacroTypeTab mapping array for this */
int StrToMacroType( char *name );
int E_(StrToMacroType)( char *name );
/** This function actually executes the macro */
void MacroDo( httpd_file_sys_t *p_args, macro_t *m,
char *p_request, int i_request, char **pp_data,
int *pi_data, char **pp_dst );
void E_(MacroDo)( httpd_file_sys_t *p_args, macro_t *m,
char *p_request, int i_request, char **pp_data,
int *pi_data, char **pp_dst );
/** This function looks for macros in a string */
char *MacroSearch( char *src, char *end,
char *E_(MacroSearch)( char *src, char *end,
int i_mvlc, vlc_bool_t b_after );
/** This function parses a file for macros */
......
......@@ -26,7 +26,7 @@
#include "http.h"
#include "macros.h"
int MacroParse( macro_t *m, char *psz_src )
int E_(MacroParse)( macro_t *m, char *psz_src )
{
char *dup = strdup( (char *)psz_src );
char *src = dup;
......@@ -106,14 +106,14 @@ int MacroParse( macro_t *m, char *psz_src )
#undef EXTRACT
}
void MacroClean( macro_t *m )
void E_(MacroClean)( macro_t *m )
{
free( m->id );
free( m->param1 );
free( m->param2 );
}
int StrToMacroType( char *name )
int E_(StrToMacroType)( char *name )
{
int i;
......@@ -131,7 +131,7 @@ int StrToMacroType( char *name )
return MVLC_UNKNOWN;
}
void MacroDo( httpd_file_sys_t *p_args,
void E_(MacroDo)( httpd_file_sys_t *p_args,
macro_t *m,
char *p_request, int i_request,
char **pp_data, int *pi_data,
......@@ -166,7 +166,7 @@ void MacroDo( httpd_file_sys_t *p_args,
} \
}
switch( StrToMacroType( m->id ) )
switch( E_(StrToMacroType)( m->id ) )
{
case MVLC_CONTROL:
if( i_request <= 0 )
......@@ -179,7 +179,7 @@ void MacroDo( httpd_file_sys_t *p_args,
msg_Warn( p_intf, "unauthorized control=%s", control );
break;
}
switch( StrToMacroType( control ) )
switch( E_(StrToMacroType)( control ) )
{
case MVLC_PLAY:
{
......@@ -514,7 +514,7 @@ void MacroDo( httpd_file_sys_t *p_args,
if( p_intf->p_sys->p_vlm == NULL ) break;
E_(ExtractURIValue)( p_request, "name", name, 512 );
if( StrToMacroType( control ) == MVLC_VLM_NEW )
if( E_(StrToMacroType)( control ) == MVLC_VLM_NEW )
{
char type[20];
E_(ExtractURIValue)( p_request, "type", type, 20 );
......@@ -554,7 +554,7 @@ void MacroDo( httpd_file_sys_t *p_args,
vlm_answer->psz_value );
}
mvar_AppendNewVar( p_args->vars, "vlm_error", vlm_error );
E_(mvar_AppendNewVar)( p_args->vars, "vlm_error", vlm_error );
vlm_MessageDelete( vlm_answer );
free( vlm_error );
......@@ -595,13 +595,13 @@ void MacroDo( httpd_file_sys_t *p_args,
if( p_intf->p_sys->p_vlm == NULL ) break;
E_(ExtractURIValue)( p_request, "name", name, 512 );
if( StrToMacroType( control ) == MVLC_VLM_PLAY )
if( E_(StrToMacroType)( control ) == MVLC_VLM_PLAY )
sprintf( psz, "control %s play", name );
else if( StrToMacroType( control ) == MVLC_VLM_PAUSE )
else if( E_(StrToMacroType)( control ) == MVLC_VLM_PAUSE )
sprintf( psz, "control %s pause", name );
else if( StrToMacroType( control ) == MVLC_VLM_STOP )
else if( E_(StrToMacroType)( control ) == MVLC_VLM_STOP )
sprintf( psz, "control %s stop", name );
else if( StrToMacroType( control ) == MVLC_VLM_SEEK )
else if( E_(StrToMacroType)( control ) == MVLC_VLM_SEEK )
{
char percent[20];
E_(ExtractURIValue)( p_request, "percent", percent, 512 );
......@@ -628,7 +628,7 @@ void MacroDo( httpd_file_sys_t *p_args,
E_(ExtractURIValue)( p_request, "file", file, 512 );
E_(DecodeEncodedURI)( file );
if( StrToMacroType( control ) == MVLC_VLM_LOAD )
if( E_(StrToMacroType)( control ) == MVLC_VLM_LOAD )
sprintf( psz, "load %s", file );
else
sprintf( psz, "save %s", file );
......@@ -663,7 +663,7 @@ void MacroDo( httpd_file_sys_t *p_args,
E_(ExtractURIValue)( p_request, m->param1, value, 512 );
E_(DecodeEncodedURI)( value );
switch( StrToMacroType( m->param2 ) )
switch( E_(StrToMacroType)( m->param2 ) )
{
case MVLC_INT:
i = atoi( value );
......@@ -693,7 +693,7 @@ void MacroDo( httpd_file_sys_t *p_args,
break;
}
switch( StrToMacroType( m->param2 ) )
switch( E_(StrToMacroType)( m->param2 ) )
{
case MVLC_INT:
i = config_GetInt( p_intf, m->param1 );
......@@ -730,13 +730,13 @@ void MacroDo( httpd_file_sys_t *p_args,
if( m->param1 )
{
EvaluateRPN( p_intf, p_args->vars, &p_args->stack, m->param1 );
s = SSPop( &p_args->stack );
v = mvar_GetValue( p_args->vars, s );
E_(EvaluateRPN)( p_intf, p_args->vars, &p_args->stack, m->param1 );
s = E_(SSPop)( &p_args->stack );
v = E_(mvar_GetValue)( p_args->vars, s );
}
else
{
v = s = SSPop( &p_args->stack );
v = s = E_(SSPop)( &p_args->stack );
}
PRINTS( "%s", v );
......@@ -744,7 +744,7 @@ void MacroDo( httpd_file_sys_t *p_args,
break;
}
case MVLC_RPN:
EvaluateRPN( p_intf, p_args->vars, &p_args->stack, m->param1 );
E_(EvaluateRPN)( p_intf, p_args->vars, &p_args->stack, m->param1 );
break;
/* Useful to learn stack management */
......@@ -768,7 +768,7 @@ void MacroDo( httpd_file_sys_t *p_args,
#undef ALLOC
}
char *MacroSearch( char *src, char *end, int i_mvlc, vlc_bool_t b_after )
char *E_(MacroSearch)( char *src, char *end, int i_mvlc, vlc_bool_t b_after )
{
int i_id;
int i_level = 0;
......@@ -780,9 +780,9 @@ char *MacroSearch( char *src, char *end, int i_mvlc, vlc_bool_t b_after )
int i_skip;
macro_t m;
i_skip = MacroParse( &m, src );
i_skip = E_(MacroParse)( &m, src );
i_id = StrToMacroType( m.id );
i_id = E_(StrToMacroType)( m.id );
switch( i_id )
{
......@@ -797,7 +797,7 @@ char *MacroSearch( char *src, char *end, int i_mvlc, vlc_bool_t b_after )
break;
}
MacroClean( &m );
E_(MacroClean)( &m );
if( ( i_mvlc == MVLC_END && i_level == -1 ) ||
( i_mvlc != MVLC_END && i_level == 0 && i_mvlc == i_id ) )
......@@ -848,11 +848,11 @@ void E_(Execute)( httpd_file_sys_t *p_args,
{
macro_t m;
src += MacroParse( &m, src );
src += E_(MacroParse)( &m, src );
//msg_Dbg( p_intf, "macro_id=%s", m.id );
switch( StrToMacroType( m.id ) )
switch( E_(StrToMacroType)( m.id ) )
{
case MVLC_INCLUDE:
{
......@@ -906,8 +906,8 @@ void E_(Execute)( httpd_file_sys_t *p_args,
vlc_bool_t i_test;
char *endif;
EvaluateRPN( p_intf, p_args->vars, &p_args->stack, m.param1 );
if( SSPopN( &p_args->stack, p_args->vars ) )
E_(EvaluateRPN)( p_intf, p_args->vars, &p_args->stack, m.param1 );
if( E_(SSPopN)( &p_args->stack, p_args->vars ) )
{
i_test = 1;
}
......@@ -915,15 +915,15 @@ void E_(Execute)( httpd_file_sys_t *p_args,
{
i_test = 0;
}
endif = MacroSearch( src, end, MVLC_END, VLC_TRUE );
endif = E_(MacroSearch)( src, end, MVLC_END, VLC_TRUE );
if( i_test == 0 )
{
char *start = MacroSearch( src, endif, MVLC_ELSE, VLC_TRUE );
char *start = E_(MacroSearch)( src, endif, MVLC_ELSE, VLC_TRUE );
if( start )
{
char *stop = MacroSearch( start, endif, MVLC_END, VLC_FALSE );
char *stop = E_(MacroSearch)( start, endif, MVLC_END, VLC_FALSE );
if( stop )
{
E_(Execute)( p_args, p_request, i_request,
......@@ -934,9 +934,9 @@ void E_(Execute)( httpd_file_sys_t *p_args,
else if( i_test == 1 )
{
char *stop;
if( ( stop = MacroSearch( src, endif, MVLC_ELSE, VLC_FALSE ) ) == NULL )
if( ( stop = E_(MacroSearch)( src, endif, MVLC_ELSE, VLC_FALSE ) ) == NULL )
{
stop = MacroSearch( src, endif, MVLC_END, VLC_FALSE );
stop = E_(MacroSearch)( src, endif, MVLC_END, VLC_FALSE );
}
if( stop )
{
......@@ -950,9 +950,9 @@ void E_(Execute)( httpd_file_sys_t *p_args,
}
case MVLC_FOREACH:
{
char *endfor = MacroSearch( src, end, MVLC_END, VLC_TRUE );
char *endfor = E_(MacroSearch)( src, end, MVLC_END, VLC_TRUE );
char *start = src;
char *stop = MacroSearch( src, end, MVLC_END, VLC_FALSE );
char *stop = E_(MacroSearch)( src, end, MVLC_END, VLC_FALSE );
if( stop )
{
......@@ -961,24 +961,24 @@ void E_(Execute)( httpd_file_sys_t *p_args,
mvar_t *v;
if( !strcmp( m.param2, "integer" ) )
{
char *arg = SSPop( &p_args->stack );
index = mvar_IntegerSetNew( m.param1, arg );
char *arg = E_(SSPop)( &p_args->stack );
index = E_(mvar_IntegerSetNew)( m.param1, arg );
free( arg );
}
else if( !strcmp( m.param2, "directory" ) )
{
char *arg = SSPop( &p_args->stack );
index = mvar_FileSetNew( p_intf, m.param1, arg );
char *arg = E_(SSPop)( &p_args->stack );
index = E_(mvar_FileSetNew)( p_intf, m.param1, arg );
free( arg );
}
else if( !strcmp( m.param2, "playlist" ) )
{
index = mvar_PlaylistSetNew( p_intf, m.param1,
index = E_(mvar_PlaylistSetNew)( p_intf, m.param1,
p_intf->p_sys->p_playlist );
}
else if( !strcmp( m.param2, "information" ) )
{
index = mvar_InfoSetNew( p_intf, m.param1,
index = E_(mvar_InfoSetNew)( p_intf, m.param1,
p_intf->p_sys->p_input );
}
else if( !strcmp( m.param2, "program" )
......@@ -988,7 +988,7 @@ void E_(Execute)( httpd_file_sys_t *p_args,
|| !strcmp( m.param2, "video-es" )
|| !strcmp( m.param2, "spu-es" ) )
{
index = mvar_InputVarSetNew( p_intf, m.param1,
index = E_(mvar_InputVarSetNew)( p_intf, m.param1,
p_intf->p_sys->p_input,
m.param2 );
}
......@@ -996,25 +996,25 @@ void E_(Execute)( httpd_file_sys_t *p_args,
{
if( p_intf->p_sys->p_vlm == NULL )
p_intf->p_sys->p_vlm = vlm_New( p_intf );
index = mvar_VlmSetNew( m.param1, p_intf->p_sys->p_vlm );
index = E_(mvar_VlmSetNew)( m.param1, p_intf->p_sys->p_vlm );
}
#if 0
else if( !strcmp( m.param2, "hosts" ) )
{
index = mvar_HttpdInfoSetNew( m.param1, p_intf->p_sys->p_httpd, HTTPD_GET_HOSTS );
index = E_(mvar_HttpdInfoSetNew)( m.param1, p_intf->p_sys->p_httpd, HTTPD_GET_HOSTS );
}
else if( !strcmp( m.param2, "urls" ) )
{
index = mvar_HttpdInfoSetNew( m.param1, p_intf->p_sys->p_httpd, HTTPD_GET_URLS );
index = E_(mvar_HttpdInfoSetNew)( m.param1, p_intf->p_sys->p_httpd, HTTPD_GET_URLS );
}
else if( !strcmp( m.param2, "connections" ) )
{
index = mvar_HttpdInfoSetNew(m.param1, p_intf->p_sys->p_httpd, HTTPD_GET_CONNECTIONS);
index = E_(mvar_HttpdInfoSetNew)(m.param1, p_intf->p_sys->p_httpd, HTTPD_GET_CONNECTIONS);
}
#endif
else if( ( v = mvar_GetVar( p_args->vars, m.param2 ) ) )
else if( ( v = E_(mvar_GetVar)( p_args->vars, m.param2 ) ) )
{
index = mvar_Duplicate( v );
index = E_(mvar_Duplicate)( v );
}
else
{
......@@ -1025,7 +1025,7 @@ void E_(Execute)( httpd_file_sys_t *p_args,
for( i_idx = 0; i_idx < index->i_field; i_idx++ )
{
mvar_t *f = mvar_Duplicate( index->field[i_idx] );
mvar_t *f = E_(mvar_Duplicate)( index->field[i_idx] );
//msg_Dbg( p_intf, "foreach field[%d] name=%s value=%s", i_idx, f->name, f->value );
......@@ -1033,26 +1033,26 @@ void E_(Execute)( httpd_file_sys_t *p_args,
f->name = strdup( m.param1 );
mvar_PushVar( p_args->vars, f );
E_(mvar_PushVar)( p_args->vars, f );
E_(Execute)( p_args, p_request, i_request,
pp_data, pi_data, &dst, start, stop );
mvar_RemoveVar( p_args->vars, f );
E_(mvar_RemoveVar)( p_args->vars, f );
mvar_Delete( f );
E_(mvar_Delete)( f );
}
mvar_Delete( index );
E_(mvar_Delete)( index );
src = endfor;
}
break;
}
default:
MacroDo( p_args, &m, p_request, i_request,
pp_data, pi_data, &dst );
E_(MacroDo)( p_args, &m, p_request, i_request,
pp_data, pi_data, &dst );
break;
}
MacroClean( &m );
E_(MacroClean)( &m );
continue;
}
......
......@@ -39,7 +39,7 @@ static int InsensitiveAlphasort( const struct dirent **foo1,
mvar_t *mvar_New( const char *name, const char *value )
mvar_t *E_(mvar_New)( const char *name, const char *value )
{
mvar_t *v = malloc( sizeof( mvar_t ) );
......@@ -54,7 +54,7 @@ mvar_t *mvar_New( const char *name, const char *value )
return v;
}
void mvar_Delete( mvar_t *v )
void E_(mvar_Delete)( mvar_t *v )
{
int i;
......@@ -63,34 +63,34 @@ void mvar_Delete( mvar_t *v )
for( i = 0; i < v->i_field; i++ )
{
mvar_Delete( v->field[i] );
E_(mvar_Delete)( v->field[i] );
}
free( v->field );
free( v );
}
void mvar_AppendVar( mvar_t *v, mvar_t *f )
void E_(mvar_AppendVar)( mvar_t *v, mvar_t *f )
{
v->field = realloc( v->field, sizeof( mvar_t * ) * ( v->i_field + 2 ) );
v->field[v->i_field] = f;
v->i_field++;
}
mvar_t *mvar_Duplicate( const mvar_t *v )
mvar_t *E_(mvar_Duplicate)( const mvar_t *v )
{
int i;
mvar_t *n;
n = mvar_New( v->name, v->value );
n = E_(mvar_New)( v->name, v->value );
for( i = 0; i < v->i_field; i++ )
{
mvar_AppendVar( n, mvar_Duplicate( v->field[i] ) );
E_(mvar_AppendVar)( n, E_(mvar_Duplicate)( v->field[i] ) );
}
return n;
}
void mvar_PushVar( mvar_t *v, mvar_t *f )
void E_(mvar_PushVar)( mvar_t *v, mvar_t *f )
{
v->field = realloc( v->field, sizeof( mvar_t * ) * ( v->i_field + 2 ) );
if( v->i_field > 0 )
......@@ -101,7 +101,7 @@ void mvar_PushVar( mvar_t *v, mvar_t *f )
v->i_field++;
}
void mvar_RemoveVar( mvar_t *v, mvar_t *f )
void E_(mvar_RemoveVar)( mvar_t *v, mvar_t *f )
{
int i;
for( i = 0; i < v->i_field; i++ )
......@@ -124,7 +124,7 @@ void mvar_RemoveVar( mvar_t *v, mvar_t *f )
/* FIXME should do a realloc */
}
mvar_t *mvar_GetVar( mvar_t *s, const char *name )
mvar_t *E_(mvar_GetVar)( mvar_t *s, const char *name )
{
int i;