[Vm-dev] VM Maker: VMMaker-oscog-EstebanLorenzano.165.mcz
commits at source.squeak.org
commits at source.squeak.org
Wed Oct 31 17:01:36 UTC 2012
Esteban Lorenzano uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker-oscog-EstebanLorenzano.165.mcz
==================== Summary ====================
Name: VMMaker-oscog-EstebanLorenzano.165
Author: EstebanLorenzano
Time: 31 October 2012, 5:59:24.762 pm
UUID: b9ded301-c60c-437f-bd59-9e8256726624
Ancestors: VMMaker-oscog-EstebanLorenzano.164
- added SystemInfoPlugin to retrieve some information about the platform (mainly for security reasons)
=============== Diff against VMMaker-oscog-EstebanLorenzano.164 ===============
Item was added:
+ SmartSyntaxInterpreterPlugin subclass: #SystemInfoPlugin
+ instanceVariableNames: ''
+ classVariableNames: ''
+ poolDictionaries: 'VMBasicConstants'
+ category: 'VMMaker-Plugins'!
+
+ !SystemInfoPlugin commentStamp: '<historical>' prior: 0!
+ I'm a symple plugin who answers some information about the system.
+ My main purpose is to provide identifiers that can be used for security reasons (to forbid an application to run in different machines)
+ !
Item was added:
+ ----- Method: SystemInfoPlugin class>>declareCVarsIn: (in category 'translation') -----
+ declareCVarsIn: codeGenerator
+ codeGenerator addHeaderFile: '"SystemInfo.h"'.!
Item was added:
+ ----- Method: SystemInfoPlugin>>primitivePrimaryMACAddress (in category 'primitives') -----
+ primitivePrimaryMACAddress
+ | identifier size resultOop resultPtr |
+
+ <export: true>
+ <var: #identifier type: 'char *'>
+ <var: #resultPtr type: 'char *'>
+
+ self primitive: #primitivePrimaryMACAddress parameters: #().
+
+ interpreterProxy failed ifTrue: [ ^self ].
+
+ identifier := self sqPrimaryMACAddress.
+ size := self strlen: identifier.
+ resultOop := interpreterProxy instantiateClass: interpreterProxy classString indexableSize: size.
+ resultPtr := interpreterProxy firstIndexableField: resultOop.
+ 0 to: (size - 1) do: [ :i |
+ resultPtr at: i put: (identifier at: i) ].
+
+ ^resultOop!
Item was added:
+ ----- Method: SystemInfoPlugin>>primitiveUniqueIdentifier (in category 'primitives') -----
+ primitiveUniqueIdentifier
+ | identifier size resultOop resultPtr |
+
+ <export: true>
+ <var: #identifier type: 'char *'>
+ <var: #resultPtr type: 'char *'>
+
+ self primitive: #primitiveUniqueIdentifier parameters: #().
+
+ interpreterProxy failed ifTrue: [ ^self ].
+
+ identifier := self sqUniqueIdentifier.
+ size := self strlen: identifier.
+ resultOop := interpreterProxy instantiateClass: interpreterProxy classString indexableSize: size.
+ resultPtr := interpreterProxy firstIndexableField: resultOop.
+ 0 to: (size - 1) do: [ :i |
+ resultPtr at: i put: (identifier at: i) ].
+
+ ^resultOop!
More information about the Vm-dev
mailing list