Author: piumarta Date: 2010-04-12 16:49:53 -0700 (Mon, 12 Apr 2010) New Revision: 2199 Added: trunk/platforms/unix/src/vm/intplugins/UUIDPlugin/ trunk/platforms/unix/src/vm/intplugins/UUIDPlugin/UUIDPlugin.c Removed: trunk/platforms/unix/src/plugins/UUIDPlugin/ Modified: trunk/platforms/unix/src/plugins.ext trunk/platforms/unix/src/plugins.int trunk/platforms/unix/src/vm/sqNamedPrims.h Log: make UUIDPlugin internal Modified: trunk/platforms/unix/src/plugins.ext =================================================================== --- trunk/platforms/unix/src/plugins.ext 2010-04-12 22:00:10 UTC (rev 2198) +++ trunk/platforms/unix/src/plugins.ext 2010-04-12 23:49:53 UTC (rev 2199) @@ -1,2 +1,2 @@ # Automatically generated makefile include for external plugins -EXTERNAL_PLUGINS = B3DAcceleratorPlugin Squeak3D ClipboardExtendedPlugin DBusPlugin SqueakFFIPrims FT2Plugin FileCopyPlugin GStreamerPlugin HostWindowPlugin ImmX11Plugin KedamaPlugin KedamaPlugin2 MIDIPlugin Mpeg3Plugin OggPlugin PseudoTTYPlugin RomePlugin UUIDPlugin AioPlugin UnixOSProcessPlugin XDisplayControlPlugin +EXTERNAL_PLUGINS = B3DAcceleratorPlugin Squeak3D ClipboardExtendedPlugin DBusPlugin SqueakFFIPrims FT2Plugin FileCopyPlugin GStreamerPlugin HostWindowPlugin ImmX11Plugin KedamaPlugin KedamaPlugin2 MIDIPlugin Mpeg3Plugin OggPlugin PseudoTTYPlugin RomePlugin AioPlugin UnixOSProcessPlugin XDisplayControlPlugin Modified: trunk/platforms/unix/src/plugins.int =================================================================== --- trunk/platforms/unix/src/plugins.int 2010-04-12 22:00:10 UTC (rev 2198) +++ trunk/platforms/unix/src/plugins.int 2010-04-12 23:49:53 UTC (rev 2199) @@ -1,2 +1,2 @@ # Automatically generated makefile include for internal plugins -INTERNAL_PLUGINS = ADPCMCodecPlugin AsynchFilePlugin BMPReadWriterPlugin B2DPlugin BitBltPlugin CroquetPlugin DSAPrims ZipPlugin DropPlugin FFTPlugin FilePlugin FloatArrayPlugin FloatMathPlugin GeniePlugin JPEGReadWriter2Plugin JPEGReaderPlugin JoystickTabletPlugin Klatt LargeIntegers LocalePlugin Matrix2x3Plugin MiscPrimitivePlugin RePlugin SecurityPlugin SerialPlugin SocketPlugin SoundCodecPrims SoundGenerationPlugin SoundPlugin StarSqueakPlugin SurfacePlugin +INTERNAL_PLUGINS = ADPCMCodecPlugin AsynchFilePlugin BMPReadWriterPlugin B2DPlugin BitBltPlugin CroquetPlugin DSAPrims ZipPlugin DropPlugin FFTPlugin FilePlugin FloatArrayPlugin FloatMathPlugin GeniePlugin JPEGReadWriter2Plugin JPEGReaderPlugin JoystickTabletPlugin Klatt LargeIntegers LocalePlugin Matrix2x3Plugin MiscPrimitivePlugin RePlugin SecurityPlugin SerialPlugin SocketPlugin SoundCodecPrims SoundGenerationPlugin SoundPlugin StarSqueakPlugin SurfacePlugin UUIDPlugin Added: trunk/platforms/unix/src/vm/intplugins/UUIDPlugin/UUIDPlugin.c =================================================================== --- trunk/platforms/unix/src/vm/intplugins/UUIDPlugin/UUIDPlugin.c (rev 0) +++ trunk/platforms/unix/src/vm/intplugins/UUIDPlugin/UUIDPlugin.c 2010-04-12 23:49:53 UTC (rev 2199) @@ -0,0 +1,156 @@ +/* Automatically generated from Squeak on 12 April 2010 4:44:37 pm + by VMMaker 4.0.3 + */ + +#include <math.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <time.h> + +/* Default EXPORT macro that does nothing (see comment in sq.h): */ +#define EXPORT(returnType) returnType + +/* Do not include the entire sq.h file but just those parts needed. */ +/* The virtual machine proxy definition */ +#include "sqVirtualMachine.h" +/* Configuration options */ +#include "sqConfig.h" +/* Platform specific definitions */ +#include "sqPlatformSpecific.h" + +#define true 1 +#define false 0 +#define null 0 /* using 'null' because nil is predefined in Think C */ +#ifdef SQUEAK_BUILTIN_PLUGIN +#undef EXPORT +// was #undef EXPORT(returnType) but screws NorCroft cc +#define EXPORT(returnType) static returnType +#endif +#include "UUIDPlugin.h" + +#include "sqMemoryAccess.h" + + +/*** Constants ***/ + +/*** Function Prototypes ***/ +static VirtualMachine * getInterpreter(void); +#pragma export on +EXPORT(const char*) getModuleName(void); +#pragma export off +static sqInt halt(void); +#pragma export on +EXPORT(sqInt) initialiseModule(void); +#pragma export off +static sqInt msg(char * s); +#pragma export on +EXPORT(sqInt) primitiveMakeUUID(void); +EXPORT(sqInt) setInterpreter(struct VirtualMachine* anInterpreter); +EXPORT(sqInt) shutdownModule(void); +#pragma export off +static sqInt sqAssert(sqInt aBool); +/*** Variables ***/ + +#ifdef SQUEAK_BUILTIN_PLUGIN +extern +#endif +struct VirtualMachine* interpreterProxy; +static const char *moduleName = +#ifdef SQUEAK_BUILTIN_PLUGIN + "UUIDPlugin 12 April 2010 (i)" +#else + "UUIDPlugin 12 April 2010 (e)" +#endif +; + + + +/* Note: This is coded so that plugins can be run from Squeak. */ + +static VirtualMachine * getInterpreter(void) { + return interpreterProxy; +} + + +/* Note: This is hardcoded so it can be run from Squeak. + The module name is used for validating a module *after* + it is loaded to check if it does really contain the module + we're thinking it contains. This is important! */ + +EXPORT(const char*) getModuleName(void) { + return moduleName; +} + +static sqInt halt(void) { + ; +} + +EXPORT(sqInt) initialiseModule(void) { + return sqUUIDInit(); +} + +static sqInt msg(char * s) { + fprintf(stderr, "\n%s: %s", moduleName, s); +} + +EXPORT(sqInt) primitiveMakeUUID(void) { + char* location; + sqInt oop; + + if (!((interpreterProxy->methodArgumentCount()) == 0)) { + return interpreterProxy->primitiveFail(); + } + oop = interpreterProxy->stackObjectValue(0); + if (interpreterProxy->failed()) { + return null; + } + if (!(interpreterProxy->isBytes(oop))) { + return interpreterProxy->primitiveFail(); + } + if (!((interpreterProxy->byteSizeOf(oop)) == 16)) { + return interpreterProxy->primitiveFail(); + } + location = interpreterProxy->firstIndexableField(oop); + MakeUUID(location); +} + + +/* Note: This is coded so that is can be run from Squeak. */ + +EXPORT(sqInt) setInterpreter(struct VirtualMachine* anInterpreter) { + sqInt ok; + + interpreterProxy = anInterpreter; + ok = interpreterProxy->majorVersion() == VM_PROXY_MAJOR; + if (ok == 0) { + return 0; + } + ok = interpreterProxy->minorVersion() >= VM_PROXY_MINOR; + return ok; +} + +EXPORT(sqInt) shutdownModule(void) { + return sqUUIDShutdown(); +} + +static sqInt sqAssert(sqInt aBool) { + /* missing DebugCode */; +} + + +#ifdef SQUEAK_BUILTIN_PLUGIN + + +void* UUIDPlugin_exports[][3] = { + {"UUIDPlugin", "primitiveMakeUUID", (void*)primitiveMakeUUID}, + {"UUIDPlugin", "getModuleName", (void*)getModuleName}, + {"UUIDPlugin", "shutdownModule", (void*)shutdownModule}, + {"UUIDPlugin", "initialiseModule", (void*)initialiseModule}, + {"UUIDPlugin", "setInterpreter", (void*)setInterpreter}, + {NULL, NULL, NULL} +}; + + +#endif /* ifdef SQ_BUILTIN_PLUGIN */ + Modified: trunk/platforms/unix/src/vm/sqNamedPrims.h =================================================================== --- trunk/platforms/unix/src/vm/sqNamedPrims.h 2010-04-12 22:00:10 UTC (rev 2198) +++ trunk/platforms/unix/src/vm/sqNamedPrims.h 2010-04-12 23:49:53 UTC (rev 2199) @@ -1,4 +1,4 @@ -/* Automatically generated from Squeak on 10 April 2010 7:46:52 pm +/* Automatically generated from Squeak on 12 April 2010 4:44:37 pm by VMMaker 4.0.3 */ /* This is an automatically generated table of all builtin modules in the VM */ @@ -36,6 +36,7 @@ extern sqExport SoundPlugin_exports[]; extern sqExport StarSqueakPlugin_exports[]; extern sqExport SurfacePlugin_exports[]; +extern sqExport UUIDPlugin_exports[]; sqExport *pluginExports[] = { vm_exports, @@ -71,5 +72,6 @@ SoundPlugin_exports, StarSqueakPlugin_exports, SurfacePlugin_exports, + UUIDPlugin_exports, NULL }; |
Free forum by Nabble | Edit this page |