summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Roitzsch <mroi@users.sourceforge.net>2002-09-06 18:13:10 +0000
committerMichael Roitzsch <mroi@users.sourceforge.net>2002-09-06 18:13:10 +0000
commit6c4cd36cc5ced530a387327c4f6c576074424c6c (patch)
tree335cf36c9732583e317983a126ec508e2d08ce0b
parent75dc355377ef3cc01cfec10a1872ad64eee154ae (diff)
downloadxine-lib-6c4cd36cc5ced530a387327c4f6c576074424c6c.tar.gz
xine-lib-6c4cd36cc5ced530a387327c4f6c576074424c6c.tar.bz2
introduce "const"
fix some input plugins that would not copy the mrl on open CVS patchset: 2623 CVS date: 2002/09/06 18:13:10
-rw-r--r--include/.cvsignore1
-rw-r--r--include/xine.h.in199
-rw-r--r--src/input/input_cda.c22
-rw-r--r--src/input/input_dvd.c29
-rw-r--r--src/input/input_file.c21
-rw-r--r--src/input/input_http.c2
-rw-r--r--src/input/input_mms.c4
-rw-r--r--src/input/input_net.c9
-rw-r--r--src/input/input_plugin.h8
-rw-r--r--src/input/input_rtp.c10
-rw-r--r--src/input/input_stdin_fifo.c28
-rw-r--r--src/input/input_vcd.c24
-rw-r--r--src/input/mms.c4
-rw-r--r--src/input/mms.h4
-rw-r--r--src/xine-engine/configfile.c34
-rw-r--r--src/xine-engine/configfile.h18
-rw-r--r--src/xine-engine/events.c16
-rw-r--r--src/xine-engine/load_plugins.c36
-rw-r--r--src/xine-engine/plugin_catalog.h4
-rw-r--r--src/xine-engine/scratch.c4
-rw-r--r--src/xine-engine/scratch.h16
-rw-r--r--src/xine-engine/xine.c80
-rw-r--r--src/xine-engine/xine_interface.c43
-rw-r--r--src/xine-engine/xine_internal.h12
-rw-r--r--src/xine-utils/xmlparser.c4
25 files changed, 335 insertions, 297 deletions
diff --git a/include/.cvsignore b/include/.cvsignore
index 1e6b5fb0c..dac399d97 100644
--- a/include/.cvsignore
+++ b/include/.cvsignore
@@ -1,4 +1,3 @@
Makefile
Makefile.in
xine.h
-xine.h.tmpl
diff --git a/include/xine.h.in b/include/xine.h.in
index 5d29af9cc..e6d4eaa27 100644
--- a/include/xine.h.in
+++ b/include/xine.h.in
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: xine.h.in,v 1.6 2002/09/06 14:36:54 guenter Exp $
+ * $Id: xine.h.in,v 1.7 2002/09/06 18:13:10 mroi Exp $
*
* public xine-lib (libxine) interface and documentation
*
@@ -46,6 +46,10 @@ typedef struct xine_s xine_t;
typedef struct xine_ao_driver_s xine_ao_driver_t;
typedef struct xine_vo_driver_s xine_vo_driver_t;
+typedef const xine_t *const xine_p;
+typedef const xine_ao_driver_t *const xine_ao_driver_p;
+typedef const xine_vo_driver_t *const xine_vo_driver_p;
+
/*
* pre-init the xine engine
*
@@ -61,7 +65,7 @@ typedef struct xine_vo_driver_s xine_vo_driver_t;
* you then pass to the xine_init function.
*/
-xine_t *xine_new (void);
+xine_p xine_new (void);
/*
* helper functions to find and init audio/video drivers
@@ -76,18 +80,17 @@ xine_t *xine_new (void);
* found ...
*/
-xine_ao_driver_t *xine_open_audio_driver (xine_t *self, char *id,
- void *data);
+xine_ao_driver_p xine_open_audio_driver (xine_p self, const char *id,
+ void *data);
-xine_vo_driver_t *xine_open_video_driver (xine_t *self, char *id,
- int visual, void *data);
+xine_vo_driver_p xine_open_video_driver (xine_p self, const char *id,
+ int visual, void *data);
/*
* post_init the xine engine, specify audio and video drivers to use
*/
-void xine_init (xine_t *self, xine_ao_driver_t *ao,
- xine_vo_driver_t *vo);
+void xine_init (xine_p self, xine_ao_driver_p ao, xine_vo_driver_p vo);
/*
* open a stream
@@ -97,7 +100,7 @@ void xine_init (xine_t *self, xine_ao_driver_t *ao,
*
* returns 1 if OK, 0 on error (use xine_get_error for details)
*/
-int xine_open (xine_t *self, char *MRL);
+int xine_open (xine_p self, const char *MRL);
/*
* play a stream from a given position
@@ -106,7 +109,7 @@ int xine_open (xine_t *self, char *MRL);
*
* returns 1 if OK, 0 on error (use xine_get_error for details)
*/
-int xine_play (xine_t *self, int start_pos, int start_time);
+int xine_play (xine_p self, int start_pos, int start_time);
/*
* set xine to a trick mode for fast forward, backwards playback,
@@ -115,7 +118,7 @@ int xine_play (xine_t *self, int start_pos, int start_time);
*
* returns 1 if OK, 0 on error (use xine_get_error for details)
*/
-int xine_trick_mode (xine_t *self, int mode, int value);
+int xine_trick_mode (xine_p self, int mode, int value);
/*
* get information about the stream such as
@@ -124,50 +127,50 @@ int xine_trick_mode (xine_t *self, int mode, int value);
* constants see below
*/
-uint32_t xine_get_stream_info (xine_t *self, int info);
+uint32_t xine_get_stream_info (xine_p self, int info);
/*
* stop playback
*/
-void xine_stop (xine_t *self);
+void xine_stop (xine_p self);
/*
* ask current/recent input plugin to eject media - may or may not work,
* depending on input plugin capabilities
*/
-int xine_eject(xine_t *self);
+int xine_eject(xine_p self);
/*
* free all resources, close all plugins, close engine.
* self pointer is no longer valid after this call.
*/
-void xine_exit (xine_t *self);
+void xine_exit (xine_p self);
/*
* error handling / engine status
*/
/* return last error */
-int xine_get_error (xine_t *self);
+int xine_get_error (xine_p self);
/* get current xine engine status (constants see below) */
-int xine_get_status (xine_t *self);
+int xine_get_status (xine_p self);
/*
* set/get xine engine parameters
* e.g. playback speed, constants see below
*/
-void xine_set_param (xine_t *self, int param, int value);
-int xine_get_param (xine_t *self, int param);
+void xine_set_param (xine_p self, int param, int value);
+int xine_get_param (xine_p self, int param);
/*
* try to find out audio/spu language of given channel
* (use -1 for current channel)
* returns 1 if ok, 0 on failure
*/
-int xine_get_audio_lang (xine_t *self, int channel, char *str);
-int xine_get_spu_lang (xine_t *self, int channel, char *str);
+int xine_get_audio_lang (xine_p self, int channel, char *str);
+int xine_get_spu_lang (xine_p self, int channel, char *str);
/*
* get position / length information
@@ -177,7 +180,7 @@ int xine_get_spu_lang (xine_t *self, int channel, char *str);
* (e.g. live network streams may not have a valid length)
*/
-int xine_get_pos_length (xine_t *self,
+int xine_get_pos_length (xine_p self,
int *pos_stream, /* 0..65535 */
int *pos_time, /* milliseconds */
int *length_time);/* milliseconds */
@@ -192,7 +195,7 @@ int xine_get_pos_length (xine_t *self,
*
* returns 1 on success, 0 failure.
*/
-int xine_get_current_frame (xine_t *self, int *width, int *height,
+int xine_get_current_frame (xine_p self, int *width, int *height,
int *ratio_code, int *format,
uint8_t *img);
@@ -208,23 +211,22 @@ int xine_get_current_frame (xine_t *self, int *width, int *height,
* frontends can display xine log output using these functions
*/
-int xine_get_log_section_count(xine_t *self);
+int xine_get_log_section_count(xine_p self);
-/* return a NULL terminated array of log sections names
- note: do not free returned pointer */
-char **xine_get_log_names(xine_t *self);
+/* return a NULL terminated array of log sections names */
+const char *const *xine_get_log_names(xine_p self);
/* print some log information to <buf> section */
-void xine_log (xine_t *self, int buf,
+void xine_log (xine_p self, int buf,
const char *format, ...);
-/* get log messages of specified section
- note: do not free returned pointer */
-char **xine_get_log (xine_t *self, int buf);
+/* get log messages of specified section */
+const char *const *xine_get_log (xine_p self, int buf);
/* log callback will be called whenever something is logged */
typedef void (*xine_log_cb_t) (void *user_data, int section);
-void xine_register_log_cb (xine_t *self, xine_log_cb_t *cb, void *user_data);
+void xine_register_log_cb (xine_p self, xine_log_cb_t cb,
+ const void *const user_data);
/*
* codec reporting callback.
@@ -243,7 +245,7 @@ void xine_register_log_cb (xine_t *self, xine_log_cb_t *cb, void *user_data);
#define XINE_CODEC_VIDEO 1
typedef void (*xine_report_codec_cb_t) (void *user_data, int codec_type,
- uint32_t fourcc, char *description,
+ uint32_t fourcc, const char *description,
int handled);
/*
* register an codec reporting callback
@@ -253,9 +255,9 @@ typedef void (*xine_report_codec_cb_t) (void *user_data, int codec_type,
*
* returns 1 if the callback was registerd, 0 if it could not.
*/
-int xine_register_report_codec_cb(xine_t *self,
+int xine_register_report_codec_cb(xine_p self,
xine_report_codec_cb_t report_codec,
- void *user_data);
+ const void *const user_data);
/*
@@ -387,11 +389,11 @@ int xine_register_report_codec_cb(xine_t *self,
*/
typedef struct {
- char *origin; /* file plugin: path */
- char *mrl; /* <type>://<location> */
- char *link;
- uint32_t type; /* see below */
- off_t size; /* size of this source, may be 0 */
+ char *origin; /* file plugin: path */
+ char *mrl; /* <type>://<location> */
+ char *link;
+ uint32_t type; /* see below */
+ off_t size; /* size of this source, may be 0 */
} xine_mrl_t;
/* mrl types */
@@ -416,7 +418,7 @@ typedef struct {
#define XINE_MRL_TYPE_file_hidden (1 << 16)
/* get a list of browsable input plugin ids */
-char **xine_get_browsable_input_plugin_ids (xine_t *self) ;
+const char *const *xine_get_browsable_input_plugin_ids (xine_p self) ;
/*
@@ -427,22 +429,21 @@ char **xine_get_browsable_input_plugin_ids (xine_t *self) ;
* returns <start_mrl> if <start_mrl> is a valid MRL, not a directory
* returns NULL if <start_mrl> is an invalid MRL, not even a directory.
*/
-xine_mrl_t **xine_get_browse_mrls (xine_t *self, char *plugin_id,
- char *start_mrl,
- int *num_mrls);
+const xine_mrl_t *const *xine_get_browse_mrls (xine_p self, const char *plugin_id,
+ const char *start_mrl, int *num_mrls);
/* get a list of plugins that support the autoplay feature */
-char **xine_get_autoplay_input_plugin_ids (xine_t *self);
+const char *const *xine_get_autoplay_input_plugin_ids (xine_p self);
/* get autoplay MRL list from input plugin named <plugin_id> */
-char **xine_get_autoplay_mrls (xine_t *self, char *plugin_id, int *num_mrls);
+const char *const *xine_get_autoplay_mrls (xine_p self, const char *plugin_id, int *num_mrls);
/* get a description string for an input plugin */
-char *xine_get_input_plugin_description (xine_t *self, char *plugin_id);
+const char *xine_get_input_plugin_description (xine_p self, const char *plugin_id);
/* get lists of available audio and video output plugins */
-char **xine_list_audio_output_plugins (xine_t *self) ;
-char **xine_list_video_output_plugins (xine_t *self) ;
+const char *const *xine_list_audio_output_plugins (xine_p self) ;
+const char *const *xine_list_video_output_plugins (xine_p self) ;
/*
@@ -450,7 +451,7 @@ char **xine_list_video_output_plugins (xine_t *self) ;
*/
/* talk to video output driver */
-int xine_gui_send_vo_data (xine_t *self,
+int xine_gui_send_vo_data (xine_p self,
int type, void *data);
typedef struct {
@@ -469,13 +470,13 @@ typedef struct {
typedef struct {
/* some information about the display */
- void *display; /* Display* */
- int screen;
+ void *display; /* Display* */
+ int screen;
/* drawable to display the video in/on */
- unsigned long d; /* Drawable */
+ unsigned long d; /* Drawable */
- void *user_data;
+ void *user_data;
/*
* dest size callback
@@ -611,20 +612,21 @@ struct xine_cfg_entry_s {
/* callback function and data for live changeable values */
xine_config_cb_t callback;
- void *callback_data;
+ const void *callback_data;
};
-char* xine_config_register_string (xine_t *self,
+const char *xine_config_register_string (
+ xine_p self,
char *key,
char *def_value,
char *description,
char *help,
int exp_level,
xine_config_cb_t changed_cb,
- void *cb_data);
+ const void *const cb_data);
-int xine_config_register_range (xine_t *self,
+int xine_config_register_range (xine_p self,
char *key,
int def_value,
int min, int max,
@@ -632,9 +634,9 @@ int xine_config_register_range (xine_t *self,
char *help,
int exp_level,
xine_config_cb_t changed_cb,
- void *cb_data);
+ const void *const cb_data);
-int xine_config_register_enum (xine_t *self,
+int xine_config_register_enum (xine_p self,
char *key,
int def_value,
char **values,
@@ -642,58 +644,58 @@ int xine_config_register_enum (xine_t *self,
char *help,
int exp_level,
xine_config_cb_t changed_cb,
- void *cb_data);
+ const void *const cb_data);
-int xine_config_register_num (xine_t *self,
+int xine_config_register_num (xine_p self,
char *key,
int def_value,
char *description,
char *help,
int exp_level,
xine_config_cb_t changed_cb,
- void *cb_data);
+ const void *const cb_data);
-int xine_config_register_bool (xine_t *self,
+int xine_config_register_bool (xine_p self,
char *key,
int def_value,
char *description,
char *help,
int exp_level,
xine_config_cb_t changed_cb,
- void *cb_data);
+ const void *const cb_data);
/*
* get first config item
*/
-xine_cfg_entry_t *xine_config_get_first_entry (xine_t *self);
+xine_cfg_entry_t *xine_config_get_first_entry (xine_p self);
/*
* get next config item (iterate through the items)
* this will return NULL when called after returning the last item
*/
-xine_cfg_entry_t *xine_config_get_next_entry (xine_t *self);
+xine_cfg_entry_t *xine_config_get_next_entry (xine_p self);
/*
* search for a config entry by key
*/
-xine_cfg_entry_t *xine_config_lookup_entry (xine_t *self,
- char *key);
+xine_cfg_entry_t *xine_config_lookup_entry (xine_p self,
+ const char *key);
/*
* update a config entry (which was returned from lookup_entry() )
*/
-void xine_config_update_entry (xine_t *self,
+void xine_config_update_entry (xine_p self,
xine_cfg_entry_t *entry);
/*
* load/save config data from/to afile (e.g. $HOME/.xine/config)
*/
-void xine_load_config (xine_t *self,
- char *cfg_filename);
-void xine_save_config (xine_t *self,
- char *cfg_filename);
-void xine_reset_config (xine_t *self);
+void xine_load_config (xine_p self,
+ const char *cfg_filename);
+void xine_save_config (xine_p self,
+ const char *cfg_filename);
+void xine_reset_config (xine_p self);
/*
* xine event mechanism
@@ -776,7 +778,7 @@ typedef struct {
*/
typedef struct {
xine_event_t event;
- uint8_t button; /* Generally 1 = left, 2 = mid, 3 = right */
+ uint8_t button;
uint16_t status; /* 0:no status, 1:selected, 2:actioned */
uint8_t command[8]; /* DVD virtual machine command. */
} xine_menu_event_t;
@@ -853,15 +855,15 @@ typedef void (*xine_event_listener_cb_t) (void *user_data,
xine_event_t *event);
/* register an event listener callback */
-int xine_register_event_listener (xine_t *self,
+int xine_register_event_listener (xine_p self,
xine_event_listener_cb_t listener,
- void *user_data);
+ const void *const user_data);
-int xine_remove_event_listener (xine_t *self,
+int xine_remove_event_listener (xine_p self,
xine_event_listener_cb_t listener);
/* send an event to all event listeners */
-void xine_send_event (xine_t *self, xine_event_t *event);
+void xine_send_event (xine_p self, xine_event_t *event);
@@ -892,36 +894,37 @@ void xine_send_event (xine_t *self, xine_event_t *event);
#define XINE_TEXTPALETTE_YELLOW_BLACK_TRANSPARENT 3
typedef struct xine_osd_s xine_osd_t;
+typedef const xine_osd_t *const xine_osd_p;
-xine_osd_t *xine_osd_new (xine_t *self, int x, int y,
+xine_osd_p xine_osd_new (xine_p self, int x, int y,
int width, int height);
-void xine_osd_draw_point (xine_osd_t *self, int x, int y, int color);
+void xine_osd_draw_point (xine_osd_p self, int x, int y, int color);
-void xine_osd_draw_line (xine_osd_t *self, int x1, int y1,
+void xine_osd_draw_line (xine_osd_p self, int x1, int y1,
int x2, int y2, int color);
-void xine_osd_draw_rect (xine_osd_t *self, int x1, int y1,
+void xine_osd_draw_rect (xine_osd_p self, int x1, int y1,
int x2, int y2,
int color, int filled );
-void xine_osd_draw_text (xine_osd_t *self, int x1, int y1,
- char *text, int color_base);
-void xine_osd_get_text_size (xine_osd_t *self, char *text,
+void xine_osd_draw_text (xine_osd_p self, int x1, int y1,
+ const char *text, int color_base);
+void xine_osd_get_text_size (xine_osd_p self, const char *text,
int *width, int *height);
-void xine_osd_set_font (xine_osd_t *self, char *fontname,
+void xine_osd_set_font (xine_osd_p self, const char *fontname,
int size);
/* set position were overlay will be blended */
-void xine_osd_set_position (xine_osd_t *osd, int x, int y);
-void xine_osd_show (xine_osd_t *self, int64_t vpts);
-void xine_osd_hide (xine_osd_t *self, int64_t vpts);
+void xine_osd_set_position (xine_osd_p self, int x, int y);
+void xine_osd_show (xine_osd_p self, int64_t vpts);
+void xine_osd_hide (xine_osd_p self, int64_t vpts);
/* empty drawing area */
-void xine_osd_clear (xine_osd_t *self);
+void xine_osd_clear (xine_osd_p self);
/*
* close osd rendering engine
* loaded fonts are unloaded
* osd objects are closed
*/
-void xine_osd_free (xine_osd_t *self);
-void xine_osd_set_palette (xine_osd_t *self, uint32_t *color,
- uint8_t *trans );
+void xine_osd_free (xine_osd_p self);
+void xine_osd_set_palette (xine_osd_p self, const uint32_t *const color,
+ const uint8_t *const trans );
/*
* set on existing text palette
* (-1 to set used specified palette)
@@ -932,12 +935,12 @@ void xine_osd_set_palette (xine_osd_t *self, uint32_t *color,
*
* Use OSD_TEXT1, OSD_TEXT2, ... for some preasssigned color indices.
*/
-void xine_osd_set_text_palette (xine_osd_t *osd,
+void xine_osd_set_text_palette (xine_osd_p self,
int palette_number,
int color_base );
/* get palette (color and transparency) */
-void xine_osd_get_palette (xine_osd_t *osd, uint32_t *color,
- uint8_t *trans);
+void xine_osd_get_palette (xine_osd_p self, const uint32_t *color,
+ const uint8_t *trans);
/*
diff --git a/src/input/input_cda.c b/src/input/input_cda.c
index cec013532..202db5af6 100644
--- a/src/input/input_cda.c
+++ b/src/input/input_cda.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: input_cda.c,v 1.32 2002/09/05 22:18:54 mroi Exp $
+ * $Id: input_cda.c,v 1.33 2002/09/06 18:13:10 mroi Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -1370,15 +1370,16 @@ static void _cda_update_ui_title(cda_input_plugin_t *this) {
/*
*
*/
-static int cda_plugin_open (input_plugin_t *this_gen, char *mrl) {
+static int cda_plugin_open (input_plugin_t *this_gen, const char *mrl) {
cda_input_plugin_t *this = (cda_input_plugin_t *) this_gen;
char *filename;
_ENTER_FUNC();
- this->mrl = mrl;
+ free(this->mrl);
+ this->mrl = strdup(mrl);
- if(strncasecmp (mrl, "cda://", 6))
+ if(strncasecmp (this->mrl, "cda://", 6))
return 0;
if(!_cda_open_cd(this->cda)) {
@@ -1395,7 +1396,7 @@ static int cda_plugin_open (input_plugin_t *this_gen, char *mrl) {
_cda_cbbd_grab_infos(this);
}
- filename = (char *) &mrl[6];
+ filename = (char *) &this->mrl[6];
if(sscanf(filename, "%d", &this->cda->cur_track) != 1) {
LOG_MSG_STDERR(this->xine, _("input_cda: malformed MRL. Use cda://<track #>\n"));
@@ -1618,8 +1619,8 @@ static char *cda_plugin_get_identifier (input_plugin_t *this_gen) {
/*
* Get dir.
*/
-static xine_mrl_t **cda_plugin_get_dir (input_plugin_t *this_gen,
- char *filename, int *nEntries) {
+static const xine_mrl_t *const *cda_plugin_get_dir (input_plugin_t *this_gen,
+ const char *filename, int *nEntries) {
cda_input_plugin_t *this = (cda_input_plugin_t *) this_gen;
int i;
@@ -1694,13 +1695,13 @@ static xine_mrl_t **cda_plugin_get_dir (input_plugin_t *this_gen,
_LEAVE_FUNC();
- return this->mrls;
+ return (const xine_mrl_t *const *)this->mrls;
}
/*
* Get autoplay.
*/
-static char **cda_plugin_get_autoplay_list (input_plugin_t *this_gen, int *nFiles) {
+static const char *const *cda_plugin_get_autoplay_list (input_plugin_t *this_gen, int *nFiles) {
cda_input_plugin_t *this = (cda_input_plugin_t *) this_gen;
int i;
@@ -1742,7 +1743,7 @@ static char **cda_plugin_get_autoplay_list (input_plugin_t *this_gen, int *nFile
_LEAVE_FUNC();
- return this->filelist;
+ return (const char *const *)this->filelist;
}
/*
@@ -1775,6 +1776,7 @@ static void cda_plugin_dispose (input_plugin_t *this_gen ) {
_cda_free_cda(this->cda);
free (this->cda);
+ free (this->mrl);
free (this->mrls);
free (this);
}
diff --git a/src/input/input_dvd.c b/src/input/input_dvd.c
index 76aaab973..d756dfb77 100644
--- a/src/input/input_dvd.c
+++ b/src/input/input_dvd.c
@@ -18,7 +18,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: input_dvd.c,v 1.76 2002/09/05 22:18:54 mroi Exp $
+ * $Id: input_dvd.c,v 1.77 2002/09/06 18:13:10 mroi Exp $
*
*/
@@ -379,7 +379,7 @@ static void dvdnav_build_mrl_list(dvdnav_input_plugin_t *this) {
* dvd:///dev/dvd2:1 - Play Title 1 from /dev/dvd2
* dvd://:1.3 - Play Title 1, program 3 from /dev/dvd
*/
-static int dvdnav_plugin_open (input_plugin_t *this_gen, char *mrl) {
+static int dvdnav_plugin_open (input_plugin_t *this_gen, const char *mrl) {
char *locator;
int colon_point;
dvdnav_input_plugin_t *this = (dvdnav_input_plugin_t *) this_gen;
@@ -390,14 +390,15 @@ static int dvdnav_plugin_open (input_plugin_t *this_gen, char *mrl) {
trace_print("Called\n");
/* printf("input_dvd: open1: dvdnav=%p opened=%d\n",this->dvdnav, this->opened); */
- this->mrl = mrl;
+ free(this->mrl);
+ this->mrl = strdup(mrl);
this->pause_timer = 0;
this->dvd_name[0] = 0;
this->dvd_name_length = 0;
/* Check we can handle this MRL */
- if (!strncasecmp (mrl, "dvd://",6))
- locator = &mrl[6];
+ if (!strncasecmp (this->mrl, "dvd://",6))
+ locator = &this->mrl[6];
else {
return 0;
}
@@ -882,8 +883,8 @@ static uint32_t dvdnav_plugin_get_blocksize (input_plugin_t *this_gen) {
return DVD_BLOCK_SIZE;
}
-static xine_mrl_t **dvdnav_plugin_get_dir (input_plugin_t *this_gen,
- char *filename, int *nFiles) {
+static const xine_mrl_t *const *dvdnav_plugin_get_dir (input_plugin_t *this_gen,
+ const char *filename, int *nFiles) {
dvdnav_input_plugin_t *this = (dvdnav_input_plugin_t*)this_gen;
trace_print("Called\n");
@@ -891,7 +892,7 @@ static xine_mrl_t **dvdnav_plugin_get_dir (input_plugin_t *this_gen,
dvdnav_build_mrl_list((dvdnav_input_plugin_t *) this_gen);
*nFiles = this->num_mrls;
- return this->mrls;
+ return (const xine_mrl_t *const *)this->mrls;
}
static int dvdnav_umount_media(char *device)
@@ -1304,8 +1305,8 @@ static int dvdnav_plugin_get_optional_data (input_plugin_t *this_gen,
return INPUT_OPTIONAL_UNSUPPORTED;
}
-static char **dvdnav_plugin_get_autoplay_list (input_plugin_t *this_gen,
- int *nFiles) {
+static const char *const *dvdnav_plugin_get_autoplay_list (input_plugin_t *this_gen,
+ int *nFiles) {
dvdnav_input_plugin_t *this = (dvdnav_input_plugin_t *) this_gen;
dvdnav_status_t res;
int titles, i;
@@ -1343,12 +1344,13 @@ static char **dvdnav_plugin_get_autoplay_list (input_plugin_t *this_gen,
printf("input_dvd: get_autoplay_list exiting opened=%d dvdnav=%p\n",this->opened, this->dvdnav);
#endif
- return filelist2;
+ return (const char *const *)filelist2;
}
void dvdnav_plugin_dispose(input_plugin_t *this_gen) {
dvdnav_input_plugin_t *this = (dvdnav_input_plugin_t*)this_gen;
pthread_mutex_destroy(&this->buf_mutex);
+ free(this->mrl); this->mrl = NULL;
free(this->mrls); this->mrls = NULL;
}
@@ -1421,6 +1423,7 @@ static void *init_input_plugin (xine_t *xine, void *data) {
this->typed_buttonN = 0;
this->dvd_name[0] = 0;
this->dvd_name_length = 0;
+ this->mrl = NULL;
this->mrls = NULL;
this->num_mrls = 0;
@@ -1496,6 +1499,10 @@ static void *init_input_plugin (xine_t *xine, void *data) {
/*
* $Log: input_dvd.c,v $
+ * Revision 1.77 2002/09/06 18:13:10 mroi
+ * introduce "const"
+ * fix some input plugins that would not copy the mrl on open
+ *
* Revision 1.76 2002/09/05 22:18:54 mroi
* remove plugin's private priority and interface members
* adapt some more decoders
diff --git a/src/input/input_file.c b/src/input/input_file.c
index 42bd3a80d..d0a522fef 100644
--- a/src/input/input_file.c
+++ b/src/input/input_file.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: input_file.c,v 1.56 2002/09/05 22:18:54 mroi Exp $
+ * $Id: input_file.c,v 1.57 2002/09/06 18:13:11 mroi Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -98,7 +98,7 @@ typedef struct {
config_values_t *config;
int mrls_allocated_entries;
- xine_mrl_t **mrls;
+ xine_mrl_t **mrls;
} file_input_plugin_t;
@@ -272,7 +272,7 @@ static uint32_t file_plugin_get_capabilities (input_plugin_t *this_gen) {
/*
*
*/
-static int file_plugin_open (input_plugin_t *this_gen, char *mrl) {
+static int file_plugin_open (input_plugin_t *this_gen, const char *mrl) {
char *filename, *subtitle;
file_input_plugin_t *this = (file_input_plugin_t *) this_gen;
@@ -427,12 +427,12 @@ static int is_a_dir(char *filepathname) {
/*
*
*/
-static xine_mrl_t **file_plugin_get_dir (input_plugin_t *this_gen,
- char *filename, int *nFiles) {
+static const xine_mrl_t *const *file_plugin_get_dir (input_plugin_t *this_gen,
+ const char *filename, int *nFiles) {
file_input_plugin_t *this = (file_input_plugin_t *) this_gen;
struct dirent *pdirent;
DIR *pdir;
- xine_mrl_t *hide_files, *dir_files, *norm_files;
+ xine_mrl_t *hide_files, *dir_files, *norm_files;
char current_dir[XINE_PATH_MAX + 1];
char current_dir_slashed[XINE_PATH_MAX + 1];
char fullfilename[XINE_PATH_MAX + XINE_NAME_MAX + 1];
@@ -453,12 +453,11 @@ static xine_mrl_t **file_plugin_get_dir (input_plugin_t *this_gen,
snprintf(current_dir, XINE_PATH_MAX, "%s", this->origin_path);
}
else {
- /* Remove exceed '/' */
- while((filename[strlen(filename) - 1] == '/') && strlen(filename) > 1)
- filename[strlen(filename) - 1] = '\0';
-
snprintf(current_dir, XINE_PATH_MAX, "%s", filename);
+ /* Remove exceed '/' */
+ while((current_dir[strlen(current_dir) - 1] == '/') && strlen(current_dir) > 1)
+ current_dir[strlen(current_dir) - 1] = '\0';
}
/* Store new origin path */
@@ -741,7 +740,7 @@ static xine_mrl_t **file_plugin_get_dir (input_plugin_t *this_gen,
}
*/
- return this->mrls;
+ return (const xine_mrl_t *const *)this->mrls;
}
/*
diff --git a/src/input/input_http.c b/src/input/input_http.c
index 954c8d2e0..1ebbf0f2f 100644
--- a/src/input/input_http.c
+++ b/src/input/input_http.c
@@ -290,7 +290,7 @@ static int http_plugin_basicauth (const char *user, const char *password,
static off_t http_plugin_read (input_plugin_t *this_gen,
char *buf, off_t nlen) ;
-static int http_plugin_open (input_plugin_t *this_gen, char *mrl) {
+static int http_plugin_open (input_plugin_t *this_gen, const char *mrl) {
http_input_plugin_t *this = (http_input_plugin_t *) this_gen;
char *proxy;
diff --git a/src/input/input_mms.c b/src/input/input_mms.c
index d18a568cb..486278015 100644
--- a/src/input/input_mms.c
+++ b/src/input/input_mms.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: input_mms.c,v 1.18 2002/09/05 22:18:55 mroi Exp $
+ * $Id: input_mms.c,v 1.19 2002/09/06 18:13:11 mroi Exp $
*
* mms input plugin based on work from major mms
*/
@@ -71,7 +71,7 @@ typedef struct {
} mms_input_plugin_t;
-static int mms_plugin_open (input_plugin_t *this_gen, char *mrl) {
+static int mms_plugin_open (input_plugin_t *this_gen, const char *mrl) {
mms_input_plugin_t *this = (mms_input_plugin_t *) this_gen;
#ifdef LOG
diff --git a/src/input/input_net.c b/src/input/input_net.c
index 9df193864..a4afe2375 100644
--- a/src/input/input_net.c
+++ b/src/input/input_net.c
@@ -139,13 +139,14 @@ static int host_connect(const char *host, int port, xine_t *xine) {
return -1;
}
-static int net_plugin_open (input_plugin_t *this_gen, char *mrl) {
+static int net_plugin_open (input_plugin_t *this_gen, const char *mrl) {
net_input_plugin_t *this = (net_input_plugin_t *) this_gen;
char *filename;
char *pptr;
int port = 7658;
- this->mrl = strdup(mrl); /* FIXME: small memory leak */
+ free(this->mrl);
+ this->mrl = strdup(mrl);
if (!strncasecmp (mrl, "tcp://", 6)) {
filename = (char *) &this->mrl[6];
@@ -170,8 +171,6 @@ static int net_plugin_open (input_plugin_t *this_gen, char *mrl) {
return 0;
}
- this->mrl = strdup(mrl); /* FIXME: small memory leak */
-
this->nbc = nbc_init (this->xine);
return 1;
@@ -328,6 +327,8 @@ static int net_plugin_get_optional_data (input_plugin_t *this_gen,
}
static void net_plugin_dispose (input_plugin_t *this_gen ) {
+ net_input_plugin_t *this = (net_input_plugin_t *) this_gen;
+ free (this->mrl);
free (this_gen);
}
diff --git a/src/input/input_plugin.h b/src/input/input_plugin.h
index 0131e211c..039f11962 100644
--- a/src/input/input_plugin.h
+++ b/src/input/input_plugin.h
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: input_plugin.h,v 1.29 2002/09/05 22:18:55 mroi Exp $
+ * $Id: input_plugin.h,v 1.30 2002/09/06 18:13:11 mroi Exp $
*/
#ifndef HAVE_INPUT_PLUGIN_H
@@ -150,7 +150,7 @@ struct input_plugin_s
/*
* open input MRL - return 1 if succ
*/
- int (*open) (input_plugin_t *this, char *mrl);
+ int (*open) (input_plugin_t *this, const char *mrl);
/*
@@ -199,7 +199,7 @@ struct input_plugin_s
* ls function
* return value: NULL => filename is a file, **char=> filename is a dir
*/
- xine_mrl_t** (*get_dir) (input_plugin_t *this, char *filename, int *nFiles);
+ const xine_mrl_t *const * (*get_dir) (input_plugin_t *this, const char *filename, int *nFiles);
/*
@@ -246,7 +246,7 @@ struct input_plugin_s
* generate autoplay list
* return value: list of MRLs
*/
- char** (*get_autoplay_list) (input_plugin_t *this, int *nFiles);
+ const char *const * (*get_autoplay_list) (input_plugin_t *this, int *nFiles);
/*
diff --git a/src/input/input_rtp.c b/src/input/input_rtp.c
index f61b649c8..e576e6f53 100644
--- a/src/input/input_rtp.c
+++ b/src/input/input_rtp.c
@@ -288,7 +288,7 @@ static void * input_plugin_read_loop(void *arg) {
/*
*
*/
-static int rtp_plugin_open (input_plugin_t *this_gen, char *mrl ) {
+static int rtp_plugin_open (input_plugin_t *this_gen, const char *mrl ) {
rtp_input_plugin_t *this = (rtp_input_plugin_t *) this_gen;
char *filename;
char *pptr;
@@ -296,10 +296,11 @@ static int rtp_plugin_open (input_plugin_t *this_gen, char *mrl ) {
pthread_attr_t thread_attrs;
int err;
- this->mrl = mrl;
+ free(this->mrl);
+ this->mrl = strdup(mrl);
- if ((!strncmp (mrl, "rtp://", 6)) || (!strncmp (mrl, "udp://", 6))) {
- filename = &mrl[6];
+ if ((!strncmp (this->mrl, "rtp://", 6)) || (!strncmp (this->mrl, "udp://", 6))) {
+ filename = &this->mrl[6];
if((!filename) || (strlen(filename) == 0))
return 0;
@@ -497,6 +498,7 @@ static void rtp_plugin_dispose (input_plugin_t *this_gen ) {
free (buf);
}
+ free (this->mrl);
free (this);
}
diff --git a/src/input/input_stdin_fifo.c b/src/input/input_stdin_fifo.c
index dd9f26da3..917fdafc4 100644
--- a/src/input/input_stdin_fifo.c
+++ b/src/input/input_stdin_fifo.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: input_stdin_fifo.c,v 1.31 2002/09/05 22:18:55 mroi Exp $
+ * $Id: input_stdin_fifo.c,v 1.32 2002/09/06 18:13:11 mroi Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -75,7 +75,7 @@ typedef struct {
static off_t stdin_plugin_read (input_plugin_t *this_gen,
char *buf, off_t todo) ;
-static int stdin_plugin_open(input_plugin_t *this_gen, char *mrl) {
+static int stdin_plugin_open(input_plugin_t *this_gen, const char *mrl) {
stdin_input_plugin_t *this = (stdin_input_plugin_t *) this_gen;
char *filename;
char *pfn;
@@ -85,30 +85,31 @@ static int stdin_plugin_open(input_plugin_t *this_gen, char *mrl) {
mrl);
#endif
- this->mrl = mrl;
+ free(this->mrl);
+ this->mrl = strdup(mrl);
- if (!strncasecmp(mrl, "stdin://", 8)
- || !strncmp(mrl, "-", 1)) {
+ if (!strncasecmp(this->mrl, "stdin://", 8)
+ || !strncmp(this->mrl, "-", 1)) {
#if defined(CONFIG_DEVFS_FS)
filename = "/dev/vc/stdin";
#else
filename = "/dev/stdin";
#endif
- } else if(!strncasecmp(mrl, "fifo://", 7)) {
+ } else if(!strncasecmp(this->mrl, "fifo://", 7)) {
- if ((pfn = strrchr((mrl + 7), ':')) != NULL) {
+ if ((pfn = strrchr((this->mrl + 7), ':')) != NULL) {
filename = ++pfn;
} else {
- if (!(strncasecmp(mrl + 7, "mpeg1", 5))
- || (!(strncasecmp(mrl + 7, "mpeg2", 5)))) {
- filename = (char *) &mrl[12];
+ if (!(strncasecmp(this->mrl + 7, "mpeg1", 5))
+ || (!(strncasecmp(this->mrl + 7, "mpeg2", 5)))) {
+ filename = (char *) &this->mrl[12];
} else {
- filename = (char *) &mrl[7];
+ filename = (char *) &this->mrl[7];
}
}
} else {
@@ -343,7 +344,10 @@ static int stdin_plugin_get_optional_data (input_plugin_t *this_gen,
}
static void stdin_plugin_dispose (input_plugin_t *this_gen ) {
- free (this_gen);
+ stdin_input_plugin_t *this = (stdin_input_plugin_t *) this_gen;
+
+ free (this->mrl);
+ free (this);
}
diff --git a/src/input/input_vcd.c b/src/input/input_vcd.c
index b875ea277..7db42ae72 100644
--- a/src/input/input_vcd.c
+++ b/src/input/input_vcd.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: input_vcd.c,v 1.50 2002/09/05 22:18:55 mroi Exp $
+ * $Id: input_vcd.c,v 1.51 2002/09/06 18:13:11 mroi Exp $
*
*/
@@ -341,13 +341,14 @@ static int sun_vcd_read(vcd_input_plugin_t *this, long lba, cdsector_t *data)
/*
*
*/
-static int vcd_plugin_open (input_plugin_t *this_gen, char *mrl) {
+static int vcd_plugin_open (input_plugin_t *this_gen, const char *mrl) {
vcd_input_plugin_t *this = (vcd_input_plugin_t *) this_gen;
char *filename;
- this->mrl = mrl;
+ free(this->mrl);
+ this->mrl = strdup(mrl);
- if (strncasecmp (mrl, "vcd://",6))
+ if (strncasecmp (this->mrl, "vcd://",6))
return 0;
this->fd = open (this->device, O_RDONLY);
@@ -362,7 +363,7 @@ static int vcd_plugin_open (input_plugin_t *this_gen, char *mrl) {
return 0;
}
- filename = (char *) &mrl[6];
+ filename = (char *) &this->mrl[6];
if (sscanf (filename, "%d", &this->cur_track) != 1) {
LOG_MSG_STDERR(this->xine, _("input_vcd: malformed MRL. Use vcd://<track #>\n"));
@@ -973,8 +974,8 @@ static char *vcd_plugin_get_identifier (input_plugin_t *this_gen) {
/*
*
*/
-static xine_mrl_t **vcd_plugin_get_dir (input_plugin_t *this_gen,
- char *filename, int *nEntries) {
+static const xine_mrl_t *const *vcd_plugin_get_dir (input_plugin_t *this_gen,
+ const char *filename, int *nEntries) {
vcd_input_plugin_t *this = (vcd_input_plugin_t *) this_gen;
int i;
@@ -1053,14 +1054,14 @@ static xine_mrl_t **vcd_plugin_get_dir (input_plugin_t *this_gen,
this->mrls[*nEntries] = NULL;
- return this->mrls;
+ return (const xine_mrl_t *const *)this->mrls;
}
/*
*
*/
-static char **vcd_plugin_get_autoplay_list (input_plugin_t *this_gen,
- int *nFiles) {
+static const char *const *vcd_plugin_get_autoplay_list (input_plugin_t *this_gen,
+ int *nFiles) {
vcd_input_plugin_t *this = (vcd_input_plugin_t *) this_gen;
int i;
@@ -1100,7 +1101,7 @@ static char **vcd_plugin_get_autoplay_list (input_plugin_t *this_gen,
this->filelist[i - 1] = (char *) realloc(this->filelist[i-1], sizeof(char *));
this->filelist[i - 1] = NULL;
- return this->filelist;
+ return (const char *const *)this->filelist;
}
/*
@@ -1129,6 +1130,7 @@ static void vcd_plugin_dispose (input_plugin_t *this_gen ) {
free (this->filelist[i]);
free (this->mrls);
+ free (this->mrl);
free (this);
}
diff --git a/src/input/mms.c b/src/input/mms.c
index 8adc9cb0f..235631adb 100644
--- a/src/input/mms.c
+++ b/src/input/mms.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: mms.c,v 1.9 2002/06/07 07:00:59 tmattern Exp $
+ * $Id: mms.c,v 1.10 2002/09/06 18:13:11 mroi Exp $
*
* based on work from major mms
* utility functions to handle communication with an mms server
@@ -616,7 +616,7 @@ void mms_gen_guid(char guid[]) {
guid[36] = '\0';
}
-mms_t *mms_connect (char *url_) {
+mms_t *mms_connect (const char *url_) {
mms_t *this;
char *url = NULL;
char *url1 = NULL;
diff --git a/src/input/mms.h b/src/input/mms.h
index daecff93f..9e535315a 100644
--- a/src/input/mms.h
+++ b/src/input/mms.h
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: mms.h,v 1.5 2002/05/06 21:40:02 f1rmb Exp $
+ * $Id: mms.h,v 1.6 2002/09/06 18:13:11 mroi Exp $
*
* libmms public header
*/
@@ -30,7 +30,7 @@
typedef struct mms_s mms_t;
char* mms_connect_common(int *s ,int *port, char *url, char **host, char **path, char **file);
-mms_t* mms_connect (char *url);
+mms_t* mms_connect (const char *url);
int mms_read (mms_t *this, char *data, int len);
uint32_t mms_get_length (mms_t *this);
diff --git a/src/xine-engine/configfile.c b/src/xine-engine/configfile.c
index 618c596ff..86edf6bc3 100644
--- a/src/xine-engine/configfile.c
+++ b/src/xine-engine/configfile.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: configfile.c,v 1.24 2002/09/04 23:31:13 guenter Exp $
+ * $Id: configfile.c,v 1.25 2002/09/06 18:13:11 mroi Exp $
*
* config object (was: file) management - implementation
*
@@ -90,7 +90,7 @@ static cfg_entry_t *xine_config_add (config_values_t *this, char *key) {
* external interface
*/
-static cfg_entry_t *_xine_config_lookup_entry (config_values_t *this, char *key) {
+static cfg_entry_t *_xine_config_lookup_entry (config_values_t *this, const char *key) {
cfg_entry_t *entry;
entry = this->first;
@@ -107,8 +107,8 @@ static char *_xine_config_register_string (config_values_t *this,
char *description,
char *help,
int exp_level,
- xine_config_cb_t changed_cb,
- void *cb_data) {
+ const xine_config_cb_t changed_cb,
+ const void *const cb_data) {
cfg_entry_t *entry;
@@ -170,8 +170,8 @@ static int _xine_config_register_num (config_values_t *this,
char *description,
char *help,
int exp_level,
- xine_config_cb_t changed_cb,
- void *cb_data) {
+ const xine_config_cb_t changed_cb,
+ const void *const cb_data) {
cfg_entry_t *entry;
@@ -225,8 +225,8 @@ static int _xine_config_register_bool (config_values_t *this,
char *description,
char *help,
int exp_level,
- xine_config_cb_t changed_cb,
- void *cb_data) {
+ const xine_config_cb_t changed_cb,
+ const void *const cb_data) {
cfg_entry_t *entry;
@@ -281,8 +281,8 @@ static int _xine_config_register_range (config_values_t *this,
char *description,
char *help,
int exp_level,
- xine_config_cb_t changed_cb,
- void *cb_data) {
+ const xine_config_cb_t changed_cb,
+ const void *const cb_data) {
cfg_entry_t *entry;
@@ -368,8 +368,8 @@ static int _xine_config_register_enum (config_values_t *this,
char *description,
char *help,
int exp_level,
- xine_config_cb_t changed_cb,
- void *cb_data) {
+ const xine_config_cb_t changed_cb,
+ const void *const cb_data) {
cfg_entry_t *entry;
@@ -497,9 +497,9 @@ static void xine_config_update_string (config_values_t *this,
/*
* load/save config data from/to afile (e.g. $HOME/.xine/config)
*/
-void xine_load_config (xine_t *x, char *filename) {
+void xine_load_config (xine_p xine_ro, const char *filename) {
- config_values_t *this = x->config;
+ config_values_t *this = xine_ro->config;
FILE *f_config;
#ifdef LOG
@@ -536,9 +536,9 @@ void xine_load_config (xine_t *x, char *filename) {
}
}
-void xine_save_config (xine_t *x, char *filename) {
+void xine_save_config (xine_p xine_ro, const char *filename) {
- config_values_t *this = x->config;
+ config_values_t *this = xine_ro->config;
FILE *f_config;
#ifdef LOG
@@ -697,7 +697,7 @@ config_values_t *xine_config_init () {
return this;
}
-int xine_config_change_opt(config_values_t *config, char *opt) {
+int xine_config_change_opt(config_values_t *config, const char *opt) {
cfg_entry_t *entry;
int handled = 0;
diff --git a/src/xine-engine/configfile.h b/src/xine-engine/configfile.h
index 14e6fd4d7..978c009c4 100644
--- a/src/xine-engine/configfile.h
+++ b/src/xine-engine/configfile.h
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: configfile.h,v 1.12 2002/09/04 23:31:13 guenter Exp $
+ * $Id: configfile.h,v 1.13 2002/09/06 18:13:11 mroi Exp $
*
* config file management
*
@@ -73,7 +73,7 @@ struct cfg_entry_s {
/* callback function and data for live changeable values */
xine_config_cb_t callback;
- void *callback_data;
+ const void *callback_data;
};
/*
@@ -105,7 +105,7 @@ struct config_values_s {
char *help,
int exp_level,
xine_config_cb_t changed_cb,
- void *cb_data);
+ const void *const cb_data);
int (*register_range) (config_values_t *this,
char *key,
@@ -115,7 +115,7 @@ struct config_values_s {
char *help,
int exp_level,
xine_config_cb_t changed_cb,
- void *cb_data);
+ const void *const cb_data);
int (*register_enum) (config_values_t *this,
char *key,
@@ -125,7 +125,7 @@ struct config_values_s {
char *help,
int exp_level,
xine_config_cb_t changed_cb,
- void *cb_data);
+ const void *const cb_data);
int (*register_num) (config_values_t *this,
char *key,
@@ -134,7 +134,7 @@ struct config_values_s {
char *help,
int exp_level,
xine_config_cb_t changed_cb,
- void *cb_data);
+ const void *const cb_data);
int (*register_bool) (config_values_t *this,
char *key,
@@ -143,7 +143,7 @@ struct config_values_s {
char *help,
int exp_level,
xine_config_cb_t changed_cb,
- void *cb_data);
+ const void *const cb_data);
/* convenience function to update range, enum, num and bool values */
void (*update_num) (config_values_t *this,
@@ -164,7 +164,7 @@ struct config_values_s {
*/
cfg_entry_t* (*lookup_entry) (config_values_t *this,
- char *key);
+ const char *key);
/*
* unregister callback function
@@ -188,7 +188,7 @@ config_values_t *xine_config_init ();
* hack: intepret "opt:"-style mrls for config value changes
*/
-int xine_config_change_opt(config_values_t *config, char *opt) ;
+int xine_config_change_opt(config_values_t *config, const char *opt) ;
#ifdef __cplusplus
diff --git a/src/xine-engine/events.c b/src/xine-engine/events.c
index 623a984fc..8f3f5eb6a 100644
--- a/src/xine-engine/events.c
+++ b/src/xine-engine/events.c
@@ -29,9 +29,10 @@
#include "xine_internal.h"
-int xine_register_event_listener (xine_t *this,
- xine_event_listener_cb_t listener,
- void *user_data) {
+int xine_register_event_listener (xine_p this_ro,
+ const xine_event_listener_cb_t listener,
+ const void *const user_data) {
+ xine_t *this = (xine_t *)this_ro;
/* Ensure the listener is non-NULL */
if(listener == NULL) {
return 0;
@@ -51,17 +52,18 @@ int xine_register_event_listener (xine_t *this,
return 0;
}
-void xine_send_event(xine_t *this, xine_event_t *event) {
+void xine_send_event(xine_p this, xine_event_t *event) {
uint16_t i;
/* Itterate through all event handlers */
for(i=0; i < this->num_event_listeners; i++) {
- (this->event_listeners[i]) (this->event_listener_user_data[i], event);
+ (this->event_listeners[i]) ((void *)this->event_listener_user_data[i], event);
}
}
-int xine_remove_event_listener(xine_t *this,
- xine_event_listener_cb_t listener) {
+int xine_remove_event_listener(xine_p this_ro,
+ const xine_event_listener_cb_t listener) {
+ xine_t *this = (xine_t *)this_ro;
uint16_t i, found;
found = 1; i = 0;
diff --git a/src/xine-engine/load_plugins.c b/src/xine-engine/load_plugins.c
index 676aa6c3d..cd7710008 100644
--- a/src/xine-engine/load_plugins.c
+++ b/src/xine-engine/load_plugins.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: load_plugins.c,v 1.84 2002/09/06 13:15:02 guenter Exp $
+ * $Id: load_plugins.c,v 1.85 2002/09/06 18:13:11 mroi Exp $
*
*
* Load input/demux/audio_out/video_out/codec plugins
@@ -557,7 +557,7 @@ void scan_plugins (xine_t *this) {
map_decoders (this);
}
-static char **_xine_get_featured_input_plugin_ids(xine_t *this, int feature) {
+static const char **_xine_get_featured_input_plugin_ids(xine_p this, int feature) {
plugin_catalog_t *catalog;
int i;
@@ -585,17 +585,17 @@ static char **_xine_get_featured_input_plugin_ids(xine_t *this, int feature) {
return catalog->ids;
}
-char **xine_get_autoplay_input_plugin_ids(xine_t *this) {
+const char *const *xine_get_autoplay_input_plugin_ids(xine_p this) {
return (_xine_get_featured_input_plugin_ids(this, INPUT_CAP_AUTOPLAY));
}
-char **xine_get_browsable_input_plugin_ids(xine_t *this) {
+const char *const *xine_get_browsable_input_plugin_ids(xine_p this) {
return (_xine_get_featured_input_plugin_ids(this, INPUT_CAP_GET_DIR));
}
-char *xine_get_input_plugin_description(xine_t *this, char *plugin_id) {
+const char *xine_get_input_plugin_description(xine_p this, const char *plugin_id) {
plugin_catalog_t *catalog;
plugin_node_t *node;
@@ -619,10 +619,11 @@ char *xine_get_input_plugin_description(xine_t *this, char *plugin_id) {
* video out plugins section
*/
-xine_vo_driver_t *xine_open_video_driver (xine_t *this,
- char *id,
- int visual_type, void *visual) {
-
+xine_vo_driver_p xine_open_video_driver (xine_p this_ro,
+ const char *id,
+ int visual_type, void *visual) {
+ xine_t *this = (xine_t *)this_ro;
+
plugin_node_t *node;
xine_vo_driver_t *driver;
vo_info_t *vo_info;
@@ -664,7 +665,7 @@ xine_vo_driver_t *xine_open_video_driver (xine_t *this,
* audio output plugins section
*/
-char **xine_list_audio_output_plugins (xine_t *this) {
+const char *const *xine_list_audio_output_plugins (xine_p this) {
plugin_catalog_t *catalog;
int i;
@@ -688,7 +689,7 @@ char **xine_list_audio_output_plugins (xine_t *this) {
return catalog->ids;
}
-char **xine_list_video_output_plugins (xine_t *this) {
+const char *const *xine_list_video_output_plugins (xine_p this) {
plugin_catalog_t *catalog;
int i;
@@ -712,9 +713,10 @@ char **xine_list_video_output_plugins (xine_t *this) {
return catalog->ids;
}
-xine_ao_driver_t *xine_open_audio_driver (xine_t *this, char *id,
- void *data) {
-
+xine_ao_driver_p xine_open_audio_driver (xine_p this_ro, const char *id,
+ void *data) {
+ xine_t *this = (xine_t *)this_ro;
+
plugin_node_t *node;
xine_ao_driver_t *driver;
ao_info_t *ao_info;
@@ -753,7 +755,7 @@ xine_ao_driver_t *xine_open_audio_driver (xine_t *this, char *id,
* get autoplay mrl list from input plugin
*/
-char **xine_get_autoplay_mrls (xine_t *this, char *plugin_id, int *num_mrls) {
+const char *const *xine_get_autoplay_mrls (xine_p this, const char *plugin_id, int *num_mrls) {
plugin_catalog_t *catalog;
plugin_node_t *node;
@@ -781,8 +783,8 @@ char **xine_get_autoplay_mrls (xine_t *this, char *plugin_id, int *num_mrls) {
/*
* input plugin mrl browser support
*/
-xine_mrl_t **xine_get_browse_mrls (xine_t *this, char *plugin_id,
- char *start_mrl, int *num_mrls) {
+const xine_mrl_t *const *xine_get_browse_mrls (xine_p this, const char *plugin_id,
+ const char *start_mrl, int *num_mrls) {
plugin_catalog_t *catalog;
plugin_node_t *node;
diff --git a/src/xine-engine/plugin_catalog.h b/src/xine-engine/plugin_catalog.h
index e851a17a8..d65ea8e25 100644
--- a/src/xine-engine/plugin_catalog.h
+++ b/src/xine-engine/plugin_catalog.h
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: plugin_catalog.h,v 1.3 2002/09/05 16:24:14 guenter Exp $
+ * $Id: plugin_catalog.h,v 1.4 2002/09/06 18:13:12 mroi Exp $
*
* xine-internal header: Definitions for plugin lists
*
@@ -51,7 +51,7 @@ struct plugin_catalog_s {
plugin_node_t *video_decoder_map[DECODER_MAX];
plugin_node_t *spu_decoder_map[DECODER_MAX];
- char *ids[PLUGIN_MAX];
+ const char *ids[PLUGIN_MAX];
};
typedef struct plugin_catalog_s plugin_catalog_t;
diff --git a/src/xine-engine/scratch.c b/src/xine-engine/scratch.c
index c47c7a9b6..eb097ed75 100644
--- a/src/xine-engine/scratch.c
+++ b/src/xine-engine/scratch.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: scratch.c,v 1.7 2002/03/01 09:29:50 guenter Exp $
+ * $Id: scratch.c,v 1.8 2002/09/06 18:13:12 mroi Exp $
*
* top-level xine functions
*
@@ -50,7 +50,7 @@ static void scratch_printf (scratch_buffer_t *this, const char *format, va_list
this->cur = (this->cur + 1) % this->num_lines;
}
-static char **scratch_get_content (scratch_buffer_t *this) {
+static const char **scratch_get_content (scratch_buffer_t *this) {
int i, j;
diff --git a/src/xine-engine/scratch.h b/src/xine-engine/scratch.h
index 4390641a8..34f60067b 100644
--- a/src/xine-engine/scratch.h
+++ b/src/xine-engine/scratch.h
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: scratch.h,v 1.3 2002/03/01 09:29:50 guenter Exp $
+ * $Id: scratch.h,v 1.4 2002/09/06 18:13:12 mroi Exp $
*
* scratch buffer for log output
*
@@ -32,17 +32,17 @@ typedef struct scratch_buffer_s scratch_buffer_t;
struct scratch_buffer_s {
- void (*scratch_printf) (scratch_buffer_t *this, const char *format, va_list ap);
+ void (*scratch_printf) (scratch_buffer_t *this, const char *format, va_list ap);
- char **(*get_content) (scratch_buffer_t *this);
+ const char **(*get_content) (scratch_buffer_t *this);
- void (*dispose) (scratch_buffer_t *this);
+ void (*dispose) (scratch_buffer_t *this);
- char **lines;
- char **ordered;
+ char **lines;
+ const char **ordered;
- int num_lines;
- int cur;
+ int num_lines;
+ int cur;
};
diff --git a/src/xine-engine/xine.c b/src/xine-engine/xine.c
index 69435755f..b796adaa4 100644
--- a/src/xine-engine/xine.c
+++ b/src/xine-engine/xine.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: xine.c,v 1.151 2002/09/05 23:20:21 guenter Exp $
+ * $Id: xine.c,v 1.152 2002/09/06 18:13:12 mroi Exp $
*
* top-level xine functions
*
@@ -150,23 +150,24 @@ void xine_report_codec( xine_t *this, int codec_type, uint32_t fourcc, uint32_t
if( !buf_type )
buf_type = fourcc_to_buf_video( fourcc );
- this->report_codec_cb( this->report_codec_user_data,
+ this->report_codec_cb( (void *)this->report_codec_user_data,
codec_type, fourcc,
buf_video_name( buf_type ), handled );
} else {
if( !buf_type )
buf_type = formattag_to_buf_audio( fourcc );
- this->report_codec_cb( this->report_codec_user_data,
+ this->report_codec_cb( (void *)this->report_codec_user_data,
codec_type, fourcc,
buf_audio_name( buf_type ), handled );
}
}
}
-int xine_register_report_codec_cb(xine_t *this,
- xine_report_codec_cb_t report_codec,
- void *user_data) {
+int xine_register_report_codec_cb(xine_p this_ro,
+ const xine_report_codec_cb_t report_codec,
+ const void *const user_data) {
+ xine_t *this = (xine_t *)this_ro;
this->report_codec_cb = report_codec;
this->report_codec_user_data = user_data;
@@ -264,7 +265,8 @@ void xine_stop_internal (xine_t *this) {
printf ("xine_stop: done\n");
}
-void xine_stop (xine_t *this) {
+void xine_stop (xine_p this_ro) {
+ xine_t *this = (xine_t *)this_ro;
pthread_mutex_lock (&this->xine_lock);
xine_stop_internal(this);
@@ -286,7 +288,7 @@ void xine_stop (xine_t *this) {
/*
* demuxer probing
*/
-static int probe_demux (xine_t *this, char *MRL, int stage1, int stage2) {
+static int probe_demux (xine_t *this, const char *MRL, int stage1, int stage2) {
int i;
int stages[3];
@@ -331,7 +333,7 @@ static int probe_demux (xine_t *this, char *MRL, int stage1, int stage2) {
/*
* try to find a demuxer which handle the MRL stream
*/
-static int find_demuxer(xine_t *this, char *MRL) {
+static int find_demuxer(xine_t *this, const char *MRL) {
this->cur_demuxer_plugin = NULL;
@@ -361,7 +363,7 @@ static int find_demuxer(xine_t *this, char *MRL) {
return 0;
}
-int xine_open_internal (xine_t *this, char *mrl) {
+int xine_open_internal (xine_t *this, const char *mrl) {
printf ("xine_open: mrl '%s'\n", mrl);
@@ -525,7 +527,8 @@ int xine_play_internal (xine_t *this, int start_pos, int start_time) {
return 1;
}
-int xine_open (xine_t *this, char *mrl) {
+int xine_open (xine_p this_ro, const char *mrl) {
+ xine_t *this = (xine_t *)this_ro;
int ret;
pthread_mutex_lock (&this->xine_lock);
@@ -535,7 +538,8 @@ int xine_open (xine_t *this, char *mrl) {
return ret;
}
-int xine_play (xine_t *this, int start_pos, int start_time) {
+int xine_play (xine_p this_ro, int start_pos, int start_time) {
+ xine_t *this = (xine_t *)this_ro;
int ret;
pthread_mutex_lock (&this->xine_lock);
@@ -546,7 +550,8 @@ int xine_play (xine_t *this, int start_pos, int start_time) {
}
-int xine_eject (xine_t *this) {
+int xine_eject (xine_p this_ro) {
+ xine_t *this = (xine_t *)this_ro;
int status;
@@ -566,7 +571,8 @@ int xine_eject (xine_t *this) {
return status;
}
-void xine_exit (xine_t *this) {
+void xine_exit (xine_p this_ro) {
+ xine_t *this = (xine_t *)this_ro;
int i;
@@ -615,7 +621,7 @@ void xine_exit (xine_t *this) {
}
-xine_t *xine_new (void) {
+xine_p xine_new (void) {
xine_t *this;
int i;
@@ -703,9 +709,12 @@ xine_t *xine_new (void) {
}
-void xine_init (xine_t *this,
- xine_ao_driver_t *ao,
- xine_vo_driver_t *vo) {
+void xine_init (xine_p this_ro,
+ xine_ao_driver_p ao_ro,
+ xine_vo_driver_p vo_ro) {
+ xine_t *this = (xine_t *)this_ro;
+ xine_ao_driver_t *ao = (xine_ao_driver_t *)ao_ro;
+ xine_vo_driver_t *vo = (xine_vo_driver_t *)vo_ro;
static char *demux_strategies[] = {"default", "reverse", "content",
"extension", NULL};
@@ -831,7 +840,8 @@ static int xine_get_current_position (xine_t *this) {
return (int) share;
}
-int xine_get_status(xine_t *this) {
+int xine_get_status(xine_p this_ro) {
+ xine_t *this = (xine_t *)this_ro;
int status;
status = this->status;
@@ -901,8 +911,9 @@ static int xine_get_stream_length (xine_t *this) {
return 0;
}
-int xine_get_pos_length (xine_t *this, int *pos_stream,
+int xine_get_pos_length (xine_p this_ro, int *pos_stream,
int *pos_time, int *length_time) {
+ xine_t *this = (xine_t *)this_ro;
*pos_stream = xine_get_current_position (this);
*pos_time = this->cur_input_time * 1000;
@@ -935,9 +946,10 @@ static int xine_set_audio_property(xine_t *this, int property, int value) {
return ~value;
}
-int xine_get_current_frame (xine_t *this, int *width, int *height,
+int xine_get_current_frame (xine_p this_ro, int *width, int *height,
int *ratio_code, int *format,
uint8_t *img) {
+ xine_t *this = (xine_t *)this_ro;
vo_frame_t *frame;
@@ -976,7 +988,8 @@ int xine_get_current_frame (xine_t *this, int *width, int *height,
return 1;
}
-int xine_get_spu_lang (xine_t *this, int channel, char *str) {
+int xine_get_spu_lang (xine_p this_ro, int channel, char *str) {
+ xine_t *this = (xine_t *)this_ro;
switch (this->spu_channel_user) {
case -2:
@@ -1002,7 +1015,8 @@ int xine_get_spu_lang (xine_t *this, int channel, char *str) {
return 0;
}
-int xine_get_audio_lang (xine_t *this, int channel, char *str) {
+int xine_get_audio_lang (xine_p this_ro, int channel, char *str) {
+ xine_t *this = (xine_t *)this_ro;
switch (this->audio_channel_user) {
case -2:
@@ -1043,12 +1057,12 @@ osd_renderer_t *xine_get_osd_renderer (xine_t *this) {
/*
* log functions
*/
-int xine_get_log_section_count (xine_t *this) {
+int xine_get_log_section_count (xine_p this_ro) {
return XINE_LOG_NUM;
}
-char **xine_get_log_names (xine_t *this) {
- static char *log_sections[XINE_LOG_NUM + 1];
+const char *const *xine_get_log_names (xine_p this_ro) {
+ static const char *log_sections[XINE_LOG_NUM + 1];
log_sections[XINE_LOG_FORMAT] = _("stream format");
log_sections[XINE_LOG_MSG] = _("messages");
@@ -1058,7 +1072,8 @@ char **xine_get_log_names (xine_t *this) {
return log_sections;
}
-void xine_log (xine_t *this, int buf, const char *format, ...) {
+void xine_log (xine_p this_ro, int buf, const char *format, ...) {
+ xine_t *this = (xine_t *)this_ro;
va_list argp;
@@ -1074,7 +1089,8 @@ void xine_log (xine_t *this, int buf, const char *format, ...) {
va_end (argp);
}
-char **xine_get_log (xine_t *this, int buf) {
+const char *const *xine_get_log (xine_p this_ro, int buf) {
+ xine_t *this = (xine_t *)this_ro;
if(buf >= XINE_LOG_NUM)
return NULL;
@@ -1082,18 +1098,18 @@ char **xine_get_log (xine_t *this, int buf) {
return this->log_buffers[buf]->get_content (this->log_buffers[buf]);
}
-void xine_register_log_cb (xine_t *self, xine_log_cb_t *cb, void *user_data) {
+void xine_register_log_cb (xine_p this_ro, const xine_log_cb_t cb, const void *const user_data) {
printf ("xine: xine_register_log_cb: not implemented yet.\n");
abort();
}
-int xine_get_error (xine_t *this) {
- return this->err;
+int xine_get_error (xine_p this_ro) {
+ return this_ro->err;
}
-int xine_trick_mode (xine_t *this, int mode, int value) {
+int xine_trick_mode (xine_p this_ro, int mode, int value) {
printf ("xine: xine_trick_mode not implemented yet.\n");
abort ();
}
diff --git a/src/xine-engine/xine_interface.c b/src/xine-engine/xine_interface.c
index c30bcb162..c929ae0ba 100644
--- a/src/xine-engine/xine_interface.c
+++ b/src/xine-engine/xine_interface.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: xine_interface.c,v 1.5 2002/09/06 14:36:54 guenter Exp $
+ * $Id: xine_interface.c,v 1.6 2002/09/06 18:13:12 mroi Exp $
*
* convenience/abstraction layer, functions to implement
* libxine's public interface
@@ -74,14 +74,14 @@ int xine_check_version(int major, int minor, int sub) {
* public config object access functions
*/
-char* xine_config_register_string (xine_t *self,
+const char* xine_config_register_string (xine_p self,
char *key,
char *def_value,
char *description,
char *help,
int exp_level,
xine_config_cb_t changed_cb,
- void *cb_data) {
+ const void *const cb_data) {
return self->config->register_string (self->config,
key,
@@ -94,7 +94,7 @@ char* xine_config_register_string (xine_t *self,
}
-int xine_config_register_range (xine_t *self,
+int xine_config_register_range (xine_p self,
char *key,
int def_value,
int min, int max,
@@ -102,7 +102,7 @@ int xine_config_register_range (xine_t *self,
char *help,
int exp_level,
xine_config_cb_t changed_cb,
- void *cb_data) {
+ const void *const cb_data) {
return self->config->register_range (self->config,
key, def_value, min, max,
description, help, exp_level,
@@ -110,7 +110,7 @@ int xine_config_register_range (xine_t *self,
}
-int xine_config_register_enum (xine_t *self,
+int xine_config_register_enum (xine_p self,
char *key,
int def_value,
char **values,
@@ -118,7 +118,7 @@ int xine_config_register_enum (xine_t *self,
char *help,
int exp_level,
xine_config_cb_t changed_cb,
- void *cb_data) {
+ const void *const cb_data) {
return self->config->register_enum (self->config,
key, def_value, values,
description, help, exp_level,
@@ -126,14 +126,14 @@ int xine_config_register_enum (xine_t *self,
}
-int xine_config_register_num (xine_t *self,
+int xine_config_register_num (xine_p self,
char *key,
int def_value,
char *description,
char *help,
int exp_level,
xine_config_cb_t changed_cb,
- void *cb_data) {
+ const void *const cb_data) {
return self->config->register_num (self->config,
key, def_value,
description, help, exp_level,
@@ -141,14 +141,14 @@ int xine_config_register_num (xine_t *self,
}
-int xine_config_register_bool (xine_t *self,
+int xine_config_register_bool (xine_p self,
char *key,
int def_value,
char *description,
char *help,
int exp_level,
xine_config_cb_t changed_cb,
- void *cb_data) {
+ const void *const cb_data) {
return self->config->register_bool (self->config,
key, def_value,
description, help, exp_level,
@@ -163,7 +163,7 @@ int xine_config_register_bool (xine_t *self,
* and return it
*/
-xine_cfg_entry_t *xine_config_get_current_entry (xine_t *this) {
+xine_cfg_entry_t *xine_config_get_current_entry (xine_p this) {
config_values_t *config = this->config;
@@ -195,7 +195,7 @@ xine_cfg_entry_t *xine_config_get_current_entry (xine_t *this) {
/*
* get first config item
*/
-xine_cfg_entry_t *xine_config_get_first_entry (xine_t *this) {
+xine_cfg_entry_t *xine_config_get_first_entry (xine_p this) {
config_values_t *config = this->config;
@@ -209,7 +209,7 @@ xine_cfg_entry_t *xine_config_get_first_entry (xine_t *this) {
* get next config item (iterate through the items)
* this will return NULL when called after returning the last item
*/
-xine_cfg_entry_t *xine_config_get_next_entry (xine_t *this) {
+xine_cfg_entry_t *xine_config_get_next_entry (xine_p this) {
config_values_t *config = this->config;
@@ -223,7 +223,7 @@ xine_cfg_entry_t *xine_config_get_next_entry (xine_t *this) {
* search for a config entry by key
*/
-xine_cfg_entry_t *xine_config_lookup_entry (xine_t *this, char *key) {
+xine_cfg_entry_t *xine_config_lookup_entry (xine_p this, const char *key) {
config_values_t *config = this->config;
@@ -236,7 +236,7 @@ xine_cfg_entry_t *xine_config_lookup_entry (xine_t *this, char *key) {
/*
* update a config entry (which was returned from lookup_entry() )
*/
-void xine_config_update_entry (xine_t *this, xine_cfg_entry_t *entry){
+void xine_config_update_entry (xine_p this, xine_cfg_entry_t *entry){
printf ("xine_interface: xine_config_update_entry: not implemented\n");
switch (entry->type) {
@@ -259,7 +259,7 @@ void xine_config_update_entry (xine_t *this, xine_cfg_entry_t *entry){
}
-void xine_reset_config (xine_t *this){
+void xine_reset_config (xine_p this){
config_values_t *config = this->config;
cfg_entry_t *entry;
@@ -278,13 +278,14 @@ void xine_reset_config (xine_t *this){
config->last = NULL;
}
-int xine_gui_send_vo_data (xine_t *this,
+int xine_gui_send_vo_data (xine_p this,
int type, void *data) {
return this->video_driver->gui_data_exchange (this->video_driver, type, data);
}
-void xine_set_param (xine_t *this, int param, int value) {
+void xine_set_param (xine_p this_ro, int param, int value) {
+ xine_t *this = (xine_t *)this_ro;
switch (param) {
case XINE_PARAM_SPEED:
@@ -324,7 +325,7 @@ void xine_set_param (xine_t *this, int param, int value) {
}
}
-int xine_get_param (xine_t *this, int param) {
+int xine_get_param (xine_p this, int param) {
switch (param) {
case XINE_PARAM_SPEED:
@@ -356,7 +357,7 @@ int xine_get_param (xine_t *this, int param) {
return 0;
}
-uint32_t xine_get_stream_info (xine_t *this, int info) {
+uint32_t xine_get_stream_info (xine_p this, int info) {
printf ("xine_interface: xine_get_stream_info: not implemented\n");
switch (info) {
diff --git a/src/xine-engine/xine_internal.h b/src/xine-engine/xine_internal.h
index 45aa9f787..ad6a7b233 100644
--- a/src/xine-engine/xine_internal.h
+++ b/src/xine-engine/xine_internal.h
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: xine_internal.h,v 1.95 2002/09/05 22:19:04 mroi Exp $
+ * $Id: xine_internal.h,v 1.96 2002/09/06 18:13:12 mroi Exp $
*
*/
@@ -149,7 +149,7 @@ struct xine_s {
config_values_t *config;
/* MRL of displayed logo */
- char *logo_mrl;
+ const char *logo_mrl;
/* Logo manipulation mutex */
pthread_mutex_t logo_lock;
@@ -218,7 +218,7 @@ struct xine_s {
/* Array of event handlers. */
xine_event_listener_cb_t event_listeners[XINE_MAX_EVENT_LISTENERS];
- void *event_listener_user_data[XINE_MAX_EVENT_LISTENERS];
+ const void *event_listener_user_data[XINE_MAX_EVENT_LISTENERS];
uint16_t num_event_listeners;
/* scratch string buffer */
@@ -233,7 +233,7 @@ struct xine_s {
int finished_thread_running;
xine_report_codec_cb_t report_codec_cb;
- void *report_codec_user_data;
+ const void *report_codec_user_data;
int playing_logo;
int curtime_needed_for_osd;
@@ -244,7 +244,7 @@ struct xine_s {
* private function prototypes:
*/
-int xine_open_internal (xine_t *this, char *MRL);
+int xine_open_internal (xine_t *this, const char *MRL);
int xine_play_internal (xine_t *this,
int start_pos, int start_time);
void xine_stop_internal (xine_t *this);
@@ -312,8 +312,6 @@ xine_ao_driver_t *xine_load_audio_output_plugin (xine_t *self, char *id);
void xine_set_speed (xine_t *this, int speed) ;
-int xine_get_spu_lang (xine_t *this, int channel, char *str) ;
-
void xine_select_spu_channel (xine_t *this, int channel) ;
int xine_get_audio_channel (xine_t *this) ;
diff --git a/src/xine-utils/xmlparser.c b/src/xine-utils/xmlparser.c
index 8324cac2a..3d32913bc 100644
--- a/src/xine-utils/xmlparser.c
+++ b/src/xine-utils/xmlparser.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: xmlparser.c,v 1.1 2002/05/01 19:41:55 guenter Exp $
+ * $Id: xmlparser.c,v 1.2 2002/09/06 18:13:12 mroi Exp $
*
*/
@@ -125,7 +125,7 @@ int xml_parser_get_node(xml_node_t *current_node, char *root_name, int rec) {
char property_name[TOKEN_SIZE];
char node_name[TOKEN_SIZE];
int state = 0;
- int res;
+ int res = 0;
int parse_res;
int bypass_get_token = 0;
xml_node_t *subtree = NULL;