You can subscribe to this list here.
| 2002 |
Jan
|
Feb
|
Mar
(27) |
Apr
(11) |
May
(112) |
Jun
(8) |
Jul
(10) |
Aug
(68) |
Sep
(12) |
Oct
(3) |
Nov
(19) |
Dec
(3) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
(6) |
Feb
(15) |
Mar
(20) |
Apr
(22) |
May
(131) |
Jun
(27) |
Jul
(19) |
Aug
(207) |
Sep
(61) |
Oct
(27) |
Nov
(28) |
Dec
(21) |
| 2004 |
Jan
(7) |
Feb
(25) |
Mar
(14) |
Apr
(55) |
May
(15) |
Jun
(2) |
Jul
(14) |
Aug
(28) |
Sep
(29) |
Oct
|
Nov
|
Dec
|
|
From: Andreas R. <and...@us...> - 2002-05-29 11:42:17
|
Update of /cvsroot/squeak/squeak/platforms/Cross/plugins/B3DAcceleratorPlugin
In directory usw-pr-cvs1:/tmp/cvs-serv9295
Modified Files:
B3DAcceleratorPlugin.h sqOpenGLRenderer.c
Log Message:
Moved property handling from platform to cross code
Index: B3DAcceleratorPlugin.h
===================================================================
RCS file: /cvsroot/squeak/squeak/platforms/Cross/plugins/B3DAcceleratorPlugin/B3DAcceleratorPlugin.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** B3DAcceleratorPlugin.h 6 May 2002 11:01:01 -0000 1.2
--- B3DAcceleratorPlugin.h 29 May 2002 11:42:14 -0000 1.3
***************
*** 68,72 ****
#warning "**************************************************************"
#warning "**************************************************************"
! # define WIN32_PURE_D3D
#endif
--- 68,72 ----
#warning "**************************************************************"
#warning "**************************************************************"
! # define WIN32_PURE_GL
#endif
***************
*** 107,124 ****
#define b3dxSetBufferRect glSetBufferRect
! #define b3dxSetViewport glSetViewport
! #define b3dxClearDepthBuffer glClearDepthBuffer
! #define b3dxClearViewport glClearViewport
#define b3dxRenderVertexBuffer glRenderVertexBuffer
! #define b3dxSetTransform glSetTransform
! #define b3dxDisableLights glDisableLights
! #define b3dxLoadLight glLoadLight
! #define b3dxLoadMaterial glLoadMaterial
#define b3dxFlushRenderer glFlushRenderer
#define b3dxFinishRenderer glFinishRenderer
! #define b3dxSwapRendererBuffers glSwapRendererBuffers
#define b3dxGetIntProperty glGetIntProperty
#define b3dxSetIntProperty glSetIntProperty
! #define b3dxSetVerboseLevel glSetVerboseLevel
#define b3dxSetFog glSetFog
#endif
--- 107,126 ----
#define b3dxSetBufferRect glSetBufferRect
! #define b3dxSetViewport glSetViewport
! #define b3dxClearDepthBuffer glClearDepthBuffer
! #define b3dxClearViewport glClearViewport
#define b3dxRenderVertexBuffer glRenderVertexBuffer
! #define b3dxSetTransform glSetTransform
! #define b3dxDisableLights glDisableLights
! #define b3dxLoadLight glLoadLight
! #define b3dxLoadMaterial glLoadMaterial
#define b3dxFlushRenderer glFlushRenderer
#define b3dxFinishRenderer glFinishRenderer
! #define b3dxSwapRendererBuffers glSwapRendererBuffers
#define b3dxGetIntProperty glGetIntProperty
#define b3dxSetIntProperty glSetIntProperty
! #define b3dxGetIntPropertyOS glGetIntPropertyOS
! #define b3dxSetIntPropertyOS glSetIntPropertyOS
! #define b3dxSetVerboseLevel glSetVerboseLevel
#define b3dxSetFog glSetFog
#endif
***************
*** 202,205 ****
--- 204,209 ----
int b3dxGetIntProperty(int handle, int prop);
int b3dxSetIntProperty(int handle, int prop, int value);
+ int b3dxGetIntPropertyOS(int handle, int prop);
+ int b3dxSetIntPropertyOS(int handle, int prop, int value);
int b3dxSetVerboseLevel(int level);
int b3dxSetFog(int handle, int fogType, double density, double rangeStart, double rangeEnd, int rgba);
Index: sqOpenGLRenderer.c
===================================================================
RCS file: /cvsroot/squeak/squeak/platforms/Cross/plugins/B3DAcceleratorPlugin/sqOpenGLRenderer.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** sqOpenGLRenderer.c 20 Jan 2002 19:21:50 -0000 1.6
--- sqOpenGLRenderer.c 29 May 2002 11:42:15 -0000 1.7
***************
*** 651,654 ****
--- 651,780 ----
}
+ int glGetIntProperty(int handle, int prop)
+ {
+ GLint v;
+
+ glRenderer *renderer = glRendererFromHandle(handle);
+ if(!renderer || !glMakeCurrentRenderer(renderer)) return 0;
+
+ if(prop < 0) return glGetIntPropertyOS(handle, prop);
+
+ switch(prop) {
+ case 1: /* backface culling */
+ if(!glIsEnabled(GL_CULL_FACE)) return 0;
+ glGetIntegerv(GL_FRONT_FACE, &v);
+ if(v == GL_CW) return 1;
+ if(v == GL_CCW) return -1;
+ return 0;
+ case 2: /* polygon mode */
+ glGetIntegerv(GL_POLYGON_MODE, &v);
+ ERROR_CHECK;
+ return v;
+ case 3: /* point size */
+ glGetIntegerv(GL_POINT_SIZE, &v);
+ ERROR_CHECK;
+ return v;
+ case 4: /* line width */
+ glGetIntegerv(GL_LINE_WIDTH, &v);
+ ERROR_CHECK;
+ return v;
+ case 5: /* blend enable */
+ return glIsEnabled(GL_BLEND);
+ case 6: /* blend source factor */
+ case 7: /* blend dest factor */
+ if(prop == 6)
+ glGetIntegerv(GL_BLEND_SRC, &v);
+ else
+ glGetIntegerv(GL_BLEND_DST, &v);
+ ERROR_CHECK;
+ switch(v) {
+ case GL_ZERO: return 0;
+ case GL_ONE: return 1;
+ case GL_SRC_COLOR: return 2;
+ case GL_ONE_MINUS_SRC_COLOR: return 3;
+ case GL_DST_COLOR: return 4;
+ case GL_ONE_MINUS_DST_COLOR: return 5;
+ case GL_SRC_ALPHA: return 6;
+ case GL_ONE_MINUS_SRC_ALPHA: return 7;
+ case GL_DST_ALPHA: return 8;
+ case GL_ONE_MINUS_DST_ALPHA: return 9;
+ case GL_SRC_ALPHA_SATURATE: return 10;
+ default: return -1;
+ }
+ }
+ return 0;
+ }
+
+ int glSetIntProperty(int handle, int prop, int value)
+ {
+ glRenderer *renderer = glRendererFromHandle(handle);
+ if(!renderer || !glMakeCurrentRenderer(renderer)) return 0;
+
+ if(prop < 0) return glSetIntPropertyOS(handle, prop, value);
+
+ switch(prop) {
+ case 1: /* backface culling */
+ if(!value) {
+ glDisable(GL_CULL_FACE);
+ ERROR_CHECK;
+ return 1;
+ }
+ glEnable(GL_CULL_FACE);
+ glFrontFace(value == 1 ? GL_CCW : GL_CW);
+ ERROR_CHECK;
+ return 1;
+ case 2: /* polygon mode */
+ if(value == 0) glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
+ else if(value == 1) glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
+ else if(value == 2) glPolygonMode(GL_FRONT_AND_BACK, GL_POINT);
+ else return 0;
+ ERROR_CHECK;
+ return 1;
+ case 3: /* point size */
+ glPointSize(value);
+ ERROR_CHECK;
+ return 1;
+ case 4: /* line width */
+ glLineWidth(value);
+ ERROR_CHECK;
+ return 1;
+ case 5: /* blend enable */
+ if(value)
+ glEnable(GL_BLEND);
+ else
+ glDisable(GL_BLEND);
+ ERROR_CHECK;
+ return 1;
+ case 6: /* blend source factor */
+ case 7: /* blend dest factor */
+ {
+ int factor;
+ int src, dst;
+ switch(value) {
+ case 0: factor = GL_ZERO; break;
+ case 1: factor = GL_ONE; break;
+ case 2: factor = GL_SRC_COLOR; break;
+ case 3: factor = GL_ONE_MINUS_SRC_COLOR; break;
+ case 4: factor = GL_DST_COLOR; break;
+ case 5: factor = GL_ONE_MINUS_DST_COLOR; break;
+ case 6: factor = GL_SRC_ALPHA; break;
+ case 7: factor = GL_ONE_MINUS_SRC_ALPHA; break;
+ case 8: factor = GL_DST_ALPHA; break;
+ case 9: factor = GL_ONE_MINUS_DST_ALPHA; break;
+ case 10: factor = GL_SRC_ALPHA_SATURATE; break;
+ default: return 0;
+ }
+ glGetIntegerv(GL_BLEND_SRC, &src);
+ glGetIntegerv(GL_BLEND_DST, &dst);
+ if(prop == 6) src = factor;
+ else dst = factor;
+ glBlendFunc(src,dst);
+ ERROR_CHECK;
+ return 1;
+ }
+ }
+ return 0;
+ }
+
#ifndef GL_VERSION_1_1
|
|
From: Cees de G. <cde...@us...> - 2002-05-28 20:16:57
|
Update of /cvsroot/squeak/squeak/platforms/unix/plugins/B3DAcceleratorPlugin
In directory usw-pr-cvs1:/tmp/cvs-serv30373
Added Files:
NOTES sqUnixOpenGL.c sqUnixOpenGL.h
Log Message:
Unix 3D plugin files.
Bert actually sent me copies of sqOpenGLRenderer.{c,h} along. My test build
used these copies, I still have to check whether what's checked in here
works with the Cross/... version of the files. So consider this broken
for now.
--- NEW FILE: NOTES ---
added in sqOpenGLRenderer.h
#elif defined(UNIX)
# include <GL/glx.h>
# include "sqUnixOpenGL.h"
added in platform.exports
#ifdef UNIX
XFN(stDisplay)
XFN(stWindow)
#endif
added "-lGL" in Makefile to line
B3DAcceleratorPlugin.la : ...
... -lGL
--- NEW FILE: sqUnixOpenGL.c ---
/* sqUnixOpenGL.c -- support for accelerated 3D rendering
*
* Author: Bert Freudenberg <be...@is...>
*
* Based on Andreas Raab's sqWin32OpenGL.c
*
* Last edited: 19 May 2001 bert@faust
*/
#include <sys/types.h>
#include "sqVirtualMachine.h"
#include "sqConfig.h"
#include "sqPlatformSpecific.h"
#include "B3DAcceleratorPlugin.h"
#if defined (B3DX_GL)
#include <GL/gl.h>
#include <GL/glx.h>
#include <X11/X.h>
#include <stdio.h>
#include "sqOpenGLRenderer.h"
/* Plugin refs */
extern struct VirtualMachine *interpreterProxy;
static Display *stDisplay= NULL; /* Squeak's display */
static Window stWindow= 0; /* Squeak's main window */
static glRenderer *current= NULL;
static glRenderer allRenderer[MAX_RENDERER];
static int visualAttributes[]= {
GLX_RGBA, /* no indexed colors */
GLX_DOUBLEBUFFER, /* will swap */
GLX_LEVEL, 0, /* frame buffer, not overlay */
GLX_RED_SIZE, 1, /* need rgb & alpha */
GLX_GREEN_SIZE, 1,
GLX_BLUE_SIZE, 1,
GLX_ALPHA_SIZE, 1,
GLX_DEPTH_SIZE, 16, /* decent depth */
GLX_STENCIL_SIZE, 0, /* need no stencil */
GLX_AUX_BUFFERS, 0, /* no aux buffers */
GLX_ACCUM_RED_SIZE, 0, /* no accumulation */
GLX_ACCUM_GREEN_SIZE, 0,
GLX_ACCUM_BLUE_SIZE, 0,
GLX_ACCUM_ALPHA_SIZE, 0,
None
};
static float blackLight[4]= { 0.0f, 0.0f, 0.0f, 0.0f };
/* Verbose level for debugging purposes:
0 - print NO information ever
1 - print critical debug errors
2 - print debug warnings
3 - print extra information
4 - print extra warnings
5 - print information about primitive execution
10 - print information about each vertex and face
*/
int verboseLevel= 1;
/*** create / destroy a renderer ***/
int glCreateRenderer(int allowSoftware, int allowHardware, int x, int y, int w, int h)
{
glRenderer *renderer;
XVisualInfo* visinfo= 0;
int index= -1;
/* find unused renderer */
{
int i;
for (i= 0; i < MAX_RENDERER; i++)
{
if (!allRenderer[i].used)
{
index= i;
break;
}
}
}
if (index == -1)
{
DPRINTF(1, (fp, "ERROR: Maximum number of renderers (%d) exceeded\n", MAX_RENDERER));
return 0;
}
renderer= &allRenderer[index];
renderer->used= True;
renderer->window= 0;
renderer->context= NULL;
DPRINTF(3, (fp, "---- Creating new renderer ----\n\n"));
/* sanity checks */
if (w < 0 || h < 0)
{
DPRINTF(1, (fp, "Negative extent (%i@%i)!\n", w, h));
goto FAILED;
}
/* choose visual and create context */
{
visinfo= glXChooseVisual(stDisplay,
DefaultScreen(stDisplay),
visualAttributes);
if (!visinfo)
{
DPRINTF(1, (fp, "No OpenGL visual found!\n"));
goto FAILED;
}
DPRINTF(3, (fp, "\n#### Selected GLX visual #%ld (depth: %d) ####\n",
visinfo->visualid, visinfo->depth));
renderer->context= glXCreateContext(stDisplay, visinfo, 0, GL_TRUE);
if (!renderer->context)
{
DPRINTF(1, (fp, "Creating GLX context failed!\n"));
goto FAILED;
}
DPRINTF(3, (fp, "\n#### Created GLX context ####\n" ));
/* create window */
{
XSetWindowAttributes attributes;
unsigned long valuemask= 0;
attributes.colormap= XCreateColormap(stDisplay,
DefaultRootWindow(stDisplay),
visinfo->visual,
AllocNone);
valuemask|= CWColormap;
attributes.background_pixel= BlackPixel(stDisplay, DefaultScreen(stDisplay));
valuemask|= CWBackPixel;
renderer->window= XCreateWindow(stDisplay, stWindow, x, y, w, h, 0,
visinfo->depth, InputOutput, visinfo->visual,
valuemask, &attributes);
if (!renderer->window)
{
DPRINTF(1, (fp, "Failed to create client window\n"));
goto FAILED;
}
XMapWindow(stDisplay, renderer->window);
}
DPRINTF(3, (fp, "\n#### Created window ####\n" ));
XFree(visinfo);
visinfo= 0;
}
/* Make the context current */
if (!glXMakeCurrent(stDisplay, renderer->window, renderer->context))
{
DPRINTF(1, (fp, "Failed to make context current\n"));
goto FAILED;
}
renderer->bufferRect[0]= x;
renderer->bufferRect[1]= y;
renderer->bufferRect[2]= w;
renderer->bufferRect[3]= h;
DPRINTF(3, (fp, "\n### Renderer created! ###\n"));
/* setup user context */
glDisable(GL_LIGHTING);
glDisable(GL_COLOR_MATERIAL);
glDisable(GL_BLEND);
glDisable(GL_ALPHA_TEST);
glEnable(GL_DITHER);
glEnable(GL_DEPTH_TEST);
glEnable(GL_NORMALIZE);
glDepthFunc(GL_LEQUAL);
glClearDepth(1.0);
glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);
glShadeModel(GL_SMOOTH);
glLightModelfv(GL_LIGHT_MODEL_AMBIENT, blackLight);
ERROR_CHECK;
return index;
FAILED:
/* do necessary cleanup */
DPRINTF(1, (fp, "OpenGL initialization failed\n"));
if (visinfo)
XFree(visinfo);
if (renderer->context)
glXDestroyContext(stDisplay, renderer->context);
if (renderer->window)
XDestroyWindow(stDisplay, renderer->window);
return -1;
}
int glDestroyRenderer(int handle)
{
glRenderer *renderer= glRendererFromHandle(handle);
DPRINTF(3, (fp, "\n--- Destroying renderer ---\n"));
if (!renderer)
return 1; /* already destroyed */
if (!glMakeCurrentRenderer(NULL))
return 0;
glXDestroyContext(stDisplay, renderer->context);
XDestroyWindow(stDisplay, renderer->window);
renderer->window= 0;
renderer->context= NULL;
renderer->used= False;
return 1;
}
/*** helpers ***/
glRenderer *glRendererFromHandle(int handle)
{
DPRINTF(7, (fp, "Looking for renderer id: %i\n", handle));
if (handle < 0 || handle >= MAX_RENDERER)
return NULL;
if (allRenderer[handle].used)
return allRenderer+handle;
return NULL;
}
int glIsOverlayRenderer(int handle)
{
/* we always use overlay renderers */
return 1;
}
int glSwapBuffers(glRenderer *renderer)
{
if (!renderer || !renderer->used)
return 0;
glXSwapBuffers(stDisplay, renderer->window);
return 1;
}
int glMakeCurrentRenderer(glRenderer *renderer)
{
if (current == renderer)
return 1;
if (renderer && !renderer->used)
return 0;
if (renderer)
{
if (!glXMakeCurrent(stDisplay, renderer->window, renderer->context))
{
DPRINTF(1, (fp, "Failed to make context current\n"));
return 0;
}
}
else
{
glXMakeCurrent(stDisplay, 0, NULL);
}
current= renderer;
return 1;
}
int glSetBufferRect(int handle, int x, int y, int w, int h)
{
glRenderer *renderer= glRendererFromHandle(handle);
if (!renderer || !glMakeCurrentRenderer(renderer))
return 0;
if (w < 1 || h < 1)
return 0;
XMoveResizeWindow(stDisplay, renderer->window,
x, y, w, h);
renderer->bufferRect[0]= x;
renderer->bufferRect[1]= y;
renderer->bufferRect[2]= w;
renderer->bufferRect[3]= h;
return 1;
}
int glSetVerboseLevel(int level)
{
verboseLevel= level;
return 1;
}
int glGetIntProperty(int handle, int prop)
{
GLint v;
glRenderer *renderer= glRendererFromHandle(handle);
if (!renderer || !glMakeCurrentRenderer(renderer))
return 0;
switch(prop) {
case 1: /* backface culling */
if (!glIsEnabled(GL_CULL_FACE)) return 0;
glGetIntegerv(GL_FRONT_FACE, &v);
if (v == GL_CW) return 1;
if (v == GL_CCW) return -1;
return 0;
case 2: /* polygon mode */
glGetIntegerv(GL_POLYGON_MODE, &v);
ERROR_CHECK;
return v;
case 3: /* point size */
glGetIntegerv(GL_POINT_SIZE, &v);
ERROR_CHECK;
return v;
case 4: /* line width */
glGetIntegerv(GL_LINE_WIDTH, &v);
ERROR_CHECK;
return v;
}
return 0;
}
int glSetIntProperty(int handle, int prop, int value)
{
glRenderer *renderer= glRendererFromHandle(handle);
if (!renderer || !glMakeCurrentRenderer(renderer))
return 0;
switch(prop) {
case 1: /* backface culling */
if (!value) {
glDisable(GL_CULL_FACE);
ERROR_CHECK;
return 1;
}
glEnable(GL_CULL_FACE);
glFrontFace(value == 1 ? GL_CCW : GL_CW);
ERROR_CHECK;
return 1;
case 2: /* polygon mode */
if (value == 0) glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
else if (value == 1) glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
else if (value == 2) glPolygonMode(GL_FRONT_AND_BACK, GL_POINT);
else return 0;
ERROR_CHECK;
return 1;
case 3: /* point size */
glPointSize(value);
ERROR_CHECK;
return 1;
case 4: /* line width */
glLineWidth(value);
ERROR_CHECK;
return 1;
}
return 0;
}
/*** Module initializers ***/
int glInitialize(void)
{
int i, p;
p= interpreterProxy->ioLoadFunctionFrom("stDisplay", NULL);
if (!p)
{
DPRINTF(1,(fp,"ERROR: Failed to look up stDisplay\n"));
return 0;
}
stDisplay= *(Display**) p;
p= interpreterProxy->ioLoadFunctionFrom("stWindow", NULL);
if (!p)
{
DPRINTF(1,(fp,"ERROR: Failed to look up stWindow\n"));
return 0;
}
stWindow= *(Window*) p;
for (i= 0; i < MAX_RENDERER; i++)
{
allRenderer[i].used= False;
}
return 1;
}
int glShutdown(void)
{
int i;
for (i=0; i< MAX_RENDERER; i++)
{
if (allRenderer[i].used)
{
glDestroyRenderer(i);
}
}
return 1;
}
#endif /* defined(B3DX_GL) */
--- NEW FILE: sqUnixOpenGL.h ---
#ifndef SQ_UNIX_OPENGL_H
#define SQ_UNIX_OPENGL_H
#define MAX_RENDERER 16
typedef struct glRenderer {
GLint bufferRect[4];
GLint viewport[4];
Bool used;
Window window;
GLXContext context;
} glRenderer;
#define GL_RENDERER_DEFINED 1
#endif /* SQ_UNIX_OPENGL_H */
|
|
From: Cees de G. <cde...@us...> - 2002-05-28 20:10:26
|
Update of /cvsroot/squeak/squeak/platforms/unix/plugins/B3DAcceleratorPlugin In directory usw-pr-cvs1:/tmp/cvs-serv24993/B3DAcceleratorPlugin Log Message: Directory /cvsroot/squeak/squeak/platforms/unix/plugins/B3DAcceleratorPlugin added to the repository |
|
From: Andreas R. <and...@us...> - 2002-05-26 18:58:23
|
Update of /cvsroot/squeak/squeak/platforms/win32/plugins/SocketPlugin
In directory usw-pr-cvs1:/tmp/cvs-serv14898
Modified Files:
sqWin32NewNet.c
Log Message:
* fixed various problems as reported by Steve and David
* added limited option support on sockets
* (disabled) support for WSAIoctl on some circumstances
Index: sqWin32NewNet.c
===================================================================
RCS file: /cvsroot/squeak/squeak/platforms/win32/plugins/SocketPlugin/sqWin32NewNet.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** sqWin32NewNet.c 11 May 2002 00:27:50 -0000 1.3
--- sqWin32NewNet.c 26 May 2002 18:58:20 -0000 1.4
***************
*** 30,33 ****
--- 30,87 ----
#endif
+ #if 0
+
+ #ifdef __MINGW32__
+ /*
+ * WinSock 2 extension -- manifest constants for WSAIoctl()
+ */
+ #define IOC_UNIX 0x00000000
+ #define IOC_WS2 0x08000000
+ #define IOC_PROTOCOL 0x10000000
+ #define IOC_VENDOR 0x18000000
+
+ #define _WSAIO(x,y) (IOC_VOID|(x)|(y))
+ #define _WSAIOR(x,y) (IOC_OUT|(x)|(y))
+ #define _WSAIOW(x,y) (IOC_IN|(x)|(y))
+ #define _WSAIORW(x,y) (IOC_INOUT|(x)|(y))
+
+ #define SIO_ASSOCIATE_HANDLE _WSAIOW(IOC_WS2,1)
+ #define SIO_ENABLE_CIRCULAR_QUEUEING _WSAIO(IOC_WS2,2)
+ #define SIO_FIND_ROUTE _WSAIOR(IOC_WS2,3)
+ #define SIO_FLUSH _WSAIO(IOC_WS2,4)
+ #define SIO_GET_BROADCAST_ADDRESS _WSAIOR(IOC_WS2,5)
+ #define SIO_GET_EXTENSION_FUNCTION_POINTER _WSAIORW(IOC_WS2,6)
+ #define SIO_GET_QOS _WSAIORW(IOC_WS2,7)
+ #define SIO_GET_GROUP_QOS _WSAIORW(IOC_WS2,8)
+ #define SIO_MULTIPOINT_LOOPBACK _WSAIOW(IOC_WS2,9)
+ #define SIO_MULTICAST_SCOPE _WSAIOW(IOC_WS2,10)
+ #define SIO_SET_QOS _WSAIOW(IOC_WS2,11)
+ #define SIO_SET_GROUP_QOS _WSAIOW(IOC_WS2,12)
+ #define SIO_TRANSLATE_HANDLE _WSAIORW(IOC_WS2,13)
+ #define SIO_ROUTING_INTERFACE_QUERY _WSAIORW(IOC_WS2,20)
+ #define SIO_ROUTING_INTERFACE_CHANGE _WSAIOW(IOC_WS2,21)
+ #define SIO_ADDRESS_LIST_QUERY _WSAIOR(IOC_WS2,22)
+ #define SIO_ADDRESS_LIST_CHANGE _WSAIO(IOC_WS2,23)
+ #define SIO_QUERY_TARGET_PNP_HANDLE _WSAIOR(IOC_WS2,24)
+ #define SIO_ADDRESS_LIST_SORT _WSAIORW(IOC_WS2,25)
+
+
+ int
+ FAR PASCAL
+ WSAIoctl(
+ SOCKET s,
+ DWORD dwIoControlCode,
+ LPVOID lpvInBuffer,
+ DWORD cbInBuffer,
+ LPVOID lpvOutBuffer,
+ DWORD cbOutBuffer,
+ LPDWORD lpcbBytesReturned,
+ LPOVERLAPPED lpOverlapped,
+ void *lpCompletionRoutine
+ );
+ #endif
+
+ #endif
+
#ifndef NDEBUG
#define DBG(s) debugCheckWatcherThreads(PSP(s))
***************
*** 747,750 ****
--- 801,805 ----
privateSocketStruct *pss = PSP(s);
int err;
+ int failPrim = 0;
if (!SocketValid(s)) return;
***************
*** 763,766 ****
--- 818,822 ----
} else {
pss->sockError = err;
+ failPrim = 1;
}
} else {
***************
*** 781,784 ****
--- 837,841 ----
}
UNLOCKSOCKET(pss->mutex);
+ if(failPrim) FAIL();
}
***************
*** 864,868 ****
addr.sin_addr.s_addr = localHostAddress;
! bind( SOCKET(s), (struct sockaddr*) &addr, sizeof(struct sockaddr_in));
if(UDPSocketType == s->socketType) { /* UDP */
SOCKETSTATE(s) = Connected | SOCK_BOUND_UDP | SOCK_DATA_WRITABLE;
--- 921,930 ----
addr.sin_addr.s_addr = localHostAddress;
! result = bind( SOCKET(s), (struct sockaddr*) &addr, sizeof(struct sockaddr_in));
! if(result == SOCKET_ERROR) {
! pss->sockError = WSAGetLastError();
! FAIL();
! return;
! }
if(UDPSocketType == s->socketType) { /* UDP */
SOCKETSTATE(s) = Connected | SOCK_BOUND_UDP | SOCK_DATA_WRITABLE;
***************
*** 905,909 ****
addr.sin_addr.s_addr = localHostAddress;
! bind( SOCKET(s), (struct sockaddr*) &addr, sizeof(struct sockaddr_in));
/* show our willingness to accept a backlogSize incoming connections */
result = listen(SOCKET(s), backlogSize);
--- 967,976 ----
addr.sin_addr.s_addr = localHostAddress;
! result = bind( SOCKET(s), (struct sockaddr*) &addr, sizeof(struct sockaddr_in));
! if(result == SOCKET_ERROR) {
! pss->sockError = WSAGetLastError();
! FAIL();
! return;
! }
/* show our willingness to accept a backlogSize incoming connections */
result = listen(SOCKET(s), backlogSize);
***************
*** 916,919 ****
--- 983,987 ----
UNLOCKSOCKET(pss->mutex);
} else {
+ pss->sockError = WSAGetLastError();
FAIL();
}
***************
*** 1130,1133 ****
--- 1198,1202 ----
int result;
int addrSize;
+ int failPrim = 0;
if (!SocketValid(s)) return -1;
***************
*** 1168,1171 ****
--- 1237,1241 ----
pss->sockState = OtherEndClosed;
pss->sockError = err;
+ failPrim = 1;
}
result = 0;
***************
*** 1173,1176 ****
--- 1243,1247 ----
UNLOCKSOCKET(pss->mutex);
}
+ if(failPrim) FAIL();
return result;
}
***************
*** 1200,1204 ****
int result;
int addrSize;
!
if (!SocketValid(s)) return -1;
/***NOTE***NOTE***NOTE***NOTE***NOTE***
--- 1271,1276 ----
int result;
int addrSize;
! int failPrim = 0;
!
if (!SocketValid(s)) return -1;
/***NOTE***NOTE***NOTE***NOTE***NOTE***
***************
*** 1243,1246 ****
--- 1315,1319 ----
pss->sockState = OtherEndClosed;
pss->sockError = err;
+ failPrim = 1;
}
result = 0;
***************
*** 1248,1251 ****
--- 1321,1325 ----
UNLOCKSOCKET(pss->mutex);
}
+ if(failPrim) FAIL();
return result;
}
***************
*** 1355,1371 ****
}
! int sqSocketSetOptionsoptionNameStartoptionNameSizeoptionValueStartoptionValueSizereturnedValue(
! SocketPtr s,int optionName, int optionNameSize, int optionValue, int optionValueSize, int *result)
! {
! return FAIL();
}
! int sqSocketGetOptionsoptionNameStartoptionNameSizereturnedValue(
! SocketPtr s,int optionName, int optionNameSize, int *result)
{
! return FAIL();
}
/*****************************************************************************
--- 1429,1641 ----
}
! /*** socket options ***/
!
!
! /* NOTE: we only support the portable options here as an incentive for
! people to write portable Squeak programs. If you need
! non-portable socket options then go write yourself a plugin
! specific to your platform. This decision is unilateral and
! non-negotiable. - ikp
! NOTE: we only support the integer-valued options because the code
! in SocketPlugin doesn't seem able to cope with the others.
! (Personally I think that things like SO_SNDTIMEO et al would
! by far more interesting than the majority of things on this
! list, but there you go...)
! NOTE: if your build fails because of a missing option in this list,
! simply DELETE THE OPTION (or comment it out) and then send
! me mail (and...@gm...) to let me know about it.
! */
!
! typedef struct {
! char *name; /* name as known to Squeak */
! int optLevel; /* protocol level */
! int optName; /* name as known to the network layer */
! int optType; /* type of option */
! } socketOption;
!
! #ifndef SOL_IP
! # define SOL_IP IPPROTO_IP
! #endif
!
! #ifndef SOL_UDP
! # define SOL_UDP IPPROTO_UDP
! #endif
!
! #ifndef SOL_TCP
! # define SOL_TCP IPPROTO_TCP
! #endif
!
! static socketOption socketOptions[]= {
! { "SO_DEBUG", SOL_SOCKET, SO_DEBUG, 1 },
! { "SO_REUSEADDR", SOL_SOCKET, SO_REUSEADDR, 1 },
! { "SO_DONTROUTE", SOL_SOCKET, SO_DONTROUTE, 1 },
! { "SO_BROADCAST", SOL_SOCKET, SO_BROADCAST, 1 },
! { "SO_SNDBUF", SOL_SOCKET, SO_SNDBUF, 1 },
! { "SO_RCVBUF", SOL_SOCKET, SO_RCVBUF, 1 },
! { "SO_KEEPALIVE", SOL_SOCKET, SO_KEEPALIVE, 1 },
! { "SO_OOBINLINE", SOL_SOCKET, SO_OOBINLINE, 1 },
! { "SO_LINGER", SOL_SOCKET, SO_LINGER, 1 },
! { "IP_MULTICAST_IF", SOL_IP, IP_MULTICAST_IF, 1 },
! { "IP_MULTICAST_TTL", SOL_IP, IP_MULTICAST_TTL, 1 },
! { "IP_MULTICAST_LOOP", SOL_IP, IP_MULTICAST_LOOP, 1 },
! { "TCP_NODELAY", SOL_TCP, TCP_NODELAY, 1 },
! { "SO_RCVLOWAT", SOL_SOCKET, SO_RCVLOWAT, 1 },
! { "SO_SNDLOWAT", SOL_SOCKET, SO_SNDLOWAT, 1 },
!
! /* multicast support */
! {"IP_ADD_MEMBERSHIP", SOL_IP, IP_ADD_MEMBERSHIP, 100},
! {"IP_DROP_MEMBERSHIP", SOL_IP, IP_DROP_MEMBERSHIP, 100},
!
! #if 0
! /* WSAIoctl() support */
! {"SIO_GET_BROADCAST_ADDRESS", 0, SIO_GET_BROADCAST_ADDRESS, 200},
! #endif
! { (char *)0, 0, 0, 0 }
! };
!
!
! static socketOption *findOption(char *name, size_t nameSize) {
! socketOption *opt= 0;
! char buf[128];
! if(nameSize > 127) return NULL;
! strncpy(buf, name, nameSize);
! buf[nameSize] = 0;
! for (opt= socketOptions; opt->name != 0; ++opt)
! if (!strcmp(buf, opt->name))
! return opt;
! return NULL;
}
!
! /*
! set the given option for the socket.
! */
! int sqSocketSetOptionsoptionNameStartoptionNameSizeoptionValueStartoptionValueSizereturnedValue
! (SocketPtr s,int optionName, int optionNameSize,
! int optionValueIndex, int optionValueSize, int *result)
{
! char optionValue[256];
! size_t bufSize;
! unsigned char buf[256];
!
! if (SocketValid(s)) {
! socketOption *opt= findOption((char *)optionName, (size_t)optionNameSize);
!
! if (opt == 0) goto barf;
! if(optionValueSize >= sizeof(optionValue)) goto barf;
!
! memcpy(optionValue, (void*)optionValueIndex, optionValueSize);
! optionValue[optionValueSize] = 0;
!
! if(opt->optType == 1) {
! /* integer options */
! ((int*)buf)[0] = atoi(optionValue);
! bufSize = sizeof(int);
! /* printf("optionValue: %d (%s)\n", ((int*)buf)[0], optionValue); */
! } else if(opt->optType == 100) {
! /* multicast options, taking one or two IP addresses, e.g.,
! '1.2.3.4|5.6.7.8' specifies multicast group + interface
! '1.2.3.4' specifies only multicast group (interface is INADDR_ANY)
! */
! if(optionValueSize == 4) {
! ((int*)buf)[0] = ((int*)optionValue)[0];
! ((int*)buf)[1] = INADDR_ANY;
! } else if(optionValueSize == 8) {
! ((int*)buf)[0] = ((int*)optionValue)[0];
! ((int*)buf)[1] = ((int*)optionValue)[1];
! } else {
! goto barf;
! }
! bufSize = 8;
! } else {
! goto barf;
! }
! {
! int err;
! err = setsockopt(SOCKET(s), opt->optLevel, opt->optName,buf, bufSize);
! /* printf("setsockopt(): %d\n", err); */
! if(err < 0) goto barf;
! }
! /* it isn't clear what we're supposed to return here, since
! setsockopt isn't supposed to have any value-result parameters
! (go grok that `const' on the buffer argument if you don't
! believe me). the image says "the result of the negotiated
! value". what the fuck is there to negotiate? either
! setsockopt sets the value or it barfs. and i'm not about to go
! calling getsockopt just to see if the value got changed or not
! (the image should send getOption: to the Socket if it really
! wants to know). if the following is wrong then I could
! probably care (a lot) less... fix the logic in the image and
! then maybe i'll care about fixing the logic in here. (i know
! that isn't very helpful, but it's 05:47 in the morning and i'm
! severely grumpy after fixing several very unpleasant bugs that
! somebody introduced into this file while i wasn't looking.) */
! *result= 0;
! return 0;
! }
! barf:
! interpreterProxy->success(false);
! return false;
}
+ /* query the socket for the given option. */
+ int sqSocketGetOptionsoptionNameStartoptionNameSizereturnedValue
+ (SocketPtr s,int optionName, int optionNameSize, int *result)
+ {
+ int optval;
+ size_t len;
+ socketOption *opt;
+ if (!SocketValid(s)) goto barf;
+ opt= findOption((char *)optionName, (size_t)optionNameSize);
+ if (opt == 0) {
+ /* printf("option not found\n"); */
+ goto barf;
+ }
+ if (opt->optType == 1) {
+ len= sizeof(optval);
+ if ((getsockopt(SOCKET(s), opt->optLevel, opt->optName,&optval, &len)) < 0)
+ {
+ /* printf("getsockopt() returned < 0\n"); */
+ goto barf;
+ }
+ if (len != sizeof(optval)) {
+ /* printf("len != sizeof(optval)"); */
+ goto barf;
+ }
+ *result= optval;
+ return 0;
+ }
+
+ #if 0
+ if(opt->optType == 200) {
+ int sz, err;
+ struct sockaddr_in addr;
+ /* WSAIoctl() */
+ if(opt->optName != SIO_GET_BROADCAST_ADDRESS) goto barf;
+ err = WSAIoctl(SOCKET(s),
+ SIO_GET_BROADCAST_ADDRESS,
+ NULL, 0,
+ &addr, sizeof(addr),
+ &sz,
+ NULL, NULL);
+ if(err) {
+ printf("WSAIoctl error: %d (WSAGetLastError=%d)\n",
+ err, WSAGetLastError());
+ goto barf;
+ }
+ if(sz != sizeof(addr)) {
+ printf("WSAIoctl returned %d instead of %d\n", sz, sizeof(addr));
+ goto barf;
+ }
+ *result = ntohl(addr.sin_addr.s_addr);
+ return 0;
+ }
+ #endif
+
+ barf:
+ interpreterProxy->success(false);
+ return errno;
+ }
/*****************************************************************************
|
|
From: Andreas R. <and...@us...> - 2002-05-26 18:55:17
|
Update of /cvsroot/squeak/squeak/platforms/win32/plugins/FilePlugin
In directory usw-pr-cvs1:/tmp/cvs-serv13860
Modified Files:
sqWin32FilePrims.c
Log Message:
Added FILE_FLAG_SEQUENTIAL_SCAN for a bit of improved performance
Index: sqWin32FilePrims.c
===================================================================
RCS file: /cvsroot/squeak/squeak/platforms/win32/plugins/FilePlugin/sqWin32FilePrims.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** sqWin32FilePrims.c 5 May 2002 18:08:16 -0000 1.6
--- sqWin32FilePrims.c 26 May 2002 18:55:14 -0000 1.7
***************
*** 136,140 ****
NULL, /* No security descriptor */
writeFlag ? OPEN_ALWAYS : OPEN_EXISTING,
! FILE_ATTRIBUTE_NORMAL,
NULL /* No template */);
if(h == INVALID_HANDLE_VALUE) {
--- 136,140 ----
NULL, /* No security descriptor */
writeFlag ? OPEN_ALWAYS : OPEN_EXISTING,
! FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN,
NULL /* No template */);
if(h == INVALID_HANDLE_VALUE) {
|
|
From: Andreas R. <and...@us...> - 2002-05-26 18:54:31
|
Update of /cvsroot/squeak/squeak/platforms/win32/plugins/B3DAcceleratorPlugin
In directory usw-pr-cvs1:/tmp/cvs-serv13714
Modified Files:
sqWin32OpenGL.c
Log Message:
fixed a TEA problem with stencil buffers
Index: sqWin32OpenGL.c
===================================================================
RCS file: /cvsroot/squeak/squeak/platforms/win32/plugins/B3DAcceleratorPlugin/sqWin32OpenGL.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** sqWin32OpenGL.c 6 May 2002 10:36:25 -0000 1.4
--- sqWin32OpenGL.c 26 May 2002 18:54:28 -0000 1.5
***************
*** 487,490 ****
--- 487,503 ----
if(pfd.iLayerType != PFD_MAIN_PLANE)
continue; /* overlay/underlay */
+ #ifdef TEA
+ #warning "**************************************************************"
+ #warning "**************************************************************"
+ #warning "**************************************************************"
+ #warning
+ #warning "TEA: Stencil buffer required"
+ #warning
+ #warning "**************************************************************"
+ #warning "**************************************************************"
+ #warning "**************************************************************"
+ if(pfd.cStencilBits < 8)
+ continue; /* need stencil bits */
+ #endif
if((pfd.dwFlags & PFD_GENERIC_FORMAT) == 0) {
|
|
From: Andreas R. <and...@us...> - 2002-05-26 18:52:14
|
Update of /cvsroot/squeak/squeak/platforms/win32/vm
In directory usw-pr-cvs1:/tmp/cvs-serv12825
Modified Files:
sqWin32.h sqWin32Args.c sqWin32Intel.c sqWin32Prefs.c
sqWin32Utils.c sqWin32Window.c
Log Message:
* added support for ini-file based on VM name (e.g., "foo.exe" uses "foo.ini").
* added support for "ImageName" in ini-file (provides full or relative image name)
* added support for "WindowTitle" in ini-file (provides fixed window title)
Index: sqWin32.h
===================================================================
RCS file: /cvsroot/squeak/squeak/platforms/win32/vm/sqWin32.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** sqWin32.h 6 May 2002 10:36:25 -0000 1.4
--- sqWin32.h 26 May 2002 18:52:10 -0000 1.5
***************
*** 241,245 ****
#endif
! #define SQUEAK_VM_VERSION TEXT("Squeak 3.2.1 VM (release candidate) from ") TEXT(__DATE__) \
TEXT("\n") TEXT("Compiler: ") TEXT(COMPILER) TEXT(VERSION)
--- 241,245 ----
#endif
! #define SQUEAK_VM_VERSION TEXT("Squeak 3.2.2 VM (release candidate) from ") TEXT(__DATE__) \
TEXT("\n") TEXT("Compiler: ") TEXT(COMPILER) TEXT(VERSION)
***************
*** 257,260 ****
--- 257,267 ----
extern TCHAR vmPath[]; /* full path to interpreter's directory */
extern TCHAR vmName[]; /* name of the interpreter's executable */
+ extern TCHAR windowTitle[]; /* window title string */
+
+ extern const TCHAR U_ON[];
+ extern const TCHAR U_OFF[];
+ extern const TCHAR U_GLOBAL[];
+ extern const TCHAR U_SLASH[];
+ extern const TCHAR U_BACKSLASH[];
#ifndef NO_PREFERENCES
***************
*** 330,333 ****
--- 337,341 ----
TCHAR* toUnicodeNew(const char *ptr); /* Inline Ansi -> Unicode */
char* fromUnicodeNew(const TCHAR *ptr); /* Inline Unicode -> Ansi */
+ TCHAR *lstrrchr(TCHAR *source, TCHAR c);
/******************************************************/
Index: sqWin32Args.c
===================================================================
RCS file: /cvsroot/squeak/squeak/platforms/win32/vm/sqWin32Args.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** sqWin32Args.c 4 May 2002 23:20:28 -0000 1.3
--- sqWin32Args.c 26 May 2002 18:52:10 -0000 1.4
***************
*** 175,196 ****
string = parseStringArg(string, &tmpImageName);
if(!string) return NULL; /* parse error */
!
! if(*tmpImageName && IsImage(tmpImageName))
! {
strcpy(imageName, tmpImageName);
! }
! /* The default image names are taken out so we always
! present a file open dialog when more than one image
! file is in the current directory */
! #if 0
! else
! { /* Not the image name -- use default */
! if(IsImage(DEFAULT_IMAGE_NAME))
! strcpy(imageName, DEFAULT_IMAGE_NAME);
! else if(IsImage(BASE_IMAGE_NAME))
! strcpy(imageName, BASE_IMAGE_NAME);
! }
! #endif
! imageOptions[numOptionsImage++] = imageName;
while(string && *string)
{
--- 175,187 ----
string = parseStringArg(string, &tmpImageName);
if(!string) return NULL; /* parse error */
! if(*imageName == 0) {
! /* only attempt to use image name if none is provided */
! if(*tmpImageName && IsImage(tmpImageName))
strcpy(imageName, tmpImageName);
! } else {
! /* provide image name as second argument if implicitly specified */
! imageOptions[numOptionsImage++] = imageName;
! }
! imageOptions[numOptionsImage++] = tmpImageName;
while(string && *string)
{
Index: sqWin32Intel.c
===================================================================
RCS file: /cvsroot/squeak/squeak/platforms/win32/vm/sqWin32Intel.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** sqWin32Intel.c 4 May 2002 23:20:28 -0000 1.3
--- sqWin32Intel.c 26 May 2002 18:52:10 -0000 1.4
***************
*** 599,602 ****
--- 599,603 ----
int virtualMemory;
+ LoadPreferences();
/* parse command line args */
if(!parseArguments(strdup(GetCommandLine()), args))
Index: sqWin32Prefs.c
===================================================================
RCS file: /cvsroot/squeak/squeak/platforms/win32/vm/sqWin32Prefs.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** sqWin32Prefs.c 6 May 2002 10:36:25 -0000 1.4
--- sqWin32Prefs.c 26 May 2002 18:52:10 -0000 1.5
***************
*** 26,33 ****
HMENU vmPrefsMenu; /* preferences menu */
- const TCHAR U_ON[] = TEXT("1");
- const TCHAR U_OFF[] = TEXT("0");
- const TCHAR U_GLOBAL[] = TEXT("Global");
-
/****************************************************************************/
/* Preference functions */
--- 26,29 ----
***************
*** 128,136 ****
}
-
void LoadPreferences()
{
/* Set preferences */
#ifndef WCE_PREFERENCES
fDeferredUpdate =
GetPrivateProfileInt(U_GLOBAL,TEXT("DeferUpdate"),
--- 124,156 ----
}
void LoadPreferences()
{
/* Set preferences */
#ifndef WCE_PREFERENCES
+ int size;
+
+ /* make ini file name based on executable file name */
+ lstrcpy(squeakIniName, vmName);
+ size = lstrlen(squeakIniName);
+ lstrcpy(squeakIniName + (size-3), TEXT("ini"));
+
+ /* get image file name from ini file */
+ size = GetPrivateProfileString(U_GLOBAL, TEXT("ImageFile"),
+ TEXT(""), imageName, MAX_PATH, squeakIniName);
+ if(size > 0) {
+ if( !(imageName[0] == '\\' && imageName[1] == '\\') && !(imageName[1] == ':' && imageName[2] == '\\')) {
+ /* make the path relative to VM directory */
+ lstrcpy(imageName, vmName);
+ (lstrrchr(imageName,U_BACKSLASH[0]))[1] = 0;
+ size = lstrlen(imageName);
+ size = GetPrivateProfileString(U_GLOBAL, TEXT("ImageFile"),
+ TEXT(""), imageName + size, MAX_PATH - size, squeakIniName);
+ }
+ }
+
+ /* get window title from ini file */
+ GetPrivateProfileString(U_GLOBAL, TEXT("WindowTitle"),
+ TEXT(""), windowTitle, MAX_PATH, squeakIniName);
+
fDeferredUpdate =
GetPrivateProfileInt(U_GLOBAL,TEXT("DeferUpdate"),
***************
*** 186,193 ****
HMENU hMenu,pMenu;
- /* make ini file */
- lstrcpy(squeakIniName, vmPath);
- lstrcat(squeakIniName,TEXT("Squeak.ini"));
- LoadPreferences();
pMenu = CreatePopupMenu();
AppendMenu(pMenu,MF_STRING | MF_DISABLED, 0,
--- 206,209 ----
Index: sqWin32Utils.c
===================================================================
RCS file: /cvsroot/squeak/squeak/platforms/win32/vm/sqWin32Utils.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** sqWin32Utils.c 4 May 2002 23:20:28 -0000 1.2
--- sqWin32Utils.c 26 May 2002 18:52:10 -0000 1.3
***************
*** 101,104 ****
--- 101,116 ----
}
+ TCHAR *lstrrchr(TCHAR *source, TCHAR c)
+ { TCHAR *tmp;
+
+ /* point to the last char */
+ tmp = source + lstrlen(source)-1;
+ while(tmp >= source)
+ if(*tmp == c) return tmp;
+ else tmp--;
+ return NULL;
+ }
+
+
/****************************************************************************/
/* Helper to pop up a message box with a message formatted from the */
Index: sqWin32Window.c
===================================================================
RCS file: /cvsroot/squeak/squeak/platforms/win32/vm/sqWin32Window.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** sqWin32Window.c 11 May 2002 17:09:03 -0000 1.7
--- sqWin32Window.c 26 May 2002 18:52:10 -0000 1.8
***************
*** 52,55 ****
--- 52,62 ----
TCHAR vmPath[MAX_PATH+1]; /* full path to interpreter's directory */
TCHAR vmName[MAX_PATH+1]; /* name of the interpreter's executable */
+ TCHAR windowTitle[MAX_PATH]; /* what should we display in the title? */
+
+ const TCHAR U_ON[] = TEXT("1");
+ const TCHAR U_OFF[] = TEXT("0");
+ const TCHAR U_GLOBAL[] = TEXT("Global");
+ const TCHAR U_SLASH[] = TEXT("/");
+ const TCHAR U_BACKSLASH[] = TEXT("\\");
int savedWindowSize= 0; /* initial size of window */
***************
*** 139,145 ****
static sqInputEvent *nextEventPut(void);
- /* UNICODE stuff */
- const TCHAR U_SLASH[] = TEXT("/");
- const TCHAR U_BACKSLASH[] = TEXT("\\");
/****************************************************************************/
--- 146,149 ----
***************
*** 675,679 ****
if(!IsWindow(stWindow)) return;
! wsprintf(titleString,TEXT("Squeak! (%s)"), toUnicode(imageName));
SetWindowText(stWindow,titleString);
}
--- 679,687 ----
if(!IsWindow(stWindow)) return;
! if(*windowTitle) {
! lstrcpy(titleString, windowTitle);
! } else {
! wsprintf(titleString,TEXT("Squeak! (%s)"), toUnicode(imageName));
! }
SetWindowText(stWindow,titleString);
}
***************
*** 2424,2438 ****
/* File Startup */
/****************************************************************************/
-
- static TCHAR *lstrrchr(TCHAR *source, TCHAR c)
- { TCHAR *tmp;
-
- /* point to the last char */
- tmp = source + lstrlen(source)-1;
- while(tmp >= source)
- if(*tmp == c) return tmp;
- else tmp--;
- return NULL;
- }
/* Check if the path/file name is subdirectory of the image path */
--- 2432,2435 ----
|
|
From: John M M. <jo...@us...> - 2002-05-17 23:45:16
|
Update of /cvsroot/squeak/squeak/platforms/Mac OS/vm/specialChangeSets
In directory usw-pr-cvs1:/tmp/cvs-serv23139/squeak/platforms/Mac OS/vm/specialChangeSets
Added Files:
Globalstructure-JMM.2.cs
Log Message:
3.2.7b4 Change logic to deal with VMMaker32-7part1.5.cs. A bit of cleanup was done by Tim which stomped on my changes
--- NEW FILE: Globalstructure-JMM.2.cs ---
'From Squeak3.2gamma of 15 January 2002 [latest update: #4857] on 9 May 2002 at 2:22:35 pm'!
"Change Set: Globalstructure-JMM
Date: 5 April 2002
Author: John M McIntosh
Slang logic change to extrude global variables as a structure. This has performance implications on
some platforms (better). Or is needed on some hardware because you don't have support for multiple globals"!
Object subclass: #CCodeGenerator
instanceVariableNames: 'translationDict inlineList constants variables variableDeclarations methods variablesSetCache headerFiles pluginName extraDefs postProcesses isCPP pluginPrefix '
classVariableNames: 'UseRightShiftForDivide '
poolDictionaries: ''
category: 'VMConstruction-Translation to C'!
CCodeGenerator subclass: #CCodeGeneratorGlobalStructure
instanceVariableNames: 'globalVariables '
classVariableNames: ''
poolDictionaries: ''
category: 'VMConstruction-Translation to C'!
ObjectMemory subclass: #Interpreter
instanceVariableNames: 'activeContext theHomeContext method receiver instructionPointer stackPointer localIP localSP localHomeContext messageSelector argumentCount newMethod currentBytecode successFlag primitiveIndex methodCache atCache lkupClass reclaimableContextCount nextPollTick nextWakeupTick lastTick interruptKeycode interruptPending semaphoresToSignalA semaphoresUseBufferA semaphoresToSignalCountA semaphoresToSignalB semaphoresToSignalCountB savedWindowSize fullScreenFlag deferDisplayUpdates pendingFinalizationSignals compilerInitialized compilerHooks extraVMMemory newNativeMethod methodClass receiverClass interpreterVersion obsoleteIndexedPrimitiveTable obsoleteNamedPrimitiveTable interpreterProxy showSurfaceFn interruptCheckCounterFeedBackReset interruptChecksEveryNms externalPrimitiveTable cntx val '
classVariableNames: 'ActiveProcessIndex AtCacheEntries AtCacheFixedFields AtCacheFmt AtCacheMask AtCacheOop AtCacheSize AtCacheTotalSize AtPutBase BlockArgumentCountIndex BytecodeTable CacheProbeMax CallerIndex CharacterValueIndex CompilerHooksSize CrossedX DirBadPath DirEntryFound DirNoMoreEntries EndOfRun ExcessSignalsIndex FirstLinkIndex GenerateBrowserPlugin HeaderIndex HomeIndex InitialIPIndex InstanceSpecificationIndex InstructionPointerIndex JitterTable LastLinkIndex LiteralStart MaxExternalPrimitiveTableSize MaxPrimitiveIndex MessageArgumentsIndex MessageDictionaryIndex MessageLookupClassIndex MessageSelectorIndex MethodArrayIndex MethodCacheClass MethodCacheEntries MethodCacheEntrySize MethodCacheMask MethodCacheMethod MethodCacheNative MethodCachePrim MethodCacheSelector MethodCacheSize MethodIndex MillisecondClockMask MyListIndex NextLinkIndex PrimitiveExternalCallIndex PrimitiveTable PriorityIndex ProcessListsIndex ReceiverIndex SelectorStart SemaphoresToSignalSize SenderIndex StackPointerIndex StreamArrayIndex StreamIndexIndex StreamReadLimitIndex StreamWriteLimitIndex SuperclassIndex SuspendedContextIndex TempFrameStart ValueIndex XIndex YIndex '
poolDictionaries: ''
category: 'VMConstruction-Interpreter'!
!CCodeGenerator methodsFor: 'utilities' stamp: 'JMM 4/16/2002 22:39'!
returnPrefixFromVariable: aName
^aName! !
!CCodeGenerator methodsFor: 'C code generator' stamp: 'ar 4/7/2002 18:25'!
emitCVariablesOn: aStream
"Store the global variable declarations on the given stream."
| varString |
aStream nextPutAll: '/*** Variables ***/'; cr.
variables asSortedCollection do: [ :var |
varString _ var asString.
(self isGeneratingPluginCode) ifTrue:[
varString = 'interpreterProxy' ifTrue:[
"quite special..."
aStream cr; nextPutAll: '#ifdef SQUEAK_BUILTIN_PLUGIN'.
aStream cr; nextPutAll: 'extern'.
aStream cr; nextPutAll: '#endif'; cr.
] ifFalse:[aStream nextPutAll:'static '].
].
(variableDeclarations includesKey: varString) ifTrue: [
aStream nextPutAll: (variableDeclarations at: varString), ';'; cr.
] ifFalse: [
"default variable declaration"
aStream nextPutAll: 'int ', varString, ';'; cr.
].
].
aStream cr.! !
!CCodeGeneratorGlobalStructure methodsFor: 'C code generator' stamp: 'JMM 4/16/2002 22:38'!
buildSortedVariablesCollection
"Build sorted vars, cheat do an allinstances to get the variables node, then consolidate in a bag
however I want to special case the arrays to put last in the structure
end result will be sorted collection based on static usage, perhaps cache lines will like this!!"
| globalNames sorted |
globalNames _ TVariableNode allInstances select: [:e | self globalVariables includes: e name].
globalNames _ globalNames collect: [:e | e name].
globalNames _ globalNames reject: [:e | variableDeclarations includesKey: e].
globalNames _ globalNames asBag.
variableDeclarations keysDo:
[:e | globalNames add: e withOccurrences: 0].
sorted _ SortedCollection sortBlock:
[:a :b | (globalNames occurrencesOf: a) > (globalNames occurrencesOf: b)].
sorted addAll: variables.
^sorted! !
!CCodeGeneratorGlobalStructure methodsFor: 'C code generator' stamp: 'JMM 5/9/2002 14:09'!
emitCVariablesOn: aStream
"Store the global variable declarations on the given stream.
break logic into vars for structure and vars for non-structure"
| varString structure nonstruct target |
structure _ WriteStream on: (String new: 32768).
nonstruct _ WriteStream on: (String new: 32768).
aStream nextPutAll: '/*** Variables ***/'; cr.
structure nextPutAll: 'struct foo {'; cr.
self buildSortedVariablesCollection do: [ :var |
varString _ var asString.
target _ (self placeInStructure: var)
ifTrue: [structure]
ifFalse: [nonstruct].
(self isGeneratingPluginCode) ifTrue:[
varString = 'interpreterProxy' ifTrue:[
"quite special..."
aStream cr; nextPutAll: '#ifdef SQUEAK_BUILTIN_PLUGIN'.
aStream cr; nextPutAll: 'extern'.
aStream cr; nextPutAll: '#endif'; cr.
] ifFalse:[aStream nextPutAll:'static '].
].
(variableDeclarations includesKey: varString) ifTrue: [
target nextPutAll: (variableDeclarations at: varString), ';'; cr.
] ifFalse: [
"default variable declaration"
target nextPutAll: 'int ', varString, ';'; cr.
].
].
structure nextPutAll: ' } fum;';cr.
structure nextPutAll: 'struct foo * foo = &fum;';cr;cr.
aStream nextPutAll: structure contents.
aStream nextPutAll: nonstruct contents.
aStream cr.! !
!CCodeGeneratorGlobalStructure methodsFor: 'C code generator' stamp: 'JMM 4/16/2002 22:45'!
globalVariables
"First time we get called we get the global variables into a set"
globalVariables ifNil:
[globalVariables _ Set withAll: variables].
^globalVariables! !
!CCodeGeneratorGlobalStructure methodsFor: 'C code generator' stamp: 'JMM 4/17/2002 16:15'!
placeInStructure: var
"See if we should put this array into a structure
This has hard coded vars, should go somewhere else!!
The variables listed are hardcoded as C in the interpreter thus they don't get resolved via TVariableNode logic
Also Lets igore variables that have special defintions that require initialization,
and the function def which has problems"
| check |
check _ variableDeclarations at: var ifAbsent: [''].
(check includes: $=) ifTrue: [^false].
(check includes: $() ifTrue: [^false].
(check includes: $[) ifTrue: [^false].
(#( 'showSurfaceFn' 'memory' 'extraVMMemory' 'interpreterProxy') includes: var) ifTrue: [^false].
^true.
! !
!CCodeGeneratorGlobalStructure methodsFor: 'C code generator' stamp: 'JMM 4/16/2002 22:39'!
returnPrefixFromVariable: aName
^((self globalVariables includes: aName) and: [self placeInStructure: aName])
ifTrue: ['foo->',aName]
ifFalse: [aName]! !
!Interpreter methodsFor: 'return bytecodes' stamp: 'JMM 4/17/2002 00:05'!
returnFalse
cntx _ self sender.
val _ falseObj.
self returnValueTo.! !
!Interpreter methodsFor: 'return bytecodes' stamp: 'JMM 4/17/2002 00:04'!
returnNil
cntx _ self sender.
val _ nilObj.
self returnValueTo.
! !
!Interpreter methodsFor: 'return bytecodes' stamp: 'JMM 4/17/2002 00:04'!
returnReceiver
cntx _ self sender.
val _ receiver.
self returnValueTo.! !
!Interpreter methodsFor: 'return bytecodes' stamp: 'JMM 4/17/2002 00:05'!
returnTopFromBlock
"Return to the caller of the method containing the block."
cntx _ self caller. "Note: caller, not sender!!"
val _ self internalStackTop.
self returnValueTo.! !
!Interpreter methodsFor: 'return bytecodes' stamp: 'JMM 4/17/2002 00:04'!
returnTopFromMethod
cntx _ self sender.
val _ self internalStackTop.
self returnValueTo.! !
!Interpreter methodsFor: 'return bytecodes' stamp: 'JMM 4/17/2002 00:05'!
returnTrue
cntx _ self sender.
val _ trueObj.
self returnValueTo.! !
!Interpreter methodsFor: 'return bytecodes' stamp: 'JMM 4/17/2002 00:16'!
returnValueTo
"Note: Assumed to be inlined into the dispatch loop."
| nilOop thisCntx contextOfCaller localCntx localVal|
self inline: true.
self sharedCodeNamed: 'commonReturn' inCase: 120.
nilOop _ nilObj. "keep in a register"
thisCntx _ activeContext.
localCntx _ cntx.
localVal _ val.
"make sure we can return to the given context"
((localCntx = nilOop) or:
[(self fetchPointer: InstructionPointerIndex ofObject: localCntx) = nilOop]) ifTrue: [
"error: sender's instruction pointer or context is nil; cannot return"
^self internalCannotReturn: localVal].
"If this return is not to our immediate predecessor (i.e. from a method to its sender, or from a block to its caller), scan the stack for the first unwind marked context and inform this context and let it deal with it. This provides a chance for ensure unwinding to occur."
thisCntx _ self fetchPointer: SenderIndex ofObject: activeContext.
"Just possibly a faster test would be to compare the homeContext and activeContext - they are of course different for blocks. Thus we might be able to optimise a touch by having a different returnTo for the blockreteurn (since we know that must return to caller) and then if active ~= home we must be doing a non-local return. I think. Maybe."
[thisCntx = localCntx] whileFalse: [
thisCntx = nilObj ifTrue:[
"error: sender's instruction pointer or context is nil; cannot return"
^self internalCannotReturn: localVal].
"Climb up stack towards localCntx. Break out to a send of #aboutToReturn:through: if an unwind marked context is found"
(self isUnwindMarked: thisCntx) ifTrue:[
"context is marked; break out"
^self internalAboutToReturn: localVal through: thisCntx].
thisCntx _ self fetchPointer: SenderIndex ofObject: thisCntx.
].
"If we get here there is no unwind to worry about. Simply terminate the stack up to the localCntx - often just the sender of the method"
thisCntx _ activeContext.
[thisCntx = localCntx]
whileFalse:
["climb up stack to localCntx"
contextOfCaller _ self fetchPointer: SenderIndex ofObject: thisCntx.
"zap exited contexts so any future attempted use will be caught"
self storePointerUnchecked: SenderIndex ofObject: thisCntx withValue: nilOop.
self storePointerUnchecked: InstructionPointerIndex ofObject: thisCntx withValue: nilOop.
reclaimableContextCount > 0 ifTrue:
["try to recycle this context"
reclaimableContextCount _ reclaimableContextCount - 1.
self recycleContextIfPossible: thisCntx].
thisCntx _ contextOfCaller].
activeContext _ thisCntx.
(thisCntx < youngStart) ifTrue: [ self beRootIfOld: thisCntx ].
self internalFetchContextRegisters: thisCntx. "updates local IP and SP"
self fetchNextBytecode.
self internalPush: localVal.
! !
!Interpreter class methodsFor: 'translation' stamp: 'JMM 4/16/2002 22:32'!
translateInDirectory: directory doInlining: inlineFlag forBrowserPlugin: pluginFlag
^self translateInDirectory: directory doInlining: inlineFlag forBrowserPlugin: pluginFlag forGlobalStructure: false! !
!Interpreter class methodsFor: 'translation' stamp: 'JMM 5/9/2002 14:21'!
translateInDirectory: directory doInlining: inlineFlag forBrowserPlugin: pluginFlag forGlobalStructure: globalStructureFlag
"Translate the Smalltalk description of the virtual machine into C. If inlineFlag is true, small method bodies are inlined to reduce procedure call overhead. On the PPC, this results in a factor of three speedup with only 30% increase in code size. If pluginFlag is true, generate code for an interpreter that runs as a browser plugin (Netscape or IE)."
"Note: The pluginFlag is meaningless on Windows and Unix. On these platforms Squeak runs as it's own process and doesn't need any special attention from the VMs point of view. Meaning that NONE of the required additional functions will be supported. In other words, the pluginFlag is not needed and not supported."
"The forGlobalStructure flag if true uses a different CCodeGenerator to build globals as a pointer to a structure, some RISC based platforms PPC for example
them make better assembler"
"Return the list of exports for this module"
| doInlining cg fileName tStamp fstat |
tStamp _ { Interpreter. ObjectMemory} inject: 0 into: [:tS :cl|
tS _ tS max: cl timeStamp].
"don't translate if the file is newer than my timeStamp"
fileName _ 'interp.c'.
fstat _ directory entryAt: fileName ifAbsent:[nil].
fstat ifNotNil:[tStamp < fstat modificationTime ifTrue:[^nil]].
doInlining _ inlineFlag.
pluginFlag ifTrue: [doInlining _ true]. "must inline when generating browser plugin"
Interpreter initialize.
ObjectMemory initialize.
GenerateBrowserPlugin _ pluginFlag.
cg _ globalStructureFlag
ifTrue: [CCodeGeneratorGlobalStructure new initialize]
ifFalse: [CCodeGenerator new initialize].
cg addClass: Interpreter.
cg addClass: ObjectMemory.
Interpreter declareCVarsIn: cg.
ObjectMemory declareCVarsIn: cg.
cg storeCodeOnFile: (directory fullNameFor: fileName) doInlining: doInlining! !
!MacOSPowerPCOS9VMMaker methodsFor: 'generate sources' stamp: 'JMM 5/9/2002 14:21'!
generateInterpreterFile
"generate the main 'interp.c' file for the interpreter and the list of
export statments"
Interpreter
translateInDirectory: self coreVMDirectory
doInlining: inline
forBrowserPlugin: forBrowser
forGlobalStructure: true.
! !
!TVariableNode methodsFor: 'as yet unclassified' stamp: 'JMM 4/5/2002 14:14'!
emitCCodeOn: aStream level: level generator: aCodeGen
name = 'nil'
ifTrue: [ aStream nextPutAll: (aCodeGen cLiteralFor: nil) ]
ifFalse: [ aStream nextPutAll: (aCodeGen returnPrefixFromVariable: name) ].! !
Interpreter removeSelector: #returnValue:to:!
Object subclass: #CCodeGenerator
instanceVariableNames: 'translationDict inlineList constants variables variableDeclarations methods variablesSetCache headerFiles pluginPrefix extraDefs postProcesses isCPP '
classVariableNames: 'UseRightShiftForDivide '
poolDictionaries: ''
category: 'VMConstruction-Translation to C'!
|
|
From: John M M. <jo...@us...> - 2002-05-17 23:43:34
|
Update of /cvsroot/squeak/squeak/platforms/Mac OS/vm
In directory usw-pr-cvs1:/tmp/cvs-serv22798/squeak/platforms/Mac OS/vm
Modified Files:
sqMacFileLogic.c
Log Message:
3.2.7b4 Fix issues with plugin location for mac classic when removed from app bundle.
Index: sqMacFileLogic.c
===================================================================
RCS file: /cvsroot/squeak/squeak/platforms/Mac OS/vm/sqMacFileLogic.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** sqMacFileLogic.c 27 Apr 2002 18:53:34 -0000 1.7
--- sqMacFileLogic.c 17 May 2002 23:43:28 -0000 1.8
***************
*** 15,18 ****
--- 15,19 ----
* 1/18/2002 JMM recheck macroman, fix dir size problem on os-9, do squeak file offset type
* 4/23/2002 JMM fix how image is found for os-9 for bundled applications
+ * 5/12/2002 JMM add logic to enable you to put plugins beside macclassic VM
*
*****************************************************************************/
***************
*** 775,778 ****
--- 776,780 ----
ProcessSerialNumber PSN;
ProcessInfoRec pinfo;
+ FSSpec checkDirectory;
OSErr err;
***************
*** 786,790 ****
err = GetProcessInformation(&PSN, &pinfo);
if (err == noErr && isSystem9_0_or_better()) {
! FSMakeFSSpecCompat(workingDirectory->vRefNum, workingDirectory->parID,"\p:::",workingDirectory);
}
return err;
--- 788,798 ----
err = GetProcessInformation(&PSN, &pinfo);
if (err == noErr && isSystem9_0_or_better()) {
! #if TARGET_API_MAC_CARBON
! FSMakeFSSpecCompat(workingDirectory->vRefNum, workingDirectory->parID,"\p:::",workingDirectory);
! #else
! FSMakeFSSpecCompat(workingDirectory->vRefNum, workingDirectory->parID,"\p:",&checkDirectory);
! if (strncmp((const char *)checkDirectory.name,(const char *) "\pMacOSClassic",13) == 0)
! FSMakeFSSpecCompat(workingDirectory->vRefNum, workingDirectory->parID,"\p:::",workingDirectory);
! #endif
}
return err;
|
|
From: Lex S. <lex...@us...> - 2002-05-17 17:48:52
|
Update of /cvsroot/squeak/squeak/platforms/unix/misc/debian
In directory usw-pr-cvs1:/tmp/cvs-serv22486
Modified Files:
README.Debian
Log Message:
added mention of OSProcess 3.0.1
added instructions for rebuilding the Debian package
Index: README.Debian
===================================================================
RCS file: /cvsroot/squeak/squeak/platforms/unix/misc/debian/README.Debian,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** README.Debian 4 Mar 2002 02:35:47 -0000 1.5
--- README.Debian 17 May 2002 17:48:49 -0000 1.6
***************
*** 14,17 ****
--- 14,35 ----
passed upstream.)
+ OSProcess 3.0.1
+ http://minnow.cc.gatech.edu/squeak/708
+
All possible plugins are generated, and they are generated internally.
+
+
+ To rebuild this package from the Source Forge sources, a directory
+ should be created which contains the following items:
+
+ platforms (from SourceForge)
+ unix (only "unix" is needed)
+ src (generated by VMMaker)
+ debian (a symlink to platforms/unix/misc/debian)
+
+
+ Rename the directory to squeak-<version>, where <version> is whatever
+ "./debian/rules version" tells you. Then make an orig.tar.gz file by
+ typing "./debian/rules origtgz". After all this, the usual Debian
+ commands such as "dpkg-buildpackage -rfakeroot" should work fine.
|
|
From: Lex S. <lex...@us...> - 2002-05-17 17:44:42
|
Update of /cvsroot/squeak/squeak/platforms/unix/misc/debian
In directory usw-pr-cvs1:/tmp/cvs-serv21465
Modified Files:
rules
Log Message:
added the "version" target
Index: rules
===================================================================
RCS file: /cvsroot/squeak/squeak/platforms/unix/misc/debian/rules,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** rules 10 May 2002 16:40:43 -0000 1.9
--- rules 17 May 2002 17:44:39 -0000 1.10
***************
*** 129,132 ****
--- 129,136 ----
cd ..; tar cfvz squeak_$(version).orig.tar.gz squeak-$(shell echo $(version) | tr - . )/{platforms/unix,platforms/Cross,src,debian} --exclude=CVS
+ # print the current version, as this file sees it
+ version:
+ @echo The version is $(version)
+
.PHONY: build clean binary-indep binary-arch binary install configure origtgz
|
|
From: John M M. <jo...@us...> - 2002-05-13 21:31:20
|
Update of /cvsroot/squeak/squeak/platforms/Mac OS/vm In directory usw-pr-cvs1:/tmp/cvs-serv22818/squeak/platforms/Mac OS/vm Modified Files: 3.2.7 Release Notes.rtf Log Message: 3.2.7b5 comments change for b5 Index: 3.2.7 Release Notes.rtf =================================================================== RCS file: /cvsroot/squeak/squeak/platforms/Mac OS/vm/3.2.7 Release Notes.rtf,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** 3.2.7 Release Notes.rtf 27 Apr 2002 19:09:45 -0000 1.1 --- 3.2.7 Release Notes.rtf 13 May 2002 21:25:11 -0000 1.2 *************** *** 36,39 **** --- 36,42 ---- g) sqPlatformSpecific.h: alter sqFTruncate to use fileno() as needed.\ h) sqMacWindow.c: use accessors for interp.c globals.\ + i) 3.2.7b5 sqMacFileLogic.c: change vmpath to resolve to classic VM if vm is moved from MacOSClassic folder\ + j) Misc changes for Netscape plugin support\ + k) Introduce osExports.c logic\ \ Mac VM 3.2.6 mach-o build for Carbon, and build for Classic.\ |
|
From: John M M. <jo...@us...> - 2002-05-13 20:08:09
|
Update of /cvsroot/squeak/squeak/platforms/Cross/plugins/DropPlugin In directory usw-pr-cvs1:/tmp/cvs-serv4307/squeak/platforms/Cross/plugins/DropPlugin Modified Files: DropPlugin.h Log Message: 3.2.7b5 added api for open file with security flag Index: DropPlugin.h =================================================================== RCS file: /cvsroot/squeak/squeak/platforms/Cross/plugins/DropPlugin/DropPlugin.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** DropPlugin.h 18 Dec 2001 23:32:45 -0000 1.2 --- DropPlugin.h 13 May 2002 19:48:44 -0000 1.3 *************** *** 8,12 **** /* note: dropRequestFileHandle needs to bypass plugin security checks when implemented */ int dropRequestFileHandle(int dropIndex); /* return READ-ONLY file handle OOP or nilObject if error */ ! int sqSetFileAccessCallback(void *); void sqSetNumberOfDropFiles(int numberOfFiles); void sqSetFileInformation(int dropIndex, void *dropFile); --- 8,12 ---- /* note: dropRequestFileHandle needs to bypass plugin security checks when implemented */ int dropRequestFileHandle(int dropIndex); /* return READ-ONLY file handle OOP or nilObject if error */ ! int sqSecFileAccessCallback(void *); void sqSetNumberOfDropFiles(int numberOfFiles); void sqSetFileInformation(int dropIndex, void *dropFile); |
|
From: John M M. <jo...@us...> - 2002-05-13 20:08:09
|
Update of /cvsroot/squeak/squeak/platforms/Mac OS/vm In directory usw-pr-cvs1:/tmp/cvs-serv6428/squeak/platforms/Mac OS/vm Removed Files: platform.exports Log Message: 3.2.7b5 This file gets deleted because of VMMaker changes. API defined here get rolled into osExports.c --- platform.exports DELETED --- |
|
From: John M M. <jo...@us...> - 2002-05-13 20:08:08
|
Update of /cvsroot/squeak/squeak/platforms/Mac OS/plugins/DropPlugin
In directory usw-pr-cvs1:/tmp/cvs-serv4627/squeak/platforms/Mac OS/plugins/DropPlugin
Modified Files:
sqMacDragDrop.c
Log Message:
3.2.7b5 Use new file open with security flag
Index: sqMacDragDrop.c
===================================================================
RCS file: /cvsroot/squeak/squeak/platforms/Mac OS/plugins/DropPlugin/sqMacDragDrop.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** sqMacDragDrop.c 9 Jan 2002 06:42:12 -0000 1.3
--- sqMacDragDrop.c 13 May 2002 19:49:47 -0000 1.4
***************
*** 43,46 ****
--- 43,48 ----
9/9/99 by John Montbriand
+ May 8th,2002,JMM - Bert Freudenberg published some changes to make file opening easier without security
+
*/
/*
***************
*** 59,63 ****
#include "sqVirtualMachine.h"
- #include "FilePlugin.h"
#include "sqMacFileLogic.h"
--- 61,64 ----
***************
*** 90,94 ****
Boolean gApprovedDrag = false; /* set to true if the drag is approved */
Boolean gInIconBox = false; /* set true if the drag is inside our drop box */
- long gSecurityCallbackToDisableSecurity = 0;
extern struct VirtualMachine *interpreterProxy;
--- 91,94 ----
***************
*** 174,190 ****
}
! int sqSetFileAccessCallback(void *function) {
! gSecurityCallbackToDisableSecurity = (long) function;
! }
!
! /* Return a pointer to the first byte of of the file record within the given Smalltalk object, or nil if objectPointer is not a file record. */
!
! static SQFile * fileValueOf(int objectPointer) {
! if (!((interpreterProxy->isBytes(objectPointer)) && ((interpreterProxy->byteSizeOf(objectPointer)) == ( sizeof(SQFile))))) {
! interpreterProxy->primitiveFail();
! return null;
! }
! return interpreterProxy->firstIndexableField(objectPointer);
! }
//Primitive to get file name
--- 174,179 ----
}
! int sqSecFileAccessCallback(void *function) {
! }
//Primitive to get file name
***************
*** 202,217 ****
int dropRequestFileHandle(int dropIndex) {
! int fileHandle,fn,iHFAfn;
! int size,classPointer;
char *dropName = dropRequestFileName(dropIndex);
! Boolean needToFlipFlagBack=false;
!
if(!dropName)
return interpreterProxy->nilObject();
! size = sizeof(SQFile);
! classPointer = interpreterProxy->classByteArray();
! fileHandle = interpreterProxy->instantiateClassindexableSize(classPointer, size);
! fn = interpreterProxy->ioLoadFunctionFrom("fileOpennamesizewrite", "FilePlugin");
if (fn == 0) {
/* begin primitiveFail */
--- 191,201 ----
int dropRequestFileHandle(int dropIndex) {
! int fileOop,fn;
char *dropName = dropRequestFileName(dropIndex);
!
if(!dropName)
return interpreterProxy->nilObject();
! fn = interpreterProxy->ioLoadFunctionFrom("fileOpenNamesizewritesecure", "FilePlugin");
if (fn == 0) {
/* begin primitiveFail */
***************
*** 219,234 ****
return null;
}
! if (gSecurityCallbackToDisableSecurity != 0 ) {
! iHFAfn = interpreterProxy->ioLoadFunctionFrom("secHasFileAccess", "SecurityPlugin");
! if ((iHFAfn != 0) && !((int (*) (void)) iHFAfn)()){
! ((int (*) (int)) gSecurityCallbackToDisableSecurity)(true);
! needToFlipFlagBack = true;
! }
! }
! ((int (*) (SQFile *, int, int,int)) fn)(fileValueOf(fileHandle),(int)dropName, strlen(dropName), 0);
! if (needToFlipFlagBack)
! ((int (*) (int)) gSecurityCallbackToDisableSecurity)(false);
! return fileHandle;
}
--- 203,209 ----
return null;
}
! fileOop = ((int (*) (int, int, int, int)) fn)((int)dropName, strlen(dropName), 0,0);
! return fileOop;
}
|
|
From: John M M. <jo...@us...> - 2002-05-13 20:08:07
|
Update of /cvsroot/squeak/squeak/platforms/Mac OS/plugins/SecurityPlugin
In directory usw-pr-cvs1:/tmp/cvs-serv5547/squeak/platforms/Mac OS/plugins/SecurityPlugin
Modified Files:
sqMacSecurity.c
Log Message:
3.2.7b5 Drop unneeded callback for security, use new logic for open file with security flag
Index: sqMacSecurity.c
===================================================================
RCS file: /cvsroot/squeak/squeak/platforms/Mac OS/plugins/SecurityPlugin/sqMacSecurity.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** sqMacSecurity.c 25 Mar 2002 07:05:06 -0000 1.3
--- sqMacSecurity.c 13 May 2002 19:52:06 -0000 1.4
***************
*** 187,200 ****
OSErr err;
FSSpec spec;
! int iLoadAS,iDropDrag;
char *data;
if (gInitialized) return 1;
gInitialized = true;
-
- iDropDrag = interpreterProxy->ioLoadFunctionFrom("setFileAccessCallback", "DropPlugin");
- if (iDropDrag != 0) {
- ((int (*) (void *)) iDropDrag)(&_ioSetFileAccess);
- }
iLoadAS = interpreterProxy->ioLoadFunctionFrom("GetAttributeString", "");
--- 187,195 ----
OSErr err;
FSSpec spec;
! int iLoadAS;
char *data;
if (gInitialized) return 1;
gInitialized = true;
iLoadAS = interpreterProxy->ioLoadFunctionFrom("GetAttributeString", "");
|
|
From: John M M. <jo...@us...> - 2002-05-13 20:08:07
|
Update of /cvsroot/squeak/squeak/platforms/Mac OS/vm
In directory usw-pr-cvs1:/tmp/cvs-serv3861/squeak/platforms/Mac OS/vm
Added Files:
osExports.c
Log Message:
3.2.7b5 create for vmmaker changes
--- NEW FILE: osExports.c ---
/* note: this file is only a backward compatible wrapper
for the old-style "platform.exports" definitions.
If your platform has migrated to the new exports
style you may as well insert the exports right here */
#include <stdio.h>
#include "sqMacUIEvents.h"
#include "serialPlugin.h"
/* duh ... this is ugly */
#define XFN(export) {"", #export, (void*)export},
#define XFN2(plugin, export) {#plugin, #export, (void*)plugin##_##export}
WindowPtr getSTWindow(void);
void setMessageHook(eventMessageHook theHook);
void setPostMessageHook(eventMessageHook theHook);
char * GetAttributeString(int id);
int serialPortSetControl(int portNum,int control, char *data);
int serialPortIsOpen(int portNum);
int serialPortNames(int portNum, char *portName, char *inName, char *outName);
Boolean IsKeyDown(void);
void *os_exports[][3] = {
XFN(getSTWindow)
XFN(setMessageHook)
XFN(setPostMessageHook)
XFN(GetAttributeString)
XFN(recordDragDropEvent)
XFN(serialPortSetControl)
XFN(serialPortIsOpen)
XFN(serialPortClose)
XFN(serialPortCount)
XFN(serialPortNames)
XFN(serialPortOpen)
XFN(serialPortReadInto)
XFN(serialPortWriteFrom)
XFN(IsKeyDown)
XFN(getUIToLock)
#ifdef PLUGIN
/* Plugin support primitives
We should make these primitives a proper plugin
but right now we just need the exports. */
XFN(primitivePluginBrowserReady)
XFN(primitivePluginRequestURLStream)
XFN(primitivePluginRequestURL)
XFN(primitivePluginPostURL)
XFN(primitivePluginRequestFileHandle)
XFN(primitivePluginDestroyRequest)
XFN(primitivePluginRequestState)
#endif
{NULL, NULL, NULL}
};
|
|
From: John M M. <jo...@us...> - 2002-05-13 20:08:07
|
Update of /cvsroot/squeak/squeak/platforms/Mac OS/vm
In directory usw-pr-cvs1:/tmp/cvs-serv7944/squeak/platforms/Mac OS/vm
Modified Files:
sqPlatformSpecific.h
Log Message:
3.2.7b5 added SQUEAK_BUILTIN_PLUGIN def for codewarrior.
Index: sqPlatformSpecific.h
===================================================================
RCS file: /cvsroot/squeak/squeak/platforms/Mac OS/vm/sqPlatformSpecific.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** sqPlatformSpecific.h 9 May 2002 19:28:04 -0000 1.9
--- sqPlatformSpecific.h 13 May 2002 19:57:39 -0000 1.10
***************
*** 11,14 ****
--- 11,15 ----
* Jan 22nd 2002, JMM type for squeak file offset
* May 5th, 2002, JMM added define for PLUGIN for CW
+ * May 12th, 2002, JMM added SQUEAK_BUILTIN_PLUGIN for CW Pro
*
How to use this file:
***************
*** 26,29 ****
--- 27,31 ----
#ifdef macintoshSqueak
//#define PLUGIN
+ #define SQUEAK_BUILTIN_PLUGIN
/* replace the image file manipulation macros with functions */
#undef sqImageFile
|
|
From: Rob W. <sl...@us...> - 2002-05-13 13:08:04
|
Update of /cvsroot/squeak/squeak/platforms/unix/vm
In directory usw-pr-cvs1:/tmp/cvs-serv1494/platforms/unix/vm
Added Files:
osExports.c
Log Message:
add osExports.c to the unix vm directory. Unix now builds correctly VMMaker32-7.5, for both internal and external modules
--- NEW FILE: osExports.c ---
#include <stdio.h>
/* duh ... this is ugly */
#define XFN(export) {"", #export, (void*)export},
#define XFN2(plugin, export) {#plugin, #export, (void*)plugin##_##export}
int primitivePluginBrowserReady(void);
int primitivePluginRequestURLStream(void);
int primitivePluginRequestURL(void);
int primitivePluginPostURL(void);
int primitivePluginRequestFileHandle(void);
int primitivePluginDestroyRequest(void);
int primitivePluginRequestState(void);
void *os_exports[][3] = {
XFN(primitivePluginBrowserReady)
XFN(primitivePluginRequestURLStream)
XFN(primitivePluginRequestURL)
XFN(primitivePluginPostURL)
XFN(primitivePluginRequestFileHandle)
XFN(primitivePluginDestroyRequest)
XFN(primitivePluginRequestState)
{NULL, NULL, NULL}
};
|
|
From: Rob W. <sl...@us...> - 2002-05-13 12:33:12
|
Update of /cvsroot/squeak/squeak/platforms/unix/vm In directory usw-pr-cvs1:/tmp/cvs-serv21917/platforms/unix/vm Removed Files: platform.exports Log Message: adding support for osExports.c and SQUEAK_BUILTIN_PLUGIN --- platform.exports DELETED --- |
|
From: Rob W. <sl...@us...> - 2002-05-13 12:26:25
|
Update of /cvsroot/squeak/squeak/platforms/unix/plugins/Mpeg3Plugin In directory usw-pr-cvs1:/tmp/cvs-serv15569/platforms/unix/plugins/Mpeg3Plugin Modified Files: mkMakeRules Log Message: Index: mkMakeRules =================================================================== RCS file: /cvsroot/squeak/squeak/platforms/unix/plugins/Mpeg3Plugin/mkMakeRules,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** mkMakeRules 5 May 2002 01:33:09 -0000 1.4 --- mkMakeRules 13 May 2002 12:26:23 -0000 1.5 *************** *** 106,110 **** cat <<EOF Mpeg3Plugin.o : \$(Mpeg3Plugin_DIR)/Mpeg3Plugin.c ! \$(COMPILE) -I\$(Mpeg3Plugin_DIR) -I\$(LIBMPEG_SOURCE_DIR) -I\$(LIBMPEG_SOURCE_DIR)/audio -I\$(LIBMPEG_SOURCE_DIR)/video -I$crossdir/plugins/Mpeg3Plugin -c \$(Mpeg3Plugin_DIR)/Mpeg3Plugin.c -o Mpeg3Plugin.o --- 106,110 ---- cat <<EOF Mpeg3Plugin.o : \$(Mpeg3Plugin_DIR)/Mpeg3Plugin.c ! \$(COMPILE) -DSQUEAK_BUILTIN_PLUGIN -I\$(Mpeg3Plugin_DIR) -I\$(LIBMPEG_SOURCE_DIR) -I\$(LIBMPEG_SOURCE_DIR)/audio -I\$(LIBMPEG_SOURCE_DIR)/video -I$crossdir/plugins/Mpeg3Plugin -c \$(Mpeg3Plugin_DIR)/Mpeg3Plugin.c -o Mpeg3Plugin.o |
|
From: Rob W. <sl...@us...> - 2002-05-13 12:26:25
|
Update of /cvsroot/squeak/squeak/platforms/unix/misc/util
In directory usw-pr-cvs1:/tmp/cvs-serv15569/platforms/unix/misc/util
Modified Files:
mkMake
Log Message:
Index: mkMake
===================================================================
RCS file: /cvsroot/squeak/squeak/platforms/unix/misc/util/mkMake,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** mkMake 5 May 2002 01:42:13 -0000 1.8
--- mkMake 13 May 2002 12:26:23 -0000 1.9
***************
*** 122,131 ****
pruneOverridenHeaders() {
#######################
! # basenames=`find "$@" -maxdepth 1 '(' -name '*.h' -o -name 'platform.exports' ')' -exec basename '{}' ';' | sort | uniq`
#######################
basenames=""
for dir in "$@"
do
! newnames=`ls "$dir"/*.h "$dir/platform.exports" 2>/dev/null`
if [ "$newnames" ]
then
--- 122,131 ----
pruneOverridenHeaders() {
#######################
! # basenames=`find "$@" -maxdepth 1 '(' -name '*.h' -o ')' -exec basename '{}' ';' | sort | uniq`
#######################
basenames=""
for dir in "$@"
do
! newnames=`ls "$dir"/*.h 2>/dev/null`
if [ "$newnames" ]
then
***************
*** 207,211 ****
# compile with default rules
THIS_PLUGIN_O=""
! THIS_PLUGIN_EXTRA_INC="-I$unixdir/plugins/$plugin -I$crossdir/plugins/$plugin -I$srcdir/vm/intplugins/$plugin"
# find the source files for this plugin
--- 207,211 ----
# compile with default rules
THIS_PLUGIN_O=""
! THIS_PLUGIN_EXTRA_INC="-DSQUEAK_BUILTIN_PLUGIN -I$unixdir/plugins/$plugin -I$crossdir/plugins/$plugin -I$srcdir/vm/intplugins/$plugin"
# find the source files for this plugin
|
|
From: Andreas R. <and...@us...> - 2002-05-11 18:20:23
|
Update of /cvsroot/squeak/squeak/platforms/win32/release In directory usw-pr-cvs1:/tmp/cvs-serv12442 Added Files: stub Log Message: added stub --- NEW FILE: stub --- This file exists to force directory creation upon export of the CVS directory. |
|
From: Andreas R. <and...@us...> - 2002-05-11 18:19:40
|
Update of /cvsroot/squeak/squeak/platforms/win32/plugins/JPEGReadWriter2Plugin In directory usw-pr-cvs1:/tmp/cvs-serv12222 Added Files: stub Log Message: added stub --- NEW FILE: stub --- This file exists to force directory creation upon export of the CVS directory. |
|
From: Andreas R. <and...@us...> - 2002-05-11 17:09:06
|
Update of /cvsroot/squeak/squeak/platforms/win32/vm
In directory usw-pr-cvs1:/tmp/cvs-serv20450
Modified Files:
sqGnu.h sqWin32Window.c
Log Message:
fixed another problem with 512 byte offset
Index: sqGnu.h
===================================================================
RCS file: /cvsroot/squeak/squeak/platforms/win32/vm/sqGnu.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** sqGnu.h 24 Oct 2001 23:14:26 -0000 1.1.1.1
--- sqGnu.h 11 May 2002 17:09:03 -0000 1.2
***************
*** 51,55 ****
&&_240, &&_241, &&_242, &&_243, &&_244, &&_245, &&_246, &&_247, &&_248, &&_249,\
&&_250, &&_251, &&_252, &&_253, &&_254, &&_255\
! }
#define PRIM_TABLE\
--- 51,56 ----
&&_240, &&_241, &&_242, &&_243, &&_244, &&_245, &&_246, &&_247, &&_248, &&_249,\
&&_250, &&_251, &&_252, &&_253, &&_254, &&_255\
! };
! /* register void **jumpTablePtr JP_REG = jumpTable; */
#define PRIM_TABLE\
***************
*** 152,155 ****
--- 153,157 ----
# define SP_REG asm("%edi")
# define CB_REG asm("%ebx")
+ //# define JP_REG asm("%ebx")
#endif
#if defined(PPC) || defined(_POWER) || defined(_IBMR2)
Index: sqWin32Window.c
===================================================================
RCS file: /cvsroot/squeak/squeak/platforms/win32/vm/sqWin32Window.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** sqWin32Window.c 6 May 2002 10:36:25 -0000 1.6
--- sqWin32Window.c 11 May 2002 17:09:03 -0000 1.7
***************
*** 2550,2555 ****
Return the length of the image if it is a valid Squeak image file.
Otherwise return 0. */
! DWORD SqueakImageLength(TCHAR *fileName)
! { DWORD dwRead, dwSize, magic = 0;
HANDLE hFile;
--- 2550,2575 ----
Return the length of the image if it is a valid Squeak image file.
Otherwise return 0. */
! DWORD SqueakImageLengthFromHandle(HANDLE hFile) {
! DWORD dwRead, dwSize, magic = 0;
! /* get the file size */
! dwSize = GetFileSize(hFile, NULL);
! /* seek to start */
! if(SetFilePointer(hFile, 0, NULL, FILE_BEGIN) != 0) return 0;
! /* read magic number */
! if(!ReadFile(hFile, &magic, 4, &dwRead, NULL)) return 0;
! /* see if it matches */
! if(readableFormat(magic) || readableFormat(byteSwapped(magic))) return dwSize;
! /* skip possible 512 byte header */
! dwSize -= 512;
! if(SetFilePointer(hFile, 512, NULL, FILE_BEGIN) != 512) return 0;
! /* read magic number */
! if(!ReadFile(hFile, &magic, 4, &dwRead, NULL)) return 0;
! /* see if it matches */
! if(readableFormat(magic) || readableFormat(byteSwapped(magic))) return dwSize;
! return 0;
! }
!
! DWORD SqueakImageLength(TCHAR *fileName) {
! DWORD dwSize;
HANDLE hFile;
***************
*** 2557,2575 ****
hFile = CreateFile(fileName, GENERIC_READ, FILE_SHARE_READ,
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
! if(hFile == INVALID_HANDLE_VALUE)
! return 0;
! /* read magic number */
! if(!ReadFile(hFile, &magic, 4, &dwRead, NULL))
! {
! CloseHandle(hFile);
! return 0;
! }
! /* get the image's size */
! dwSize = GetFileSize(hFile, NULL);
CloseHandle(hFile);
! if(!readableFormat(magic) && !readableFormat(byteSwapped(magic)))
! return 0;
! else
! return dwSize;
}
--- 2577,2584 ----
hFile = CreateFile(fileName, GENERIC_READ, FILE_SHARE_READ,
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
! if(hFile == INVALID_HANDLE_VALUE) return 0;
! dwSize = SqueakImageLengthFromHandle(hFile);
CloseHandle(hFile);
! return dwSize;
}
|