[Mplayer-cvslog] CVS: main/loader elfdll.c,1.3,1.4 ext.h,1.1,1.2 ldt_keeper.c,1.3,1.4 win32.c,1.20,1.21 win32.h,1.3,1.4

Arpi of Ize arpi at mplayer.dev.hu
Tue Oct 9 00:26:32 CEST 2001


Update of /cvsroot/mplayer/main/loader
In directory mplayer:/var/tmp.root/cvs-serv4808

Modified Files:
	elfdll.c ext.h ldt_keeper.c win32.c win32.h 
Log Message:
changes merged back from avifile cvs

Index: elfdll.c
===================================================================
RCS file: /cvsroot/mplayer/main/loader/elfdll.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- elfdll.c	4 Oct 2001 02:21:34 -0000	1.3
+++ elfdll.c	8 Oct 2001 22:26:13 -0000	1.4
@@ -7,14 +7,7 @@
 
 #ifdef HAVE_LIBDL
 
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-
 #include <wine/windef.h>
-//#include <wine/global.h>
-//#include <wine/process.h>
 #include <wine/module.h>
 #include <wine/heap.h>
 #include <wine/elfdll.h>
@@ -23,6 +16,10 @@
 
 //DEFAULT_DEBUG_CHANNEL(elfdll)
 
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <ctype.h>
 #include <dlfcn.h>
 
 struct modref_list_t;

Index: ext.h
===================================================================
RCS file: /cvsroot/mplayer/main/loader/ext.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ext.h	12 Jul 2001 15:27:47 -0000	1.1
+++ ext.h	8 Oct 2001 22:26:13 -0000	1.2
@@ -1,4 +1,3 @@
-
 #ifndef loader_ext_h
 #define loader_ext_h
 

Index: ldt_keeper.c
===================================================================
RCS file: /cvsroot/mplayer/main/loader/ldt_keeper.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ldt_keeper.c	4 Oct 2001 11:17:39 -0000	1.3
+++ ldt_keeper.c	8 Oct 2001 22:26:13 -0000	1.4
@@ -6,6 +6,8 @@
  * and initializes it at the start of player!
  */
 
+#include "ldt_keeper.h"
+
 #include <string.h>
 #include <stdlib.h>
 #include <errno.h>
@@ -14,7 +16,6 @@
 #include <sys/types.h>
 #include <stdio.h>
 #include <unistd.h>
-
 #ifdef __linux__
 #include <asm/unistd.h>
 #include <asm/ldt.h>
@@ -36,8 +37,8 @@
 }
 #endif
 
-#ifndef NUMSYSLDTS		/* SunOS 2.5.1 does not define NUMSYSLDTS */
-#define NUMSYSLDTS	6	/* Let's hope the SunOS 5.8 value is OK */
+#ifndef NUMSYSLDTS             /* SunOS 2.5.1 does not define NUMSYSLDTS */
+#define NUMSYSLDTS     6       /* Let's hope the SunOS 5.8 value is OK */
 #endif
 
 #define       TEB_SEL_IDX     NUMSYSLDTS
@@ -72,8 +73,6 @@
 #endif
 #define       TEB_SEL LDT_SEL(TEB_SEL_IDX)
 
-#include "ldt_keeper.h"
-
 /**
  *
  *  This should be performed before we create first thread. See remarks
@@ -81,8 +80,8 @@
  *
  */
 
-static void* fs_seg=NULL;
-static char* prev_struct=NULL;
+static void* fs_seg = NULL;
+static char* prev_struct = NULL;
 /**
  * here is a small logical problem with Restore for multithreaded programs -
  * in C++ we use static class for this...
@@ -200,18 +199,18 @@
 
 #if defined(__svr4__)
     {
-    struct ssd ssd;
-    ssd.sel = TEB_SEL;
-    ssd.bo = array.base_addr;
-    ssd.ls = array.limit - array.base_addr;
-    ssd.acc1 = ((array.read_exec_only == 0) << 1) |
-               (array.contents << 2) |
-               0xf0;   /* P(resent) | DPL3 | S */
-    ssd.acc2 = 0x4;   /* byte limit, 32-bit segment */
-    if (sysi86(SI86DSCR, &ssd) < 0) {
-	perror("sysi86(SI86DSCR)");
-	printf("Couldn't install fs segment, expect segfault\n");
-    }
+	struct ssd ssd;
+	ssd.sel = TEB_SEL;
+	ssd.bo = array.base_addr;
+	ssd.ls = array.limit - array.base_addr;
+	ssd.acc1 = ((array.read_exec_only == 0) << 1) |
+	    (array.contents << 2) |
+	    0xf0;   /* P(resent) | DPL3 | S */
+	ssd.acc2 = 0x4;   /* byte limit, 32-bit segment */
+	if (sysi86(SI86DSCR, &ssd) < 0) {
+	    perror("sysi86(SI86DSCR)");
+	    printf("Couldn't install fs segment, expect segfault\n");
+	}
     }
 #endif
 

Index: win32.c
===================================================================
RCS file: /cvsroot/mplayer/main/loader/win32.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- win32.c	4 Oct 2001 02:21:34 -0000	1.20
+++ win32.c	8 Oct 2001 22:26:13 -0000	1.21
@@ -19,10 +19,16 @@
 #include "wine/winerror.h"
 #include "wine/debugtools.h"
 #include "wine/module.h"
-#include "win32.h"
 
 #include <stdio.h>
+#include "win32.h"
+
+#include "registry.h"
+#include "loader.h"
+#include "com.h"
+
 #include <stdlib.h>
+#include <stdarg.h>
 #include <ctype.h>
 #include <pthread.h>
 #include <errno.h>
@@ -39,9 +45,6 @@
 #include <kstat.h>
 #endif
 
-#include "registry.h"
-#include "loader.h"
-#include "com.h"
 
 char* def_path=WIN32_PATH;
 
@@ -221,7 +224,7 @@
     if(to_zero)
     	memset(heap+heap_counter, 0, size);	    
     else
-	memset(heap+heap_counter, 0xcc, size);  // make crash reprocable
+	memset(heap+heap_counter, 0xcc, size);  // make crash reproducable
     heap_counter+=size;
     return heap+heap_counter-size;	
 }
@@ -1945,7 +1948,33 @@
     dbgprintf(" => 0\n");
     return 0;
 }
-
+int expsprintf(char* str, const char* format, ...)
+{
+    va_list args;
+    int r;
+    dbgprintf("sprintf(%s, %s)\n", str, format);
+    va_start(args, format);
+    r = vsprintf(str, format, args);
+    va_end(args);
+    return r;
+}
+int expsscanf(const char* str, const char* format, ...)
+{
+    va_list args;
+    int r;
+    dbgprintf("sscanf(%s, %s)\n", str, format);
+    va_start(args, format);
+    r = vsscanf(str, format, args);
+    va_end(args);
+    return r;
+}
+void* expfopen(const char* path, const char* mode)
+{
+    //fails
+    printf("fopen: \"%s\"  mode:%s\n", path, mode);
+    //return fopen(path, mode);
+    return 0;
+}
 unsigned int _GetPrivateProfileIntA(const char* appname, const char* keyname, INT default_value, const char* filename)
 {
     return expGetPrivateProfileIntA(appname, keyname, default_value, filename);
@@ -2063,6 +2092,21 @@
     return result;
 }
 
+int exprand()
+{
+    return rand();
+}
+
+void expsrand(int seed)
+{
+    srand(seed);
+}
+
+int exp_ftol(float f)
+{
+    return (int)(f+.5);
+}
+
 int WINAPI expStringFromGUID2(GUID* guid, char* str, int cbMax)
 {
     int result=snprintf(str, cbMax, "%.8x-%.4x-%.4x-%.2x%.2x%.2x%.2x%.2x%.2x%.2x%.2x",
@@ -2814,6 +2858,12 @@
 FF(memmove, -1)
 FF(memcmp, -1)
 FF(time, -1)
+FF(_ftol,-1)
+FF(rand, -1)
+FF(srand, -1)
+FF(sprintf,-1)
+FF(sscanf,-1)
+FF(fopen,-1)
 };
 struct exports exp_winmm[]={
 FF(GetDriverModuleHandle, -1)

Index: win32.h
===================================================================
RCS file: /cvsroot/mplayer/main/loader/win32.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- win32.h	4 Oct 2001 02:21:34 -0000	1.3
+++ win32.h	8 Oct 2001 22:26:14 -0000	1.4
@@ -201,6 +201,7 @@
 extern LONG WINAPI explstrcatA(char* str1, const char* str2);
 extern LONG WINAPI expInterlockedExchange(long *dest, long l);
 
+
 extern void* CDECL expmalloc(int size);
 extern void CDECL expfree(void* mem);
 extern void* CDECL expnew(int size);
@@ -219,7 +220,16 @@
 extern int expmemcmp(void* dest, void* src, int n);
 extern void *expmemcpy(void* dest, void* src, int n) ;
 extern time_t exptime(time_t* t);
+extern int expsprintf(char* str, const char* format, ...);
+extern int expsscanf(const char* str, const char* format, ...);
+extern void* expfopen(const char* path, const char* mode);
+
+
 extern void* LookupExternal(const char* library, int ordinal);
 extern void* LookupExternalByName(const char* library, const char* name);
+
+extern int exprand();
+extern int exp_ftol(float f);
+extern void WINAPI expInitCommonControls();
 
 #endif




More information about the MPlayer-cvslog mailing list