RV: sqAPI portings was: Nasty VM stuff

Alejandro F. Reimondo alereimondo at sugarweb.com
Wed Apr 15 18:12:53 UTC 1998


jim benson[SMTP:jb at speed.net] wrote:

>I want to have DLL calls. (These are called CodeFragments on the Mac ).
I have implemented sqAPI layer for Squeak under windows and porting the implementation to other operating systems is very easy.
You must implement only 4 functions in C!
I want to port the sqAPIs to other OS but I don't know how to program under Mac... :-(
Please if you know how to implement the code to other operating systems please let me know mailTo:aleReimondo at sugarWeb.com

sqAPIs supports callbacks! and let you send a Smalltalk message inside a primitive! (Warning: callbacks is under development and not fully tested)

Ale.
Note: the OS/2 porting  is been done by Juan Manuel Vuletich (mailTo:jvuletic at dc.uba.ar). He is porting SqueakVM to native OS/2 too.
 
---Code to be ported starts here-------------
 /****************************************************************************
*   PROJECT: Squeak port for Win32 (NT / Win95)
*   FILE:    sqWin32API.c
*   CONTENT: External Function Calls
*
*   AUTHOR:  Alejandro F. Reimondo (afr)
*   ADDRESS: Amenabar 3476 (2B)	[1429]	Buenos Aires	Argentina
*   EMAIL:   alereimondo at sugarweb.com
*   RCSID:   $Id: sqWin32Api.c,v 1.23 1997/12/29 17:41:09 afr Exp $
*
*   NOTES:
*    1) NO notes upto date
*
*****************************************************************************/
// #include "sqWin32.h"
#include "sq.h"

#include <windows.h>
#include "sqWin32API.h"

static char RCSID[]="$Id: sqWin32Api.c,v 1.23 1997/12/29 17:41:09 afr Exp $";

int sqLoadLibrary(char *pathString)
{
  return LoadLibrary(pathString);
}

int sqGetModuleHandle(char *pathString)
{
  /* QueryModuleHandle by name. */
  return GetModuleHandle(pathString);
}

int sqFreeLibrary(int hLib)
{
  /* Free library determined by hLib. */
  return FreeLibrary(hLib);
}

int sqGetProcAddressname(int hModule, char *lpProcName)
{
  /* Returns the address of the specified external function. */
  return GetProcAddress(hModule, lpProcName);
}

int sqGetHInstance()
{
	/* Returns the handle to the current instance activation (Can be unimplemented returning 0)*/
	return hInstance;
}
  
---End of code to be ported--------------------------------





More information about the Squeak-dev mailing list