summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiguel Freitas <miguelfreitas@users.sourceforge.net>2003-04-06 23:58:18 +0000
committerMiguel Freitas <miguelfreitas@users.sourceforge.net>2003-04-06 23:58:18 +0000
commit28d774a38b3db8c04e95338fbc9c2e9c5b55bd60 (patch)
tree60657a6cdcea7f2782c293247ffeb65a9e92ca15
parent3be62315bb43ead81b1978cb47c31fe5f5ba0944 (diff)
downloadxine-lib-28d774a38b3db8c04e95338fbc9c2e9c5b55bd60.tar.gz
xine-lib-28d774a38b3db8c04e95338fbc9c2e9c5b55bd60.tar.bz2
fix pointers by making them relative to struct address
CVS patchset: 4558 CVS date: 2003/04/06 23:58:18
-rw-r--r--include/xine.h.in14
-rw-r--r--src/xine-engine/xine_interface.c9
2 files changed, 16 insertions, 7 deletions
diff --git a/include/xine.h.in b/include/xine.h.in
index 8c3afedc9..79edf5138 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.73 2003/04/06 22:56:16 guenter Exp $
+ * $Id: xine.h.in,v 1.74 2003/04/06 23:58:18 miguelfreitas Exp $
*
* public xine-lib (libxine) interface and documentation
*
@@ -1277,14 +1277,20 @@ typedef struct {
/* See XINE_MSG_xxx for defined types. */
int type;
- /* some message types have additional information parameters */
+ /* defined types are provided with a standard explanation.
+ * note: zero means no explanation.
+ */
+ int explanation; /* add to struct address to get a valid (char *) */
+
+ /* parameters are zero terminated strings */
int num_parameters;
+ int parameters; /* add to struct address to get a valid (char *) */
- /* where messages are stored, will be longer
+ /* where messages are stored, will be longer
*
* this field begins with the message text itself (\0-terminated),
* followed by (optional) \0-terminated parameter strings
- * the end marker is \0 \0
+ * the end marker is \0 \0
*/
char messages[1];
} xine_ui_message_data_t;
diff --git a/src/xine-engine/xine_interface.c b/src/xine-engine/xine_interface.c
index e075001d4..780ce2b87 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.49 2003/04/06 22:56:17 guenter Exp $
+ * $Id: xine_interface.c,v 1.50 2003/04/06 23:58:18 miguelfreitas Exp $
*
* convenience/abstraction layer, functions to implement
* libxine's public interface
@@ -748,12 +748,15 @@ int xine_message(xine_stream_t *stream, int type, ...) {
data->type = type;
data->num_parameters = n;
- params = data->messages;
-
if( explanation ) {
strcpy (data->messages, explanation);
+ data->explanation = data->messages - (char *)data;
params = data->messages + strlen(explanation) + 1;
+ } else {
+ data->explanation = 0;
+ params = data->messages;
}
+ data->parameters = params - (char *)data;
params[0] = '\0';
va_start(ap, type);