Commit fb1651c6 authored by Jean-Paul Saman's avatar Jean-Paul Saman
Browse files

PDA Interface:

- Fixed resource leak with playlists
- VLC coding style cleanup
- Rework v4l and stream out interface code to use  VLC playlists as it should be used.
- Remove dead wood
parent 03b32e8e
/*****************************************************************************
* network.c : Network interface of the gtk-pda plugin.
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: network.c,v 1.1 2003/07/23 22:02:56 jpsaman Exp $
*
* Authors: Marc Ariberti <marcari@videolan.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
/*****************************************************************************
* Preamble
*****************************************************************************/
#include <sys/types.h> /* off_t */
#include <stdlib.h>
#include <vlc/vlc.h>
#include <vlc/intf.h>
#include <vlc/vout.h>
#include <stdio.h>
#include <string.h>
#include <dirent.h>
#include <sys/stat.h>
#include <unistd.h>
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <gtk/gtk.h>
#include "callbacks.h"
#include "interface.h"
#include "support.h"
#include "pda.h"
static void update_network_multicast(GtkWidget * widget);
static void update_network_multicast(GtkWidget * widget)
{
intf_thread_t * p_intf = GtkGetIntf( widget );
GtkToggleButton * p_network_multicast =
GTK_GET( TOGGLE_BUTTON, "network_multicast" );
GtkEditable * p_network_multicast_address =
GTK_GET( EDITABLE, "network_multicast_address" );
GtkEditable * p_network_multicast_port =
GTK_GET( EDITABLE, "network_multicast_port" );
if (gtk_toggle_button_get_active(p_network_multicast))
{
gchar * str = g_strconcat( "udp://@",
gtk_editable_get_chars(p_network_multicast_address, 0, -1), ":",
gtk_editable_get_chars(p_network_multicast_port, 0, -1), NULL );
gtk_entry_set_text(p_intf->p_sys->p_mrlentry, str);
g_free( str );
}
}
void
on_network_multicast_toggled (GtkToggleButton *togglebutton,
gpointer user_data)
{
update_network_multicast(GTK_WIDGET(togglebutton));
}
void
on_network_multicast_port_changed (GtkEditable *editable,
gpointer user_data)
{
update_network_multicast(GTK_WIDGET(editable));
}
void
on_network_multicast_address_changed (GtkEditable *editable,
gpointer user_data)
{
update_network_multicast(GTK_WIDGET(editable));
}
void
on_network_http_toggled (GtkToggleButton *togglebutton,
gpointer user_data)
{
intf_thread_t * p_intf = GtkGetIntf( togglebutton );
if (gtk_toggle_button_get_active(togglebutton))
{
gtk_entry_set_text(p_intf->p_sys->p_mrlentry, "http://");
}
}
void
on_network_ftp_toggled (GtkToggleButton *togglebutton,
gpointer user_data)
{
intf_thread_t * p_intf = GtkGetIntf( togglebutton );
if (gtk_toggle_button_get_active(togglebutton))
{
gtk_entry_set_text(p_intf->p_sys->p_mrlentry, "ftp://");
}
}
void
on_network_mms_toggled (GtkToggleButton *togglebutton,
gpointer user_data)
{
intf_thread_t * p_intf = GtkGetIntf( togglebutton );
if (gtk_toggle_button_get_active(togglebutton))
{
gtk_entry_set_text(p_intf->p_sys->p_mrlentry, "mms://");
}
}
/*****************************************************************************
* network.h : Network part of the gtk-pda plugin.
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: network.h,v 1.1 2003/07/23 22:02:56 jpsaman Exp $
*
* Authors: Marc Ariberti <marcari@videolan.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
void
on_network_udp_toggled (GtkToggleButton *togglebutton,
gpointer user_data);
void
on_network_udp_port_changed (GtkEditable *editable,
gpointer user_data);
void
on_network_multicast_toggled (GtkToggleButton *togglebutton,
gpointer user_data);
void
on_network_multicast_port_changed (GtkEditable *editable,
gpointer user_data);
void
on_network_multicast_address_changed (GtkEditable *editable,
gpointer user_data);
void
on_network_http_toggled (GtkToggleButton *togglebutton,
gpointer user_data);
void
on_network_ftp_toggled (GtkToggleButton *togglebutton,
gpointer user_data);
void
on_network_mms_toggled (GtkToggleButton *togglebutton,
gpointer user_data);
void
PDANetworkGo (GtkButton *button,
gpointer user_data);
......@@ -2,7 +2,7 @@
* pda.c : PDA Gtk2 plugin for vlc
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: pda.c,v 1.13 2003/11/30 11:22:29 jpsaman Exp $
* $Id: pda.c,v 1.14 2003/11/30 21:21:20 jpsaman Exp $
*
* Authors: Jean-Paul Saman <jpsaman@wxs.nl>
* Marc Ariberti <marcari@videolan.org>
......@@ -145,10 +145,11 @@ static void Run( intf_thread_t *p_intf )
int i_args = 1;
int i_dummy;
#endif
GtkCellRenderer *renderer = NULL;
GtkTreeViewColumn *column = NULL;
GtkListStore *filelist = NULL;
GtkListStore *playlist = NULL;
playlist_t *p_playlist;
GtkCellRenderer *p_renderer = NULL;
GtkTreeViewColumn *p_column = NULL;
GtkListStore *p_filelist = NULL;
GtkListStore *p_playlist_store = NULL;
#ifndef NEED_GTK2_MAIN
gtk_set_locale ();
......@@ -223,46 +224,46 @@ static void Run( intf_thread_t *p_intf )
msg_Err(p_intf, "Error obtaining pointer to File List");
/* Insert columns 0 */
renderer = gtk_cell_renderer_text_new ();
gtk_tree_view_insert_column_with_attributes(p_intf->p_sys->p_tvfile, 0, _("Filename"), renderer, NULL);
column = gtk_tree_view_get_column(p_intf->p_sys->p_tvfile, 0 );
gtk_tree_view_column_add_attribute(column, renderer, "text", 0 );
gtk_tree_view_column_set_sort_column_id(column, 0);
p_renderer = gtk_cell_renderer_text_new ();
gtk_tree_view_insert_column_with_attributes(p_intf->p_sys->p_tvfile, 0, _("Filename"), p_renderer, NULL);
p_column = gtk_tree_view_get_column(p_intf->p_sys->p_tvfile, 0 );
gtk_tree_view_column_add_attribute(p_column, p_renderer, "text", 0 );
gtk_tree_view_column_set_sort_column_id(p_column, 0);
/* Insert columns 1 */
renderer = gtk_cell_renderer_text_new ();
gtk_tree_view_insert_column_with_attributes(p_intf->p_sys->p_tvfile, 1, _("Permissions"), renderer, NULL);
column = gtk_tree_view_get_column(p_intf->p_sys->p_tvfile, 1 );
gtk_tree_view_column_add_attribute(column, renderer, "text", 1 );
gtk_tree_view_column_set_sort_column_id(column, 1);
p_renderer = gtk_cell_renderer_text_new ();
gtk_tree_view_insert_column_with_attributes(p_intf->p_sys->p_tvfile, 1, _("Permissions"), p_renderer, NULL);
p_column = gtk_tree_view_get_column(p_intf->p_sys->p_tvfile, 1 );
gtk_tree_view_column_add_attribute(p_column, p_renderer, "text", 1 );
gtk_tree_view_column_set_sort_column_id(p_column, 1);
/* Insert columns 2 */
renderer = gtk_cell_renderer_text_new ();
gtk_tree_view_insert_column_with_attributes(p_intf->p_sys->p_tvfile, 2, _("Size"), renderer, NULL);
column = gtk_tree_view_get_column(p_intf->p_sys->p_tvfile, 2 );
gtk_tree_view_column_add_attribute(column, renderer, "text", 2 );
gtk_tree_view_column_set_sort_column_id(column, 2);
p_renderer = gtk_cell_renderer_text_new ();
gtk_tree_view_insert_column_with_attributes(p_intf->p_sys->p_tvfile, 2, _("Size"), p_renderer, NULL);
p_column = gtk_tree_view_get_column(p_intf->p_sys->p_tvfile, 2 );
gtk_tree_view_column_add_attribute(p_column, p_renderer, "text", 2 );
gtk_tree_view_column_set_sort_column_id(p_column, 2);
/* Insert columns 3 */
renderer = gtk_cell_renderer_text_new ();
gtk_tree_view_insert_column_with_attributes(p_intf->p_sys->p_tvfile, 3, _("Owner"), renderer, NULL);
column = gtk_tree_view_get_column(p_intf->p_sys->p_tvfile, 3 );
gtk_tree_view_column_add_attribute(column, renderer, "text", 3 );
gtk_tree_view_column_set_sort_column_id(column, 3);
p_renderer = gtk_cell_renderer_text_new ();
gtk_tree_view_insert_column_with_attributes(p_intf->p_sys->p_tvfile, 3, _("Owner"), p_renderer, NULL);
p_column = gtk_tree_view_get_column(p_intf->p_sys->p_tvfile, 3 );
gtk_tree_view_column_add_attribute(p_column, p_renderer, "text", 3 );
gtk_tree_view_column_set_sort_column_id(p_column, 3);
/* Insert columns 4 */
renderer = gtk_cell_renderer_text_new ();
gtk_tree_view_insert_column_with_attributes(p_intf->p_sys->p_tvfile, 4, _("Group"), renderer, NULL);
column = gtk_tree_view_get_column(p_intf->p_sys->p_tvfile, 4 );
gtk_tree_view_column_add_attribute(column, renderer, "text", 4 );
gtk_tree_view_column_set_sort_column_id(column, 4);
p_renderer = gtk_cell_renderer_text_new ();
gtk_tree_view_insert_column_with_attributes(p_intf->p_sys->p_tvfile, 4, _("Group"), p_renderer, NULL);
p_column = gtk_tree_view_get_column(p_intf->p_sys->p_tvfile, 4 );
gtk_tree_view_column_add_attribute(p_column, p_renderer, "text", 4 );
gtk_tree_view_column_set_sort_column_id(p_column, 4);
/* Get new directory listing */
filelist = gtk_list_store_new (5,
p_filelist = gtk_list_store_new (5,
G_TYPE_STRING, /* Filename */
G_TYPE_STRING, /* permissions */
G_TYPE_UINT64, /* File size */
G_TYPE_STRING, /* Owner */
G_TYPE_STRING);/* Group */
ReadDirectory(p_intf, filelist, ".");
gtk_tree_view_set_model(GTK_TREE_VIEW(p_intf->p_sys->p_tvfile), GTK_TREE_MODEL(filelist));
g_object_unref(filelist); /* Model will be released by GtkTreeView */
ReadDirectory(p_intf, p_filelist, ".");
gtk_tree_view_set_model(GTK_TREE_VIEW(p_intf->p_sys->p_tvfile), GTK_TREE_MODEL(p_filelist));
g_object_unref(p_filelist); /* Model will be released by GtkTreeView */
gtk_tree_selection_set_mode(gtk_tree_view_get_selection(GTK_TREE_VIEW(p_intf->p_sys->p_tvfile)),GTK_SELECTION_MULTIPLE);
/* Column properties */
......@@ -278,33 +279,35 @@ static void Run( intf_thread_t *p_intf )
msg_Err(p_intf, "Error obtaining pointer to Play List");
/* Columns 1 */
renderer = gtk_cell_renderer_text_new ();
gtk_tree_view_insert_column_with_attributes(p_intf->p_sys->p_tvplaylist, 0, _("Filename"), renderer, NULL);
column = gtk_tree_view_get_column(p_intf->p_sys->p_tvplaylist, 0 );
gtk_tree_view_column_add_attribute(column, renderer, "text", 0 );
gtk_tree_view_column_set_sort_column_id(column, 0);
p_renderer = gtk_cell_renderer_text_new ();
gtk_tree_view_insert_column_with_attributes(p_intf->p_sys->p_tvplaylist, 0, _("Filename"), p_renderer, NULL);
p_column = gtk_tree_view_get_column(p_intf->p_sys->p_tvplaylist, 0 );
gtk_tree_view_column_add_attribute(p_column, p_renderer, "text", 0 );
gtk_tree_view_column_set_sort_column_id(p_column, 0);
/* Column 2 */
renderer = gtk_cell_renderer_text_new ();
gtk_tree_view_insert_column_with_attributes(p_intf->p_sys->p_tvplaylist, 1, _("Time"), renderer, NULL);
column = gtk_tree_view_get_column(p_intf->p_sys->p_tvplaylist, 1 );
gtk_tree_view_column_add_attribute(column, renderer, "text", 1 );
gtk_tree_view_column_set_sort_column_id(column, 1);
p_renderer = gtk_cell_renderer_text_new ();
gtk_tree_view_insert_column_with_attributes(p_intf->p_sys->p_tvplaylist, 1, _("Time"), p_renderer, NULL);
p_column = gtk_tree_view_get_column(p_intf->p_sys->p_tvplaylist, 1 );
gtk_tree_view_column_add_attribute(p_column, p_renderer, "text", 1 );
gtk_tree_view_column_set_sort_column_id(p_column, 1);
#if 0
/* Column 3 - is a hidden column used for reliable deleting items from the underlying playlist */
renderer = gtk_cell_renderer_text_new ();
gtk_tree_view_insert_column_with_attributes(p_intf->p_sys->p_tvplaylist, 2, _("Index"), renderer, NULL);
column = gtk_tree_view_get_column(p_intf->p_sys->p_tvplaylist, 2 );
gtk_tree_view_column_add_attribute(column, renderer, "text", 2 );
gtk_tree_view_column_set_sort_column_id(column, 2);
p_renderer = gtk_cell_renderer_text_new ();
gtk_tree_view_insert_column_with_attributes(p_intf->p_sys->p_tvplaylist, 2, _("Index"), p_renderer, NULL);
p_column = gtk_tree_view_get_column(p_intf->p_sys->p_tvplaylist, 2 );
gtk_tree_view_column_add_attribute(p_column, p_renderer, "text", 2 );
gtk_tree_view_column_set_sort_column_id(p_column, 2);
#endif
/* update the playlist */
playlist = gtk_list_store_new (3,
p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
p_playlist_store = gtk_list_store_new (3,
G_TYPE_STRING, /* Filename */
G_TYPE_STRING, /* Time */
G_TYPE_UINT); /* Hidden index */
PlaylistRebuildListStore( playlist, vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE ));
gtk_tree_view_set_model(GTK_TREE_VIEW(p_intf->p_sys->p_tvplaylist), GTK_TREE_MODEL(playlist));
g_object_unref(playlist);
PlaylistRebuildListStore(p_playlist_store, p_playlist);
gtk_tree_view_set_model(GTK_TREE_VIEW(p_intf->p_sys->p_tvplaylist), GTK_TREE_MODEL(p_playlist_store));
g_object_unref(p_playlist_store);
vlc_object_release(p_playlist); /* Free the playlist */
gtk_tree_selection_set_mode(gtk_tree_view_get_selection(GTK_TREE_VIEW(p_intf->p_sys->p_tvplaylist)),GTK_SELECTION_MULTIPLE);
/* Column properties */
......
......@@ -2,7 +2,7 @@
* pda_callbacks.c : Callbacks for the pda Linux Gtk+ plugin.
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: pda_callbacks.c,v 1.19 2003/11/30 11:22:29 jpsaman Exp $
* $Id: pda_callbacks.c,v 1.20 2003/11/30 21:21:20 jpsaman Exp $
*
* Authors: Jean-Paul Saman <jpsaman@wxs.nl>
*
......@@ -87,7 +87,7 @@ void * E_(__GtkGetIntf)( GtkWidget * widget )
return p_data;
}
void PlaylistAddItem(GtkWidget *widget, gchar *name)
void PlaylistAddItem(GtkWidget *widget, gchar *name, char **ppsz_options, int i_size)
{
intf_thread_t *p_intf = GtkGetIntf( widget );
playlist_t *p_playlist;
......@@ -112,6 +112,8 @@ void PlaylistAddItem(GtkWidget *widget, gchar *name)
if (p_play_model)
{
int i;
/* Add a new row to the playlist treeview model */
gtk_list_store_append (GTK_LIST_STORE(p_play_model), &p_play_iter);
gtk_list_store_set (GTK_LIST_STORE(p_play_model), &p_play_iter,
......@@ -124,15 +126,20 @@ void PlaylistAddItem(GtkWidget *widget, gchar *name)
#if 0
if (p_intf->p_sys->b_autoplayfile)
{
playlist_Add( p_playlist, (const char*)name, 0, 0,
playlist_Add( p_playlist, (const char*)name, (const char**)ppsz_options, i_size,
PLAYLIST_APPEND | PLAYLIST_GO, PLAYLIST_END);
}
else
#endif
{
playlist_Add( p_playlist, (const char*)name, 0, 0,
playlist_Add( p_playlist, (const char*)name, (const char**)ppsz_options, i_size,
PLAYLIST_APPEND, PLAYLIST_END );
}
}
/* Cleanup memory */
for (i=0; i<i_size; i++)
free(ppsz_options[i]);
free(ppsz_options);
}
}
vlc_object_release( p_playlist );
......@@ -143,11 +150,12 @@ void PlaylistRebuildListStore( GtkListStore * p_list, playlist_t * p_playlist )
GtkTreeIter iter;
int i_dummy;
gchar * ppsz_text[2];
#if 0
GdkColor red;
red.red = 65535;
red.blue = 0;
red.green = 0;
#endif
vlc_mutex_lock( &p_playlist->object_lock );
for( i_dummy = 0; i_dummy < p_playlist->i_size ; i_dummy++ )
{
......@@ -169,9 +177,9 @@ void PlaylistRebuildListStore( GtkListStore * p_list, playlist_t * p_playlist )
void ReadDirectory(intf_thread_t *p_intf, GtkListStore *p_list, char *psz_dir )
{
GtkTreeIter iter;
struct dirent **namelist;
struct passwd *pw;
struct group *grp;
struct dirent **pp_namelist;
struct passwd *p_pw;
struct group *p_grp;
struct stat st;
int n=-1, status=-1;
......@@ -182,7 +190,7 @@ void ReadDirectory(intf_thread_t *p_intf, GtkListStore *p_list, char *psz_dir )
if (status<0)
msg_Dbg(p_intf, "permision denied" );
}
n = scandir(".", &namelist, 0, alphasort);
n = scandir(".", &pp_namelist, 0, alphasort);
if (n<0)
perror("scandir");
......@@ -194,14 +202,14 @@ void ReadDirectory(intf_thread_t *p_intf, GtkListStore *p_list, char *psz_dir )
if (lstat("..", &st)==0)
{
/* user, group */
pw = getpwuid(st.st_uid);
grp = getgrgid(st.st_gid);
p_pw = getpwuid(st.st_uid);
p_grp = getgrgid(st.st_gid);
/* XXX : kludge temporaire pour yopy */
ppsz_text[0] = "..";
ppsz_text[1] = get_file_perms(st);
ppsz_text[2] = pw->pw_name;
ppsz_text[3] = grp->gr_name;
ppsz_text[2] = p_pw->pw_name;
ppsz_text[3] = p_grp->gr_name;
/* Add a new row to the model */
gtk_list_store_append (p_list, &iter);
......@@ -218,18 +226,18 @@ void ReadDirectory(intf_thread_t *p_intf, GtkListStore *p_list, char *psz_dir )
/* kludge */
for (i=0; i<n; i++)
{
if ((namelist[i]->d_name[0] != '.') &&
(lstat(namelist[i]->d_name, &st)==0))
if ((pp_namelist[i]->d_name[0] != '.') &&
(lstat(pp_namelist[i]->d_name, &st)==0))
{
/* user, group */
pw = getpwuid(st.st_uid);
grp = getgrgid(st.st_gid);
p_pw = getpwuid(st.st_uid);
p_grp = getgrgid(st.st_gid);
/* This is a list of strings. */
ppsz_text[0] = namelist[i]->d_name;
ppsz_text[0] = pp_namelist[i]->d_name;
ppsz_text[1] = get_file_perms(st);
ppsz_text[2] = pw->pw_name;
ppsz_text[3] = grp->gr_name;
ppsz_text[2] = p_pw->pw_name;
ppsz_text[3] = p_grp->gr_name;
#if 0
msg_Dbg(p_intf, "(%d) file: %s permission: %s user: %s group: %s", i, ppsz_text[0], ppsz_text[1], ppsz_text[2], ppsz_text[3] );
#endif
......@@ -245,90 +253,87 @@ void ReadDirectory(intf_thread_t *p_intf, GtkListStore *p_list, char *psz_dir )
if (ppsz_text[1]) free(ppsz_text[1]);
}
}
free(namelist);
free(pp_namelist);
}
}
static char *get_file_perms(const struct stat st)
{
char *perm;
char *psz_perm;
perm = (char *) malloc(sizeof(char)*10);
strncpy( perm, "----------", sizeof("----------"));
psz_perm = (char *) malloc(sizeof(char)*10);
strncpy( psz_perm, "----------", sizeof("----------"));
/* determine permission modes */
if (S_ISLNK(st.st_mode))
perm[0]= 'l';
psz_perm[0]= 'l';
else if (S_ISDIR(st.st_mode))
perm[0]= 'd';
psz_perm[0]= 'd';
else if (S_ISCHR(st.st_mode))
perm[0]= 'c';
psz_perm[0]= 'c';
else if (S_ISBLK(st.st_mode))
perm[0]= 'b';
psz_perm[0]= 'b';
else if (S_ISFIFO(st.st_mode))
perm[0]= 'f';
psz_perm[0]= 'f';
else if (S_ISSOCK(st.st_mode))
perm[0]= 's';
psz_perm[0]= 's';
else if (S_ISREG(st.st_mode))
perm[0]= '-';
psz_perm[0]= '-';
else /* Unknown type is an error */
perm[0]= '?';
psz_perm[0]= '?';
/* Get file permissions */
/* User */
if (st.st_mode & S_IRUSR)
perm[1]= 'r';
psz_perm[1]= 'r';
if (st.st_mode & S_IWUSR)
perm[2]= 'w';
psz_perm[2]= 'w';
if (st.st_mode & S_IXUSR)
{
if (st.st_mode & S_ISUID)
perm[3] = 's';
psz_perm[3] = 's';
else
perm[3]= 'x';
psz_perm[3]= 'x';
}
else if (st.st_mode & S_ISUID)
perm[3] = 'S';
psz_perm[3] = 'S';
/* Group */
if (st.st_mode & S_IRGRP)
perm[4]= 'r';
psz_perm[4]= 'r';
if (st.st_mode & S_IWGRP)
perm[5]= 'w';
psz_perm[5]= 'w';
if (st.st_mode & S_IXGRP)
{
if (st.st_mode & S_ISGID)
perm[6] = 's';
psz_perm[6] = 's';
else
perm[6]= 'x';
psz_perm[6]= 'x';
}
else if (st.st_mode & S_ISGID)
perm[6] = 'S';
psz_perm[6] = 'S';
/* Other */
if (st.st_mode & S_IROTH)
perm[7]= 'r';
psz_perm[7]= 'r';
if (st.st_mode & S_IWOTH)
perm[8]= 'w';
psz_perm[8]= 'w';
if (st.st_mode & S_IXOTH)
{
// 'sticky' bit
if (st.st_mode &S_ISVTX)
perm[9] = 't';
psz_perm[9] = 't';
else
perm[9]= 'x';
psz_perm[9]= 'x';
}
else if (st.st_mode &S_ISVTX)
perm[9]= 'T';
psz_perm[9]= 'T';
return perm;
return psz_perm;
}
/*
* Main interface callbacks
*/
gboolean
onPDADeleteEvent (GtkWidget *widget,
GdkEvent *event,
gpointer user_data)
gboolean onPDADeleteEvent(GtkWidget *widget, GdkEvent *event, gpointer user_data)
{
intf_thread_t *p_intf = GtkGetIntf( widget );
......@@ -341,11 +346,9 @@ onPDADeleteEvent (GtkWidget *widget,
}
void
onRewind (GtkButton *button,
gpointer user_data)
void onRewind(GtkButton *button, gpointer user_data)
{
intf_thread_t * p_intf = GtkGetIntf( button );
intf_thread_t *p_intf = GtkGetIntf( button );
if (p_intf->p_sys->p_input != NULL)
{
......@@ -354,11 +357,9 @@ onRewind (GtkButton *button,