#include "vlc_codec.h"
#include "variables.h"
+
+#ifdef HAVE_SEARCH_H
+# include <search.h>
+#endif
+
#ifndef WIN32
+# include <vlc_fs.h>
# include <unistd.h>
#else
# include <io.h>
# define close( a ) closesocket (a)
#endif
-#include <search.h>
#include <limits.h>
#include <assert.h>
static int DumpCommand( vlc_object_t *, char const *,
vlc_value_t, vlc_value_t, void * );
-static vlc_object_t * FindParent ( vlc_object_t *, int );
-static vlc_object_t * FindChild ( vlc_object_internals_t *, int );
static vlc_object_t * FindParentName( vlc_object_t *, const char * );
static vlc_object_t * FindChildName ( vlc_object_internals_t *, const char * );
static void PrintObject( vlc_object_internals_t *, const char * );
/**
* select()-able pipes emulated using Winsock
*/
-static int pipe (int fd[2])
+# define vlc_pipe selectable_pipe
+static int selectable_pipe (int fd[2])
{
SOCKADDR_IN addr;
int addrlen = sizeof (addr);
if (internals->pipes[0] == -1)
#endif
{
- if (pipe (internals->pipes))
+ if (vlc_pipe (internals->pipes))
internals->pipes[0] = internals->pipes[1] = -1;
}
}
}
-#undef vlc_object_find
-/*****************************************************************************
- * find a typed object and increment its refcount
- *****************************************************************************
- * This function recursively looks for a given object type. i_mode can be one
- * of FIND_PARENT, FIND_CHILD or FIND_ANYWHERE.
- *****************************************************************************/
-void * vlc_object_find( vlc_object_t *p_this, int i_type, int i_mode )
-{
- vlc_object_t *p_found;
-
- /* If we are of the requested type ourselves, don't look further */
- if( vlc_internals (p_this)->i_object_type == i_type )
- {
- vlc_object_hold( p_this );
- return p_this;
- }
-
- /* Otherwise, recursively look for the object */
- if (i_mode == FIND_ANYWHERE)
- return vlc_object_find (VLC_OBJECT(p_this->p_libvlc), i_type, FIND_CHILD);
-
- switch (i_type)
- {
- case VLC_OBJECT_VOUT:
- case VLC_OBJECT_AOUT:
- break;
- case VLC_OBJECT_INPUT:
- /* input can only be accessed like this from children,
- * otherwise we could not promise that it is initialized */
- if (i_mode != FIND_PARENT)
- return NULL;
- break;
- default:
- return NULL;
- }
-
- libvlc_lock (p_this->p_libvlc);
- switch (i_mode)
- {
- case FIND_PARENT:
- p_found = FindParent (p_this, i_type);
- break;
- case FIND_CHILD:
- p_found = FindChild (vlc_internals (p_this), i_type);
- break;
- default:
- assert (0);
- }
- libvlc_unlock (p_this->p_libvlc);
- return p_found;
-}
-
-
static int objnamecmp(const vlc_object_t *obj, const char *name)
{
char *objname = vlc_object_get_name(obj);
MYCASE( INTEGER, "integer" );
MYCASE( HOTKEY, "hotkey" );
MYCASE( STRING, "string" );
- MYCASE( MODULE, "module" );
- MYCASE( FILE, "file" );
- MYCASE( DIRECTORY, "directory" );
MYCASE( VARIABLE, "variable" );
MYCASE( FLOAT, "float" );
MYCASE( TIME, "time" );
MYCASE( COORDS, "coords" );
MYCASE( ADDRESS, "address" );
MYCASE( MUTEX, "mutex" );
- MYCASE( LIST, "list" );
#undef MYCASE
}
printf( " *-o \"%s\" (%s", p_var->psz_name, psz_type );
printf( ": %s", p_var->val.b_bool ? "true" : "false" );
break;
case VLC_VAR_INTEGER:
- printf( ": %d", p_var->val.i_int );
+ printf( ": %"PRId64, p_var->val.i_int );
break;
case VLC_VAR_STRING:
printf( ": \"%s\"", p_var->val.psz_string );
case VLC_VAR_ADDRESS:
printf( ": %p", p_var->val.p_address );
break;
- case VLC_VAR_LIST:
- fputs( ": TODO", stdout );
- break;
}
fputc( '\n', stdout );
}
/* Following functions are local */
-static vlc_object_t *FindParent (vlc_object_t *p_this, int i_type)
-{
- for (vlc_object_t *parent = p_this->p_parent;
- parent != NULL;
- parent = parent->p_parent)
- {
- if (vlc_internals (parent)->i_object_type == i_type)
- return vlc_object_hold (parent);
- }
- return NULL;
-}
-
static vlc_object_t *FindParentName (vlc_object_t *p_this, const char *name)
{
for (vlc_object_t *parent = p_this->p_parent;
return NULL;
}
-static vlc_object_t *FindChild (vlc_object_internals_t *priv, int i_type)
-{
- for (priv = priv->first; priv != NULL; priv = priv->next)
- {
- if (priv->i_object_type == i_type)
- return vlc_object_hold (vlc_externals (priv));
-
- vlc_object_t *found = FindChild (priv, i_type);
- if (found != NULL)
- return found;
- }
- return NULL;
-}
-
static vlc_object_t *FindChildName (vlc_object_internals_t *priv,
const char *name)
{