summaryrefslogtreecommitdiff
path: root/src/xine-utils
diff options
context:
space:
mode:
Diffstat (limited to 'src/xine-utils')
-rw-r--r--src/xine-utils/utils.c64
-rw-r--r--src/xine-utils/xine_buffer.h10
-rw-r--r--src/xine-utils/xineutils.h15
3 files changed, 56 insertions, 33 deletions
diff --git a/src/xine-utils/utils.c b/src/xine-utils/utils.c
index fff4f028d..a26b83b46 100644
--- a/src/xine-utils/utils.c
+++ b/src/xine-utils/utils.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: utils.c,v 1.34 2004/09/20 19:30:05 valtri Exp $
+ * $Id: utils.c,v 1.35 2004/09/26 22:54:53 valtri Exp $
*
*/
#define _POSIX_PTHREAD_SEMANTICS 1 /* for 5-arg getpwuid_r on solaris */
@@ -28,6 +28,9 @@
#include "xineutils.h"
#include "xineintl.h"
+#ifdef _MSC_VER
+#include "xine_internal.h"
+#endif
#include <errno.h>
#include <pwd.h>
@@ -267,33 +270,37 @@ void *xine_xmalloc_aligned(size_t alignment, size_t size, void **base) {
*/
char *exec_path_append_subdir(char *string) {
- static char tmp_win32_path[1024];
- char *tmpchar;
- char *cmdline;
+ static char tmp_win32_path[1024] = "\0";
char *back_slash;
char *fore_slash;
char *last_slash;
- /* get program exec command line */
- cmdline = GetCommandLine();
+ /* first run - fill out dll path */
+ if (!*tmp_win32_path) {
+ char *tmpchar;
+ char *cmdline;
- /* check for " at beginning of string */
- if( *cmdline == '\"' ) {
- /* copy command line, skip first quote */
- strncpy(tmp_win32_path, cmdline + 1, sizeof(tmp_win32_path));
- tmp_win32_path[sizeof(tmp_win32_path) - 1] = '\0';
+ /* get program exec command line */
+ cmdline = GetCommandLine();
- /* terminate at second set of quotes */
- tmpchar = strchr(tmp_win32_path, '\"');
- if (tmpchar) *tmpchar = 0;
- } else {
- /* copy command line */
- strncpy(tmp_win32_path, cmdline, sizeof(tmp_win32_path));
- tmp_win32_path[sizeof(tmp_win32_path) - 1] = '\0';
+ /* check for " at beginning of string */
+ if( *cmdline == '\"' ) {
+ /* copy command line, skip first quote */
+ strncpy(tmp_win32_path, cmdline + 1, sizeof(tmp_win32_path));
+ tmp_win32_path[sizeof(tmp_win32_path) - 1] = '\0';
- /* terminate at first space */
- tmpchar = strchr(tmp_win32_path, ' ');
- if (tmpchar) *tmpchar = 0;
+ /* terminate at second set of quotes */
+ tmpchar = strchr(tmp_win32_path, '\"');
+ if (tmpchar) *tmpchar = 0;
+ } else {
+ /* copy command line */
+ strncpy(tmp_win32_path, cmdline, sizeof(tmp_win32_path));
+ tmp_win32_path[sizeof(tmp_win32_path) - 1] = '\0';
+
+ /* terminate at first space */
+ tmpchar = strchr(tmp_win32_path, ' ');
+ if (tmpchar) *tmpchar = 0;
+ }
}
/* find the last occurance of a back
@@ -554,3 +561,18 @@ const char *xine_guess_spu_encoding(void) {
return "iso-8859-1";
}
+
+
+#ifdef _MSC_VER
+void xine_xprintf(xine_t *xine, int verbose, const char *fmt, ...) {
+ char message[256];
+ va_list ap;
+
+ if (xine && xine->verbosity >= verbose) {
+ va_start(ap, fmt);
+ vsnprintf(message, sizeof(message), fmt, ap);
+ va_end(ap);
+ xine_log(xine, XINE_LOG_TRACE, "%s", message);
+ }
+}
+#endif
diff --git a/src/xine-utils/xine_buffer.h b/src/xine-utils/xine_buffer.h
index 98b68fd2f..80f09a77e 100644
--- a/src/xine-utils/xine_buffer.h
+++ b/src/xine-utils/xine_buffer.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2000-2003 the xine project
+ * Copyright (C) 2000-2004 the xine project
*
* This file is part of xine, a free video player.
*
@@ -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_buffer.h,v 1.3 2003/12/09 00:02:39 f1rmb Exp $
+ * $Id: xine_buffer.h,v 1.4 2004/09/26 22:54:53 valtri Exp $
*
*
* generic dynamic buffer functions. The goals
@@ -52,7 +52,11 @@
#ifndef HAVE_XINE_BUFFER_H
#define HAVE_XINE_BUFFER_H
-#include <inttypes.h>
+#ifdef XINE_COMPILE
+# include <inttypes.h>
+#else
+# include <xine/os_types.h>
+#endif
/*
* returns an initialized pointer to a buffer.
diff --git a/src/xine-utils/xineutils.h b/src/xine-utils/xineutils.h
index 6a4be56bf..8e45d150a 100644
--- a/src/xine-utils/xineutils.h
+++ b/src/xine-utils/xineutils.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: xineutils.h,v 1.93 2004/09/20 19:30:05 valtri Exp $
+ * $Id: xineutils.h,v 1.94 2004/09/26 22:54:53 valtri Exp $
*
*/
#ifndef XINEUTILS_H
@@ -30,16 +30,17 @@ extern "C" {
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
-#include <inttypes.h>
#include <pthread.h>
#ifdef XINE_COMPILE
+# include <inttypes.h>
# include "attributes.h"
# include "compat.h"
# include "xmlparser.h"
# include "xine_buffer.h"
# include "configfile.h"
#else
+# include <xine/os_types.h>
# include <xine/attributes.h>
# include <xine/compat.h>
# include <xine/xmlparser.h>
@@ -849,7 +850,7 @@ void xine_hexdump (const char *buf, int length);
#define lprintf(fmt, args...) do {} while(0)
#else
#ifdef _MSC_VER
- #define lprintf
+void __inline lprintf(const char * fmt, ...) {};
#else
#define lprintf(...) do {} while(0)
#endif /* _MSC_VER */
@@ -893,12 +894,8 @@ void xine_hexdump (const char *buf, int length);
} while(0)
#else
#ifdef _MSC_VER
- #define xprintf(xine, verbose, fmtargs) \
- do { \
- if((xine) && (xine)->verbosity >= verbose){ \
- xine_log(xine, XINE_LOG_TRACE, fmtargs); \
- } \
- } while(0)
+void xine_xprintf(xine_t *xine, int verbose, const char *fmt, ...);
+ #define xprintf xine_xprintf
#else
#define xprintf(xine, verbose, ...) \
do { \